Kodiologist added the comment:
This bit me real bad. On Python 3.8, I wrote a program with `isolation_level =
None` and `with db: …` and spent a long time figuring out why writes were so
slow. Turns out that `with db` doesn't actually start a transaction in this
case, as the document
Kodiologist added the comment:
> the builtin variable "True"
Is the existence of this entity, as separate from the constant `True`,
documented anywhere? constants.rst doesn't seem to acknowledge it. Indeed, is
its existence a feature, or is
Change by Kodiologist :
--
keywords: +patch
pull_requests: +29191
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/31012
___
Python tracker
<https://bugs.python.org/issu
Kodiologist added the comment:
(Hilariously, I couldn't post this comment on bugs.python.org due to some kind
of Unicode bug ("Edit Error: 'utf8' codec can't decode bytes in position
208-210: invalid continuation byte"), so I've rendered
"\U0001D
New submission from Kodiologist :
I'm not sure if this is a bug, but it certainly surprised me. Most reserved
words, when Unicode-mangled, as in "𝕕𝕖𝕗", act like ordinary identifiers (see
e.g. bpo-46520). `True`, `False`, and `None` are weird in that Unicode-mangled
version
Kodiologist added the comment:
And yes, while this behavior will look strange, the only code that will parse
to AST nodes that require it will be code that uses exactly the same trick.
--
___
Python tracker
<https://bugs.python.org/issue46
Kodiologist added the comment:
I've done very little work on CPython, but I do a lot of AST construction and
call `ast.unparse` a lot in my work on Hylang, and I think this is a wart worth
fixing. The real mistake was letting the user say `𝕕𝕖𝕗 = 1`, but that's been
legal Python
New submission from Kodiologist :
This works:
𝕕𝕖𝕗 = 1
This raises SyntaxError:
import ast
exec(ast.unparse(ast.parse("𝕕𝕖𝕗 = 1")))
It looks like `ast.parse` creates a `Name` node with `id='def'`, which is
correct per PEP 3131, but `ast.unparse` does
Change by Kodiologist :
--
keywords: +patch
pull_requests: +23662
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/24897
___
Python tracker
<https://bugs.python.org/issu
New submission from Kodiologist :
`ast.unparse` throws an error on an empty set, and it produces `nan` for NaN,
which isn't a legal Python literal.
PR to follow shortly.
--
messages: 388872
nosy: Kodiologist
priority: normal
severity: normal
status: open
title: Allow `ast.unpars
New submission from Kodiologist :
On Python 3.8.2, the below program runs without errors. On Python 3.9.0b1, it
raises "TypeError: 'tuple' object is not callable" for the last line.
d1 = {'a': 1}
d2 = {'c': 3}
def fun(a, b, c):
re
New submission from Kodiologist:
Compare ``isinstance``, ``issubclass``, and ``islower`` to ``is_integer``,
``is_fifo``, and ``is_enabled``. In Python 3.6, of all the names in the
standard library starting with ``is``, I count 69 names with the underscore and
91 without. It seems better to
12 matches
Mail list logo