[issue46927] Improve error message for subscripting non-generic types

2022-03-05 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46927] Improve error message for subscripting non-generic types

2022-03-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset ab9301a28fa431d7a32163126fc96de3b2ce6107 by Serhiy Storchaka in 
branch 'main':
bpo-46927: Include the type's name in the error message for subscripting 
non-generic types (GH-31694)
https://github.com/python/cpython/commit/ab9301a28fa431d7a32163126fc96de3b2ce6107


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46927] Improve error message for subscripting non-generic types

2022-03-05 Thread Alex Waygood


Change by Alex Waygood :


--
nosy: +Jelle Zijlstra

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46927] Improve error message for subscripting non-generic types

2022-03-05 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +29814
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/31694

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46927] Improve error message for subscripting non-generic types

2022-03-05 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +gvanrossum, kj

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46927] Improve error message for subscripting non-generic types

2022-03-05 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

Currently, if you try to subscript a non-generic type you will get an error:

>>> int[str]
Traceback (most recent call last):
  File "", line 1, in 
TypeError: 'type' object is not subscriptable

Yes, 'type' objects are usually not subscriptable, but list[str] works, and it 
is not clear from the error message for what type it is failed.

The following PR changes an error message:

>>> int[str]
Traceback (most recent call last):
  File "", line 1, in 
TypeError: type 'int' is not subscriptable

--
components: Interpreter Core
messages: 414573
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: Improve error message for subscripting non-generic types
type: enhancement
versions: Python 3.11

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com