[issue46643] typing.Annotated cannot wrap typing.ParamSpec args/kwargs

2022-02-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Should it? Annotated wraps types, and P.args/P.kwargs are not types. If make Annotated accepting P.args/P.kwargs (and possible other non-types, e.g. P), it is a new feature which should be publicly discussed first and documented. I do not thing it

[issue46676] ParamSpec args and kwargs are not equal to themselves.

2022-02-07 Thread Gregory Beauregard
Change by Gregory Beauregard : -- pull_requests: +29380 pull_request: https://github.com/python/cpython/pull/31210 ___ Python tracker ___

[issue46676] ParamSpec args and kwargs are not equal to themselves.

2022-02-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset c8b62bbe46e20d4b6dd556f2fa85960d1269aa45 by Gregory Beauregard in branch 'main': bpo-46676: Make ParamSpec args and kwargs equal to themselves (GH-31203) https://github.com/python/cpython/commit/c8b62bbe46e20d4b6dd556f2fa85960d1269aa45

[issue45948] Unexpected instantiation behavior for xml.etree.ElementTree.XMLParser(target=None)

2022-02-07 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- components: +Extension Modules nosy: +serhiy.storchaka versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.8 ___ Python tracker ___

[issue46639] Ceil division with math.ceildiv

2022-02-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Round division would be useful not less than ceil division, if not more. In the stdlib it would be used in: 1. The datetime module. 2. Fraction.__round__. -- ___ Python tracker

[issue46639] Ceil division with math.ceildiv

2022-02-07 Thread Tim Peters
Tim Peters added the comment: The `decimal` module intends to be a faithful implementation of external standards. The identity x == (x // y) * y + x % y isn't a minor detail, it's the dog on which all else is but a tail ;-) It's why Guido picked -7 // 4 = -2 in Python[1]. That's really not

[issue46669] Add types.Self

2022-02-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: > Your suggested signature looks like it's trying to support > the second invariant, but it doesn't quite: if the types > don't match, the type checker will just set T to the > common base type of the two arguments. Is there a way to write the second

[issue46323] Use _PyObject_Vectorcall in Modules/_ctypes/callbacks.c

2022-02-07 Thread Dong-hee Na
Dong-hee Na added the comment: New changeset e959dd9f5c1d8865d4e10c49eb30ee0a4fe2735d by Dong-hee Na in branch 'main': bpo-46323 Fix ref leak if ctypes.CFuncPtr raises an error. (GH-31209) https://github.com/python/cpython/commit/e959dd9f5c1d8865d4e10c49eb30ee0a4fe2735d --

[issue46282] return value of builtins is not clearly indicated

2022-02-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: > New learners coming to Python don't know the same things > as people with experience. IMO, new learners will be worse off by adding "returns None" to all of the builtins. At best it a distractor. I work with new learners almost every day. The issue

[issue46323] Use _PyObject_Vectorcall in Modules/_ctypes/callbacks.c

2022-02-07 Thread Dong-hee Na
Dong-hee Na added the comment: @vstinner PR 31209 is for fixing the leak. -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue46323] Use _PyObject_Vectorcall in Modules/_ctypes/callbacks.c

2022-02-07 Thread Dong-hee Na
Change by Dong-hee Na : -- pull_requests: +29379 pull_request: https://github.com/python/cpython/pull/31209 ___ Python tracker ___

[issue46647] `test_functools` unexpected failures when C `_functoolsmodule` is missing

2022-02-07 Thread Nikita Sobolev
Nikita Sobolev added the comment: > Or maybe you have other cases to show the functools module will missing > unexpectly? No, I can't think of any :) Your argument about code churn also makes sense. But, if we ever are going to refactor this test module, this is something to remember of.

[issue46159] Segfault when using trace functions in 3.11a3

2022-02-07 Thread Alex Gaynor
Alex Gaynor added the comment: It seems to no longer be crashing with alpha5. Hopefully it's actually fixed and not merely having a more subtle failure mode. -- ___ Python tracker

