classification
Title: Documentation Error: Extra line Break
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 2.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: docs@python Nosy List: berker.peksag, docs@python, georg.brandl, janonymous, tim.golden, willingc
Priority: normal Keywords: patch

Created on 2015-04-19 10:29 by janonymous, last changed 2015-05-01 02:56 by janonymous. This issue is now closed.

Files
File name Uploaded Description Edit
doc_patch.patch janonymous, 2015-04-19 11:00 Additional New Line ommited to run on interpreter . review
Screen Shot 2015-04-19 at 12.19.07 PM.png willingc, 2015-04-19 19:36 Copy-paste to IPython interpreter on Python.org
Messages (12)
msg241508 - (view) Author: Jaivish Kothari (janonymous) * Date: 2015-04-19 10:29
https://docs.python.org/2/whatsnew/2.4.html?highlight=decorators#pep-318-decorators-for-functions-and-methods
'''
def require_int (func):
    def wrapper (arg):
        assert isinstance(arg, int)
        return func(arg)

    return wrapper
'''

New line is ommited before return wrapper 

'''
def require_int (func):
    def wrapper (arg):
        assert isinstance(arg, int)
        return func(arg)
    return wrapper

'''
msg241510 - (view) Author: Jaivish Kothari (janonymous) * Date: 2015-04-19 11:00
Please find the attached patch for review.
msg241511 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2015-04-19 12:42
Why is this a bug?
msg241525 - (view) Author: Carol Willing (willingc) * (Python committer) Date: 2015-04-19 18:10
janonymous, Thanks for the contribution. I agree with George that this is not a bug. The whitespace exists for developer readability and maintainability of code. Here's a section from PEP8 about the use of whitespace (https://www.python.org/dev/peps/pep-0008/#id15). I am closing this issue as not a bug. I do hope you will contribute to Python again. Thanks.

Close as not a bug.
msg241543 - (view) Author: Tim Golden (tim.golden) * (Python committer) Date: 2015-04-19 19:06
One small thing to bear in mind is that the existing code (ie with the extra linefeed) raises an IndentationError if cut-and-pasted into the interactive interpreter; with the OP's change, it succeeds. Might not have been their intention, but certainly is the case.

(Doesn't make it a bug, as such, but makes it more than a stylistic difference of opinion).
msg241556 - (view) Author: Carol Willing (willingc) * (Python committer) Date: 2015-04-19 19:36
Tim, A good point re: the interpreter. I've attached an output from IPython interpreter.

Georg, Given Tim's additional insight, I'm inclined to reopen the issue and review the patch as a positive change. Though not a bug, but as an enhancement for learners to copy-paste doc code into an interpreter. Thoughts?
msg241575 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2015-04-20 00:25
That document is 10 years old :) I don't think it's worth to change now. Also, "what's new" documents shouldn't be used as a tutorial. There are many tutorials about writing decorators on the internet.

(Thanks for the report and the patch, Jaivish)
msg241603 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2015-04-20 05:03
Yeah, agreed.
msg241604 - (view) Author: Tim Golden (tim.golden) * (Python committer) Date: 2015-04-20 05:14
(Laughs). I admit, I was so close to the trees, I missed the fact that 
the doc is, as you say, a What's New, and for Python 2.4. Agree that to 
change this now would be somewhat ludicrous.

If some similar patch were proposed to some more current, relevant 
document I'd still be at least open to the change proposed for the 
reasons I gave but let's close this one now.
msg242261 - (view) Author: Jaivish Kothari (janonymous) * Date: 2015-04-30 04:31
Thanks for support . I agree it is not a bug at all but just as Tim said it would be easy to copy paste code directly to interpreter with such changes. This was my first contribution in python though not accepted , it is ok :) . I'll try to contribute more towards it .Thanks for commenting . Could you guys suggest some issues i could work on as a beginner :)
msg242265 - (view) Author: Tim Golden (tim.golden) * (Python committer) Date: 2015-04-30 07:32
Jaivish Kothari,

Thanks for making the effort to contribute. Can I suggest you have a
look at the Core Mentorship site:

  http://pythonmentors.com/

and perhaps join the Core Mentorship list:

  http://mail.python.org/mailman/listinfo/core-mentorship

TJG
msg242298 - (view) Author: Jaivish Kothari (janonymous) * Date: 2015-05-01 02:56
Thank you Tim.
History
Date User Action Args
2015-05-01 02:56:36janonymoussetmessages: + msg242298
2015-04-30 07:32:55tim.goldensetmessages: + msg242265
2015-04-30 04:31:42janonymoussetmessages: + msg242261
2015-04-20 05:14:47tim.goldensetmessages: + msg241604
2015-04-20 05:03:38georg.brandlsetmessages: + msg241603
2015-04-20 00:25:06berker.peksagsetnosy: + berker.peksag
messages: + msg241575
2015-04-19 19:36:24willingcsetfiles: + Screen Shot 2015-04-19 at 12.19.07 PM.png

messages: + msg241556
2015-04-19 19:06:12tim.goldensetnosy: + tim.golden
messages: + msg241543
2015-04-19 18:10:03willingcsetstatus: open -> closed

nosy: + willingc
messages: + msg241525

resolution: fixed -> not a bug
stage: resolved
2015-04-19 12:42:51georg.brandlsetmessages: + msg241511
2015-04-19 11:00:56janonymoussetfiles: + doc_patch.patch
resolution: fixed
messages: + msg241510

keywords: + patch
2015-04-19 10:29:28janonymouscreate