Open ItsDrike opened 1 month ago
i guess whatever special casing pyright does to support this legacy behavior doesn't work properly with reportUnnecessaryIsInstance
. tbh i would consider fixing this to be low priority considering this functionality is deprecated and will probably be removed from pyright eventually.
on a related note, i also intend to add an option to disable other type promotions (#319) because i think it's a really dumb feature in general
For some reason, when
disableBytesTypePromotions = false
, basedpyright no longer reportsunnecessaryIsInstance
in the code below:Yet with the
disableBytesTypePromotions = true
, the error is reported properly.The
disableBytesTypePromotions
just controles whether or notbytes
are considered a supertype ofbytearray
andmemoryview
, however, this setting shouldn't matter here, asbytes
will always be a subtype ofbytes | bytearray
, the check should be unnecessary in both cases (unless I'm missing something).