[issue46662] Lib/sqlite3/dbapi2.py: convert_timestamp function failed to correctly parse timestamp

2022-02-07 Thread Ned Deily
Change by Ned Deily : -- nosy: +erlendaasland ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34191] argparse: Missing subparser error message should be more clear

2022-02-07 Thread Ned Deily
Change by Ned Deily : -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> argparse fails with required subparsers, un-named dest, and empty argv ___ Python tracker

[issue45948] Unexpected instantiation behavior for xml.etree.ElementTree.XMLParser(target=None)

2022-02-07 Thread Ned Deily
Change by Ned Deily : -- nosy: +eli.bendersky, scoder ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46323] Use _PyObject_Vectorcall in Modules/_ctypes/callbacks.c

2022-02-07 Thread Dong-hee Na
Dong-hee Na added the comment: No leak after if I revert PR 31188 on my local -- ___ Python tracker ___ ___ Python-bugs-list

[issue46323] Use _PyObject_Vectorcall in Modules/_ctypes/callbacks.c

2022-02-07 Thread Dong-hee Na
Dong-hee Na added the comment: @vstinner PR 31188 cause reference leak, please check Raised RLIMIT_NOFILE: 256 -> 1024 0:00:00 load avg: 5.38 Run tests sequentially 0:00:00 load avg: 5.38 [1/1] test_ctypes beginning 6 repetitions 123456 .. test_ctypes leaked [1028, 1026, 1028]

[issue45413] Add install scheme for virtual environments

2022-02-07 Thread Filipe Laíns
Filipe Laíns added the comment: I agree. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46543] Add sys._getfunc

2022-02-07 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: > Usually the calling function object should be enough. I want to at least provide some historical context on why sys._getframe() exists. I originally wrote that to support PEP 292 and internationalization in Mailman. This has since been extracted into

[issue46639] Ceil division with math.ceildiv

2022-02-07 Thread Steven D'Aprano
Steven D'Aprano added the comment: Decimal is a good question. Why does floor division not do floor division on Decimal? The documentation says The integer division operator // behaves analogously, returning the integer part of the true quotient (truncating towards zero) rather

[issue46678] Invalid cross device link in Lib/test/support/import_helper.py

2022-02-07 Thread miss-islington
miss-islington added the comment: New changeset da576e08296490e94924421af71001bcfbccb317 by Jason Wilkes in branch 'main': bpo-46678: Fix Invalid cross device link in Lib/test/support/import_helper.py (GH-31204)

[issue46678] Invalid cross device link in Lib/test/support/import_helper.py

2022-02-07 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 1.0 -> 2.0 pull_requests: +29378 pull_request: https://github.com/python/cpython/pull/31207 ___ Python tracker

[issue46659] Deprecate locale.getdefaultlocale() function

2022-02-07 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +29377 pull_request: https://github.com/python/cpython/pull/31206 ___ Python tracker ___

[issue12029] Allow catching virtual subclasses in except clauses

2022-02-07 Thread Guido van Rossum
Guido van Rossum added the comment: Thanks you. I think it's reasonable to reject the feature request and instead update the docs, so let's do that. -- ___ Python tracker

[issue43557] Deprecate getdefaultlocale(), getlocale() and normalize() functions

2022-02-07 Thread STINNER Victor
Change by STINNER Victor : -- keywords: +patch pull_requests: +29376 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31206 ___ Python tracker ___

[issue46659] Deprecate locale.getdefaultlocale() function

2022-02-07 Thread STINNER Victor
STINNER Victor added the comment: New changeset 7a0486eaa98083e0407ff491872db6d7a0da2635 by Victor Stinner in branch 'main': bpo-46659: calendar uses locale.getlocale() (GH-31166) https://github.com/python/cpython/commit/7a0486eaa98083e0407ff491872db6d7a0da2635 --

