[issue47132] Move tests from setobject.c to _testcapimodule

2022-03-26 Thread Dennis Sweeney
Change by Dennis Sweeney : -- nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue47133] enhance unittest to show test name and docstring on one line

2022-03-26 Thread Steven D'Aprano
Steven D'Aprano added the comment: I have no problem with pinging Python-Dev, or any other forum, asking for interested parties. I just don't think we should be intentionally spliting the discussion more than it's going to get split organically. (If this is interesting to people, they will

[issue47079] Integral.denominator shouldn't return an int

2022-03-26 Thread Sergey B Kirpichev
Sergey B Kirpichev added the comment: > Integral.__add__ is an abstract method, so it is a problem of your > implementation. But such an implementation does satisfy all assumptions of the Integral abc, correct? -- ___ Python tracker

[issue43323] UnicodeEncodeError: surrogates not allowed when parsing invalid charset

2022-03-26 Thread Anders Kaseorg
Anders Kaseorg added the comment: It could and does, as quoted in my original report. Content-Type: text/plain; charset*=utf-8”''utf-8%E2%80%9D That’s a U+201D right double quotation mark. This is not a valid charset for the charset of course, but it seems like the code was intended to

[issue47133] enhance unittest to show test name and docstring on one line

2022-03-26 Thread Ethan Furman
Ethan Furman added the comment: I proposed a discussion to python-dev to increase the odds that folks with an interest could chime in. Not everyone follows the new-bugs list. I find having the output on two lines counter-intuitive -- I was expecting one line per test, and indeed my

[issue47133] enhance unittest to show test name and docstring on one line

2022-03-26 Thread Steven D'Aprano
Steven D'Aprano added the comment: I don't think this change of behaviour should be accepted without discussion, and I'm not sure why you think Python-Dev is the right place, rather than here. Messing around with unittest and docstrings has already caused issues in the past:

[issue14265] Fully qualified test name in failure output

2022-03-26 Thread Ethan Furman
Ethan Furman added the comment: Hopefully somebody on the core-mentorship list can move this forward by converting to a PR and reviewing. If @palaviv is still active the review itself will still be useful. -- assignee: michael.foord -> ethan.furman keywords: +easy -patch nosy:

[issue47133] enhance unittest to show test name and docstring on one line

2022-03-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Issue14265, issue46126. -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list

[issue47134] Document the meaning of the number in OverflowError

2022-03-26 Thread Eryk Sun
Eryk Sun added the comment: The error code for `1e+300 ** 2` is ERANGE, from calling libm pow(). Since pow() returns a double, there's no way to indicate an error in the return value. Instead, C errno is set to 0 beforehand and checked for a non-zero error value after the call. If the error

[issue47129] Improve errors messages in f-string syntax errors

2022-03-26 Thread Eric V. Smith
Eric V. Smith added the comment: >From a suggestion by @Jelle on the python discord server: how about just >"f-string: expression required before '!'"? -- ___ Python tracker

[issue47133] enhance unittest to show test name and docstring on one line

2022-03-26 Thread Itay Yeshaya
Itay Yeshaya added the comment: I would like to work on this. -- nosy: +itay.yeshaya ___ Python tracker ___ ___ Python-bugs-list

[issue47134] Document the meaning of the number in OverflowError

2022-03-26 Thread Steven D'Aprano
New submission from Steven D'Aprano : OverflowError sometimes (but not always) includes some sort of numeric code: >>> 1e+300 ** 2 Traceback (most recent call last): File "", line 1, in OverflowError: (34, 'Numerical result out of range') but the meaning of the 34 is not documented:

[issue43323] UnicodeEncodeError: surrogates not allowed when parsing invalid charset

2022-03-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is interesting that you get an UnicodeEncodeError when try to decode. Could the charser name contain non-ascii characters? -- nosy: +serhiy.storchaka ___ Python tracker

[issue47133] enhance unittest to show test name and docstring on one line

2022-03-26 Thread Irit Katriel
Change by Irit Katriel : -- keywords: +easy ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43818] Email does not apply policy to multipart messages with defects

