【问题标题】:Method call resolves as function call on a class方法调用解析为对类的函数调用
【发布时间】:2019-12-03 19:07:09
【问题描述】:

我有 python2.7 和 twistd 框架。我正在使用twisted-theseus==0.14.1.3 库。

我的 twistd 插件中的前两行如下:

from theseus import Tracer

t = Tracer()
t.install()

异常失败:

exceptions.TypeError: install() 只接受一个参数(给定 0)

这里有什么问题?看起来它不是在对象接收器上而是在类上调用 install() 。

【问题讨论】:

  • 对我来说,sn-p 在 python 2.7 virtualenv 上不会给出任何错误,但我会在 python3.6.x virtualenv 上得到同样的错误,我很困惑

标签: python python-2.7 methods twisted


【解决方案1】:

这似乎是由于 twisted-theseus 的一个已知问题:https://github.com/habnabit/twisted-theseus/issues/1

Github 问题有一个解决方法:

$ pip install cython
$ git clone https://github.com/habnabit/twisted-theseus
$ cd twisted-theseus
$ pip install .

【讨论】:

  • 所以 PyPI 包自 2016 年以来就无法使用,作者知道。哇。
猜你喜欢
  • 2014-11-30
  • 2015-07-13
  • 1970-01-01
  • 1970-01-01
  • 2020-02-03
  • 1970-01-01
  • 1970-01-01
  • 2016-02-29
  • 2023-01-30
相关资源
最近更新 更多