You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tuple and Optional will are used very frequently in my experimentation. Similar to allowing None in place of NoneType, it would be nice to have some shorthand expression for these types. As a possible suggestion, a tuple of types should be treated as Tuple, that is (int, str) would be equivalent to Tuple[int, str]. A set of a single type could be treated as an optional of that type, that is {int} would be equivalent to Optional[int].
The text was updated successfully, but these errors were encountered:
Sorry, no. The tuple syntax was proposed multiple times in the discussions leading up to the PEP and rejected. Plain tuples like (int, str) have so many uses already that adding yet another use feels too much; and others have proposed them as a union shortcut, so it's apparently not obvious to everyone what they should mean. The {int} proposal is new but too arbitrary (why doesn't it mean Set[int]?).
Tuple and Optional will are used very frequently in my experimentation. Similar to allowing None in place of NoneType, it would be nice to have some shorthand expression for these types. As a possible suggestion, a tuple of types should be treated as Tuple, that is (int, str) would be equivalent to Tuple[int, str]. A set of a single type could be treated as an optional of that type, that is {int} would be equivalent to Optional[int].
The text was updated successfully, but these errors were encountered: