__qualname__ in python 3.3

2014-09-06 Thread ISE Development
Hi, When a class is defined within a function, the class generation function's '__qualname__' attrbute is not qualified a name. For instance: def test(): class T: def method(self): pass t = T() t.method() When tracing a call to 'test()' u

Re: __qualname__ in python 3.3

2014-09-06 Thread ISE Development
Peter Otten wrote: > ISE Development wrote: > >> Hi, >> >> When a class is defined within a function, the class generation >> function's '__qualname__' attrbute is not qualified a name. >> >> For instance: >> >&g

Re: __qualname__ in python 3.3

2014-09-07 Thread ISE Development
Antoine Pitrou wrote: > Hi, > > ISE Development gmail.com> writes: >> 'code' object 'function' object >> >> co_name: test __qualname__: test >> co_name: T__qualnam

functools.wraps behaviour

2014-09-15 Thread ISE Development
The purpose of 'functools.wraps' is to make a decorated function look like the original function, i.e. such that the __name__, __module__, __doc__ attributes are the same as the wrapped function. However, I've noticed inconsistent behaviour. Given the following: import functools def d

Re: functools.wraps behaviour

2014-09-16 Thread ISE Development
Chris Angelico wrote: > On Tue, Sep 16, 2014 at 9:15 AM, ISE Development > wrote: >> @functools.wraps(func) >> def wrapper(self): >> func(self) >> return wrapper >> >> try: >> k.method(1) >>

Multiple ways to access attributes

2013-02-10 Thread ISE Development
Is it considered acceptable practice (e.g. not confusing, not surprising or not Pythonic) to allow multiple ways to access the same attributes? For example, supposing I am providing access to external devices, that these parameters may vary slightly between devices (e.g. different models, etc.