brocksam / pyproprop

Write classes with lots of similar simple defensive properties without the boilerplate

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Processed properties should be able to be compared to one another

brocksam opened this issue · comments

Example would be:

from pyproprop import processed_property

class SomeClass:

    some_property_min = processed_property(
        "some_property_min",
        description="some property's minimum bounded value",
        less_than="some_property_max",
    )
    some_property_max = processed_property(
        "some_property_max",
        description="some property's maximum bounded value",
        less_than="some_property_min",
    )

Uses new keyword:

  • less_than
  • greater_than
  • at_least
  • at_most
  • equals