PFython / cleverdict

A JSON-friendly data structure which allows both object attributes and dictionary keys and values to be used simultaneously and interchangeably.
MIT License
101 stars 9 forks source link

Incomplete set of aliases for Keys True and False #3

Closed PFython closed 4 years ago

PFython commented 4 years ago

Aliases for True/False in __str__. Given that 1, 1.0, and True are considered equivalent as dictionary keys, it would be helpfully explicit to create all possibilities as aliases regardless of which Key is given initially. Likewise False.

>>> x = CleverDict({True: "Is this?"})

>>> print(x)

CleverDict
    x[True] == x['_True'] == x._True == x[1] == x[1.0] == 'Is this?'
PFython commented 4 years ago

Closed in version 1.5 and higher.