Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #29414
| Newsgroups | comp.lang.python |
|---|---|
| Date | 2012-09-18 00:52 -0700 |
| Message-ID | <74247047-c5b5-42a0-af69-4c520a1d5d8d@googlegroups.com> (permalink) |
| Subject | How to use __getattr__ to the current module, for automatically add attributes of the real-time |
| From | sergeiiv65@gmail.com |
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 (((.
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
How to use __getattr__ to the current module, for automatically add attributes of the real-time sergeiiv65@gmail.com - 2012-09-18 00:52 -0700
csiph-web