[issue12029] Allow catching virtual subclasses in except clauses

2022-02-07 Thread Irit Katriel
Irit Katriel added the comment: To summarise the discussion so far: The arguments in favour of changing exception matching to match on virtual base classes are: 1. It is confusing that it doesn't follow issubclass semantics. 2. Two use cases were presented as practical motivation. - one

[issue12029] Allow catching virtual subclasses in except clauses

2022-02-07 Thread Michael McCoy
Michael McCoy added the comment: Checking my comment history here, a past me was terribly bad at linking the correct PR on github.This is the correct link: https://github.com/python/cpython/pull/6461 On Mon, Feb 7, 2022 at 10:12 AM Guido van Rossum wrote: > > Guido van Rossum added the

[issue46282] return value of builtins is not clearly indicated

2022-02-07 Thread Ned Batchelder
Ned Batchelder added the comment: > When you state the obvious... Obvious to who? New learners coming to Python don't know the same things as people with experience. -- nosy: +nedbat ___ Python tracker

[issue46657] Add mimalloc memory allocator

2022-02-07 Thread Neil Schemenauer
Neil Schemenauer added the comment: My preference would be for --with-mimalloc=yes in an upcoming release. For platforms without the required stdatomic.h stuff, they can manually specify --with-mimalloc=no. That will make them aware that a future release of Python might no longer build (if

[issue46648] `test.test_urllib2.MiscTests.test_issue16464` flaky due to external connection

2022-02-07 Thread STINNER Victor
STINNER Victor added the comment: I close again the issue. The 3.8 backport is waiting for the Python 3.8 Release Manager approval. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue45413] Add install scheme for virtual environments

2022-02-07 Thread Steve Dower
Steve Dower added the comment: I think we want the scheme to be static and accessible on all platforms, like the others. So it probably should be 'nt_venv' and 'posix_venv' with additional/improved logic to help apps determine when they need each. -- nosy: +steve.dower

[issue46679] test.support.wait_process ignores timeout argument

2022-02-07 Thread Jason Wilkes
Change by Jason Wilkes : -- keywords: +patch pull_requests: +29375 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31205 ___ Python tracker ___

[issue46679] test.support.wait_process ignores timeout argument

2022-02-07 Thread Jason Wilkes
New submission from Jason Wilkes : The function wait_process in Lib/test/support/__init__.py ignores its timeout argument. This argument is useful, for example, in tests that need to determine whether a deadlock has been fixed (e.g., in PR-30310). Will submit a pull request to fix this.

[issue46678] Invalid cross device link in Lib/test/support/import_helper.py

2022-02-07 Thread Jason Wilkes
Change by Jason Wilkes : -- keywords: +patch pull_requests: +29374 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31204 ___ Python tracker ___

[issue46534] Implementing PEP 673 (Self type)

2022-02-07 Thread Guido van Rossum
Guido van Rossum added the comment: New changeset 7ba1cc8049fbcb94ac039ab02522f78177130588 by James Hilton-Balfe in branch 'main': bpo-46534: Implement PEP 673 Self in typing.py (GH-30924) https://github.com/python/cpython/commit/7ba1cc8049fbcb94ac039ab02522f78177130588 --

[issue46678] Invalid cross device link in Lib/test/support/import_helper.py

2022-02-07 Thread Jason Wilkes
New submission from Jason Wilkes : In Lib/test/support/import_helper.py, the function make_legacy_pyc makes a call to os.rename which can fail when the source and target live on different devices. This happens (for example) when PYTHONPYCACHEPREFIX is set to a directory on a different device

[issue46648] `test.test_urllib2.MiscTests.test_issue16464` flaky due to external connection

2022-02-07 Thread miss-islington
miss-islington added the comment: New changeset 9539400390494f4930c245b3f98453592f4a1a8c by Miss Islington (bot) in branch '3.10': [3.10] bpo-46648: Rewrite test_urllib2.test_issue16464() with a local HTTP server (GH-31186) (GH-31189)

