google / python-fire

Python Fire is a library for automatically generating command line interfaces (CLIs) from absolutely any Python object.
Other
26.86k stars 1.44k forks source link

guide sample code is entered incorrectly #466

Closed fuhaha closed 11 months ago

fuhaha commented 11 months ago

hi guide sample code is wrong https://github.com/google/python-fire/blob/master/docs/guide.md#accessing-properties sample code

self.name = dict(airports).get(self.code) to self.name = dict(airports.airports).get(self.code)

Adityakhalkar commented 11 months ago

As its a from airports import airports import , we do not need to call airports module for referencing the airports member.

fuhaha commented 11 months ago

my mistake In my code, airports.py was in the airports directory. If airports.py is in the same directory, you should be fine.