You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We do not get static type checking because all effects of metaprogramming happen at runtime, and a static type checker does not run your program. It can only analyze the static source code, and it is not smart enough to understand what record_factory does, or that the string `'name weight owner' is actually naming attributes of a class that will be built at runtime.
Consider the example in 24-class-metaprog/factories.py (corresponds to example 24-2, page 912 in my copy)
We do not get static type checking on, e.g.,
rex.name
Is there an easy fix, or is this because types in metaclasses / metaprogramming are hard?
The text was updated successfully, but these errors were encountered: