Closed Lotram closed 2 weeks ago
In your code sample, you've defined the old-style TypeVar with an upper bound, but you've omitted the upper bound for the new-style type parameter. If no upper bound is provided, the default upper bound is object
.
If you want to make the new-style type parameter equivalent, you'd need to do this:
class NewStyleTask[Params: TaskParameters]: ...
Ok so I did miss something in the doc, thanks.
Hi,
If I'm not mistaken, the new syntax to declare a generic class, is to do
MyClass[T]:
instead ofMyClass(Generic[T])
. However the following code does not give the same pyright output:Using pyright 1.1.377, I get:
The first class raises an error while the second does not.