Terry J. Reedy <tjre...@udel.edu> added the comment:

Respone to msg312353: Yes, let us restrict this to testing pyparse code as is.  
I opened issue #32880 for changing the code.  My followup post discusses parse 
variable initialization.

Putting instance variable defaults in class attributes is a known practice.  
But this is usually done when the 'default' is the most common value, not when 
the class attribute is always masked, before access, by an instance attribute 
of the same name.

One could claim that it is buggy to not create a new Parser instance for each 
subtest.  But the class appears to be designed for instance reuse, by having a 
separate set string method and by never looking at string-specific attributes 
until set from the string.

We could instead say that the bug is the test checking an undefined value. I 
rejected the option of not looking when test.lastopenbracketpos is None and 
instead suggest on the new issue that this instance attribute always be freshly 
set, like all the others.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32874>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to