[issue37812] Make implicit returns explicit in longobject.c (in CHECK_SMALL_INT)

2019-08-10 Thread Greg Price
Greg Price added the comment: I've just sent GH-15203 which is the first of two patches for this. It's quite small. The second patch, which completes the change, is also small: https://github.com/gnprice/cpython/commit/c6b905104 It depends on the first one, so I think the easiest is for me

[issue37802] micro-optimization of PyLong_FromSize_t()

2019-08-10 Thread Greg Price
Change by Greg Price : -- nosy: +Greg Price ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37813] PEP 7 line-breaking with binary operations contradicts Knuth's rule

2019-08-10 Thread Géry
New submission from Géry : I have just read PEP 7 and noticed that its line-breaking recommandation in presence of binary operations seems to contradict its analogue in PEP 8 which follows Knuth's rule. PEP 7 (https://www.python.org/dev/peps/pep-0007/#code-lay-out): > When you break a long

[issue37765] IDLE: Include keywords in __main__ autocomplete list

2019-08-10 Thread Terry J. Reedy
Terry J. Reedy added the comment: After more research, I am more inclined to add the keywords to the global identifiers list. The IDLE doc says that they should be present. "Show Completions Open a scrollable list allowing selection of keywords and attributes." If this issue were rejected,

[issue37807] Make hash() return a non-negative number

2019-08-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The only problem is that the current algorithm for numeric types is documented to return negative numbers. https://docs.python.org/3/library/stdtypes.html#hashing-of-numeric-types -- nosy: +mark.dickinson, serhiy.storchaka

[issue37807] Make hash() return a non-negative number

2019-08-10 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +14928 stage: -> patch review pull_request: https://github.com/python/cpython/pull/15199 ___ Python tracker

[issue37809] Alias typing.NamedTuple to collections

2019-08-10 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: > FWIW, I had updated the docs for namedtuple() to link to typing.NamedTuple. > I think that should suffice. Thank you! I looked at the docs everything looks good. I think this can be closed now. -- assignee: -> docs@python components:

[issue37807] Make hash() return a non-negative number

2019-08-10 Thread Tim Peters
Tim Peters added the comment: Well, I have no code that would benefit from this change. What's the point? Sure, I use _parts_ of hash codes at times, but, e.g., index = the_hash_code & SOME_LOW_BIT_MASK in Python couldn't care less about the sign of `the_hash_code` - it returns a

[issue37807] Make hash() return a non-negative number

2019-08-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Currently the hash for integers and several other types uses 62 bits of 64 (on 64-bit platform). The domain of values is continuous: -sys.hash_info.modulus < h < sys.hash_info.modulus If interpret Py_hash_t as Py_uhash_t, it will no longer be

[issue37792] xml.etree.ElementTree.Element.__eq__ does compare only objects identity

2019-08-10 Thread Stefan Behnel
Stefan Behnel added the comment: Right. If you want to compare XML trees for equality, either write your own deep-tree comparison function, or use something like doctestcompare, or use a C14N serialisation (which is now part of Py3.8). Whichever suits your needs.

[issue37810] ndiff reports incorrect location when diff strings contain tabs

2019-08-10 Thread Raymond Hettinger
Raymond Hettinger added the comment: This seems like a reasonable suggestion to me. Am not sure whether it should be backported. Tim, what do you think? -- assignee: -> tim.peters components: +Library (Lib) nosy: +rhettinger, tim.peters ___

[issue37756] Error 0x80070643 when installing

2019-08-10 Thread Steve Dower
Steve Dower added the comment: I can't see anything specific in that log file, but if you can provide the "Python 3.7.4 (32-bit)_20190804181255_000_core_JustForMe.log" file, that should be able to help. (For others who may have to triage these in the future, the main thing you'll find in

[issue37812] Make implicit returns explicit in longobject.c (in CHECK_SMALL_INT)

