[issue32683] isinstance is calling ob.__getattribute__ as a fallback instead of object.__class__.__get__

2021-12-09 Thread Gabriele N Tornetta
Gabriele N Tornetta added the comment: I think the issue on display here is that isinstance could cause a side effect, which I dare say it's unexpected (and not documented AFAIK). Are there any reasons why __class__ cannot be retrieved with object.__getattribute__ instead? In fact, consideri

[issue43112] SOABI on Linux does not distinguish between GNU libc and musl libc

2021-12-09 Thread Dave Shawley
Change by Dave Shawley : -- nosy: +dave-shawley ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.

[issue42943] singledispatchmethod should expose registry of all known overloads

2021-12-09 Thread hongweipeng
Change by hongweipeng : -- keywords: +patch nosy: +hongweipeng nosy_count: 5.0 -> 6.0 pull_requests: +28231 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30007 ___ Python tracker __

[issue46025] Raising in an atexit function in dev mode crashes

2021-12-09 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue46025] Raising in an atexit function in dev mode crashes

2021-12-09 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset 934a24c641da5bc4bdb724e901adc20f9a5dff40 by Miss Islington (bot) in branch '3.10': bpo-46025: Fix a crash in the atexit module for auto-unregistering functions (GH-30002) (GH-30005) https://github.com/python/cpython/commit/934a24c641da5b

[issue32683] isinstance is calling ob.__getattribute__ as a fallback instead of object.__class__.__get__

2021-12-09 Thread Steven D'Aprano
Steven D'Aprano added the comment: If you don't want to customise attribute access, don't overload `__getattribute__`. The documentation for `__getattribute__` is clear about what it does: "Called unconditionally to implement attribute accesses for instances of the class." https://docs.pyt

[issue45949] Provide pure-Python implementation of Programs/_freeze_module for cross building

2021-12-09 Thread Christian Heimes
Christian Heimes added the comment: Eric, could you review my PR, please? It simplifies cross building to other platforms. I took a look at Tools/freeze/freeze.py. The freeze tool creates different output than Program/_freeze_module.c. -- ___ Pyt

[issue32683] isinstance is calling ob.__getattribute__ as a fallback instead of object.__class__.__get__

2021-12-09 Thread Paul Moore
Paul Moore added the comment: I tend to agree with Steven and David here. You define __getattribute__ and so that's the behaviour you get when an attribute of the class is requested (whether by the system or by your code). The documentation (here: https://docs.python.org/3/reference/datamode

[issue32683] isinstance is calling ob.__getattribute__ as a fallback instead of object.__class__.__get__

2021-12-09 Thread Gabriele N Tornetta
Gabriele N Tornetta added the comment: > I tend to agree with Steven and David here. You define __getattribute__ and > so that's the behaviour you get when an attribute of the class is requested > (whether by the system or by your code). I would agree if it was obvious or explicitly stated t

[issue46016] fcntl module add F_DUP2FD_CLOEXEC

2021-12-09 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +28232 pull_request: https://github.com/python/cpython/pull/30009 ___ Python tracker ___ __

[issue46018] expm1 may incorrectly raise OverflowError on underflow

2021-12-09 Thread Steve Dower
Steve Dower added the comment: I considered just switching to <2.0, but wasn't sure if I would be breaking some other unspoken behaviour there. But you're right, it's really just detecting underflow vs. overflow, so that's a much simpler way to check. I've filed the upstream report. I suspec

[issue46024] Different behaviour with zipfile

2021-12-09 Thread Eric V. Smith
Eric V. Smith added the comment: What does "path" (the input to ZipPath) look like? Please change your print statement to: print(repr(path), ZipPath(path).name) Then send us the output from each version of python. -- nosy: +eric.smith ___ Python t

[issue46018] expm1 may incorrectly raise OverflowError on underflow

2021-12-09 Thread Steve Dower
Steve Dower added the comment: I've also got no idea how to write a test for this, given that it's a very thin wrapper around a platform's C runtime library. Our existing test discovered when the library changed behaviour to start setting errno, which is probably the best we can do. ---

[issue32683] isinstance is calling ob.__getattribute__ as a fallback instead of object.__class__.__get__

