On Tue, Aug 3, 2010 at 10:48 PM, Antoine Pitrou <solipsis at pitrou.net> 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) relying on the current meaning, though. 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, including any decorator lines". The decision could (and arguably should) have gone the other way when decorator syntax was first added, but changing our minds now would be making the situation worse rather than better. Cheers, Nick. -- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
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