2019-08-10 Thread Greg Price
New submission from Greg Price : In longobject.c we have the following usage a few times: PyObject * PyLong_FromLong(long ival) { PyLongObject *v; // ... more locals ... CHECK_SMALL_INT(ival); if (ival < 0) { /* negate: can't write this as abs_ival = -ival since that

[issue37812] Make implicit returns explicit in longobject.c (in CHECK_SMALL_INT)

2019-08-10 Thread Greg Price
Change by Greg Price : -- keywords: +patch pull_requests: +14932 stage: -> patch review pull_request: https://github.com/python/cpython/pull/15203 ___ Python tracker ___

[issue37807] Make hash() return a non-negative number

2019-08-10 Thread Raymond Hettinger
Raymond Hettinger added the comment: We think can clarify that those docs describe int.__hash__, float.__hash__, and complex.__hash__. The builtin hash() function can and does make transformations on the result from the __dunder__ method: >>> class A: def __hash__(self):

[issue37809] Alias typing.NamedTuple to collections

2019-08-10 Thread Raymond Hettinger
Raymond Hettinger added the comment: Further notes for posterity: * Anything written using collections.NamedTuple would instantly lose its backwards compatibility. * The casing of NamedTuple is more in line with the typing module: List, Deque, NamedTuple and doesn't fit well with the

[issue37807] Make hash() return a non-negative number

2019-08-10 Thread Mark Dickinson
Mark Dickinson added the comment: This is a change of documented behaviour that will affect 3rd party libraries that provide numeric types, like NumPy and gmpy; it should not be done lightly. I think such a change deserves at least a deprecation warning, and should also be discussed more

[issue37792] xml.etree.ElementTree.Element.__eq__ does compare only objects identity

2019-08-10 Thread Stefan Behnel
Stefan Behnel added the comment: FWIW, deep traversing an XML tree on an operation as simple as "==" seems excessive. To me, object identity comparison seems the most sensible behaviour of "==" on Element objects. (It's not "complicated to implement", but rather can be very expensive to

[issue37792] xml.etree.ElementTree.Element.__eq__ does compare only objects identity

2019-08-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: In some applications the order of attributes matters, and in others it does not. So the equality check is application dependent. -- nosy: +serhiy.storchaka ___ Python tracker

[issue37810] ndiff reports incorrect location when diff strings contain tabs

2019-08-10 Thread Anthony Sottile
New submission from Anthony Sottile : Here's an example from difflib import ndiff def main(): x = '\tx\t=\ty\n\t \t \t^' y = '\tx\t=\ty\n\t \t \t^\n' print('\n'.join( line.rstrip('\n') for line in ndiff(x.splitlines(True), y.splitlines(True))) ) if __name__

[issue19692] Rename Py_SAFE_DOWNCAST

2019-08-10 Thread Sanyam Khurana
Change by Sanyam Khurana : -- nosy: +CuriousLearner versions: +Python 3.7, Python 3.8, Python 3.9 -Python 3.4 ___ Python tracker ___

[issue37811] [FreeBSD, OSX] Socket module: incorrect usage of poll(2)

2019-08-10 Thread Artem Khramov
Change by Artem Khramov : -- keywords: +patch pull_requests: +14931 stage: -> patch review pull_request: https://github.com/python/cpython/pull/15202 ___ Python tracker ___

[issue37764] email.Message.as_string infinite loop

2019-08-10 Thread Abhilash Raj
Abhilash Raj added the comment: Adding security label since this can cause DOS. -- type: -> security ___ Python tracker ___ ___

[issue34155] email.utils.parseaddr mistakenly parse an email

2019-08-10 Thread Abhilash Raj
Abhilash Raj added the comment: Closing this since teh PRs are merged. -- stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue37811] [FreeBSD, OSX] Socket module: incorrect usage of poll(2)

2019-08-10 Thread Artem Khramov
New submission from Artem Khramov : FreeBSD implementation of poll(2) restricts timeout argument to be either zero, or positive, or equal to INFTIM (-1). Unless otherwise overridden, socket timeout defaults to -1. This value is then converted to milliseconds (-1000) and used as argument to

[issue37809] Alias typing.NamedTuple to collections

2019-08-10 Thread Raymond Hettinger
Raymond Hettinger added the comment: > we should do a better job of advertising typing.NamedTuple FWIW, I had updated the docs for namedtuple() to link to typing.NamedTuple. I think that should suffice. -- nosy: +rhettinger ___ Python tracker

[issue37806] Infinite recursion with typing.get_type_hints

2019-08-10 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi : -- assignee: -> levkivskyi ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue14465] xml.etree.ElementTree: add feature to prettify XML output

2019-08-10 Thread Stefan Behnel
Change by Stefan Behnel : -- pull_requests: +14929 pull_request: https://github.com/python/cpython/pull/15200 ___ Python tracker ___

