A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-August/047471.html below:

[Python-Dev] Re: Decorators: vertical bar syntax

[Python-Dev] Re: Decorators: vertical bar syntaxSimon Percivall s.percivall at chello.se
Mon Aug 9 23:34:50 CEST 2004
On 2004-08-09, at 21.20, Simon Percivall wrote:
> On 2004-08-09, at 19.50, Fernando Perez wrote:
>> I further worry what will happen to tools like inspect.getsource() 
>> with
>> decorators outside the def:
>>
>> @foo
>> @bar
>> def baz(x,y):
>>    ....
>>
>> if I try to get the source for baz, will I see foo/bar?  For 
>> introspection
>> tools, this can lead to pretty misleading results.  But perhaps this 
>> is easy
>> to solve or has even already been taken care of.  I imagine if 
>> @foo/@bar were
>> inside the def, this wouldn't be an issue.
>
> Right now, you'll see the source of the function/method defined above
> the decorators or, if none, the top line/lines of the source file. Yes,
> it's pretty broken.

I uploaded a quick patch for this broken behaviour to SF, patch 
1006219, if
anyone cares.

//Simon

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4