Skip to main content

A classy toolkit designed with OOP in mind.

Project description

Generics

azure-devops-builds azure-devops-coverage pypi

A classy toolkit designed with OOP in mind.

Documentation | Source Code | Task Tracker

In our opinion, main benefits of having objects implemented in the language are encapsulation and polymorphous. Classes that could be easily used in a composition are tricky to write. The generics library aims to help you in writing code with high quality.

Pros

  • Real private attributes without loosing the readability
  • Leads to a better design forcing you to use encapsulation properly
  • Makes writing quality code with high cohesion and low coupling easier
  • Guides you to follow SOLID principles

Example

The generics library gives you an easy way to define private attributes on objects without loosing little nice things like readability.

>>> from attr import attrs, attrib
>>> from generics import private

>>> @private
... @attrs(frozen=True)
... class User:
...     name = attrib()
...
...     def greet(self):
...         return f'Hello, {self.name}'

>>> user = User('Jeff')

>>> user.greet()
'Hello, Jeff'

>>> hasattr(user, 'name')
False

Questions

If you have any questions, feel free to create an issue in our Task Tracker. We have the question label exactly for this purpose.

License

Generics library is offered under the two clause BSD license.

— ⭐️ —

The generics library is part of the SOLID python family.

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

generics-1.0.1.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

generics-1.0.1-py2.py3-none-any.whl (7.4 kB view details)

Uploaded Python 2Python 3

File details

Details for the file generics-1.0.1.tar.gz.

File metadata

  • Download URL: generics-1.0.1.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.10 CPython/3.8.5 Linux/4.15.0-1091-azure

File hashes

Hashes for generics-1.0.1.tar.gz
Algorithm Hash digest
SHA256 7c374d9584eee7aa43b369f6fe99195127f6b9a6394f0369e9ffde43f061a073
MD5 554c3412efb354228cf86c9b8de5f915
BLAKE2b-256 7fd0d5c6228eb4f631d4957155a4f1e25f134fe38d35701b6142effe91e17d7e

See more details on using hashes here.

File details

Details for the file generics-1.0.1-py2.py3-none-any.whl.

File metadata

  • Download URL: generics-1.0.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.10 CPython/3.8.5 Linux/4.15.0-1091-azure

File hashes

Hashes for generics-1.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 bd9df2ef0d556dad4984085c476a80561a45b4521af9cee69853923787f7aca8
MD5 fc3b850e096e78d762b9d591dc238c20
BLAKE2b-256 11f6f22b23671f7adc0734a47ddd3374bd514fc8e9a0b25308c77293c30064ca

See more details on using hashes here.

Supported by

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