[issue14465] xml.etree.ElementTree: add feature to prettify XML output

2019-08-10 Thread Stefan Behnel
Stefan Behnel added the comment: The spec section that Raymond quoted makes it clear that pretty printing is not for everyone. But there are many use cases where it is 1) helpful, 2) leads to correct results, and 3) does not grow the file size excessively. Whoever wants to make use of it is

[issue37810] ndiff reports incorrect location when diff strings contain tabs

2019-08-10 Thread Anthony Sottile
Change by Anthony Sottile : -- keywords: +patch pull_requests: +14930 stage: -> patch review pull_request: https://github.com/python/cpython/pull/15201 ___ Python tracker ___

[issue23666] Add shell session logging option to IDLE

2019-08-10 Thread Terry J. Reedy
Terry J. Reedy added the comment: A dirty editor must be saved before running, or discarded before closing. Neither is true for Shell, Making these at least an option in Shell should be the first change. If the user has specified a savefile name, that should be used, and the user is

[issue32912] Raise non-silent warning for invalid escape sequences

2019-08-10 Thread miss-islington
miss-islington added the comment: New changeset b4be87a04a2a8ccfd2480e19dc527589fce53555 by Miss Islington (bot) (Gregory P. Smith) in branch 'master': bpo-32912: Revert SyntaxWarning on invalid escape sequences. (GH-15195)

[issue37756] Error 0x80070643 when installing

2019-08-10 Thread Eryk Sun
Eryk Sun added the comment: If we see 0x8XXX_, it's either an NTSTATUS [1] warning, which is unlikely, or and HRESULT [2] error, which is very likely. One of the more common facility codes for HRESULT is the Windows API, 0x007. If we see 0x8007, then is a Windows system error

[issue37807] Make hash() return a non-negative number

2019-08-10 Thread Raymond Hettinger
New submission from Raymond Hettinger : The existing API for the builtin hash() function is inconvenient. When implementing structure that use a hash value, you never want a negative number. Running abs(hash(x)) works but is awkward, slower, and loses one bit of entropy. --

[issue37808] Deprecate unbound super methods

2019-08-10 Thread Steven D'Aprano
New submission from Steven D'Aprano : As per the discussion here, let's deprecate unbound super methods. https://discuss.python.org/t/is-it-time-to-deprecate-unbound-super-methods/1833 -- messages: 349338 nosy: steven.daprano priority: normal severity: normal status: open title:

[issue37801] Compilation on MINGW64 fails (CODESET,wcstok,...)

2019-08-10 Thread Christoph Reiter
Christoph Reiter added the comment: > I wasn't aware that CPython builds for MSYS2 out of the box, since it's a > POSIX-on-Windows platform like Cygwin. Apparently there are patches that > enable it to build, since MSYS2 has Python available. MSYS2 consists of a cygwin like environment and

[issue37809] Alias typing.NamedTuple to collections

2019-08-10 Thread Steven D'Aprano
New submission from Steven D'Aprano : As discussed in the thread starting here with Guido's message: https://mail.python.org/archives/list/python-id...@python.org/message/WTBXYJJ7CSGDLLJHHPHSH5ZCCA4C7QEP/ and these two follow-ups:

[issue37806] Infinite recursion with typing.get_type_hints

2019-08-10 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +gvanrossum, levkivskyi ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue37756] Error 0x80070643 when installing

2019-08-10 Thread Terry J. Reedy
Terry J. Reedy added the comment: The error comes from Windows and it indicates a problem with your computer. Questions about Windows errors should be initially directed to python-list or elsewhere. Searching for 0x80070643 returns multiple hits, including this 'official' one.

[issue37765] IDLE: Include keywords in __main__ autocomplete list

2019-08-10 Thread Raymond Hettinger
Raymond Hettinger added the comment: Since the word "main" is short and since the dunder prefix is common, I don't expect to get much value out of adding '__main__'.ISTM, this just increases the risk of a false positive for a given dunder method. > To be clear, I'm currently -1 on this

[issue37756] Error 0x80070643 when installing

2019-08-10 Thread Terry J. Reedy
Terry J. Reedy added the comment: I seems to me that Python Setup and Usage, Using Python on Windows should have a section for install failure and MS 0x8XXX install errors. Then I and others on python-list could tell people to start with that. --

