Skip to content
All lessons

Tech Insights· python.org

PEP 591 specifies a final decorator that intends to restrict subsclassing for those classes with the giving decorator as well...

PEP 591 specifies a final decorator that intends to restrict subsclassing for those classes with the giving decorator as well as overriding methods with this annotation. It plays nicely with the @overload decorator, although a type checker such as mypy would require the @final decorator to be put last. As any typing implementation, it's not going to be enforced at runtime if no runtime type checker is being used. For more info, see

Shared by

Read on python.org
  • Python
  • Typing

Book a call

Lessons like this one
shape how we build.

Tell us what you’re building. In one call, we’ll show you how our team would approach it.

Tell us what you’re building, and we’ll show you how we’d approach it.

Still prefer the good old email? Contact us