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
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
Antoine Pitrou wrote:
> Hi,
>
> ISE Development gmail.com> writes:
>> 'code' object 'function' object
>>
>> co_name: test __qualname__: test
>> co_name: T__qualnam
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
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)
>>
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.