Guido van Rossum added the comment:
I don't think this is a bug, unless you can show an example where the bytecode
compiler or the interpreter actually crashes. Basically you can change AST
nodes in lots of ways that don't correspond to valid programs, and as long as
you can't make CPython
Guido van Rossum added the comment:
Steve, is there a better way?
--
components: +Windows -C API
nosy: +gvanrossum, paul.moore, steve.dower, tim.golden, zach.ware
___
Python tracker
<https://bugs.python.org/issue42
Guido van Rossum added the comment:
This is not a bug -- it is how it's supposed to work (for better or for worse).
Please see a use forum to help you understand what's going on here.
--
nosy: +gvanrossum
resolution: -> not a bug
stage: -> resolved
status: open -&g
Guido van Rossum added the comment:
The problem with that formulation of the feature request is that it would
require the math.log function to recognize rationals, or at least the Fraction
type. Since the numeric tower and the fractions module are implemented in pure
Python that would
Guido van Rossum added the comment:
Cheryl, do you have time to review this?
--
nosy: +cheryl.sabella, gvanrossum
___
Python tracker
<https://bugs.python.org/issue42
Guido van Rossum added the comment:
I agree this is a bit unfortunate, but I also think it's a bit late to change
now.
However *if* we're going to change it we should do it now (in 3.10) or never.
Given that we never *write* type(None) in annotations, it's unfortunate to get
that back
Guido van Rossum added the comment:
I guess another approach might be to change the math module so that all its
functions support franctions (and decimal, and other esoteric number types).
But that would require having __log__ and many others as methods on the numeric
types.
Personally I
Guido van Rossum added the comment:
Quickest way to get that done is to send in a PR that updates whatsnew.
--
nosy: +gvanrossum
___
Python tracker
<https://bugs.python.org/issue42
Guido van Rossum added the comment:
No, let's leave 3.7 alone -- it's in security-fixes-only mode.
--
resolution: -> fixed
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Guido van Rossum added the comment:
Oh, you’re right about walrus. And I don’t actually understand async generator
expressions.
This suggests that we definitely need a PEP. :-)
--
___
Python tracker
<https://bugs.python.org/issue42
Guido van Rossum added the comment:
I would assume it’s some interaction between threads and fork. Have you asked
the authors of sound device about this?
--
nosy: +gvanrossum
___
Python tracker
<https://bugs.python.org/issue42
Guido van Rossum added the comment:
You are doing something very evil during finalization here. There’s nothing
that can be done reasonably.
--
nosy: +gvanrossum
resolution: -> wont fix
stage: -> resolved
status: open -> closed
___
Pytho
Change by Guido van Rossum :
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Guido van Rossum added the comment:
I wouldn’t have thought you’d need a PEP for this but if you want to write one
that sounds like the right thing.
Re: async and walrus: I think those are different, their presence doesn’t
affect the meaning of the function like yield. We can’t hope
Guido van Rossum added the comment:
This looks more like a question than an issue. Have you tried stackoverflow or
a user forum?
--
nosy: +gvanrossum
___
Python tracker
<https://bugs.python.org/issue42
Guido van Rossum added the comment:
I meant Irit. Silly autocorrect.
--
___
Python tracker
<https://bugs.python.org/issue42848>
___
___
Python-bugs-list mailin
Guido van Rossum added the comment:
No problem. Riot, are you interested in this?
--
nosy: +Guido.van.Rossum, iritkatriel
___
Python tracker
<https://bugs.python.org/issue42
Guido van Rossum added the comment:
The recursion error is actually inside the traceback module. The reason is that
the code there calls itself recursively for each level of context. Since bar()
builds up an endless chain of contexts as it calls itself recursively, that
chain is very long
Guido van Rossum added the comment:
Is there anything specific about __getattribute__ here? Wouldn't you have the
same issue for *any* function that raises RecursionError called inside an async
def?
--
nosy: +gvanrossum
___
Python tracker
<ht
Guido van Rossum added the comment:
SGTM, the use of ISO-8859 is surely a legacy issue.
--
nosy: +gvanrossum
___
Python tracker
<https://bugs.python.org/issue42
Guido van Rossum added the comment:
Excellent!
--
___
Python tracker
<https://bugs.python.org/issue42840>
___
___
Python-bugs-list mailing list
Unsubscribe:
Guido van Rossum added the comment:
If Brett's theory is right, compile() has a bug though -- it shouldn't plug a
non-string into the code object. Or possibly the code object constructor should
reject such objects (or extract the string
Guido van Rossum added the comment:
Undoubtedly -- but impact should be measured on what typical users would see,
not on narrow benchmarks.
--
___
Python tracker
<https://bugs.python.org/issue42
Guido van Rossum added the comment:
Maybe Brett can help?
--
nosy: +brett.cannon, gvanrossum
___
Python tracker
<https://bugs.python.org/issue42839>
___
___
Guido van Rossum added the comment:
That sounds intentional to me (else the class statement would have a capability
that cannot be dynamically emulated by calling type()).
We should probably update the docs (if you could submit a small PR that would
be appreciated) and also typeshed (ditto
Guido van Rossum added the comment:
This was discussed during the PEP review and rejected. The main reason is that
this operator would need to create a new instance, and there is no standard API
that's part of the Mapping protocol that can be used (the constructor of a
Mapping instance
Guido van Rossum added the comment:
This is expected -- those modules contain C extensions for which no 3.10 wheels
are available from PyPI yet, so pip tries to build them locally.
If you want to help testing, please install the recommended free version of the
MS C++ compiler. From CPython
Change by Guido van Rossum :
--
nosy: +gvanrossum, lys.nikolaou, pablogsal
___
Python tracker
<https://bugs.python.org/issue42837>
___
___
Python-bugs-list mailin
Guido van Rossum added the comment:
Yield in an annotation should be a syntax error.
--
___
Python tracker
<https://bugs.python.org/issue42725>
___
___
Pytho
Change by Guido van Rossum :
--
nosy: -gvanrossum
___
Python tracker
<https://bugs.python.org/issue42835>
___
___
Python-bugs-list mailing list
Unsubscribe:
Guido van Rossum added the comment:
Looks to me like this line is at fault:
607 | } else if PyLong_Check(obj) {
That's not valid C. In the GitHub mirror this line has been corrected.
--
resolution: -> third party
stage: -> resolved
status: open -&g
Guido van Rossum added the comment:
Do we have good intuition or data about which operations need speeding up most?
Everybody always assumes it's BINARY_ADD, but much Python code isn't actually
numeric, and binary operations aren't all that common. (For example, IIRC at my
previous employer
Guido van Rossum added the comment:
I've skimmed several papers by Stefan Brunthaler about something called
Quickening that I first found via the Pyston blog, which linked to an ancient
bpo issue with a patch created by Stefan (https://bugs.python.org/issue14757).
The gist seems
Guido van Rossum added the comment:
Maybe libxml is using a deprecated API or an invalid combination of command
line flags. I don't feel like debugging this until there's a clearer indication
of who's at fault.
--
___
Python tracker
<ht
Guido van Rossum added the comment:
Have you approached the libxml2 developers with this problem?
--
nosy: +gvanrossum
___
Python tracker
<https://bugs.python.org/issue42
Guido van Rossum added the comment:
This should be discussed on a user forum, not in our bug tracker.
--
nosy: +gvanrossum
resolution: -> rejected
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Guido van Rossum added the comment:
If you want this to work you have to pass the namespace where B is defined as
locals to get_type_hint(). The recommended approach is to make B a global
class; where that is not possible (as in your second example) you should chose
a different name.
We're
Guido van Rossum added the comment:
Hm, I was thinking to recognize the specific type of descriptor used by slots
and cache only that. Though we would still have to consider updates to
C.__dict__ (that's handled by looking at the dict version right
Change by Guido van Rossum :
--
nosy: +Guido.van.Rossum
___
Python tracker
<https://bugs.python.org/issue42115>
___
___
Python-bugs-list mailing list
Unsub
Change by Guido van Rossum :
--
resolution: -> out of date
stage: patch review -> resolved
status: languishing -> closed
___
Python tracker
<https://bugs.python.o
Guido van Rossum added the comment:
Please ping this issue if the backports don't auto-merge after the tests pass,
or if the tests fail.
--
nosy: +gvanrossum
___
Python tracker
<https://bugs.python.org/issue40
Guido van Rossum added the comment:
Thanks! Do you have any plans for further inline caches? I was wondering if we
could reverse the situation for slots again by adding slots support to the
LOAD_ATTR opcode inline cache...
--
nosy: +gvanrossum
Guido van Rossum added the comment:
This is a known limitation. To get this to work you have to pass globals() and
locals():
typing.get_type_hints(Test, globals(), locals())
--
nosy: +gvanrossum
resolution: -> wont fix
stage: -> resolved
status: open -&g
Guido van Rossum added the comment:
Sounds good, go for it. I assume @brandtbucher won't mind.
--
___
Python tracker
<https://bugs.python.org/issue40
Guido van Rossum added the comment:
Excellent!
--
___
Python tracker
<https://bugs.python.org/issue28937>
___
___
Python-bugs-list mailing list
Unsubscribe:
Guido van Rossum added the comment:
This issue probably needs a new champion. There is broad agreement but some
bike shedding, so a PEP isn’t needed.--
--Guido (mobile)
--
___
Python tracker
<https://bugs.python.org/issue28
Guido van Rossum added the comment:
That's fair. How do other builtins validate their pickling implementation?
Since the pickling goes through __reduce__/__reduce_ex__ we could instead test
that those methods return the expected results, that pickling roundtrips, and
that unpickling those
Guido van Rossum added the comment:
Looks like we can close this now, right? You can open a separate issue in the
python/typing repo to update typing_extensions.
--
___
Python tracker
<https://bugs.python.org/issue41
Guido van Rossum added the comment:
New changeset 11276cd9c49faea66ce7760f26a238d1edbf6421 by Ken Jin in branch
'master':
bpo-41559: Documentation for PEP 612 (GH-24000)
https://github.com/python/cpython/commit/11276cd9c49faea66ce7760f26a238d1edbf6421
Guido van Rossum added the comment:
Did you check this with master?
--
___
Python tracker
<https://bugs.python.org/issue42806>
___
___
Python-bugs-list mailin
Guido van Rossum added the comment:
> It makes sense to me to be able to do `(*a), b` if I can do `*a, b`, but I
> don't really have a strong opinion on it.
I disagree. *a is not an expression, so the normal rules for parenthesizing
those don't apply. I've always thought of *a as a f
Guido van Rossum added the comment:
Honestly this seems like a bug in 3.8 to me (if it indeed behaves like this):
>>> (*x), y
(1, 2, 3)
Every time I mistakenly tried (*x) I really meant (*x,), so it's surprising
that (*x), y would be interpreted as (*x, y) rather than fla
Guido van Rossum added the comment:
I see this as a backwards incompatible change and it's not worth doing for what
seems to me a very minor benefit.
--
___
Python tracker
<https://bugs.python.org/issue42
Guido van Rossum added the comment:
Whoa, you start a discussion on python-dev and another on bpo? That sounds a
bit hasty.
--
nosy: +gvanrossum
___
Python tracker
<https://bugs.python.org/issue42
Change by Guido van Rossum :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Guido van Rossum added the comment:
New changeset efb1f0918fad2ba3346a986b0e958dc5753a7bbe by Ken Jin in branch
'master':
bpo-42740: Support PEP 604, 612 for typing.py get_args and get_origin (GH-23942)
https://github.com/python/cpython/commit/efb1f0918fad2ba3346a986b0e958dc5753a7bbe
Guido van Rossum added the comment:
Wow, this is amazing. I just found that this is now faster than slots. Should
we mention that in What's New?
(Of course there's an optimization possible for slots as well, but it would
require complicating the cache struct. Maybe in 3.11
Guido van Rossum added the comment:
Yeah, we're talking about a future here where `from __future__ import
annotations` is always on. And that future is now. (3.10)
--
___
Python tracker
<https://bugs.python.org/issue42
Guido van Rossum added the comment:
So the distinction between simple and complex is to define what goes into
`__annotations__`. As long as we don't disturb that I think it's fine not to
evaluate anything. (There's also the effect on what's considered a local
variable, inside functions
Guido van Rossum added the comment:
Indeed. Thanks!
--
resolution: -> fixed
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Guido van Rossum added the comment:
Okay, let's do it. It should probably a post-parse check (before we invoke the
bytecode compiler but after we have the AST in hand).
--
___
Python tracker
<https://bugs.python.org/issue42
Guido van Rossum added the comment:
Huge thanks!
I think the next step is to port the essence to typing_extensions, which has to
work for anything from 3.5 up (or maybe 3.6), *including* 3.10 and above.
https://github.com/python/typing/tree/master/typing_extensions
Honestly maybe we could
Guido van Rossum added the comment:
New changeset 73607be68668ab7f4bee53507c8dc7b5a46c9cb4 by kj in branch 'master':
bpo-41559: Implement PEP 612 - Add ParamSpec and Concatenate to typing (#23702)
https://github.com/python/cpython/commit/73607be68668ab7f4bee53507c8dc7b5a46c9cb4
Guido van Rossum added the comment:
If we simply ignored yield in the annotation, wouldn't we have the problem that
def f(a: (yield)): pass
silently changes from being a generator (in 3.9) to not being a generator (in
3.10)? That would be bad. I'd rather make this an error still
Guido van Rossum added the comment:
The difference is that that just causes a slight inefficiency, while processing
'yield' makes the function a generator. So I don't feel as strongly about that.
--
___
Python tracker
<https://bugs.python.
Change by Guido van Rossum :
--
nosy: +lys.nikolaou
___
Python tracker
<https://bugs.python.org/issue42725>
___
___
Python-bugs-list mailing list
Unsubscribe:
Guido van Rossum added the comment:
Ouch. I think we should generate a SyntaxError if yield [from] is used in an
annotation.
--
___
Python tracker
<https://bugs.python.org/issue42
Guido van Rossum added the comment:
Can this be closed now?
--
___
Python tracker
<https://bugs.python.org/issue42675>
___
___
Python-bugs-list mailin
Guido van Rossum added the comment:
New changeset 597ebc8cf604de49eabbc7b83be2debd005d7819 by kj in branch '3.9':
[3.9] bpo-42675: Document collections.abc.Callable changes (GH-23839) (#23852)
https://github.com/python/cpython/commit/597ebc8cf604de49eabbc7b83be2debd005d7819
Change by Guido van Rossum :
--
nosy: +gvanrossum
___
Python tracker
<https://bugs.python.org/issue42683>
___
___
Python-bugs-list mailing list
Unsubscribe:
Guido van Rossum added the comment:
New changeset d75f6f78e6ca230d0dacc116dca9d8bf91509b68 by kj in branch 'master':
bpo-42675: Document collections.abc.Callable changes (GH-23839)
https://github.com/python/cpython/commit/d75f6f78e6ca230d0dacc116dca9d8bf91509b68
Guido van Rossum added the comment:
It's been a while, I've lost context for this idea. What problem are you trying
to solve here? Are there issues where people have reported problems that this
would allow them to solve?
--
___
Python tracker
Guido van Rossum added the comment:
I think something should probably be done about this, but opening another
tracker issue is not the way to make progress here. So I am closing the issue.
It will happen in due time. No need to have more open issues.
--
stage: -> resolved
sta
Guido van Rossum added the comment:
Looks like we can close this. Thanks for the report Zac (hopefully you can live
with the resolution), and thanks a bundle Ken Jin for all your work on this! I
hope it was fun and educational for you. I know it was for me.
--
resolution: -> fi
Guido van Rossum added the comment:
New changeset 33b3fedd43e10e5a227ec8b7d251496e7cad4717 by kj in branch '3.9':
[3.9] bpo-42195: Ensure consistency of Callable's __args__ in collections.abc
and typing (GH-23765)
https://github.com/python/cpython/commit
Guido van Rossum added the comment:
This is now unblocked now that GH-23060 has landed.
--
___
Python tracker
<https://bugs.python.org/issue41559>
___
___
Pytho
Guido van Rossum added the comment:
New changeset 463c7d3d149283814d879a9bb8411af64e656c8e by kj in branch 'master':
bpo-42195: Ensure consistency of Callable's __args__ in collections.abc and
typing (GH-23060)
https://github.com/python/cpython/commit/463c7d3d149283814d879a9bb8411af64e656c8e
Guido van Rossum added the comment:
I started doing this in the original code (long ago when PEP 484 was brand
new) but have since realized that this makes the typing module both slow
and hard to maintain. We should not follow this example. I do think we
should try to keep `__args__` hashable
Guido van Rossum added the comment:
For reference, here's what Pyre has (though it's an older version):
https://github.com/facebook/pyre-check/tree/master/pyre_extensions
--
___
Python tracker
<https://bugs.python.org/issue41
Guido van Rossum added the comment:
> class X(Generic[T, P]): ...
>
> 1. X[int, [int, bool]] raises TypeError because second arg isn't a type (this
> is easy to fix).
How would you fix it? By just allowing it? But then X.__args__ would be
unhashable (see the other issue w
Guido van Rossum added the comment:
Josh, feel free to submit a PR (make sure it mentions this issue).
--
___
Python tracker
<https://bugs.python.org/issue39
Guido van Rossum added the comment:
I wrote
class C(Generic[T, P]): ...
and was surprised that C.__parameters__ was (T,) instead of (T, P).
--
___
Python tracker
<https://bugs.python.org/issue41
Guido van Rossum added the comment:
Thanks for working on this -- let me know when you have a question for me. Once
this is ready we should also add it to the typing_extensions module so people
can use it on older Python versions.
(https://github.com/python/typing/tree/master
Guido van Rossum added the comment:
Looking for another reviewer.
--
___
Python tracker
<https://bugs.python.org/issue42059>
___
___
Python-bugs-list mailin
Guido van Rossum added the comment:
Thanks for the quick fix!
--
___
Python tracker
<https://bugs.python.org/issue42576>
___
___
Python-bugs-list mailin
Guido van Rossum added the comment:
Oh, this looks like I copied the wrong idiom. Good catch!
--
___
Python tracker
<https://bugs.python.org/issue42576>
___
___
Guido van Rossum added the comment:
Wait, is the OP maybe that there’s a difference between typeshed an the stdlib
typing.py?
--
___
Python tracker
<https://bugs.python.org/issue38
Guido van Rossum added the comment:
Hm, I wonder if there's a typo here in pythonrun.c:
/* For use in Py_LIMITED_API */
#undef Py_CompileString
PyObject *
PyCompileString(const char *str, const char *filename, int start)
{
return Py_CompileStringFlags(str, filename, start, NULL
Guido van Rossum added the comment:
Thanks!
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Guido van Rossum added the comment:
New changeset d82e08d185d52086f4d921c08b853c76c80bebbe by Irit Katriel in
branch '3.8':
[3.8] bpo-42474: test TracebackException comparison to non-equal instances
(GH-23558)
https://github.com/python/cpython/commit/d82e08d185d52086f4d921c08b853c76c80bebbe
Guido van Rossum added the comment:
New changeset 586bdd1add2ca7236e3096ab7167862cf17f0939 by Irit Katriel in
branch '3.9':
[3.9] bpo-42474: test TracebackException comparison to non-equal instances
(GH-23557)
https://github.com/python/cpython/commit/586bdd1add2ca7236e3096ab7167862cf17f0939
Guido van Rossum added the comment:
Now that I've seen and reviewed KJ's implementation using _PosArgs, I am
worried about it, as it looks quite complicated. @Shantanu, do we really need
to worry that Callable[P, R] could be ambiguous? If P is a ParamSpec, wouldn't
Callable[[P], R
Guido van Rossum added the comment:
Irit, can you,do the manual backports?
--
___
Python tracker
<https://bugs.python.org/issue42474>
___
___
Python-bugs-list m
Guido van Rossum added the comment:
For background, see
https://github.com/iritkatriel/cpython/pull/3#issuecomment-734640036 -- it
seems the link to exc_traceback was added with little concern for the original
design of TracebackExceptionGroup.
The question is, can we get rid of it, even
Guido van Rossum added the comment:
New changeset 44ca05afc89c9967f5dbc6c3ad89fc298c460e93 by Irit Katriel in
branch 'master':
bpo-42474: test TracebackException comparison to non-equal instances (GH-23522)
https://github.com/python/cpython/commit/44ca05afc89c9967f5dbc6c3ad89fc298c460e93
Change by Guido van Rossum :
--
nosy: -gvanrossum
___
Python tracker
<https://bugs.python.org/issue42468>
___
___
Python-bugs-list mailing list
Unsubscribe:
Guido van Rossum added the comment:
Greg, do you have an opinion here?
--
nosy: +gregory.p.smith
___
Python tracker
<https://bugs.python.org/issue42468>
___
___
Change by Guido van Rossum :
--
nosy: +gvanrossum
___
Python tracker
<https://bugs.python.org/issue29980>
___
___
Python-bugs-list mailing list
Unsubscribe:
Guido van Rossum added the comment:
No, they both have a different meaning. Object has (almost) no attributes. Any
has all attributes.
--
___
Python tracker
<https://bugs.python.org/issue42
Guido van Rossum added the comment:
I'm still not sold on __args__ == (Tuple[int, int], str); it looks too weird.
However if we introduced a new private type for this purpose that might work? I
see that the definition of Tuple in typing.py is
Tuple = _TupleType(tuple, -1, inst=False, name
901 - 1000 of 5393 matches
Mail list logo