fluentpython / example-code

Example code for the book Fluent Python, 1st Edition (O'Reilly, 2015)
http://bit.ly/fluentpy
MIT License
5.56k stars 2.18k forks source link

How to maintain keys in TransformDict? #21

Open oldman1991 opened 6 years ago

oldman1991 commented 6 years ago

I see the demo: '''

d = TransformDict(str.lower) d['Foo'] = 5 d['foo'] == d['FOO'] == d['Foo'] == 5 True set(d.keys()) {'Foo'} ''' but , i dont know the object how to maintain the keys. thanks