David Lord added the comment:
Meant to say that "done" shows up on the same line, not the shell prompt. An
earlier version of my example was in the REPL, where its prompt *does* show up
on the same line.
--
___
Python track
David Lord added the comment:
I can reproduce this on Python 3.10.
Actually, `input` and `getpass` both seem to have this behavior now. Please
reopen it.
```python
import getpass
try:
getpass.getpass("in: ")
except:
pass
print("done")
```
```
$ python example
David Lord added the comment:
I'm using Arch Linux. After your reply I tried again and now I'm seeing the
same result as you, negligible difference from inheriting `Generic` on Python
3.9. I can't explain it, I ran the timings repeatedly before I posted here, but
I guess
David Lord added the comment:
Is this performance issue supposed to be fixed in 3.9? I'm still observing
severe slowdown by inheriting from `Generic[T]`.
I'm currently adding typing to Werkzeug, where we define many custom data
structures such as `MultiDict`. It would be ideal
David Lord added the comment:
It appears to be solved in Flask-SQLAlchemy's development version already, as
the mixins now inherit from `type`. We caught the issue when we started
applying flake8 (possibly through flake8-bugbear).
--
nosy: +dav
Change by David Lord :
--
nosy: +davidism
___
Python tracker
<https://bugs.python.org/issue35894>
___
___
Python-bugs-list mailing list
Unsubscribe:
David Lord added the comment:
After thinking about it more, I guess I misunderstood what \w was doing
compared to isidentifier. Since Python just relies on the Unicode database,
there's not much to be done anyway. Closing this.
For anyone interested, we ended up with a hybrid approac
David Lord added the comment:
Adding `or ('a' + s).isidentifer()`, to catch valid id_continue characters, to
the test in the previous script reveals many more characters that seem like
valid word characters but aren't matched by `\w`.
--
___
New submission from David Lord:
This came up while writing a regex to match characters that are valid in Python
identifiers for Jinja. https://github.com/pallets/jinja/pull/731 `\w` matches
all valid identifier characters except for 4 special cases:
import unicodedata
import re
import sys