TypeVar single constraint not allowed, why?

Gregory Ewing greg.ewing at canterbury.ac.nz
Wed May 3 18:32:52 EDT 2017


Ned Batchelder wrote:
> Couldn't you simply annotate it as ": type", without using a TypeVar?

Not if you want to constrain two types to be the same type.

-- 
Greg



More information about the Python-list mailing list