Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/285.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python google fire自动运行@property_Python_Python Fire - Fatal编程技术网

Python google fire自动运行@property

Python google fire自动运行@property,python,python-fire,Python,Python Fire,我使用for cli,但遇到以下问题 #test.py 进口火 C类: @财产 def foo(self): 打印('foo') def bar(自): 打印('bar') 火,火 然后作为 python test.py C bar foo bar 正如所见,它打印了不需要的“foo”,有什么优雅的方法来解决这个问题吗?我通过将fire版本更新为3.x解决了这个问题。我无法在Python 3.6.5/macOS上复制这个问题

我使用for cli,但遇到以下问题

#test.py
进口火
C类:
@财产
def foo(self):
打印('foo')
def bar(自):
打印('bar')
火,火
然后作为

python test.py C bar

foo
bar

正如所见,它打印了不需要的“foo”,有什么优雅的方法来解决这个问题吗?

我通过将
fire
版本更新为3.x解决了这个问题。

我无法在Python 3.6.5/macOS上复制这个问题