Function docstring as a local variable

Andrew Berg bahamutzero8825 at gmail.com
Mon Jul 11 01:27:53 CEST 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

On 2011.07.10 06:06 PM, Corey Richardson wrote:
> Python 2.7.1 (r271:86832, Jul  8 2011, 22:48:46) [GCC 4.4.5] on
> linux2 Type "help", "copyright", "credits" or "license" for more
> information.
>>>> def foo():
> ...     "Docstring" ...     print __doc__ ...
>>>> foo()
> None
I get the same result with Python 3.2.

- -- 
CPython 3.2 | Windows NT 6.1.7601.17592 | Thunderbird 5.0
PGP/GPG Public Key ID: 0xF88E034060A78FCB
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAwAGBQJOGjV5AAoJEPiOA0Bgp4/LF2YH/jaEjS6sFuwekVG0cKyjnx/z
8j28OHB9mklXg6oEMSsypU5dVPst2a6fmEHm+sXPYgQHZ9tk0oun+xxmdldNyV8h
knfFVgMC5ww1Q7gLkPWzY8me3k4YcokYGhsuwXEGBvPby4M4ZC5uyetKTzVWp+uH
sO11DPBaaXzGj7E7wu+HbfWsvPxw9h9jfJ7ihjhHNSUiL3MkGEqlxK8Pw2o3cw1e
sCY7XWm1x8qClJLrwwxnB7pfuOfNJ6aS3xLd8FFs4hRp1J9W+z4on91XZooa5kT+
UEfkrzppOjw1UNA1etxIGmJQ+/qrKSGg5Nmc4jHXNfwIZCECHuWxEqaL5e0WdHU=
=5gdS
-----END PGP SIGNATURE-----



More information about the Python-list mailing list