Improving the type signature of setattr
#9410
Labels
status: deferred
Issue or PR deferred until some precondition is fixed
setattr
#9410
When the first argument of
setattr
is of typeNoneType
orEllipsisType
the function will always raise anAttributeError
on runtime, so it would be nice if the following calls would be detected as type errors.I am not sure what's the best way to go about this is, there are probably many builtin types that do not support arbitrary attributes to be set. We do not appear to have a type to categorize such types, which could then in the future be used with
Not[]
, once python/typing#801 is implemented.The text was updated successfully, but these errors were encountered: