ionelmc / python-fields

A totally different take on container boilerplate.
BSD 2-Clause "Simplified" License
138 stars 8 forks source link

Have a "seal" function at module level (instead of __invert__) #1

Open ionelmc opened 9 years ago

ionelmc commented 9 years ago

Or maybe it can just call __invert__ (magic method for ~ operator) for you ...

Currently, if you do class Foo(Fields.foo.bar): pass then everything is fine, but if you do Foo = Fields.foo.bar then it's not really fine, because Fields.foo.bar is still "unsealed"

In that situation you can do Foo = ~Fields.foo.bar to force the "seal"