[issue28739] PEP 498: docstrings as f-strings

2017-03-31 Thread Donald Stufft
Changes by Donald Stufft : -- pull_requests: +885 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.

[issue28739] PEP 498: docstrings as f-strings

2017-03-24 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: New changeset d4e89287b397c7382c12d3f3d9fd901fd8243b3c by Mariatta in branch 'master': bpo-28739: Document that f-strings cannot be used as docstring (GH-592) https://github.com/python/cpython/commit/d4e89287b397c7382c12d3f3d9fd901fd8243b3c -- _

[issue28739] PEP 498: docstrings as f-strings

2017-03-24 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: New changeset ff6f3716279e75b2519133a82b9de0c3601963d9 by Mariatta in branch '3.6': bpo-28739: Document that f-strings cannot be used as docstring (GH-592) (GH-600) https://github.com/python/cpython/commit/ff6f3716279e75b2519133a82b9de0c3601963d9 --

[issue28739] PEP 498: docstrings as f-strings

2017-03-10 Thread Mariatta Wijaya
Changes by Mariatta Wijaya : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ __

[issue28739] PEP 498: docstrings as f-strings

2017-03-10 Thread Eric V. Smith
Eric V. Smith added the comment: Yes, I think it can be closed. Thanks! -- ___ Python tracker ___ ___ Python-bugs-list mailing list Un

[issue28739] PEP 498: docstrings as f-strings

2017-03-10 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: Thanks for reviewing, Serhiy and Eric. Documentation has been updated and backported to 3.6. OK to close this issue? -- ___ Python tracker __

[issue28739] PEP 498: docstrings as f-strings

2017-03-10 Thread Mariatta Wijaya
Changes by Mariatta Wijaya : -- pull_requests: +494 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue28739] PEP 498: docstrings as f-strings

2017-03-09 Thread Mariatta Wijaya
Changes by Mariatta Wijaya : -- stage: needs patch -> patch review ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscrib

[issue28739] PEP 498: docstrings as f-strings

2017-03-09 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: Hi, I updated the documentation mentioning that f-strings cannot be used as docstring. Please review it. Thanks. -- nosy: +Mariatta ___ Python tracker ___

[issue28739] PEP 498: docstrings as f-strings

2017-03-09 Thread Mariatta Wijaya
Changes by Mariatta Wijaya : -- pull_requests: +487 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue28739] PEP 498: docstrings as f-strings

2017-02-11 Thread Joakim Soderlund
Joakim Soderlund added the comment: I got slightly confused here while playing around. Python 3.6.0 (default, Jan 31 2017, 11:39:39) [GCC 4.9.2] on linux Type "help", "copyright", "credits" or "license" for more information. >>> class Huacaya: ... f"""Huacaya!""" ... >>> class Suri: ... f"

[issue28739] PEP 498: docstrings as f-strings

2016-12-11 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> docs@python components: +Documentation -Interpreter Core keywords: -patch nosy: +docs@python stage: patch review -> needs patch ___ Python tracker ___

[issue28739] PEP 498: docstrings as f-strings

2016-12-11 Thread Roundup Robot
Roundup Robot added the comment: New changeset 30341d5c1423 by Serhiy Storchaka in branch '3.6': Issue #28739: f-string expressions no longer accepted as docstrings and https://hg.python.org/cpython/rev/30341d5c1423 New changeset 8e0f147dfa3d by Serhiy Storchaka in branch 'default': Issue #28739

[issue28739] PEP 498: docstrings as f-strings

2016-12-11 Thread Eric V. Smith
Eric V. Smith added the comment: It looks good to me, save for one tiny issue. I left a review comment. -- ___ Python tracker ___ ___

[issue28739] PEP 498: docstrings as f-strings

2016-12-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Eric, could you please make a review of the patch? -- stage: -> patch review type: -> behavior versions: +Python 3.6 ___ Python tracker ___

[issue28739] PEP 498: docstrings as f-strings

2016-11-26 Thread Guido van Rossum
Guido van Rossum added the comment: I was just noticing that the formal grammar in the reference manual first defines a single string literal and then separately describes concatenation. -- ___ Python tracker _

[issue28739] PEP 498: docstrings as f-strings

