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__
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
Changes by Jonathan Goble :
--
nosy: +Jonathan Goble
___
Python tracker
<http://bugs.python.org/issue30299>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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
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
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
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
Jonathan Goble added the comment:
c06b2480766d appears to be the offending changeset.
--
___
Python tracker
<http://bugs.python.org/issue25652>
___
___
Python-bug
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
10 matches
Mail list logo