google fire run @property automatically

Viewed 35

I use google fire for cli, and met an issue below.

# test.py
import fire

class C:
    @property
    def foo(self):
        print('foo')

    def bar(self):
        print('bar')

fire.Fire()

then run as

python test.py C bar

foo
bar

as seen it print "foo" which is unwanted, any elegant way to solve this?

1 Answers

I have solved the issue by updating the fire version to 3.x.

Related