[issue46586] In documentation contents enum.property erroneously links to built-in property

2022-02-07 Thread Éric Araujo
Éric Araujo added the comment: Using a substitution is necessary when we need code markup and a link. For this bug, the simple ~ markup will be enough. -- ___ Python tracker

[issue42548] debugger stops at breakpoint of `pass` that is not actually reached

2022-02-07 Thread Irit Katriel
Irit Katriel added the comment: Fine, I’ll reopen it for 3.9. However, realistically the release managers are unlikely to investigate how this bug got fixed between 3.9 and 3.11 so if you think this is important you might want to do that work. -- resolution: out of date -> status:

[issue46669] Add types.Self

2022-02-07 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: The conventional way is to write def __exit__( self, __typ: type[BaseException] | None, __exc: BaseException | None, __tb: types.TracebackType | None, ) -> None: ... But there are two invariants about how __exit__ works in practice that this

[issue20779] Add pathlib.chown method

2022-02-07 Thread Jaspar S.
Jaspar S. added the comment: I would love to use chown for a pathlib Path, too. It may not be used often, but if anyone want's to change all the os references from a file, it would be cool to have it on pathlib! -- nosy: +y0urself ___ Python

[issue42548] debugger stops at breakpoint of `pass` that is not actually reached

2022-02-07 Thread Andy S
Andy S added the comment: Then maybe those RMs (for 3.9 and 3.10) should decide on their own? That should mean the bug should be reopened for them to get assigned to. -- ___ Python tracker

[issue46677] TypedDict docs are incomplete

2022-02-07 Thread Jelle Zijlstra
New submission from Jelle Zijlstra : https://docs.python.org/3.10/library/typing.html#typing.TypedDict It says: > To allow using this feature with older versions of Python that do not support > PEP 526, TypedDict supports two additional equivalent syntactic forms But there is another reason

[issue42548] debugger stops at breakpoint of `pass` that is not actually reached

2022-02-07 Thread Irit Katriel
Irit Katriel added the comment: It depends how risky the 3.9 release manager would consider the fix to be. The first step would be to find out which commit(s) fixed it. -- ___ Python tracker

[issue42548] debugger stops at breakpoint of `pass` that is not actually reached

2022-02-07 Thread Andy S
Andy S added the comment: Can reproduce this on 3.9. Is the fact 3.9 is in `bugfix` status enough to backport any fixing changes from 3.11 (if that's true and the bug was fixed)? -- ___ Python tracker

[issue46676] ParamSpec args and kwargs are not equal to themselves.

2022-02-07 Thread Gregory Beauregard
Change by Gregory Beauregard : -- keywords: +patch pull_requests: +29373 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31203 ___ Python tracker

[issue46676] ParamSpec args and kwargs are not equal to themselves.

2022-02-07 Thread Gregory Beauregard
New submission from Gregory Beauregard : from typing import ParamSpec P = ParamSpec("P") print(P.args == P.args) # False print(P.kwargs == P.kwargs) # False ParamSpec args and kwargs are not equal to themselves; this can cause problems for unit tests and type introspection w/ e.g.

[issue46639] Ceil division with math.ceildiv

2022-02-07 Thread Mark Dickinson
Mark Dickinson added the comment: > Couldn't math.ceildiv(x, y) be implemented as -(-x//y) in a type-agnostic > fashion? Ah, good point. Yes, that could work. We'd have to decide what to do about Decimal if we took this approach, since the -(-x//y) trick doesn't work there. (Document the

[issue46667] SequenceMatcher & autojunk - false negative

2022-02-07 Thread Tim Peters
Tim Peters added the comment: We can't change defaults without superb reason - Python has millions of users, and changing the output of code "that works" is almost always a non-starter. Improvements to the docs are welcome. In your example, try running this code after using autojunk=True:

[issue12029] Allow catching virtual subclasses in except clauses

2022-02-07 Thread Guido van Rossum
Guido van Rossum added the comment: Fixing the version field. Since it's a feature, this could not go into any version before 3.11. Maybe Irit can look through the discussion and patch and see if there's value to doing this? (Feel free to decline!) -- nosy: +iritkatriel versions:

[issue46669] Add types.Self

2022-02-07 Thread Raymond Hettinger
Change by Raymond Hettinger : -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Implementing PEP 673 (Self type) ___ Python tracker ___

[issue46668] encodings: the "mbcs" alias doesn't work

2022-02-07 Thread Eryk Sun
Eryk Sun added the comment: > I don't think that this fallback is needed anymore. Which Windows > code page can be used as ANSI code page which is not already > implemented as a Python codec? Python has full coverage of the ANSI and OEM code pages in the standard Windows locales, but I

[issue45459] Limited API support for Py_buffer

2022-02-07 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +29372 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/31201 ___ Python tracker ___

[issue45459] Limited API support for Py_buffer

2022-02-07 Thread rdb
Change by rdb : -- nosy: +rdb ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12029] Allow catching virtual subclasses in except clauses

2022-02-07 Thread Václav Dvořák
Change by Václav Dvořák : -- versions: +Python 3.9 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45459] Limited API support for Py_buffer

