[issue19175] Erroneous reference to "integer" in format string grammar

2019-05-17 Thread Cheryl Sabella


Change by Cheryl Sabella :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Format mini-language integer definition is incorrect

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19175] Erroneous reference to integer in format string grammar

2013-10-06 Thread Georg Brandl

Changes by Georg Brandl ge...@python.org:


--
assignee: docs@python - eric.smith
nosy: +eric.smith

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19175
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19175] Erroneous reference to integer in format string grammar

2013-10-06 Thread Georg Brandl

Georg Brandl added the comment:

The bug is that integer links to the integer production in the Python 
grammar.  This shouldn't happen; I'll have a look on the Sphinx side.

As a workaround, integer can be replaced by digit+ as requested (it occurs 
twice).

--
nosy: +georg.brandl

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19175
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19175] Erroneous reference to integer in format string grammar

2013-10-05 Thread David Chambers

New submission from David Chambers:

I first raised this issue on Stack Overflow: 
http://stackoverflow.com/questions/19203194

The [replacement field grammar][1] states that an [integer][2] is a valid 
field_name, but this is inaccurate:

 '{0}'.format('zero')
'zero'
 '{0x0}.format('zero')
KeyError: '0x0'
 '{0o0}.format('zero')
KeyError: '0o0'
 '{0b0}.format('zero')
KeyError: '0b0'

This [comment][3] by Eric Smith suggests that the above is the intended 
behaviour:

 get_integer uses the narrowest possible definition for integer indexes,
 in order to pass all other strings to mappings.

The documentation should be updated to match the actual behaviour. abarnert on 
Stack Overflow suggested the following change:

-arg_name  ::=  [identifier | integer]
+arg_name  ::=  [identifier | digit+]


[1]: http://docs.python.org/2/library/string.html#format-string-syntax
[2]: 
http://docs.python.org/2/reference/lexical_analysis.html#grammar-token-integer
[3]: http://bugs.python.org/issue8985#msg107705

--
assignee: docs@python
components: Documentation
messages: 199024
nosy: davidchambers, docs@python
priority: normal
severity: normal
status: open
title: Erroneous reference to integer in format string grammar
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19175
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com