<p>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 </p>
By clicking “Accept cookies”, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage and assist in our marketing efforts. Check our privacy policies.
By clicking “Accept all”, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage and assist in our marketing efforts. Check our privacy policies.