[issue37765] IDLE: Include keywords in __main__ autocomplete list

2019-08-10 Thread Terry J. Reedy
Terry J. Reedy added the comment: Raymond, since there is no proposal to 'add __main__', I don't understand your response. For the case in question, the completion list continues to be based on the keys in __main__.__builtins__.__dict__, and main__.__dict__, as it always has been.

[issue37817] create_pipe_connection and start_serving_pipe not documented

2019-08-10 Thread Paul Martin
New submission from Paul Martin : I found these two methods in the windows_events code for asyncio. Is there a reason why they don't seem to be documented, and are not included in AbstractServer? They provide a good Windows alternative to create_unix_server & create_unix_connection for

[issue37808] Deprecate unbound super methods

2019-08-10 Thread Zackery Spytz
Change by Zackery Spytz : -- keywords: +patch pull_requests: +14934 stage: -> patch review pull_request: https://github.com/python/cpython/pull/15205 ___ Python tracker ___

[issue16837] Number ABC can be instantiated

2019-08-10 Thread Guido van Rossum
Guido van Rossum added the comment: Let's not do this. We've survived this long. -- ___ Python tracker ___ ___ Python-bugs-list

[issue37815] 'Make Test' error whe trying to install Python 3.7.4 on Linux Mint

2019-08-10 Thread Missono Dell
New submission from Missono Dell : Ran 38 tests in 1.058s FAILED (failures=1) test test_pdb failed 1 test failed again: test_pdb == Tests result: FAILURE then FAILURE == 403 tests OK. 1 test failed: test_pdb 12 tests skipped: test_devpoll test_kqueue test_msilib

[issue37814] typing module: empty tuple syntax is undocumented

2019-08-10 Thread Guido van Rossum
Guido van Rossum added the comment: That’s correct. Mind making a PR? -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue37818] Behaviors of binary bitwise operators contradicting documentation

2019-08-10 Thread John Rogers
New submission from John Rogers : In Python Language Reference (version 3.7), section 6.9 it states that the arguments of binary bitwise operators must be integers. However, the following expressions work without error: True & False False | True True ^ True Each produces a

[issue37759] Polish whatsnew for 3.8

2019-08-10 Thread Raymond Hettinger
Change by Raymond Hettinger : -- pull_requests: +14933 pull_request: https://github.com/python/cpython/pull/15204 ___ Python tracker ___

[issue37815] 'Make Test' error while trying to install Python 3.7.4 on Linux Mint

2019-08-10 Thread Missono Dell
Missono Dell added the comment: Ran 38 tests in 1.058s FAILED (failures=1) test test_pdb failed 1 test failed again: test_pdb == Tests result: FAILURE then FAILURE == 403 tests OK. 1 test failed: test_pdb 12 tests skipped: test_devpoll test_kqueue test_msilib test_ossaudiodev

[issue37816] f-string documentation not fully accurate

2019-08-10 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +eric.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37814] typing module: empty tuple syntax is undocumented

2019-08-10 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +gvanrossum, levkivskyi ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue37814] typing module: empty tuple syntax is undocumented

2019-08-10 Thread Josh Holland
New submission from Josh Holland : The empty tuple syntax in type annotations, `Tuple[()]`, is not obvious from the examples given in the documentation (I naively expected `Tuple[]` to work); it has been documented in PEP 484[1] and in mypy[2], but not in the documentation for the typing

[issue37816] f-string documentation not fully accurate

2019-08-10 Thread Glenn Linderman
New submission from Glenn Linderman : I noticed the following description for f-strings: > Escape sequences are decoded like in ordinary string literals (except when a > literal is also marked as a raw string). After decoding, the grammar for the > contents of the string is: followed by

[issue37818] Behaviors of binary bitwise operators contradicting documentation

2019-08-10 Thread Steven D'Aprano
Steven D'Aprano added the comment: bools are integers, specifically they are a subclass of int: py> isinstance(True, int) True py> issubclass(bool, int) True so the behaviour is correct. -- nosy: +steven.daprano resolution: -> not a bug stage: -> resolved status: open -> closed

[issue37808] Deprecate unbound super methods

2019-08-10 Thread Zackery Spytz
Change by Zackery Spytz : -- nosy: +ZackerySpytz ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: