How to use __getattr__ to the current module, for automatically add attributes of the real-time
sergeiiv65 at gmail.com
sergeiiv65 at gmail.com
Tue Sep 18 03:52:53 EDT 2012
More information about the Python-list mailing list
Tue Sep 18 03:52:53 EDT 2012
- Previous message (by thread): How to queue functions
- Next message (by thread): How to use __getattr__ to the current module, for automatically add attributes of the real-time
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Want to work so:
import sys
class Foo(object):
def __getattr__(self, t):
print 'use __getattr__ - ', t
return type(t, (object,), {})
def funct1(self): pass
def funct2(self): pass
sys.modules[__name__] = Foo()
ttt('yy')
name 'ttt' is not defined.
__getattr__ not work (((.
- Previous message (by thread): How to queue functions
- Next message (by thread): How to use __getattr__ to the current module, for automatically add attributes of the real-time
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list