overrides

A decorator to automatically detect mismatch when overriding a method

APACHE-2.0 License

Downloads
21.2M
Stars
261
Committers
19

Bot releases are hidden (Show)

overrides - Overrides 7.7.0 Latest Release

Published by mkorpela 9 months ago

overrides - Overrides 7.6.0

Published by mkorpela 9 months ago

Full Changelog: https://github.com/mkorpela/overrides/compare/7.5.0...7.6.0

Fixing bytecode handling in 3.12

overrides - Overrides 7.5.0

Published by mkorpela 9 months ago

What's Changed

New Contributors

Full Changelog: https://github.com/mkorpela/overrides/compare/7.4.0...7.5.0

overrides - Overrides 7.4.0

Published by mkorpela about 1 year ago

Support PEP 604 Allow writing union types as X | Y

Thanks @LysanderGG for reporting the issue about this!

overrides - Overrides 7.3.1

Published by mkorpela about 2 years ago

Full Changelog: https://github.com/mkorpela/overrides/compare/7.3.0...7.3.1

Fix type defs for @override https://github.com/mkorpela/overrides/issues/109

Thanks @bersbersbers for contribution!

overrides - Overrides 7.3.0

Published by mkorpela about 2 years ago

Full Changelog: https://github.com/mkorpela/overrides/compare/7.2.0...7.3.0

Add an alias to @overrides decorator called @override. Use it as default as it seems to be de facto wording suggested.
https://github.com/mkorpela/overrides/issues/108

overrides - Overrides 7.2.0

Published by mkorpela about 2 years ago

Full Changelog: https://github.com/mkorpela/overrides/compare/7.1.0...7.2.0

@final decorator now is directly typing.final when running in Python 3.11 or above.

Thank you ucucha for pointing this out!

overrides - Overrides 7.1.0

Published by mkorpela about 2 years ago

Changes
Preliminary support for upcoming Python 3.11.

Full Changelog: https://github.com/mkorpela/overrides/compare/7.0.0...7.1.0

overrides - Overrides 7.0.0

Published by mkorpela about 2 years ago

What's Changed

Backwards incompatibilities:

  • Magic methods starting with double underscore marked as final will now raise TypeError when accidentally overriden
  • AssertionErrors from EnforceOverrides metaclass changed to TypeErrors

Full Changelog: https://github.com/mkorpela/overrides/compare/6.5.0...7.0.0

overrides - Overrides 6.5.0

Published by mkorpela about 2 years ago

Full Changelog: https://github.com/mkorpela/overrides/compare/6.4.0...6.5.0

Allow positional only argument name to change from super class name https://github.com/mkorpela/overrides/issues/88

overrides - Overrides 6.4.0

Published by mkorpela about 2 years ago

overrides - Overrides 6.3.0

Published by mkorpela about 2 years ago

What's Changed

New Contributors

Thanks to @jobh and @tjsmart for your effort!

Full Changelog: https://github.com/mkorpela/overrides/compare/6.2.0...6.3.0

overrides - Overrides 6.2.0

Published by mkorpela about 2 years ago

overrides - Ignore untyped third party (another main module) signature

Published by mkorpela over 3 years ago

Fixing: "Override breaks when overriding a method with no type hints in third party library" https://github.com/mkorpela/overrides/issues/77

overrides - Ignore broken types

Published by mkorpela over 3 years ago

Broken types caused errors in 6.0.0.
Now these are detected and ignored.

overrides - Correct types for decorated methods

Published by mkorpela over 3 years ago

Overrides decorator used to return Any, now keeps the original type information and is more compatible with mypy.

overrides - Fix recursive TypeVar

Published by mkorpela over 3 years ago

Fix bug with TypeVar somewhere in the type structure.

overrides - Signature checks in overrides

Published by mkorpela over 3 years ago

This is a major new release that implements signature checks.
There are notable cases where signature checks do not work, but library has now also better support for mypy and typing.

@overrides decorator has now two optional arguments to handle hard signature checks:

  • check_signature: bool set this to False to completely disable method signature check
  • check_at_runtime: bool set this to True to delay signature checks until runtime. This enables forward reference checks.

Special thanks goes to @ashwin153, @brentyi and @cboots - you have all made this happen!

@ashwin153 has contributed large parts and initial implementations for signature checks. Awesome work!

overrides - Fix 3.6 crash

Published by mkorpela over 3 years ago

overrides - Fix type definition string

Published by mkorpela over 3 years ago

Fix case where type is defined as string.