Skip to main content

Python ABC with a simple @abstract_property decorated checked after instantiation

Project description

Better Abstract Basic Classes

Python ABC with a simple @abstract_property decorated checked after instantiation

Entirely based on this StackOverflow answer by krassowski.

Example:

from better_abc import BetterABC,abstract_property

class AbstractClassWithAbstractAttribute(BetterABC):
  @abstract_property
  def prop(self):
    pass

  otherprop = abstract_property()

class ClassWithProperty(AbstractClassWithAbstractAttribute)
  def __init__(self,propvalue=12):
    self.prop = 12
    self.otherprop = "a string"

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

abc_property-1.0-py3-none-any.whl (3.4 kB view hashes)

Uploaded Python 3

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