mypy correctly prevents the problem shown immediately after I said that, this actually has come up before though, and it’s less cut and dry because mypy is doing the right thing for type safety, pyright is doing the right thing for specification…

Also note that you forgot
ClassVar
which is something I would have expected both type checkers to complain about.
unfortunately, the specification both allows this and specifies something unsafe here
PEP 526 as well as the specifcation states that all annotations in a class scope should be treated as instance variables unless marked with ClassVar. Can this be modified to “When type checkers cannot statically determine if a class scoped annotation is an instance variable or classvariable, they should default to instance variable?” This would change the typing behavior of: class X: something: int = 1 to be able to determine that X.something is a classvariable. This is statically availab…
discussion didn’t really go anywhere at the time, with objections such as:
The example you give is not necessarily a class var. I’ve seen code before that mixes class and instance variable behaviour like this to define a default value:
The specification unfortunately very frequently picks “easier for users to write, but with an element of type unsafety” over “type safe”, and it seems like every time I point this out, people are fine with a type system that is intentionally not providing type safety.