2022-03-26 Thread Martin Dengler
Change by Martin Dengler : -- nosy: +mdengler ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43323] UnicodeEncodeError: surrogates not allowed when parsing invalid charset

2022-03-26 Thread Martin Dengler
Change by Martin Dengler : -- nosy: +mdengler ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue47133] enhance unittest to show test name and docstring on one line

2022-03-26 Thread Ethan Furman
Change by Ethan Furman : -- assignee: -> ethan.furman ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46126] Unittest output drives developers to avoid docstrings

2022-03-26 Thread Ethan Furman
Ethan Furman added the comment: That makes sense. issue47133 created. -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue47133] enhance unittest to show test name and docstring on one line

2022-03-26 Thread Ethan Furman
New submission from Ethan Furman : When running unittest with the -v flag, if a test has errors, and has a docstring, the test name is shown on one line, and the docstring is shown on the next line -- and the ERROR word is shown with the docstring. What this means is that: - the test name is

[issue47098] sha3: Replace Keccak Code Package with tiny_sha3

2022-03-26 Thread Illia Volochii
Change by Illia Volochii : -- pull_requests: +30216 pull_request: https://github.com/python/cpython/pull/24601 ___ Python tracker ___

[issue47098] sha3: Replace Keccak Code Package with tiny_sha3

2022-03-26 Thread Illia Volochii
Change by Illia Volochii : -- nosy: +illia-v nosy_count: 2.0 -> 3.0 pull_requests: +30215 pull_request: https://github.com/python/cpython/pull/28768 ___ Python tracker ___

[issue47098] sha3: Replace Keccak Code Package with tiny_sha3

2022-03-26 Thread Christian Heimes
Christian Heimes added the comment: New changeset 5fd8c574e016aec85725ddc5ced8742267b0e1b3 by Christian Heimes in branch 'main': bpo-47098: Replace Keccak Code Package with tiny_sha3 (GH-32060) https://github.com/python/cpython/commit/5fd8c574e016aec85725ddc5ced8742267b0e1b3 --

[issue46126] Unittest output drives developers to avoid docstrings

2022-03-26 Thread Jason R. Coombs
Jason R. Coombs added the comment: My goal with this issue is to simply unblock the use of docstrings in Python tests. I believe with the work above and the proposed published post, I've accomplished that goal. I've already spent more time than I'd hoped on this issue and would like to

[issue47116] Use _PyLong_FromUnsignedChar in bytearrayobject.c

2022-03-26 Thread Dennis Sweeney
Dennis Sweeney added the comment: Thanks! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue47061] Deprecate modules listed in PEP 594

2022-03-26 Thread Brett Cannon
Change by Brett Cannon : -- pull_requests: +30214 pull_request: https://github.com/python/cpython/pull/32134 ___ Python tracker ___

[issue27929] asyncio.AbstractEventLoop.sock_connect broken for AF_BLUETOOTH

2022-03-26 Thread Ned Deily
Change by Ned Deily : -- nosy: +asvetlov -ned.deily versions: +Python 3.11 -Python 3.5, Python 3.6, Python 3.7, Python 3.8 ___ Python tracker ___

[issue47095] Prefer libb2 over vendored copy of blake2

2022-03-26 Thread Christian Heimes
Change by Christian Heimes : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue26120] pydoc: move __future__ imports out of the DATA block

2022-03-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I am positive about this idea, but we must also think about the possible negative consequences. For example, the future annotations will be included in the star-import by default and can override some global names. The fact that some names not visible in

[issue47095] Prefer libb2 over vendored copy of blake2

2022-03-26 Thread Christian Heimes
Christian Heimes added the comment: New changeset b16b6bb8dacc41e9e569783890b0c88fcd3b24e8 by Christian Heimes in branch 'main': bpo-47095: Use libb2 to provide blake2 implementation (GH-32059) https://github.com/python/cpython/commit/b16b6bb8dacc41e9e569783890b0c88fcd3b24e8 --

[issue47116] Use _PyLong_FromUnsignedChar in bytearrayobject.c

