How to use the overrides.EnforceOverrides function in overrides

To help you get started, we’ve selected a few overrides examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mkorpela / overrides / tests / test_enforce.py View on Github external
from typing import Dict

import unittest
from overrides import overrides,final,EnforceOverrides


class Enforcing(EnforceOverrides):

    classVariableIsOk = "OK?"

    @final
    def finality(self):
        return "final"

    def nonfinal1(self, param: int) -> str:
        return "super1"

    def nonfinal2(self):
        return "super2"

    @property
    def nonfinal_property(self):
        return "super_property"

overrides

A decorator to automatically detect mismatch when overriding a method.

Apache-2.0
Latest version published 10 months ago

Package Health Score

84 / 100
Full package analysis

Similar packages