2022-02-07 Thread STINNER Victor
STINNER Victor added the comment: > There's some side effects with "buffer.h" inclusion in Panda3D when building > againt 3.11a5, project manager concerns are here > https://github.com/python/cpython/pull/29991#issuecomment-1031731100 Copy of rdb's message: """ This change broke our project

[issue46638] Inconsistent registry virtualization in Windows Store package

2022-02-07 Thread Steve Dower
Steve Dower added the comment: New changeset 76b072717a160c44cb8d54be3d5e878bc31f2c38 by Miss Islington (bot) in branch '3.9': bpo-46638: Makes registry virtualisation setting stable when building MSIX packages (GH-31130)

[issue45459] Limited API support for Py_buffer

2022-02-07 Thread pmp-p
pmp-p added the comment: There's some side effects with "buffer.h" inclusion in Panda3D when building againt 3.11a5, project manager concerns are here https://github.com/python/cpython/pull/29991#issuecomment-1031731100 -- ___ Python tracker

[issue46638] Inconsistent registry virtualization in Windows Store package

2022-02-07 Thread miss-islington
miss-islington added the comment: New changeset 9c45390208df712126c59f7c2b6f8d2b4e19ccf7 by Miss Islington (bot) in branch '3.10': bpo-46638: Makes registry virtualisation setting stable when building MSIX packages (GH-31130)

[issue12029] Allow catching virtual subclasses in except clauses

2022-02-07 Thread Václav Dvořák
Change by Václav Dvořák : -- nosy: +Václav Dvořák ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46669] Add types.Self

2022-02-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: On a related note, is this the correct way to annotate __exit__? Exc = TypeVar('Exc', bound=Exception) def __exit__(self, exctype: Optional[Type[Exc]], excinst: Optional[Exc], exctb: Any) -> None: -- ___

[issue41021] ctypes callback with structure crashes in Python 3.8 on Windows x86

2022-02-07 Thread Steve Dower
Steve Dower added the comment: Only by following the link I posted and searching for issues that sound like this one. Which I just did for you: https://github.com/libffi/libffi/issues/367 There may be more, though. I just grabbed the first one that looked like a match. --

[issue46638] Inconsistent registry virtualization in Windows Store package

2022-02-07 Thread Steve Dower
Steve Dower added the comment: New changeset 3a5afc14e16370c1f4f72d43cb553298ad9a1fa4 by Steve Dower in branch 'main': bpo-46638: Makes registry virtualisation setting stable when building MSIX packages (GH-31130)

[issue46638] Inconsistent registry virtualization in Windows Store package

2022-02-07 Thread miss-islington
Change by miss-islington : -- pull_requests: +29371 pull_request: https://github.com/python/cpython/pull/31200 ___ Python tracker ___

[issue46638] Inconsistent registry virtualization in Windows Store package

2022-02-07 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +29370 pull_request: https://github.com/python/cpython/pull/31199 ___ Python tracker

[issue46072] Unify handling of stats in the CPython VM

2022-02-07 Thread Mark Shannon
Mark Shannon added the comment: New changeset 9c979d7afd839abbb080028bdfeb73727e5cf633 by Mark Shannon in branch 'main': bpo-46072: Merge dxpairs into py_stats. (GH-31197) https://github.com/python/cpython/commit/9c979d7afd839abbb080028bdfeb73727e5cf633 --

[issue46166] [C API] Get "self" args or non-null co_varnames from frame object with C-API

2022-02-07 Thread STINNER Victor
STINNER Victor added the comment: New changeset a89772c79183e3e62bf61b92077a04f6ebcc4a2b by Victor Stinner in branch 'main': bpo-46166: Fix compiler warnings in What's New in Python 3.11 (GH-31198) https://github.com/python/cpython/commit/a89772c79183e3e62bf61b92077a04f6ebcc4a2b --

[issue46647] `test_functools` unexpected failures when C `_functoolsmodule` is missing

2022-02-07 Thread Hai Shi
Hai Shi added the comment: > _functoolsmodule is a core bootstrap module and defined in > Modules/Setup.bootstrap. It has no external dependencies. There is no reason > and no point to disable the module. +1. > Cristian, in this case - is there a reason to keep `skipUnless(c_functools)`

[issue45459] Limited API support for Py_buffer

2022-02-07 Thread pmp-p
Change by pmp-p : -- nosy: +pmpp ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46655] typing.TypeAlias is not in the list of allowed plain _SpecialForm typeforms

2022-02-07 Thread Guido van Rossum
Guido van Rossum added the comment: New changeset e2eeffefed32bb8c47c09bdd94e27a4e949894ef by Gregory Beauregard in branch '3.10': [3.10] bpo-46655: allow stringized TypeAlias with get_type_hints (GH-31156). (#31175)

[issue46166] [C API] Get "self" args or non-null co_varnames from frame object with C-API

2022-02-07 Thread STINNER Victor
Change by STINNER Victor : -- title: Get "self" args or non-null co_varnames from frame object with C-API -> [C API] Get "self" args or non-null co_varnames from frame object with C-API ___ Python tracker

[issue46323] Use _PyObject_Vectorcall in Modules/_ctypes/callbacks.c

2022-02-07 Thread hydroflask
hydroflask added the comment: Just to clarify further, the original benchmark by corona10 did indeed lead to `_CallPythonObject` being invoked but it was not quite the normal use-case. In the original benchmark it invoked the generated ctypes thunk via Python so as vstinner said it was

[issue46166] Get "self" args or non-null co_varnames from frame object with C-API

2022-02-07 Thread STINNER Victor
STINNER Victor added the comment: I proposed GH-31198 to fix the compiler warnings in the doc. -- ___ Python tracker ___ ___

[issue46166] Get "self" args or non-null co_varnames from frame object with C-API

2022-02-07 Thread STINNER Victor
Change by STINNER Victor : -- keywords: +patch pull_requests: +29369 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31198 ___ Python tracker ___

[issue46166] Get "self" args or non-null co_varnames from frame object with C-API

2022-02-07 Thread STINNER Victor
STINNER Victor added the comment: > Is there anyway to get the PyObject* associated with a PyFrameObject*? Ah. I see. If you pass a PyFrameObject* frame to PyObject_GetAttrString(), you get a compiler warning. You should cast it explicitly: PyObject_GetAttrString((PyObject*)frame,

[issue46166] Get "self" args or non-null co_varnames from frame object with C-API

2022-02-07 Thread STINNER Victor
STINNER Victor added the comment: Example of C code that I added to _testcapi: --- static PyObject * get_caller_locals(PyObject *self, PyObject *Py_UNUSED(args)) { PyFrameObject *frame = PyThreadState_GetFrame(PyThreadState_Get()); if (frame == NULL) { Py_RETURN_NONE; }

[issue46166] Get "self" args or non-null co_varnames from frame object with C-API

2022-02-07 Thread Aaron Gokaslan
Aaron Gokaslan added the comment: The frame object I am referring to was: PyFrameObject *frame = PyThreadState_GetFrame(PyThreadState_Get()); This frame can not be used with PyObject_GetAttrString. Is there anyway to get the PyObject* associated with a PyFrameObject*? It seems weird that

[issue46323] Use _PyObject_Vectorcall in Modules/_ctypes/callbacks.c

2022-02-07 Thread STINNER Victor
STINNER Victor added the comment: Oh ok, thanks for the clarification :-) -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue46323] Use _PyObject_Vectorcall in Modules/_ctypes/callbacks.c

2022-02-07 Thread hydroflask
hydroflask added the comment: > A benchmark on calling C functions using ctypes sounds better than a > benchmark calling Python functions. Calling C functions from Python is not the code path handled by _CallPythonObject() so no difference in run-time would theoretically be observed by

[issue46670] Build Python with -Wundef: don't use undefined macros

2022-02-07 Thread STINNER Victor
STINNER Victor added the comment: New changeset f20ca766fe404a20daea29230f161a0eb71bb489 by Victor Stinner in branch 'main': bpo-46670: Fix #ifdef in sha3module.c (GH-31180) https://github.com/python/cpython/commit/f20ca766fe404a20daea29230f161a0eb71bb489 --

[issue46670] Build Python with -Wundef: don't use undefined macros

2022-02-07 Thread STINNER Victor
STINNER Victor added the comment: New changeset 7d8b69e1d1f125454d8cec81ff0dee72f2bef957 by Victor Stinner in branch 'main': bpo-46670: Remove unused macros in the Python directory (GH-31192) https://github.com/python/cpython/commit/7d8b69e1d1f125454d8cec81ff0dee72f2bef957 --

[issue46670] Build Python with -Wundef: don't use undefined macros

2022-02-07 Thread STINNER Victor
STINNER Victor added the comment: New changeset 760349198dbd8771629753e096a885c1aa28a1ca by Victor Stinner in branch 'main': bpo-46670: Remove unused macros in the Objects directory (GH-31193) https://github.com/python/cpython/commit/760349198dbd8771629753e096a885c1aa28a1ca --

[issue46670] Build Python with -Wundef: don't use undefined macros

2022-02-07 Thread STINNER Victor
STINNER Victor added the comment: New changeset 4f1d3f33dd8b37a151b73533f18b08b0500223e5 by Victor Stinner in branch 'main': bpo-46670: Remove unused macros in the Modules directory (GH-31194) https://github.com/python/cpython/commit/4f1d3f33dd8b37a151b73533f18b08b0500223e5 --

[issue39277] _PyTime_FromDouble() fails to detect an integer overflow when converting a C double to a C int64_t

2022-02-07 Thread STINNER Victor
STINNER Victor added the comment: New changeset d3e53bc5321a9f08c7ed5b9383eefb2e03dfa6e2 by Victor Stinner in branch 'main': bpo-39277: Fix PY_TIMEOUT_MAX cast in _threadmodule.c (GH-31195) https://github.com/python/cpython/commit/d3e53bc5321a9f08c7ed5b9383eefb2e03dfa6e2 --

[issue46670] Build Python with -Wundef: don't use undefined macros

2022-02-07 Thread Mark Shannon
Mark Shannon added the comment: New changeset 4b603f628207b380a8a2f22d7ff5d2dbb0853e2e by Victor Stinner in branch 'main': bpo-46670: Remove unused macros in ceval.c (GH-31196) https://github.com/python/cpython/commit/4b603f628207b380a8a2f22d7ff5d2dbb0853e2e -- nosy: +Mark.Shannon

[issue46667] SequenceMatcher & autojunk - false negative

2022-02-07 Thread Jonathan
Jonathan added the comment: I still don't get how UNIQUESTRING is the longest even with autojunk=True, but that's an implementation detail and I'll trust you that it's working as expected. Given this, I'd suggest the following then: * `Autojunk=False` should be the default unless there's

[issue46639] Ceil division with math.ceildiv

2022-02-07 Thread Steven D'Aprano
Steven D'Aprano added the comment: I don't understand why math.ceildiv couldn't ducktype. There's no rule that says it *must* convert arguments to float first, that's just a convention, and we've broken it before. >>> math.prod([Fraction(1, 3), 7]) Fraction(7, 3) Couldn't math.ceildiv(x,

[issue46072] Unify handling of stats in the CPython VM

2022-02-07 Thread Mark Shannon
Change by Mark Shannon : -- pull_requests: +29368 pull_request: https://github.com/python/cpython/pull/31197 ___ Python tracker ___

[issue46072] Unify handling of stats in the CPython VM

2022-02-07 Thread Mark Shannon
Mark Shannon added the comment: New changeset 062460e8fd54e53c9a1a6f175ef49c9d730851b8 by Mark Shannon in branch 'main': bpo-46072: Improve LOAD_METHOD stats (GH-31104) https://github.com/python/cpython/commit/062460e8fd54e53c9a1a6f175ef49c9d730851b8 --

[issue46675] Allow more than 16 items in split-keys dicts and "virtual" object dicts.

2022-02-07 Thread Mark Shannon
Change by Mark Shannon : -- keywords: +patch pull_requests: +29367 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31191 ___ Python tracker ___

[issue46657] Add mimalloc memory allocator

2022-02-07 Thread Christian Heimes
Christian Heimes added the comment: References: - C11 stdatomic.h https://en.cppreference.com/w/c/atomic - mimalloc-atomic.h https://github.com/microsoft/mimalloc/blob/master/include/mimalloc-atomic.h - MSVC Interlocked Variable Access

[issue46640] Python can now use the C99 NAN constant or __builtin_nan()

2022-02-07 Thread Petr Viktorin
Petr Viktorin added the comment: > IMO this PEP is outdated for a long time. It is not. Even if it is, it should be marked as such, and that is not a decision that should be done in this issue. Please, don't break the rules because you think they're outdated. > Well, if you ask me, I would

[issue46640] Python can now use the C99 NAN constant or __builtin_nan()

2022-02-07 Thread STINNER Victor
STINNER Victor added the comment: > Well, if you ask me, I would simply require a C99 compiler. That's all :-) Done in https://github.com/python/peps/pull/2309 -- ___ Python tracker

[issue46670] Build Python with -Wundef: don't use undefined macros

2022-02-07 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +29366 pull_request: https://github.com/python/cpython/pull/31196 ___ Python tracker ___

[issue39277] _PyTime_FromDouble() fails to detect an integer overflow when converting a C double to a C int64_t

2022-02-07 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +29365 pull_request: https://github.com/python/cpython/pull/31195 ___ Python tracker ___

[issue46670] Build Python with -Wundef: don't use undefined macros

2022-02-07 Thread STINNER Victor
STINNER Victor added the comment: -Wexpansion-to-defined and -Wunused-macros options are also interesting. -- ___ Python tracker ___

[issue46670] Build Python with -Wundef: don't use undefined macros

2022-02-07 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +29364 pull_request: https://github.com/python/cpython/pull/31194 ___ Python tracker ___

[issue46670] Build Python with -Wundef: don't use undefined macros

2022-02-07 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +29363 pull_request: https://github.com/python/cpython/pull/31193 ___ Python tracker ___

  1   2   >