[issue26576] Tweak wording of decorator docos

2016-08-03 Thread Berker Peksag
Berker Peksag added the comment: Thanks for the patch, Chris. I've only changed `func` to ``func`` (we don't use single backtick in reST.) -- nosy: +berker.peksag resolution: -> fixed stage: -> resolved status: open -> closed type: -> enhancement versions: +Python 3.5, Python 3.6

[issue26576] Tweak wording of decorator docos

2016-08-03 Thread Roundup Robot
Roundup Robot added the comment: New changeset e0f9f8be7963 by Berker Peksag in branch '3.5': Issue #26576: Clarify that the @deco syntax is not always an equivalent of f = deco(f) https://hg.python.org/cpython/rev/e0f9f8be7963 New changeset 08359651815e by Berker Peksag in branch 'default':

[issue26576] Tweak wording of decorator docos

2016-03-19 Thread Terry J. Reedy
Terry J. Reedy added the comment: Guido, the discrepancy between the decorator doc's 'equivalent code' and actual, optimized, behavior with regard to skipping an intermediate binding of the function to the name came up soon after decorators were added. I cannot find the issue, but as I

[issue26576] Tweak wording of decorator docos

2016-03-19 Thread Georg Brandl
Georg Brandl added the comment: (Also, toggled your "is committer" bit so you get the Python logo next to your name.) -- ___ Python tracker ___

[issue26576] Tweak wording of decorator docos

2016-03-19 Thread Chris Angelico
Chris Angelico added the comment: The remaining difference that's actually of use, perhaps. But the decoration itself happens before the name is bound. It's impossible to describe in Python code; but it can be probed - you can monkeypatch a class using a decorator: def monkeypatch(cls):

[issue26576] Tweak wording of decorator docos

2016-03-19 Thread Chris Angelico
Chris Angelico added the comment: I may be a committer, but I don't push to cpython - just to the peps. But sure, pretty little logo :) -- ___ Python tracker

[issue26576] Tweak wording of decorator docos

2016-03-19 Thread Chris Angelico
New submission from Chris Angelico: The official documentation declares an unambiguous equivalence which is not true in some corner cases: @deco def f(x): pass is not quite the same as def f(x): pass f = deco(f) as the name is never bound to the undecorated function. This is

[issue26576] Tweak wording of decorator docos

2016-03-19 Thread Chris Angelico
Chris Angelico added the comment: Sure - changing it to "roughly". I started with that wording, and then changed to "broadly", for reasons which I now can't remember - so they can't have been too important. Consistency wins. -- Added file:

[issue26576] Tweak wording of decorator docos

2016-03-19 Thread Raymond Hettinger
Raymond Hettinger added the comment: Elsewhere we use "roughly equivalent to" instead of "broadly equivalent to". The latter seems a little bit off the mark. -- nosy: +rhettinger ___ Python tracker

[issue26576] Tweak wording of decorator docos

2016-03-19 Thread Chris Angelico
Chris Angelico added the comment: Sounds good to me. Replacement patch. -- Added file: http://bugs.python.org/file42182/deco-docos.patch ___ Python tracker

[issue26576] Tweak wording of decorator docos

2016-03-18 Thread Chris Angelico
Chris Angelico added the comment: Question: Is it worth having an explanation somewhere of exactly what *does* happen? To what extent is it guaranteed by the language? -- ___ Python tracker

[issue26576] Tweak wording of decorator docos

2016-03-18 Thread Georg Brandl
Georg Brandl added the comment: The patch is definitely an improvement. What about a remark like ", except that `deco` is evaluated before the function `f` is created"? That should cover the remaining difference. -- nosy: +georg.brandl ___ Python

[issue26576] Tweak wording of decorator docos

2016-03-18 Thread Georg Brandl
Georg Brandl added the comment: That is definitely supported. Whether it's actually useful to document, I'm not sure. "except that the original function is not temporarily bound to the name `f`" could work. -- ___ Python tracker