2022-03-26 Thread Dennis Sweeney
Dennis Sweeney added the comment: New changeset c23ddf5ec229b7302437a1cf32d366df5cc5b837 by Pieter Eendebak in branch 'main': bpo-47116: use _PyLong_FromUnsignedChar instead of PyLong_FromLong (GH-32110) https://github.com/python/cpython/commit/c23ddf5ec229b7302437a1cf32d366df5cc5b837

[issue47132] Move tests from setobject.c to _testcapimodule

2022-03-26 Thread Oleg Iarygin
Change by Oleg Iarygin : -- keywords: +patch pull_requests: +30213 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32133 ___ Python tracker ___

[issue47089] Avoid sporadic failure of test_compileall on Windows

2022-03-26 Thread Jeremy Kloth
Change by Jeremy Kloth : -- nosy: +vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue47131] Speedup test_unparse

2022-03-26 Thread Jeremy Kloth
Change by Jeremy Kloth : -- nosy: +vstinner type: -> performance ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue47131] Speedup test_unparse

2022-03-26 Thread Jeremy Kloth
Change by Jeremy Kloth : -- keywords: +patch pull_requests: +30212 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32132 ___ Python tracker ___

[issue47132] Move tests from setobject.c to _testcapimodule

2022-03-26 Thread Oleg Iarygin
New submission from Oleg Iarygin : Currently, tests for PySet/PyFrozenSet C API are defined in Objects/setobject.c and available via set.test_c_api(). Moving them to, for example, _testcapimodule gives the following advantanges: - an internal, CPython-specific method stops being available in

[issue47131] Speedup test_unparse

2022-03-26 Thread Jeremy Kloth
New submission from Jeremy Kloth : The string building and comparing of ast.dump() causes significant slowdowns on the large ASTs produced when doing the roundtrip test on the stdlib. This PR avoids that cost by doing a direct node traversal and comparison. It results in a 33% runtime

[issue46126] Unittest output drives developers to avoid docstrings

2022-03-26 Thread Ethan Furman
Ethan Furman added the comment: Perhaps we could make an enhancement then? Having the extra information on a separate line is, at least for me, very jarring -- as in, I hadn't figured out that that was the way it was done until Inadasan pointed it out. Perhaps a command-line switch to

[issue47117] repl segfaults on non utf-8 input

2022-03-26 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Thanks for the report, Jon! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue47117] repl segfaults on non utf-8 input

2022-03-26 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset 27ee43183437c473725eba00def0ea7647688926 by Pablo Galindo Salgado in branch '3.10': [3.10] bpo-47117: Don't crash if we fail to decode characters when the tokenizer buffers are uninitialized (GH-32129) (GH-32130)

[issue32642] add support for path-like objects in sys.path

2022-03-26 Thread Eryk Sun
Eryk Sun added the comment: > I've got in mind a PyListObject subclass with calls to PyOS_FSPath > before insert, append, extend and __getitem__. The sys module doesn't prevent rebinding sys.path. Most code I think is careful to update sys.path. But surely some code replaces it with a new

[issue27929] asyncio.AbstractEventLoop.sock_connect broken for AF_BLUETOOTH

2022-03-26 Thread Vincent Bernat
Change by Vincent Bernat : -- keywords: +patch nosy: +bernat nosy_count: 4.0 -> 5.0 pull_requests: +30211 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/32131 ___ Python tracker

[issue47129] Improve errors messages in f-string syntax errors

2022-03-26 Thread Maciej Górski
Maciej Górski added the comment: Understandable. In this case I can maybe propose something along the lines of "f-string: empty expression not allowed (Conversion specifier '!' can only follow non-empty expressions)", and so on for each of the specifiers. This way the original message is

[issue47117] repl segfaults on non utf-8 input

2022-03-26 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- pull_requests: +30210 pull_request: https://github.com/python/cpython/pull/32130 ___ Python tracker ___

[issue46964] The global config should not be stored on each interpreter

2022-03-26 Thread STINNER Victor
STINNER Victor added the comment: > Moving the invariant bits would certainly make sense. IMO it's convenient to have a single structure for all "configuration", even if a few parameters are expected to be the same in all interpreters. Python/initconfig.c is already a long C file. It

[issue47129] Improve errors messages in f-string syntax errors

