/Lib/test/doctest_aliases.py

http://unladen-swallow.googlecode.com/ · Python · 13 lines · 4 code · 3 blank · 6 comment · 0 complexity · 225c9f03e9fde5e3cdeecf52aadbb6fb MD5 · raw file

  1. # Used by test_doctest.py.
  2. class TwoNames:
  3. '''f() and g() are two names for the same method'''
  4. def f(self):
  5. '''
  6. >>> print TwoNames().f()
  7. f
  8. '''
  9. return 'f'
  10. g = f # define an alias for f