Re:What's New in Python 3.12
by thatxliner on Wednesday October 18, 2023 @04:46PM
(#37934542)
“The new syntax allows declaring TypeVarTuple and ParamSpec parameters, as well as TypeVar parameters with bounds or constraints:”
Why can’t the syntax be
[ Parent
| on HN ]
I think because that conflicts with the `bound` syntax which expects a single type.
Re:What's New in Python 3.12
by thatxliner on Wednesday October 18, 2023 @08:50PM
(#37936858)
Unless I’m mistaken, bound constrains the type to a specific protocol while this constrains the type to specific types.