Guido van Rossum added the comment:
This is not really just a doc issue then, is it? Maybe we should just deprecate
the feature?
--
___
Python tracker
<https://bugs.python.org/issue46
Guido van Rossum added the comment:
I recommend opening an issue here:
https://github.com/python/typing/issues/new/choose
--
___
Python tracker
<https://bugs.python.org/issue46
New submission from Guido van Rossum :
In https://github.com/python/cpython/pull/30096#discussion_r768802144 it is
pointed out that the hash seed can be changed if the interpreter is reset.
To guard against this we need to force (re)calculation of all hash seeds in the
generated code when
Guido van Rossum added the comment:
Couldn't we just change the first occurrence of "central location" in the note
to "a central location" and the second to "(different) central locations"? That
would leave Steven's intention intact but satisfy thos
Guido van Rossum added the comment:
We should have a discussion here about improvements that Mark Shannon would
like to see, in particular to do more work in the compiler instead of the
interpreter.
--
nosy: +Mark.Shannon, gvanrossum
___
Python
Guido van Rossum added the comment:
Never mind, this was based on incorrect information. See subsequent messages in
the linked thread.
--
resolution: -> not a bug
stage: test needed -> resolved
status: open -> closed
___
Python tracke
New submission from Guido van Rossum :
I am trying to build under Visual Studio (the 2019 release) and I'm
encountering the following weird issue. In the project file
PCbuild\_freeze_module.vcxproj there's a command that runs the
Tools\scripts\deepfreeze.py script to generate some
Change by Guido van Rossum :
--
keywords: +patch
pull_requests: +28346
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/30127
___
Python tracker
<https://bugs.python.org/issu
Guido van Rossum added the comment:
Great! I will leave it to Steven and Mark D to work out an acceptable solution.
PS. Allen Downey is a computer scientist who has written at least one book
about Python.
--
___
Python tracker
<ht
Guido van Rossum added the comment:
I think a 3.10 backport would be appreciated.
--
___
Python tracker
<https://bugs.python.org/issue45755>
___
___
Python-bug
Guido van Rossum added the comment:
I don't see a reason to go through the bootstrap python on Windows. It would
increase the build time, which is already pretty slow.
--
___
Python tracker
<https://bugs.python.org/is
Guido van Rossum added the comment:
A thread without a frame looks like a natural end case when you consider the
frames as a linked list. Could it be that exec()/eval() run in the current
frame, and if there isn't a frame, they refuse to run? (Sorry, I don't recall
anything mor
Guido van Rossum added the comment:
I presume https://github.com/faster-cpython/ideas/discussions/194 is also
relevant.
--
___
Python tracker
<https://bugs.python.org/issue46
Change by Guido van Rossum :
--
nosy: -gvanrossum
___
Python tracker
<https://bugs.python.org/issue45235>
___
___
Python-bugs-list mailing list
Unsubscribe:
Guido van Rossum added the comment:
> Note: attrgetter could easily be made faster by migrating it to use
> vectorcall.
Sure, though code that *doesn't* use attrgetter is usually easier to read --
attrgetter is rare enough in my experience that I usually have to look it up.
Guido van Rossum added the comment:
Yes, it is too late for 3.10 (but you can add it to typing_extensions). Also,
PEP 585 is done, we don't update PEPs. Please do test with `from __future__
import annotations` -- you never know.
When this was first proposed (https://github.com/python/t
Guido van Rossum added the comment:
We managed to do this for 'with' so it should be possible here too, I'd think.
The "committing" token would be the newline following the close parenthesis.
Serhiy: the benefit is when you want to split it acros
Guido van Rossum added the comment:
I like the lookahead. We could also make the comma and the message mandatory
when inside parentheses:
| 'assert' '(' a=expression ',' b=expression [','] ')' &(NEWLINE | ';')
| '
Guido van Rossum added the comment:
You don’t have to use the new feature. But people expect it to work.
--
___
Python tracker
<https://bugs.python.org/issue46
Guido van Rossum added the comment:
See https://github.com/python/mypy/issues/9773#issuecomment-1000975000. I may
have talked myself into agreeing with Serhiy there! It does seem inconsistent
that Any is not considered a type but list[int] is:
>>> isinstance(list[int], type)
True
&
Guido van Rossum added the comment:
Do you have evidence that people make this particular mistake often? And that
the suggested solution is indeed what they should use? Why would you want to
subclass UserId?
Do we have examples of other error messages split across two lines like this
Guido van Rossum added the comment:
Weird, the docs you cite claims
# Also does not typecheck
ProUserId = NewType('ProUserId', UserId)
but when I try it, it works at runtime and passes mypy (even with --strict) and
also pyright.
So maybe those docs are incorrect? I
Guido van Rossum added the comment:
There's no point in lamenting the compatibility with Python 3.6, it's water
under the bridge. Dispatching on types like list[int] or types generated by
NewType is not realistic. Maybe the only thing left to do is to raise an error
on registratio
Guido van Rossum added the comment:
That mypy error is only reported with a certain mypy setting (--strict, or
probably one of the specific settings that that turns on).
We won't be supporting Sequence[Any] at runtime (because we only support actual
types), but we should support Seq
Guido van Rossum added the comment:
Let's close this issue as "won't fix" then. The solution "use
collections.abc.Sequence" makes sense.
--
___
Python tracker
<h
Guido van Rossum added the comment:
Could you try with 3.10 and the stdlib typing.Annotated please? There might
be changes (in the past a default of None automatically caused an Optional
to be added, but we changed our minds.--
--Guido (mobile
Guido van Rossum added the comment:
If we allow registering list[int] but give it the same meaning as registering
plain list (at runtime), that would violate user expectations pretty strongly
-- for the same reason why we don't allow isinstance(x, list[int]).
If you want stronger che
Guido van Rossum added the comment:
Yes, we changed PEP 484 in https://github.com/python/peps/pull/689.
So get_type_hints() should follow suit.
--
___
Python tracker
<https://bugs.python.org/issue46
Change by Guido van Rossum :
--
nosy: -gvanrossum
___
Python tracker
<https://bugs.python.org/issue44394>
___
___
Python-bugs-list mailing list
Unsubscribe:
Guido van Rossum added the comment:
Let me have a look. May take a day, okay?--
--Guido (mobile)
--
___
Python tracker
<https://bugs.python.org/issue46
Guido van Rossum added the comment:
So if I understand the speed.python.org results correctly, the time to run
`python -c pass` went way up, but the time for `python -S -c pass` did not go
up significantly.
Unfortunately the only machine I have access to is a Mac, and I cannot repro
this
Guido van Rossum added the comment:
Maybe it's Linux specific? I managed to run pyperformance and got this:
### python_startup ###
Mean +- std dev: 23.2 ms +- 0.8 ms -> 23.4 ms +- 1.2 ms: 1.01x slower
Not significant
Note, I am not dismissing the report -- in fact it looks quite ba
Guido van Rossum added the comment:
Maybe something unrelated changed on the benchmark machines? (Like installing a
new version of pyperformance???) Though it happened across both benchmark
machines. What configuration and flags are being used to run the benchmark
suite on that machine
Guido van Rossum added the comment:
I propose a test: revert the PR and see if speed.Python.org shows a speedup
back to the previous number.--
--Guido (mobile)
--
___
Python tracker
<https://bugs.python.org/issue46
Guido van Rossum added the comment:
Confirmed about _TypeVarLike. Go ahead and make a PR. Do add a news blurb when
requested.
Please open separate issues for other such classes, each fix may need to be
reviewed by a different expert
Guido van Rossum added the comment:
I wrote a tiny script that calls compile() on raw bytes read from some source
file, does this 100 times, and reports the total time. I tested the script with
Lib/pydoc_data/topics.py (which happens to be the largest source file in the
CPython repo, but
Guido van Rossum added the comment:
"is very very unlike that there is no actual regression"
I presume you meant
"it is very very *likely* that there is no actual regression"
This shouldn't hold up releases, but (having spent months trying to improve
startup spe
Guido van Rossum added the comment:
So is it too late to change this? This went out with 3.10, Serhiy has argued
it's a bugfix.
--
___
Python tracker
<https://bugs.python.org/is
Guido van Rossum added the comment:
Okay, so it is probably here to stay. We could justify it (after the fact :-)
by saying that you can instantiate list[int], but not Any.
Are there exceptions to that? (I.e. are there other annotation types that have
isinstance(X, type) return False but
Guido van Rossum added the comment:
I'm still wondering why speed.python.org showed such a slowdown, and how we can
revert that. Here's a new theory.
Thanks to an investigation I did together with Eric, I now suspect that the
release of setuptools 60.0.0 on Dec 19 is a s
Guido van Rossum added the comment:
More data. On my Mac, with SETUPTOOLS_USE_DISTUTILS=stdlib, using -X importtime
I see the following extra modules being imported:
import time: 278 |278 | types
import time: 112 |112 | _operator
import time
Guido van Rossum added the comment:
I now agree with Serhiy's plan. We should execute ASAP so people get a chance
to try this in the next alpha release.
We will still allow instantiating e.g. list[int], right?
--
___
Python tracker
&
Change by Guido van Rossum :
--
title: FreeBSL buiildbots cannot compile Python -> FreeBSD buildbots cannot
compile Python
___
Python tracker
<https://bugs.python.org/issu
Guido van Rossum added the comment:
Is this under control, or do you still need help with some part? (Are there
two separate issues or not?)--
--Guido (mobile)
--
___
Python tracker
<https://bugs.python.org/issue46
Guido van Rossum added the comment:
IIUC Steve is still on vacation, so we shouldn't wait for him to fix this.
--
___
Python tracker
<https://bugs.python.org/is
Guido van Rossum added the comment:
Niklas, can you show a brief example showing the issue you're running into? Is
it just that list["Node"].__args__ is just ("Node",), not
(ForwardRef("Node"),)? Or is it more complex?
--
___
Guido van Rossum added the comment:
Deep-freezing is definitely not a miracle cure. We should continue to trim or
delay unneeded imports (like Christian just did for setuptools'
_distutils_hack).
What *would* be a miracle cure would be if we could deep-freeze the module
contents aft
Guido van Rossum added the comment:
To close the loop, setuptools 60.4.0 should fix this, see
https://github.com/pypa/setuptools/pull/3009.
--
___
Python tracker
<https://bugs.python.org/issue46
Change by Guido van Rossum :
--
nosy: -gvanrossum
___
Python tracker
<https://bugs.python.org/issue46148>
___
___
Python-bugs-list mailing list
Unsubscribe:
Guido van Rossum added the comment:
Yup. All better:
https://speed.python.org/timeline/#/?exe=12&ben=python_startup&env=1&revs=50&equid=off&quarts=on&extr=on
--
___
Python tracker
<https:/
Change by Guido van Rossum :
--
stage: -> needs patch
___
Python tracker
<https://bugs.python.org/issue46333>
___
___
Python-bugs-list mailing list
Unsubscrib
Guido van Rossum added the comment:
Good catch. Do you want to submit a PR? I agree that the repr() could also be
better (but please only show other values if they differ from the default).
--
versions: +Python 3.11
___
Python tracker
<ht
Guido van Rossum added the comment:
Since the conclusion is that we can't do this without breaking backwards
compatibility, should we just close this? Or is there still a compromise
possible?
--
___
Python tracker
<https://bugs.py
Guido van Rossum added the comment:
Thanks for the bisection. It's not surprising that that's the culprit, and in
other situations that's the right thing to do. I'm not sure how to address this
without breaking other stuff -- maybe leave the ForwardRef if evaluating i
Guido van Rossum added the comment:
Yes.--
--Guido (mobile)
--
___
Python tracker
<https://bugs.python.org/issue46244>
___
___
Python-bugs-list mailin
New submission from Guido van Rossum :
I am getting these warnings:
C:\Users\gvanrossum\cpython\PC\_testconsole.c(70,38): warning C4013:
'_Py_get_osfhandle' undefined; assuming extern returnin
g int [C:\Users\gvanrossum\cpython\PCbuild\_testconsole.vcxproj]
C:\Users\gvanrossum\
Change by Guido van Rossum :
--
nosy: +gvanrossum
___
Python tracker
<https://bugs.python.org/issue46303>
___
___
Python-bugs-list mailing list
Unsubscribe:
Guido van Rossum added the comment:
New changeset e2a9c8ef09cb7123d6b28852a323e6cc1f878b5b by Nikita Sobolev in
branch 'main':
bpo-46348: modernize `test_typing` (GH-30547)
https://github.com/python/cpython/commit/e2a9c8ef09cb7123d6b28852a323e6
Guido van Rossum added the comment:
New changeset 0bbf30e2b910bc9c5899134ae9d73a8df968da35 by Jelle Zijlstra in
branch 'main':
bpo-46342: make @typing.final introspectable (GH-30530)
https://github.com/python/cpython/commit/0bbf30e2b910bc9c5899134ae9d73a
Guido van Rossum added the comment:
New changeset 1de60155d5d01be2924e72fb68dd13d4fd00acd7 by Nikita Sobolev in
branch 'main':
bpo-46345: Add a test case for implicit `Optional` class attribute (GH-30535)
https://github.com/python/cpython/commit/1de60155d5d01be2924e72fb68dd13
Guido van Rossum added the comment:
Wasn’t the fix for it also backported?
(Weird that the test wasn’t part of the fix.)
--
___
Python tracker
<https://bugs.python.org/issue46
Guido van Rossum added the comment:
Okay, PR welcome.
(Though since this can only work for 3.11+,
maybe typeshed could also be adjusted?
For that you’d have to file a bug there.)
--
___
Python tracker
<https://bugs.python.org/issue46
Guido van Rossum added the comment:
[Meta: Why did adding a comment add all those people (back?) to the nosy list?]
--
___
Python tracker
<https://bugs.python.org/issue12
Guido van Rossum added the comment:
Probably.
On Mon, Jan 17, 2022 at 02:14 Alex Waygood wrote:
>
> Alex Waygood added the comment:
>
> Do these changes warrant an entry in "What's New in 3.11"?
>
> --
>
> ___
New submission from Guido van Rossum :
This saves some space when strings are shared across deep-frozen module.
Kumar measured this at around 0.2 Mbyte.
See discussion https://github.com/faster-cpython/ideas/issues/218
--
___
Python tracker
<ht
Guido van Rossum added the comment:
Given all this discussion I defer to Serhiy and Inada-San.
On Wed, Jan 19, 2022 at 02:23 Serhiy Storchaka
wrote:
>
> Serhiy Storchaka added the comment:
>
> I share concerns of Inada-san. I also think that keeping a status quo
> (ignor
Guido van Rossum added the comment:
New changeset 263c0dd16017613c5ea2fbfc270be4de2b41b5ad by Nikita Sobolev in
branch 'main':
bpo-46437: remove useless `hasattr` from `test_typing` (#30704)
https://github.com/python/cpython/commit/263c0dd16017613c5ea2fbfc270be4de2b41b5ad
-
New submission from Guido van Rossum :
This seems to happen in 3.11 in the REPL only.
>>> def f():
... print(0)
... return yield 42
File "", line 3
def f():
^
SyntaxError: invalid syntax
Note that running it from a file gives the expected output:
PS
Guido van Rossum added the comment:
New changeset 194ecc6d44adc1fb39a56ca696418368b69432ce by Kumar Aditya in
branch 'main':
bpo-46443: deepfreeze: use small ints and singleton zero bytes (GH-30715)
https://github.com/python/cpython/commit/194ecc6d44adc1fb39a56ca6964183
Guido van Rossum added the comment:
Thanks for the quick fix!
--
___
Python tracker
<https://bugs.python.org/issue46441>
___
___
Python-bugs-list mailin
Guido van Rossum added the comment:
New changeset ef3ef6fa43d5cca072eed2a66064e818de583be7 by Kumar Aditya in
branch 'main':
bpo-46429: Merge all deepfrozen files into one (GH-30572)
https://github.com/python/cpython/commit/ef3ef6fa43d5cca072eed2a66064e8
Change by Guido van Rossum :
--
nosy: -gvanrossum
___
Python tracker
<https://bugs.python.org/issue46399>
___
___
Python-bugs-list mailing list
Unsubscribe:
Guido van Rossum added the comment:
Hm, the deep-frozen objects are statically initialized with a very large
refcount that isn't accounted for (they are intended to be immortal). It seems
that Py_Finalize() somehow decrefs those objects. I guess this means we need
some kind of
Guido van Rossum added the comment:
I was hoping @eric.snow could tell me.
--
___
Python tracker
<https://bugs.python.org/issue46449>
___
___
Python-bugs-list m
Guido van Rossum added the comment:
IMO we shouldn't update PEP 544. PEPs reflect the historical proposal, they are
not documentation for the current state of the interpreter.
--
___
Python tracker
<https://bugs.python.org/is
Guido van Rossum added the comment:
Just because __init__ is extra weird doesn't mean that other methods aren't
roughly like C++.
But I can't find the text the OP refers to. Without a specific pointer (at
least a URL and quoted text) this issue is non-actionable and shou
Guido van Rossum added the comment:
New changeset 881a763cfe07ef4a5806ec78f13a9bc99e8909dc by Weipeng Hong in
branch 'main':
bpo-43118: Fix bug in inspect.signature around 'base.__text_signature__'
(GH-30285)
https://github.com/python/cpython/commit/881a763cfe07ef4a5806
Guido van Rossum added the comment:
Arguably the runtime should not check for incorrect calls to Concatenate.
That's the job of static type checkers. So maybe that code could just be
removed? (We don't bother checking things like list
Guido van Rossum added the comment:
New changeset 65b88d5e01c845c0cfa3ff61bc8b2faec8f67a57 by Nikita Sobolev in
branch 'main':
bpo-46445: Cover multiple inheritance of `TypedDict` in `test_typing` (GH-30719)
https://github.com/python/cpython/commit/65b88d5e01c845c0cfa3ff61bc8b2f
Guido van Rossum added the comment:
You appear more interested in a discussion of Python semantics than in
improving the tutorial. I see nothing actionable here.
--
resolution: -> wont fix
stage: -> resolved
status: open -> closed
_
Guido van Rossum added the comment:
New changeset 83aef4d34022f293336f606dba8598cc7ac8f9f2 by Miss Islington (bot)
in branch '3.10':
bpo-43118: Fix bug in inspect.signature around 'base.__text_signature__'
(GH-30285) (#30765)
https://github.com/p
Guido van Rossum added the comment:
@kj, are you looking into this?
--
___
Python tracker
<https://bugs.python.org/issue46465>
___
___
Python-bugs-list mailin
Guido van Rossum added the comment:
Is this a matter of adding some documentation showing how it should be done?
Even if we don't want to encourage such subclassing, we do have APIs to support
it, and I think we ought to show how to do it, given that you have to
coordinate a bunch of t
Guido van Rossum added the comment:
If any of the immortal, deep-frozen code objects is ever quickened, I suppose
the quickening data is never freed. But when we finalize and reinitialize, the
co_quickened flag should remain set, so this would be a one-time leak.
The question is whether the
Guido van Rossum added the comment:
> Is there a way to disable deepfreeze when building Python?
It looks like this isn't easy, sorry. :-( Adding Christian Heimes in case he
has a suggestion.
--
nosy: +christian.heimes
___
Python tracker
Guido van Rossum added the comment:
> Would it be possible to enhance deepfreeze be produce a list of all
> (immortal) code objects?
That should be simple. We could see if Kumar is interested.
--
nosy: +kumaraditya303
___
Python tracker
Guido van Rossum added the comment:
Do you recommend to just close this as "fixed"?
--
___
Python tracker
<https://bugs.python.org/issue44642>
___
___
Guido van Rossum added the comment:
I'm wondering if the test is faulty. It seems to call EventLoop.sendfile() with
a file that is 8K + 1 byte long,
and the protocol is instructed to close after 1K bytes have been written, but
it seems to try to send as much of the file as it can.
Cou
Guido van Rossum added the comment:
New changeset ca78130d7eb5265759697639e42487ec6d0a4caf by Kumar Aditya in
branch 'main':
bpo-46471: Use single byte singletons (GH-30781)
https://github.com/python/cpython/commit/ca78130d7eb5265759697639e42487
Guido van Rossum added the comment:
+1--
--Guido (mobile)
--
___
Python tracker
<https://bugs.python.org/issue46491>
___
___
Python-bugs-list mailing list
Unsub
Guido van Rossum added the comment:
@Kumar do you want to tackle this?
--
nosy: +kumaraditya303
___
Python tracker
<https://bugs.python.org/issue46449>
___
___
Change by Guido van Rossum :
--
resolution: -> fixed
stage: patch review -> resolved
status: pending -> closed
___
Python tracker
<https://bugs.python.or
Guido van Rossum added the comment:
> With the current design, it isn't possible though because the code objects
> are modified in place so if co_quickened is freed the VM still tries to
> execute the copied instructions.
Or the cleanup code could also restore co_firstinstr an
Change by Guido van Rossum :
--
nosy: -gvanrossum
___
Python tracker
<https://bugs.python.org/issue46494>
___
___
Python-bugs-list mailing list
Unsubscribe:
Guido van Rossum added the comment:
"When in doubt, the status quo wins."
Maybe we should just close this and the PR without merging.
--
___
Python tracker
<https://bugs.python.o
Guido van Rossum added the comment:
So, a PR with that fix would be nice?
--
___
Python tracker
<https://bugs.python.org/issue46431>
___
___
Python-bugs-list m
Guido van Rossum added the comment:
I tried to make the 'FROZEN' variable in freeze_modules.py empty, but it has a
bunch of places where this is unexpected. Maybe someone can fix that?
--
___
Python tracker
<https://bugs.python.o
Change by Guido van Rossum :
--
nosy: -gvanrossum
___
Python tracker
<https://bugs.python.org/issue46483>
___
___
Python-bugs-list mailing list
Unsubscribe:
Guido van Rossum added the comment:
No, that would make the behavior normative.
Let sleeping dogs lie.
--
resolution: -> wont fix
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Guido van Rossum added the comment:
Exactly what I just thought. A bit more research might find a buggy assumption
in the test "framework".
--
nosy: +gvanrossum
___
Python tracker
<https://bugs.python.o
1 - 100 of 5533 matches
Mail list logo