ypcrts / fqdn

RFC-compliant FQDN validation and manipulation for Python.
http://fqdn.readthedocs.io/
Mozilla Public License 2.0
30 stars 11 forks source link

feat: hashable FQDN with locked down FQDN variable #11

Closed wakemaster39 closed 4 years ago

wakemaster39 commented 4 years ago

Since absolute and things are wrapped in @cached_properties, changing self.fqdn out from underneath it is really bad. Hide this away and expose a fqdn property in case someone was actually using this field for anything.

Since we have defined equality, and we are protecting _fqdn kind of now might as well define hashable as well so they can be dictionary keys or anything else. Hashable is based on absolute just like equality, which feels weird now having the @fqdn property being different. I would kill it personally but that would require a roll to version 2.0.

Stopped short of messing with set_attr or slots to ensure immutable.