[issue10021] Format parser is too permissive

2015-10-02 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- stage: -> needs patch versions: +Python 3.6 -Python 3.2 ___ Python tracker ___ ___ Python-bugs-l

[issue10021] Format parser is too permissive

2010-10-08 Thread Terry J. Reedy
Terry J. Reedy added the comment: This is a bug report in that there is a discrepancy between the grammar in the doc and the behavior. Laxiness can lead to portability problems if CPython is lax compared to a normal reading of the spec and another implementation takes the spec seriously. I a

[issue10021] Format parser is too permissive

2010-10-05 Thread Eric Smith
Eric Smith added the comment: I agree that it being an implementation detail is not a good thing. I think we should just document the current CPython behavior as the language standard: once parsed, any string after a dot is passed to getattr. I can't see why we should pay the penalty of valid

[issue10021] Format parser is too permissive

2010-10-05 Thread Benjamin Peterson
Benjamin Peterson added the comment: This should not be classified as an "implementation detail". Either we should document it and cause other implementations to support it or check it ourselves. -- ___ Python tracker

[issue10021] Format parser is too permissive

2010-10-05 Thread Mark Dickinson
Mark Dickinson added the comment: > I seem to remember this having been discussed before, but I cannot find the right thread. It came up in the issue 7951 discussion, I think. -- ___ Python tracker __

[issue10021] Format parser is too permissive

2010-10-04 Thread Eric Smith
Eric Smith added the comment: I agree it should be documented as a CPython specific behavior. I should also add a CPython specific test for it, modeled on your code (if one doesn't already exist). I'll look into it. -- ___ Python tracker

[issue10021] Format parser is too permissive

2010-10-04 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Mon, Oct 4, 2010 at 1:02 PM, Eric Smith wrote: .. > Ah, but I don't need to in order to comply with the PEP! This is true and this is the reason I changed this issue from bug to doc. I seem to remember this having been discussed before, but I cannot

[issue10021] Format parser is too permissive

2010-10-04 Thread Eric Smith
Eric Smith added the comment: Ah, but I don't need to in order to comply with the PEP! -- ___ Python tracker ___ ___ Python-bugs-list

[issue10021] Format parser is too permissive

2010-10-04 Thread Benjamin Peterson
Benjamin Peterson added the comment: 2010/10/4 Eric Smith : > > Eric Smith added the comment: > > Right. It seemed like a hassle to have the str.format parser try to figure > out what a valid identifier is, so it just passes it through. You can always use "str.isidentifier()" (I don't remembe

[issue10021] Format parser is too permissive

2010-10-04 Thread Eric Smith
Eric Smith added the comment: Right. It seemed like a hassle to have the str.format parser try to figure out what a valid identifier is, so it just passes it through. I don't see this as any different from: >>> class X: ...def __getattribute__(self, a): return 'foo' ... >>> getattr(X(),

[issue10021] Format parser is too permissive

2010-10-04 Thread Mark Dickinson
Changes by Mark Dickinson : -- nosy: +eric.smith, mark.dickinson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue10021] Format parser is too permissive

2010-10-04 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- assignee: -> d...@python components: +Documentation -Interpreter Core nosy: +d...@python ___ Python tracker ___

[issue10021] Format parser is too permissive

2010-10-04 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: PEP 3101 has the following """ Implementation note: The implementation of this proposal is not required to enforce the rule about a simple or dotted name being a valid Python identifier. Instead, it will rely on the getattr function of th

[issue10021] Format parser is too permissive

2010-10-04 Thread Éric Araujo
Changes by Éric Araujo : -- nosy: +eric.araujo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

[issue10021] Format parser is too permissive

2010-10-04 Thread Alexander Belopolsky
New submission from Alexander Belopolsky : According to the Format String Syntax section [1], attribute_name must be an identifier. However, the parser does not catch a violation of this rule and happily passes non-indentifier strings to getattribute: >>> class X: ...def __getattribute__(