This is similar to https://github.com/microsoft/pyright/issues/3495 but applies to constructors and class-scoped TypeVars.