This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mickey695
Recipients mickey695
Date 2017-10-31.00:35:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1509410120.18.0.213398074469.issue31907@psf.upfronthosting.co.za>
In-reply-to
Content
PEP 3101 states that format strings may only use the "."(getattr) or the "[]" (getitem) operators to address either attributes or items of parameters.
Should a programmer attempt to, for example, call a function of a parameter as follows: 

>>> d = datetime.datetime(2017, 10, 31)
>>> "{0.ctime()}".format(d)

they will receive an error message such as:

AttributeError: 'datetime.datetime' object has no attribute 'ctime()'

Proposal:
Raise an error stating that cannot embed arbitrary expressions in str.format() format strings
History
Date User Action Args
2017-10-31 00:35:20mickey695setrecipients: + mickey695
2017-10-31 00:35:20mickey695setmessageid: <1509410120.18.0.213398074469.issue31907@psf.upfronthosting.co.za>
2017-10-31 00:35:20mickey695linkissue31907 messages
2017-10-31 00:35:20mickey695create