2016-11-26 Thread Terry J. Reedy
Terry J. Reedy added the comment: I considered concatenated string literals to be included in 'string literal'. If that is not obvious, then it should be made so. Replace 'string literal' with 'string literal or concatenated strings literals' and link each part to their respective (and succe

[issue28739] PEP 498: docstrings as f-strings

2016-11-26 Thread Guido van Rossum
Guido van Rossum added the comment: I think such a patch is fine -- for 3.6.1. Also note that linking to the definition of "string literal" is insufficient, assuming we will want to continue supporting literal concatenation ( https://docs.python.org/3/reference/lexical_analysis.html#string-liter

[issue28739] PEP 498: docstrings as f-strings

2016-11-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Proposed patch makes f-strings not be accepted as docstrings. It also disallow f-strings in ast.literal_eval(). -- keywords: +patch Added file: http://bugs.python.org/file45658/fstring-no-docstring.patch ___ Python

[issue28739] PEP 498: docstrings as f-strings

2016-11-26 Thread Terry J. Reedy
Terry J. Reedy added the comment: I withdraw my previously suggested addition to the Docstring glossary entry (msg281740). It implies that trivial f-strings are acceptable and I agree that other implementations and future Cpython should be free to strictly follow the literal meaning of the fi

[issue28739] PEP 498: docstrings as f-strings

2016-11-26 Thread Guido van Rossum
Guido van Rossum added the comment: OK, clearly the code that sets __doc__ is too closely tied to the generated code (or to the reduced AST used to generate code). I still think code that uses any of these is on thin ice and should expect to be broken in the future. -- _

[issue28739] PEP 498: docstrings as f-strings

2016-11-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Adding more confusion, the expression ``('This is a docstring')`` is accepted as a docstring despite the fact that it is not a string literal. The cases f'string' and ('string') looks similar to me. Both are simple expressions that become indistinguishable f

[issue28739] PEP 498: docstrings as f-strings

2016-11-25 Thread Guido van Rossum
Guido van Rossum added the comment: I don't really care that much, but I personally think that it would be more consistent (and a simpler rule) if *no* f-string (not even ones without substitutions) were to be allowed as docstrings. In all other examples that Raymond shows it's the syntactic f

[issue28739] PEP 498: docstrings as f-strings

2016-11-25 Thread Raymond Hettinger
Raymond Hettinger added the comment: [TJR] > I think this issue should either be closed as 'not a bug' > or redefined as a doc issue. I concur. FWIW, here are some comparisons. Not allowed: 'Not counted as' + ' a docstring' 'Not a docstring ' * 10 b'Also not a docstring' Allowed

[issue28739] PEP 498: docstrings as f-strings

2016-11-25 Thread Terry J. Reedy
Terry J. Reedy added the comment: Much of this discussion seems to duplicate and effectively re-open of #25179, wherein it was decided/accepted that true, non-degenerate, non-trivial, non-constant, f-strings that actually do formatting are not constants and do not and should not become docstri

[issue28739] PEP 498: docstrings as f-strings

2016-11-18 Thread Ned Deily
Ned Deily added the comment: Since this was previously discussed and rejected (in Issue25179), I don't think we should revisit this now for 3.6, other than potentially a documentation tweak. -- nosy: +ned.deily versions: -Python 3.6 ___ Python trac

[issue28739] PEP 498: docstrings as f-strings

2016-11-18 Thread Guido van Rossum
Guido van Rossum added the comment: Might I point out the precedent of b-strings? Those also don't contribute to __doc__. -- ___ Python tracker ___ __

[issue28739] PEP 498: docstrings as f-strings

2016-11-18 Thread Eric V. Smith
Eric V. Smith added the comment: It's Ned's call, but I wouldn't recommend changing this in 3.6, at least not 3.6.0. As Martin points out, the reason f'foo' is a "normal" string has to do with how strings and f-strings are assembled and concatenated. Similarly: 'foo' f'bar' 'baz' is a normal

[issue28739] PEP 498: docstrings as f-strings

2016-11-18 Thread Martin Panter
Martin Panter added the comment: Having an unassigned f-string as the first statement is still valid syntax, so could at most be a warning, not a SyntaxError. -- ___ Python tracker

[issue28739] PEP 498: docstrings as f-strings

2016-11-18 Thread Martin Panter
Martin Panter added the comment: Actually, testing your code fragment, it seems you do get a doc string when the f-string has no substitutions in curly brackets, otherwise you don’t get any doc string. Maybe this is due to how different forms of string are compiled. >>> class Foo: ...f'spa

[issue28739] PEP 498: docstrings as f-strings

2016-11-18 Thread Yury Selivanov
Yury Selivanov added the comment: > IMO it would be simpler do disallow all f-strings as docstrings. How exactly you want to disallow them? Raise SyntaxError? If you don't raise anything, then the behaviour is just confusing -- the interpreter parses them, but __doc__ is None. I think this

[issue28739] PEP 498: docstrings as f-strings

2016-11-18 Thread Martin Panter
Martin Panter added the comment: There was a bit of discussion at the top of . IMO it would be simpler do disallow all f-strings as docstrings. Otherwise, what would the result of this be: name = "module level" class C: name = "class level"

[issue28739] PEP 498: docstrings as f-strings

2016-11-18 Thread Eric V. Smith
Eric V. Smith added the comment: As you've seen, the answer is "no"! We'd need to add logic to evaluate them at function definition time. That would be a slight noticeable change, if the expressions had side effects. -- ___ Python tracker

[issue28739] PEP 498: docstrings as f-strings

2016-11-18 Thread Yury Selivanov
New submission from Yury Selivanov: Can f-strings be used as docstrings? Right now: class Foo: f'spam' Foo.__doc__ is None I couldn't find that f-strings cannot be used as docstrings in neither PEP 498 not in the 3.6 documentation, so I suppose this is a bug. -- compon