[issue41114] "TypeError: unhashable type" could often be more clear

2020-09-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: > Do you think it would help if the exception was of type UnhashableType That would not add more information. The message already says "unhashable type". Saying it twice doesn't help. -- ___ Python tracker

[issue41756] Do not always use exceptions to return result from coroutine

2020-09-27 Thread Vladimir Matveev
Vladimir Matveev added the comment: Serhiy, AFAIR PyIter_Send in my PR appear only as a rename from placeholder `Name_TBD` and it still was specific to PyGenObjects. Do you mean something that was listed in https://bugs.python.org/msg377007 ? --

[issue41872] get_type_hints fails to resolve forward references in nested function

2020-09-27 Thread Guido van Rossum
Guido van Rossum added the comment: This cannot be helped (unless we were to add an ugly sys._getframe() call to get_type_hints(), which I don't want to do). The solution is to pass `localns=locals()`, e.g. get_type_hints(foo, None, locals()) or get_type_hints(foo, localns=locals())

[issue41114] "TypeError: unhashable type" could often be more clear

2020-09-27 Thread Samuel Freilich
Samuel Freilich added the comment: > The user already knows The example I link to in the initial description appears to be one case where the user does not in fact know. I do think context that this restriction applies to dict key in particular is very relevant. The line could use the same

[issue41872] get_type_hints fails to resolve forward references in nested function

2020-09-27 Thread Chris Withers
Chris Withers added the comment: The tough one is that no-one wants an ugly sys._getframe() call, but by avoiding it in the standard library, we force each library that needs this to have the ugly sys._getframe() call rather than it being an unpleasant implementation detail of

[issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows

2020-09-27 Thread Evgeny
Evgeny added the comment: Hello, this is to let you know, that I have created a pull request for this issue https://github.com/python/cpython/pull/22431 I am not really an experienced programmer, but I will give it a try -- nosy: +ev2geny ___

[issue30953] Fatal python error when jumping into except clause

2020-09-27 Thread ppperry
Change by ppperry : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue41872] get_type_hints fails to resolve forward references in nested function

2020-09-27 Thread Guido van Rossum
Guido van Rossum added the comment: I've only seen it in test cases too -- that's one of the very few situations where it makes sense to define a class inside a function. (Creating a class is an expensive operation, so any function that expects to be called more than once is better off moving

[issue23706] pathlib.Path.write_text should include a newline argument

2020-09-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It should work exactly as the newline argument of open(). Anything else would be surprising. -- nosy: +serhiy.storchaka ___ Python tracker

[issue23706] pathlib.Path.write_text should include a newline argument

2020-09-27 Thread Maxim Burov
Maxim Burov added the comment: For the newline parameter, what is the expected behaviour? To work as newline from io.open() which supports only so called "legal" newlines which are: None, '', '\n', '\r', and '\r\n', or to allow users use any sequence as newline hence do replacing before

[issue41861] Convert sqlite3 to PEP 384

2020-09-27 Thread Erlend Egeberg Aasland
Change by Erlend Egeberg Aasland : -- pull_requests: +21462 pull_request: https://github.com/python/cpython/pull/22428 ___ Python tracker ___

[issue41865] doc search for super().__init__() returns no useful results

2020-09-27 Thread Raymond Hettinger
Change by Raymond Hettinger : -- stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing

[issue24427] subclass of multiprocessing Connection segfault upon attribute acces

2020-09-27 Thread William Pickard
William Pickard added the comment: You did just necro a 5 year old bug report... -- nosy: +WildCard65 ___ Python tracker ___ ___

[issue24427] subclass of multiprocessing Connection segfault upon attribute acces

2020-09-27 Thread William Pickard
Change by William Pickard : -- nosy: -WildCard65 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue41858] Fix incomplete line on optparse documentation

2020-09-27 Thread Tal Einat
Tal Einat added the comment: Thanks for the report and the PR, Emmanuel! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue41863] IDLE shell not opening with 3.5 on Mac Mohave.

2020-09-27 Thread GJL
GJL added the comment: Thank you both. Decided to just download 3.8.6 instead of dealing with 3.5 IDLE shell works. Appreciate the help. -- ___ Python tracker ___

[issue41114] "TypeError: unhashable type" could often be more clear

2020-09-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: > I've noticed that Python beginners tend to find this really confusing. No minor tweak to the exception message will make this go away. For understanding to occur, the only way to forward is to learn a bit about hashability. That is a step that every

[issue39862] Why are the union relationships not implemented by default for ≤ and ≥?

2020-09-27 Thread Géry
Géry added the comment: Alright @rhettinger, here is the post: https://discuss.python.org/t/add-missing-default-implementations-of-le-and-ge/5327 -- ___ Python tracker ___

[issue17490] Improve ast.literal_eval test suite coverage

2020-09-27 Thread Irit Katriel
Irit Katriel added the comment: I just noticed that the patch by Serhiy has unit tests for this case, expecting ValueError. So this is apprently a feature and not a bug. -- ___ Python tracker

[issue41861] Convert sqlite3 to PEP 384