2022-03-26 Thread Eric V. Smith
Eric V. Smith added the comment: I'm not convinced this is an improvement. I don't think someone trying '!' in an f-string expression happens often enough to worry about that specific error message. And a generic "optional specifier" isn't great. If we're going to do this, it should

[issue43224] Add support for PEP 646

2022-03-26 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: New changeset e8e737bcf6d22927caebc30c5d57ac4634063219 by Matthew Rahtz in branch 'main': bpo-43224: Implement PEP 646 grammar changes (GH-31018) https://github.com/python/cpython/commit/e8e737bcf6d22927caebc30c5d57ac4634063219 --

[issue47130] mro and super don't feel so pythonic

2022-03-26 Thread Ken Jin
Ken Jin added the comment: Hi @mamliteria, this is the bug tracker for CPython. I understand that you have suggestions to improve super(), but feature suggestions usually go on the python-ideas mailing list [1]. So you might want to post on there instead. If you're interested, the MRO

[issue47117] repl segfaults on non utf-8 input

2022-03-26 Thread miss-islington
miss-islington added the comment: New changeset 26cca8067bf5306e372c0e90036d832c5021fd90 by Pablo Galindo Salgado in branch 'main': bpo-47117: Don't crash if we fail to decode characters when the tokenizer buffers are uninitialized (GH-32129)

[issue47130] mro and super don't feel so pythonic

2022-03-26 Thread malmiteria
New submission from malmiteria : Hi, Before anything, i made a github repository about this topic here : https://github.com/malmiteria/super-alternative-to-super The core of what i wanna discuss here is that i don't think mro and super (mainly because it relies on mro) are very pythonic.

[issue47117] repl segfaults on non utf-8 input

2022-03-26 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Ah yes, we have been defeated by half an emoji :) -- ___ Python tracker ___ ___

[issue47117] repl segfaults on non utf-8 input

2022-03-26 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- keywords: +patch pull_requests: +30209 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32129 ___ Python tracker

[issue46126] Unittest output drives developers to avoid docstrings

2022-03-26 Thread Jason R. Coombs
Change by Jason R. Coombs : -- pull_requests: +30208 pull_request: https://github.com/python/cpython/pull/32128 ___ Python tracker ___

[issue47129] Improve errors messages in f-string syntax errors

2022-03-26 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- nosy: +eric.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46126] Unittest output drives developers to avoid docstrings

2022-03-26 Thread Jason R. Coombs
Change by Jason R. Coombs : -- resolution: -> works for me ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue47129] Improve errors messages in f-string syntax errors

2022-03-26 Thread Maciej Górski
Change by Maciej Górski : -- keywords: +patch pull_requests: +30206 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32127 ___ Python tracker ___

[issue47129] Improve errors messages in f-string syntax errors

2022-03-26 Thread Maciej Górski
New submission from Maciej Górski : When an empty expression is provided in curly brackets inside an f-string we get Syntax Error: "f-string: empty expression not allowed". This is correct, however error with the same message is raised in the following cases: f"{!foo}", f"{!}", f"{:bar}",

[issue46126] Unittest output drives developers to avoid docstrings

2022-03-26 Thread Jason R. Coombs
Jason R. Coombs added the comment: I've confirmed that prior to the patch in PR 30194, the location of the failure was indeed reported. It was just not reported on the same line: ``` cpython main $ git log -1 commit 3e93af0b06cada874c4a16868b6f863b599919f2 (HEAD -> main) Author: Jason R.

[issue47126] Update to canonical PEP URLs

2022-03-26 Thread Hugo van Kemenade
Hugo van Kemenade added the comment: Here's a devguide PR: https://github.com/python/devguide/pull/822 -- ___ Python tracker ___

[issue47128] Enhance Argument Clinic's NoneType return converter to give `void`

2022-03-26 Thread Oleg Iarygin
Oleg Iarygin added the comment: > The function should return different values for success and error It does, and a `void` return type enforces it. Here is the trick: > An important convention throughout the Python interpreter is the following: > when a function fails, it should set an

[issue32642] add support for path-like objects in sys.path

2022-03-26 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 26.03.2022 08:59, Nick Coghlan wrote: > > The import system is already complex, so I think the hesitation about > allowing arbitrary Path-like objects is warranted. (For example: are > importlib's caching semantics really valid for *arbitrary*

[issue47128] Enhance Argument Clinic's NoneType return converter to give `void`

2022-03-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The function should return different values for success and error. Functions which do not do this have bad design. -- nosy: +serhiy.storchaka ___ Python tracker

[issue47072] Database corruption with the shelve module

2022-03-26 Thread Hubert Tournier
Hubert Tournier added the comment: I modified the test program to better reflect the size of the data structures stored in shelve (sys.getsizeof() which I used was far off the real size). I saw that the database was corrupted with big records, though even bigger previous records had not

[issue47128] Enhance Argument Clinic's NoneType return converter to give `void`

2022-03-26 Thread Oleg Iarygin
Change by Oleg Iarygin : -- keywords: +patch pull_requests: +30205 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32126 ___ Python tracker ___

[issue47128] Enhance Argument Clinic's NoneType return converter to give `void`

2022-03-26 Thread Oleg Iarygin
New submission from Oleg Iarygin : The attached PR makes the following possible (note that the impl has a `void` return type): /*[clinic input] _io._IOBase.writelines -> NoneType lines: object / [clinic start generated code]*/ static void

[issue46964] The global config should not be stored on each interpreter

2022-03-26 Thread Nick Coghlan
Nick Coghlan added the comment: Moving the invariant bits would certainly make sense. As Victor notes, though, some things (like whether to install the signal handlers) should be different. -- ___ Python tracker

[issue46761] functools.update_wrapper breaks the signature of functools.partial objects

2022-03-26 Thread Nick Coghlan
Nick Coghlan added the comment: On the historical front, wraps & update_wrapper were only designed to handle true wrapper functions (i.e. those that don't change the calling signature). For anything else (including partial), I considered it unlikely that the doc string would still be

[issue47079] Integral.denominator shouldn't return an int

2022-03-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Integral.__add__ is an abstract method, so it is a problem of your implementation. -- ___ Python tracker ___

[issue47127] Specialize call for c functions with METH_FASTCALL|METH_KEYWORDS

2022-03-26 Thread Kumar Aditya
New submission from Kumar Aditya : Specialize call for c functions with METH_FASTCALL|METH_KEYWORDS flags. It is the second largest PRECALL specialization failure as per the stats. See https://github.com/faster-cpython/ideas/blob/main/stats.md#specialization-attempts-10 --

[issue32642] add support for path-like objects in sys.path

2022-03-26 Thread Noam Cohen
Noam Cohen added the comment: that's why pre-insert conversion was suggested. path-like objects could still be added to sys.path, while converting to str upon insert, preserving sys.path's bytes and strings only policy. -- ___ Python tracker

[issue47079] Integral.denominator shouldn't return an int

2022-03-26 Thread Sergey B Kirpichev
Sergey B Kirpichev added the comment: > The module documentation should not contain all historical reasons of every > design decision. Sure. But, for example, there should be an explanation of why foo+foo.denominator could produce an error for a valid implementation of the Integral abc.

[issue47126] Update to canonical PEP URLs

2022-03-26 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Sphinx also changed the URL in https://github.com/sphinx-doc/sphinx/pull/10267 -- nosy: +xtreak ___ Python tracker ___

[issue47126] Update to canonical PEP URLs

2022-03-26 Thread Hugo van Kemenade
Change by Hugo van Kemenade : -- assignee: hugovk -> ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue47126] Update to canonical PEP URLs

2022-03-26 Thread Hugo van Kemenade
Change by Hugo van Kemenade : -- keywords: +patch pull_requests: +30203 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32124 ___ Python tracker

[issue47079] Integral.denominator shouldn't return an int

2022-03-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The module documentation should not contain all historical reasons of every design decision. If you are interesting why something was done in one way or another, do your research. One of reasons is that type(self) not always have a constructor with

[issue32642] add support for path-like objects in sys.path

2022-03-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: pkgutil just skips non-string elements in sys.path. for dir in search_path: if not isinstance(dir, str): continue -- ___ Python tracker

[issue32642] add support for path-like objects in sys.path

2022-03-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think you are trying to solve a wrong problem. > This wasn't obvious because Path objects appear as strings in normal debug > output, etc. How is it? >>> pathlib.Path('/usr/lib') PosixPath('/usr/lib') >>> [pathlib.Path('/usr/lib')]

[issue47126] Update to canonical PEP URLs

2022-03-26 Thread Hugo van Kemenade
New submission from Hugo van Kemenade : With the recent implementation https://peps.python.org/pep-0676/ the canonical URL for PEPs has changed from, for example: https://www.python.org/dev/peps/pep-0008/ to: https://peps.python.org/pep-0008/ Redirects are in place so the old links still

[issue32642] add support for path-like objects in sys.path

2022-03-26 Thread Noam Cohen
Noam Cohen added the comment: So I've got in mind a PyListObject subclass with calls to PyOS_FSPath before insert, append, extend and __getitem__. But I feel like this is an overkill; also, extend function might be trickier to implement. Do any of you have better idea? --

[issue47079] Integral.denominator shouldn't return an int

2022-03-26 Thread Sergey B Kirpichev
Sergey B Kirpichev added the comment: > There is no "why". Why not? Apparently, this is a documentation error, at least. (And I doubt there are tests for default methods.) > If you are interesting "why", try to search old archives for the history of > creating that module. Thanks.

[issue32642] add support for path-like objects in sys.path

2022-03-26 Thread Nick Coghlan
Nick Coghlan added the comment: The import system is already complex, so I think the hesitation about allowing arbitrary Path-like objects is warranted. (For example: are importlib's caching semantics really valid for *arbitrary* path-like objects? An object can be path-like without being

[issue47053] Reduce de-optimization in BINARY_OP_INPLACE_ADD_UNICODE

2022-03-26 Thread Dennis Sweeney
Change by Dennis Sweeney : -- pull_requests: +30202 pull_request: https://github.com/python/cpython/pull/32122 ___ Python tracker ___

[issue47079] Integral.denominator shouldn't return an int

2022-03-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There is no "why". There is a fact that there is no such constrain. Adding a new constrain may break existing code. If you want to add a constrain, add it in you code. If you are interesting "why", try to search old archives for the history of creating

[issue47079] Integral.denominator shouldn't return an int

2022-03-26 Thread Sergey B Kirpichev
Sergey B Kirpichev added the comment: > There is no such constrain. Why not? Any example where it does make sense to have different types for numerator and denominator? -- ___ Python tracker

[issue47072] Database corruption with the shelve module

2022-03-26 Thread Hubert Tournier
Hubert Tournier added the comment: Hello, Same results with Python 3.10.4: [...] Adding 185.220.102.6 Database has 62 records for 442368 bytes. Last record was 640 bytes long Traceback (most recent call last): File "./shelve-test.py", line 84, in _verify_whois_cache() File

[issue47079] Integral.denominator shouldn't return an int

2022-03-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There is no such constrain. And no default implementation in this module depends on the constructor. It is important, the constructor is not the part of interfaces. If you want to return the same type in denominator, just override it in your class.

[issue44090] Add class binding to unbound super objects for allowing autosuper with class methods

2022-03-26 Thread Raymond Hettinger
Raymond Hettinger added the comment: Will leave this open for a few days to see if anyone else steps forward to make a case for or against this proposal. -- assignee: -> rhettinger versions: -Python 3.10, Python 3.9 ___ Python tracker

[issue32642] add support for path-like objects in sys.path

2022-03-26 Thread Noam Cohen
Noam Cohen added the comment: You've got a point. But in my opinion path-like object usage should be intuitive and users should not worry about converting it into string in some of the places. What do you feel about sub-classing list for sys.path and converting path-like objects upon

[issue47079] Integral.denominator shouldn't return an int

2022-03-26 Thread Sergey B Kirpichev
Sergey B Kirpichev added the comment: > How would it work for bool or IntEnum? Neither subclass the Integral abc. The constraint (for which I care about) is: numerator/denominator should have same types. The default implementation, which I propose: it's the same type as the given Integral