source:
trunk/essentials/dev-lang/python/Lib/test/doctest_aliases.py@
3326
| Last change on this file since 3326 was 3225, checked in by , 19 years ago | |
|---|---|
| File size: 243 bytes | |
| Line | |
|---|---|
| 1 | # Used by test_doctest.py. |
| 2 | |
| 3 | class TwoNames: |
| 4 | '''f() and g() are two names for the same method''' |
| 5 | |
| 6 | def f(self): |
| 7 | ''' |
| 8 | >>> print TwoNames().f() |
| 9 | f |
| 10 | ''' |
| 11 | return 'f' |
| 12 | |
| 13 | g = f # define an alias for f |
Note:
See TracBrowser
for help on using the repository browser.