2021-12-09 Thread Ethan Furman
Ethan Furman added the comment: $ python3 Python 3.8.10 (default, Sep 28 2021, 16:10:42) [GCC 9.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> object >>> import builtins >>> builtins.object >>> builtins.object = int >>> object Python is very mu

[issue45654] Freeze the runpy module.

2021-12-09 Thread Guido van Rossum
Guido van Rossum added the comment: New changeset 44b0e76f2a80c9a78242b7542b8b1218d244af07 by Kumar Aditya in branch 'main': bpo-45654: Freeze the runpy module and stuff it imports (GH-29903) https://github.com/python/cpython/commit/44b0e76f2a80c9a78242b7542b8b1218d244af07 -- nosy:

[issue45654] Freeze the runpy module.

2021-12-09 Thread Guido van Rossum
Guido van Rossum added the comment: Thanks Kumar! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ __

[issue46025] Raising in an atexit function in dev mode crashes

2021-12-09 Thread STINNER Victor
STINNER Victor added the comment: Interesting bug report! Thanks for the fix ;-) -- ___ Python tracker ___ ___ Python-bugs-list mai

[issue46025] Raising in an atexit function in dev mode crashes

2021-12-09 Thread STINNER Victor
STINNER Victor added the comment: For me, the question is why would anyone call atexit.unregister() inside an atexit callback. Is it useful? atexit._run_exitfuncs() removes all registered callbacks. Py_Finalize() calls _PyAtExit_Call() which also removes all registered callbacks. -

[issue36048] Deprecate implicit truncating when convert Python numbers to C integers: use __index__, not __int__

2021-12-09 Thread Calin Culianu
Calin Culianu added the comment: Hi, I'm cculianu, the reporting user. May I get a link or some background for the motivation for this change? It seems to me that there are vague allusions to "Decimal -> int cause problems in past", or some such, and I'd like to read the arguments presented

[issue46018] expm1 may incorrectly raise OverflowError on underflow

2021-12-09 Thread Mark Dickinson
Mark Dickinson added the comment: > I've also got no idea how to write a test for this Yep, that's fine. All I want is that at least one particular value that caused the spurious OverflowError is in the test suite somewhere, but it sounds as though that's already the case. I'd imagine that o

[issue46025] Raising in an atexit function in dev mode crashes

2021-12-09 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: >For me, the question is why would anyone call atexit.unregister() inside an >atexit callback. Is it useful? Is not useful, is just an edge case -- ___ Python tracker _

[issue46018] expm1 may incorrectly raise OverflowError on underflow

2021-12-09 Thread Steve Dower
Steve Dower added the comment: Lines 500-504 are the ones that trigger it. Apparently there are no tests in that file for straight exp(), but the equivalent tests for those would return 0.0 and suppress ERANGE too. -- ___ Python tracker

[issue46027] email.utils.parsedate_to_datetime() handling of -0000 offset

2021-12-09 Thread Fred Drake
New submission from Fred Drake : A local time offset of '-' is not handled the same way as an offset of '+', but I'd expect it would be: >>> import email.utils >>> >>> email.utils.parsedate_to_datetime('9 Dec 2021 08:52:04 -') datetime.datetime(2021, 12, 9, 8, 52, 4) >>> email.uti

[issue44525] Implement CALL_FUNCTION adaptive interpreter optimizations

2021-12-09 Thread Mark Shannon
Change by Mark Shannon : -- pull_requests: +28233 pull_request: https://github.com/python/cpython/pull/30011 ___ Python tracker ___

[issue36048] Deprecate implicit truncating when convert Python numbers to C integers: use __index__, not __int__

2021-12-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See issue660144 which made float values be rejected in most cases where an integer is expected rather of silently truncating them. It was at 2003. Guido mentioned that is an age-old problem, so perhaps you can find older discussions on the tracker or maili

[issue46018] expm1 may incorrectly raise OverflowError on underflow

2021-12-09 Thread Mark Dickinson
Mark Dickinson added the comment: > Lines 500-504 are the ones that trigger it. Ah, right. Thanks. > Apparently there are no tests in that file for straight exp() Yes - that file was mostly written to give good coverage for places where we'd written our own implementations rather than simpl

[issue46018] expm1 may incorrectly raise OverflowError on underflow

2021-12-09 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +28234 pull_request: https://github.com/python/cpython/pull/30012 ___ Python tracker _

[issue46018] expm1 may incorrectly raise OverflowError on underflow

2021-12-09 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington, miss-islington, miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +28234, 28235, 28236 pull_request: https://github.com/python/cpython/pull/30012 ___ Python tracker

[issue46018] expm1 may incorrectly raise OverflowError on underflow

2021-12-09 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington, miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +28234, 28235 pull_request: https://github.com/python/cpython/pull/30012 ___ Python tracker __

[issue46018] expm1 may incorrectly raise OverflowError on underflow

2021-12-09 Thread miss-islington
Change by miss-islington : -- pull_requests: +28237 pull_request: https://github.com/python/cpython/pull/30013 ___ Python tracker ___ __

