[issue31907] Clarify error message when attempting to call function via str.format()

2017-12-29 Thread mickey695
mickey695 added the comment: Well, it has been more than the 2 weeks I promised however now I finally have time to look into this. I did some fuzzing to build a list quickly and the following ASCII characters can not be used as part of the argument name: exclamation mark(!) period(.) colon(:)

[issue31907] Clarify error message when attempting to call function via str.format()

2017-11-03 Thread mickey695
mickey695 added the comment: I think it should be documented properly. In roughly two weeks I will have some time to look into it. So I could probably document the current behaviour by the start of December(unless someone beats me to it) -- ___ Py

[issue31907] Clarify error message when attempting to call function via str.format()

2017-11-02 Thread Eric V. Smith
Eric V. Smith added the comment: Guido's suggestion in https://mail.python.org/pipermail/python-dev/2017-October/150055.html is to not change anything. Assuming we do that, it's still an open issue as to if/how we should document and test the current behavior. I'd be surprised if it's tested

[issue31907] Clarify error message when attempting to call function via str.format()

2017-10-31 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I have wrote a patch that change the parser to only accept valid identifiers. But now I have the same doubts and want first to discuss this [1]. This change can break the existing code as Eric's example shows. [1] https://mail.python.org/pipermail/python-de

[issue31907] Clarify error message when attempting to call function via str.format()

2017-10-31 Thread Eric V. Smith
Eric V. Smith added the comment: How would you distinguish this from the case where an actually missing attribute was given? >>> "{0.ctimex}".format(d) Traceback (most recent call last): File "", line 1, in AttributeError: 'datetime.datetime' object has no attribute 'ctimex' I guess it wou

[issue31907] Clarify error message when attempting to call function via str.format()

2017-10-30 Thread mickey695
New submission from mickey695 : 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.datet