2020-09-27 Thread STINNER Victor
STINNER Victor added the comment: New changeset a937ab45d6af4f99ff16fec73d5d75d93c569456 by Erlend Egeberg Aasland in branch 'master': bpo-41861: Convert _sqlite3 cache and node static types to heap types (GH-22417)

[issue41114] "TypeError: unhashable type" could often be more clear

2020-09-27 Thread Irit Katriel
Irit Katriel added the comment: Do you think it would help if the exception was of type UnhashableType (subclass of TypeError)? This would give the user a hint that this error is a thing which is worth looking for in the docs and understanding. -- nosy: +iritkatriel

[issue17490] Improve ast.literal_eval test suite coverage

2020-09-27 Thread Irit Katriel
Irit Katriel added the comment: I think this is a bug in literal_eval: >>> 3+6j (3+6j) >>> 6j+3 (3+6j) >>> ast.literal_eval('3+6j') (3+6j) >>> ast.literal_eval('6j+3') Traceback (most recent call last): File "", line 1, in File "C:\Users\User\src\cpython\lib\ast.py", line 105, in

[issue24427] subclass of multiprocessing Connection segfault upon attribute acces

2020-09-27 Thread Irit Katriel
Irit Katriel added the comment: I think this issue is out of date. 1. I replaced the import statement in the script by "from multiprocessing.connection import Connection" and it gave "AttributeError: 'Crash' object has no attribute 'bar'" rather than a segfault. 2. I can't find

[issue41870] Use PEP 590 vectorcall to speed up calls to bool()

2020-09-27 Thread Dong-hee Na
Change by Dong-hee Na : -- keywords: +patch pull_requests: +21461 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22427 ___ Python tracker ___

[issue40471] Grammar typo in issubclass docstring

2020-09-27 Thread Irit Katriel
Irit Katriel added the comment: Should this PR be backported? Otherwise this issue can be closed. -- nosy: +iritkatriel ___ Python tracker ___

[issue41871] Add PyList_Remove() in listobject.c

2020-09-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: You always can use PyObject_CallMethod(). It is not a method called in tight loop for which the overhead of calling method is significant. -- nosy: +serhiy.storchaka ___ Python tracker

[issue41872] get_type_hints fails to resolve forward references in nested function

2020-09-27 Thread Chris Withers
New submission from Chris Withers : Reproducer: def test_forward_type_references(self): def foo(a: 'Foo') -> 'Bar': pass class Foo: pass class Bar: pass get_type_hints(foo) The above gives the following exception, rather than resolving the type:

[issue13790] In str.format an incorrect error message for list, tuple, dict, set

2020-09-27 Thread Eric V. Smith
Change by Eric V. Smith : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue17490] Improve ast.literal_eval test suite coverage

2020-09-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: literal_eval() is not purposed to evaluate arbitrary arithmetic expressions. It is only purposed to handle strings produced by repr() of some simple builtin objects. repr(6j+3) is '(3+6j)', not '(6j+3)' and not '(6j--3)', so it accepts the former form and

[issue41842] Add codecs.unregister() to unregister a codec search function

2020-09-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: If add a function for unregistering a codec search function, it would be worth to add also a function for unregistering an error handler. -- nosy: +serhiy.storchaka ___ Python tracker

[issue41871] Add PyList_Remove() in listobject.c

2020-09-27 Thread hai shi
hai shi added the comment: > You always can use PyObject_CallMethod(). It is not a method called in tight > loop for which the overhead of calling method is significant. Thanks, serhiy. You are right. To PR19069, it's fine to use `PyList_SetSlice` or `PyObject_CallMethod`. We don't have the

[issue41858] Fix incomplete line on optparse documentation

2020-09-27 Thread Emmanuel Arias
Emmanuel Arias added the comment: Thanks for the help and review! -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue41870] Use PEP 590 vectorcall to speed up calls to bool()

2020-09-27 Thread Dong-hee Na
New submission from Dong-hee Na : bool type is well-used builtin types, I noticed that if we use vector call to bool type, it shows the awesome performance enhancement. Mean +- std dev: [master] 91.4 us +- 3.3 us -> [vectorcall] 48.6 us +- 3.1 us: 1.88x faster (-47%) -- assignee:

[issue41870] Use PEP 590 vectorcall to speed up calls to bool()

2020-09-27 Thread Dong-hee Na
Change by Dong-hee Na : -- components: +Interpreter Core ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue41871] Add PyList_Remove() in listobject.c

2020-09-27 Thread hai shi
New submission from hai shi : Do we need add PyList_Remove() in C level? same thing like list.remove(). As victor comment in: https://github.com/python/cpython/pull/19069#discussion_r491893466. -- components: C API messages: 377566 nosy: shihai1991, vstinner priority: normal severity:

[issue13790] In str.format an incorrect error message for list, tuple, dict, set

2020-09-27 Thread Irit Katriel
Irit Katriel added the comment: This seems complete. -- nosy: +iritkatriel ___ Python tracker ___ ___ Python-bugs-list mailing

[issue41872] get_type_hints fails to resolve forward references in nested function

2020-09-27 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +gvanrossum, levkivskyi ___ Python tracker ___ ___ Python-bugs-list mailing list