[Python-3000] PEP 30xx: Access to Module/Class/Function Currently Being Defined (this)

Barry Warsaw barry at python.org
Mon Apr 23 15:36:20 CEST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Apr 23, 2007, at 9:21 AM, Christian Heimes wrote:

> -1 on __module__
>
> I understand PEP 3020 correctly then sys.main will contain the dotted
> name of the module as *string*.
>
> Also __module__ is already used in objects like classes.

I'm not sure whether a general mechanism is necessary or not, but  
I've always wished I could just do something like "import __me__" to  
get the current module.

- -Barry

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iQCVAwUBRiy2VHEjvBPtnXfVAQKgdwQAmuAVdKvz+rZdOPHHSyk03bOM6wkUQ9FU
+qhhThUPl9yZIexJP5DvE/fEo6b3hsU87kkSBmTVynCCdVzzhwYDqILdGvCaJ8wP
L+K3oD9mq69BJ8bVi1mGu8st9XmK/jwWuq6d6Fo3pMKGehuk38EtW3N6dzHHFG0g
oECLki6Fc1I=
=yw83
-----END PGP SIGNATURE-----


More information about the Python-3000 mailing list