[issue13971] format() doesn't parse str.

2012-02-08 Thread umedoblock

New submission from umedoblock umedobl...@gmail.com:

format() mis understaning.
please pay attention to [0], [x].

 d = {0: a, 0: A}
 'd[0] = {0[0]}'.format(d)
'd[0] = a'
 'd[0] = {0[0]}'.format(d)
Traceback (most recent call last):
  File stdin, line 1, in module
KeyError: '0'
 d2 = {x: 100}
 'd2[x] = {0[x]}'.format(d2)
'd2[x] = 100'

--
components: Regular Expressions
messages: 152897
nosy: ezio.melotti, umedoblock
priority: normal
severity: normal
status: open
title: format() doesn't parse str.
type: behavior
versions: Python 3.2

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



[issue13971] format() doesn't parse str.

2012-02-08 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +eric.smith

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



[issue13971] format() doesn't parse str.

2012-02-08 Thread Eric V. Smith

Eric V. Smith e...@trueblade.com added the comment:

This is working as defined in PEP 3101: it calls PySequence_GetItem() or 
PyObject_GetItem() on the value inside the brackets. There is indeed no item in 
d that is the string 0 (including the quotes).

--
assignee:  - eric.smith
resolution:  - invalid
stage:  - committed/rejected
status: open - closed

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