[ty] __class_getitem__ is a classmethod (#20192)
## Summary `__class_getitem__` is [implicitly a classmethod](https://docs.python.org/3/reference/datamodel.html#object.__class_getitem__). ## Test Plan Added regression test.
This commit is contained in:
@@ -19,6 +19,12 @@ class Identity:
|
||||
reveal_type(Identity[0]) # revealed: str
|
||||
```
|
||||
|
||||
`__class_getitem__` is implicitly a classmethod, so it can be called like this:
|
||||
|
||||
```py
|
||||
reveal_type(Identity.__class_getitem__(0)) # revealed: str
|
||||
```
|
||||
|
||||
## Class getitem union
|
||||
|
||||
```py
|
||||
|
||||
Reference in New Issue
Block a user