Skip to content

Releases: zganger/compysitions

Set attribute values using kwargs when initializing objects by default

22 Aug 21:55
2305fcd
Compare
Choose a tag to compare

When initializing a Compysition object, you can override the default values by providing any attribute value as a kwarg, such as house = House(color=Color.WHITE) by default, without creating a custom init function for your class. Assignment will fail if the value does not match the expected attribute type.