[issue46018] expm1 may incorrectly raise OverflowError on underflow

2021-12-09 Thread Steve Dower
Steve Dower added the comment: New changeset 3363e1cb05d0d19ed172ea63606d8cb6268747fc by Steve Dower in branch 'main': bpo-46018: Ensure that math.expm1 does not raise on underflow (GH-29997) https://github.com/python/cpython/commit/3363e1cb05d0d19ed172ea63606d8cb6268747fc -- _

[issue45582] Rewrite getpath.c in Python

2021-12-09 Thread neonene
Change by neonene : -- pull_requests: +28238 pull_request: https://github.com/python/cpython/pull/30014 ___ Python tracker ___ ___ P

[issue27315] pydoc: prefer the pager command in favor of the specifc less command

2021-12-09 Thread Irit Katriel
Change by Irit Katriel : -- type: -> enhancement versions: +Python 3.11 -Python 2.7, Python 3.5, Python 3.6 ___ Python tracker ___

[issue45635] Tidy up error handling in traceback.c / python run.c

2021-12-09 Thread Irit Katriel
Change by Irit Katriel : -- pull_requests: +28239 pull_request: https://github.com/python/cpython/pull/30015 ___ Python tracker ___

[issue36048] Deprecate implicit truncating when convert Python numbers to C integers: use __index__, not __int__

2021-12-09 Thread Calin Culianu
Calin Culianu added the comment: Ok, well I found this in that issue you linked to: This is the original "problem": ``` type __mul__ is wierd: >> 'a'.__mul__(3.4) 'aaa' >>> [1].__mul__(3.4) [1, 1, 1] ``` And this is Guido's response: > The problem is that on the one hand you want "i" to ac

[issue46018] expm1 may incorrectly raise OverflowError on underflow

2021-12-09 Thread miss-islington
miss-islington added the comment: New changeset 5ae4265b8c8042c496e569b6dbf9ef107e1d5b31 by Miss Islington (bot) in branch '3.9': bpo-46018: Ensure that math.expm1 does not raise on underflow (GH-29997) https://github.com/python/cpython/commit/5ae4265b8c8042c496e569b6dbf9ef107e1d5b31 --

[issue46018] expm1 may incorrectly raise OverflowError on underflow

2021-12-09 Thread Steve Dower
Change by Steve Dower : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___ P

[issue14965] super() and property inheritance behavior

2021-12-09 Thread Ronny Pfannschmidt
Ronny Pfannschmidt added the comment: im on the noisy list because i faced this first in 2012 a key problem where i ran into this was mixins, - depending on whether a mixin was added or not one would get errors or not from my pov a super object should look like the "next class" so propert

[issue36048] Deprecate implicit truncating when convert Python numbers to C integers: use __index__, not __int__

2021-12-09 Thread Guido van Rossum
Guido van Rossum added the comment: Claim, you need to tone down the rhetoric. Python is not C++ and user expectations are different. You are the one who is fighting windmills here. -- ___ Python tracker __

[issue46018] expm1 may incorrectly raise OverflowError on underflow

2021-12-09 Thread miss-islington
miss-islington added the comment: New changeset ca08655b808aed2e3abeb64cb67d98a79a661dda by Miss Islington (bot) in branch '3.10': bpo-46018: Ensure that math.expm1 does not raise on underflow (GH-29997) https://github.com/python/cpython/commit/ca08655b808aed2e3abeb64cb67d98a79a661dda -

[issue46008] Prepare runtime/interp/thread state and init for upcoming changes.

2021-12-09 Thread Eric Snow
Eric Snow added the comment: New changeset c8749b578324ad4089c8d014d9136bc42b065343 by Eric Snow in branch 'main': bpo-46008: Make runtime-global object/type lifecycle functions and state consistent. (gh-29998) https://github.com/python/cpython/commit/c8749b578324ad4089c8d014d9136bc42b065343

[issue36048] Deprecate implicit truncating when convert Python numbers to C integers: use __index__, not __int__

2021-12-09 Thread Calin Culianu
Calin Culianu added the comment: Ok, Guido, thanks. Fair enough. So regardless: what is the problem exactly if a C function expects an int but gets given a float? Why does such strictness matter, in that it required a whole other set of __index__ etc to be added? I am having trouble seeing

[issue12038] assertEqual doesn't display newline differences quite well

2021-12-09 Thread Irit Katriel
Irit Katriel added the comment: Reproduced on 3.11. -- nosy: +iritkatriel versions: +Python 3.11 -Python 3.3 ___ Python tracker ___ ___

<    1   2