[issue25652] collections.UserString.__rmod__() raises NameError

2017-05-10 Thread Jonathan Goble
Jonathan Goble added the comment: I would prefer to keep __rmod__ and fix the bug, given that the use case I described above would otherwise create an inconsistency in subclasses, which would be able to easily extend __mod__ by calling super(), but would be forced to fully implement __rmod__

[issue25652] collections.UserString.__rmod__() raises NameError

2017-05-09 Thread Jonathan Goble
Jonathan Goble added the comment: Any decision on this? I recently played around and found a reasonable use case where UserString.__rmod__ does get called; run the attached userstringerror.py to see it in action. Basically, it seems the idea of UserString is to subclass it, tweak as desired

[issue30299] Display the bytecode when compiled a regular expression in debug mode

2017-05-08 Thread Jonathan Goble
Changes by Jonathan Goble : -- nosy: +Jonathan Goble ___ Python tracker <http://bugs.python.org/issue30299> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue25652] collections.UserString.__rmod__() raises NameError

2016-07-10 Thread Jonathan Goble
Jonathan Goble added the comment: Code analysis, if it can even be called that. I was simply looking through the source of the collections module one day out of curiosity (mainly to see how various things in it were implemented) and this bug jumped out at me as I was reading the code. I do

[issue25652] collections.UserString.__rmod__() raises NameError

2016-03-05 Thread Jonathan Goble
Jonathan Goble added the comment: *ping* Can this be reviewed? It's a simple fix to a problem that happens consistently, and it would be nice to get it into the next bugfix release. -- versions: +Python 3.6 ___ Python tracker

[issue26336] Expose regex bytecode as attribute of compiled pattern object

2016-02-20 Thread Jonathan Goble
Jonathan Goble added the comment: Noting for the record that, as I had brought up on python-ideas [1], in addition to simply exposing the raw code, it would be nice to have a public constructor for the compiled pattern type and a 'dis'-like module for support. The former wo

[issue26336] Expose regex bytecode as attribute of compiled pattern object

2016-02-17 Thread Jonathan Goble
Jonathan Goble added the comment: It would indeed be marked as a CPython implementation detail, and with no guarantee of backward compatibility. Others (well, at least one other) have suggested the same on python-ideas. So a simple note in the accompanying documentation would suffice

[issue26336] Expose regex bytecode as attribute of compiled pattern object

2016-02-10 Thread Jonathan Goble
New submission from Jonathan Goble: Once a regular expression is compiled with `obj = re.compile()`, it would be nice to have access to the raw bytecode, probably as `obj.code` or `obj.bytecode`, so it can be explored programmatically. Currently, regex bytecode is only stored in a C struct

[issue25652] collections.UserString.__rmod__() raises NameError

2015-11-17 Thread Jonathan Goble
Jonathan Goble added the comment: c06b2480766d appears to be the offending changeset. -- ___ Python tracker <http://bugs.python.org/issue25652> ___ ___ Python-bug

[issue25652] collections.UserString.__rmod__() raises NameError

2015-11-17 Thread Jonathan Goble
New submission from Jonathan Goble: In an instance of collections.UserString, any call to the __rmod__() method will raise NameError, due to the undefined "args" name in the method. -- components: Library (Lib) messages: 254830 nosy: Jonathan Goble, rhettinger priority: norma