[issue6396] No conversion specifier in the string, no __getitem__ method in the right hand value

Mahmoud report at bugs.python.org
Wed Jul 1 18:14:07 CEST 2009


New submission from Mahmoud <saghaei at med.mui.ac.ir>:

When using a class instance as a mapping for the right hand value in a
sting format expression without conversion specifier, it seems logical
that the class has a __getitem__ method. Therefore following format
expression should raise an exception.

>>> class AClass(object):
...   pass
... 
>>> c = AClass()
>>> "a string with no conversion specifier" % c
'a string with no conversion specifier'

----------
messages: 89987
nosy: msaghaei
severity: normal
status: open
title: No conversion specifier in the string, no __getitem__ method in the right hand value
versions: Python 2.6, Python 2.7, Python 3.0, Python 3.1

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6396>
_______________________________________


More information about the Python-bugs-list mailing list