Guido van Rossum wrote:
What are the use cases for co_firstlineno? Even if it is for
displaying the source code, I can find virtue for both sides of this
argument.
Seems to me that if the code is being displayed to a
human, the decorators are an important thing to know
about, so including them
On 8/3/2010 8:48 AM, Antoine Pitrou wrote:
On Tue, 3 Aug 2010 22:25:01 +1000
Nick Coghlan wrote:
On Tue, Aug 3, 2010 at 1:40 PM, Eli Bendersky wrote:
The first print out correctly specifies the line "def foo" is in. However,
the second one points to the line with "@dummydecorator" instead of
On Tue, Aug 3, 2010 at 9:05 AM, Nick Coghlan wrote:
> .. While I'd agree with you for a
> clean slate definition, that's not what we're dealing with here:
> "co_firstlineno" has an existing meaning, and it *isn't* "the line
> containing the def keyword", it's "the first line of the function,
> inc
Le mardi 03 août 2010 à 11:05 -0400, Raghuram Devarakonda a écrit :
> On Tue, Aug 3, 2010 at 10:14 AM, Guido van Rossum wrote:
>
> > What are the use cases for co_firstlineno? Even if it is for
> > displaying the source code, I can find virtue for both sides of this
> > argument.
>
> nose uses c
On Tue, Aug 3, 2010 at 10:14 AM, Guido van Rossum wrote:
> What are the use cases for co_firstlineno? Even if it is for
> displaying the source code, I can find virtue for both sides of this
> argument.
nose uses co_firstlineno to determine order of the test functions and
decorating a test funct
On Tue, Aug 3, 2010 at 6:05 AM, Nick Coghlan wrote:
> On Tue, Aug 3, 2010 at 10:48 PM, Antoine Pitrou wrote:
>> Furthermore, co_firstlineno is an attribute of the code object, not the
>> function object, so it shouldn't ideally depend on whether a decorator
>> was applied or not.
>
> You cut the
On Tue, Aug 3, 2010 at 10:48 PM, Antoine Pitrou wrote:
> Furthermore, co_firstlineno is an attribute of the code object, not the
> function object, so it shouldn't ideally depend on whether a decorator
> was applied or not.
You cut the part about the inspect module (and no doubt other code)
relyi
On Tue, 3 Aug 2010 22:25:01 +1000
Nick Coghlan wrote:
> On Tue, Aug 3, 2010 at 1:40 PM, Eli Bendersky wrote:
> > The first print out correctly specifies the line "def foo" is in. However,
> > the second one points to the line with "@dummydecorator" instead of "def
> > bar". [Python 2.6]
> >
> > T
On Tue, Aug 3, 2010 at 1:40 PM, Eli Bendersky wrote:
> The first print out correctly specifies the line "def foo" is in. However,
> the second one points to the line with "@dummydecorator" instead of "def
> bar". [Python 2.6]
>
> The side-effects of this behavior can be easily seen in the output o
[Since I received no replies on this in python-list, perhaps python-dev is
more appropriate]
Hello,
I've been tinkering with __code__.co_firstlineno for testing the trace.py
module (Python Issue 9315), and ran into an interesting problem. Consider
this code:
def dummydecorator(f):
return f
10 matches
Mail list logo