Skip to main content

Final classes for Python 3

Project description

final_class

wemake.services Build Status

Final classes for python3.6+.

Features

  • No metaclass conflicts
  • No runtime overhead
  • No dependencies
  • Type hints included
  • Designed to be as simple as possible

Why?

In languages like java we have a nice way to restrict subclassing any class by making it final:

public final class SomeClass {
  // ...
}

In python we don't have such feature out of the box. That's where final_class library comes in!

Installation

pip install final_class

Usage

from final_class import final


@final
class Example(object):  # You won't be able to subclass it!
    ...


class Error(Example):  # Raises `TypeError`
    ...

License

MIT.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

final-class-0.1.0.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

final_class-0.1.0-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file final-class-0.1.0.tar.gz.

File metadata

  • Download URL: final-class-0.1.0.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for final-class-0.1.0.tar.gz
Algorithm Hash digest
SHA256 14d500364cf8eab8e59f50be48eff0a9ffb5bc11dfe632626de8e93dded778df
MD5 93dd236681bed1dda5138ca280fbc2df
BLAKE2b-256 f1d277eaced776f10802595f58459439b7a44fb882a878c97d9b06bd7b1b4d9a

See more details on using hashes here.

File details

Details for the file final_class-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for final_class-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fc94c2b314cabe528d7cb02684eccd2eb9b238535140f1cacd25ed61468eadcd
MD5 292aa63f39234842aa167e6fee58775c
BLAKE2b-256 c7ce25444296e5c8537946986eee8594ce166eddf9e19d1a59d592625c13fa6a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page