mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 04:51:24 +07:00
Update type inference for named tuples. Don't infer named tuple type for typing.NamedTuple inheritors, provide it only in calls. Add initializing named tuples type tests.
15 lines
216 B
Python
15 lines
216 B
Python
from typing import NamedTuple
|
|
|
|
|
|
class User(NamedTuple):
|
|
class PrivLvl:
|
|
ADMIN = 1
|
|
OPERATOR = 2
|
|
|
|
name: str
|
|
level: PrivLvl = PrivLvl.ADMIN
|
|
|
|
User.PrivLvl
|
|
|
|
admin = User('MrRobot')
|
|
admin.PrivLvl |