pylint

    1熱度

    1回答

    我正在嘗試構建一個元類,我只是在想我真的懂了它。我想爲這個元類的每個實例都有類方法。 class MyMeta(type): """A metaclass""" def __new__(mcs, name, bases, attributes): pass def _foo(cls): pass def _bar(cls):

    0熱度

    1回答

    至今flake8和pylint都很棒,我已經研究了幾個linting工具。不幸的是,我需要將這些linting工具與IronPython而不是CPython一起使用。如何使用IronPython使用pylint(或者flake8)?

    0熱度

    1回答

    我在看這個最小有效的程序(?): import sys def f(): try: raise Exception() except Exception: raise Exception(), None, sys.exc_info()[2] f() 該程序執行,並按照我們的期望,保留的堆棧跟蹤內部例外,如help("raise")所述。然而,

    -1熱度

    1回答

    我有這樣的代碼: import pyqtgraph as pg # Short name cause pyqtgraph is looong import pyqtgraph.exporters # ... some code pg.foo() pg.exporters.ExportItem(blah) 現在pylint的埋怨import pyqtgraph.exporters說這

    4熱度

    1回答

    的不堪不透明爲什麼IDE中的pylint的和智能感知功能具有難以識別的time.struct_time實例?下面的代碼包含了對類的現有/不存在屬性的一些簡單測試,名爲元組和名稱元組,如time.struct_time。一切正常的pylint的,和的IntelliJ VSCode - 在每種情況下,除了time.struct_time報告給缺少的屬性的訪問 - 它產生任何這些工具沒有警告或錯誤。他們

    1熱度

    1回答

    爲什麼我在VCCode中收到此消息,但實際上沒有錯誤? 而這一次 如果我運行它的工作沒有錯誤的程序。

    3熱度

    1回答

    我讀了很多關於泛型類的內容,雖然這些類很酷,但有時候我只需要一個泛型函數。這是我寫的一個小的: def _matrix_map(self, mapper): """returns the matrix applying the mapper funcfunc""" return {key: mapper(value) for key, value in self._matrix

    1熱度

    4回答

    對不起,我想不出一個更好的方式來標題! 基本上,我想一個抽象基類,則一個子類的一個不起實現抽象方法,則一個子類的該,其不實現該方法。這也可能是用一個例子更容易: import abc class A(abc.ABC): def __init__(self, some_var): self.some_var = some_var @abc.abstractmetho

    0熱度

    1回答

    我有一個類,它通過類變量實現了一些類型檢查。 然後,當實例化類時,定義的變量將成爲該類的必需參數,並具有所需的類型。圖案看起來像這樣: class MyClass(MagicBaseClass): arg1 = ArgumentObj(allowedTypes=(basestring,)) arg2 = ArgumentObj(allowedTypes=(list, tuple

    1熱度

    1回答

    我試圖在Windows上安裝Pylint(使用Visual Studio代碼)。我有這個例外,我找不到解決方案。 我已經嘗試完全重新安裝python,但我有完全相同的錯誤。 在其他PC上,相同的再生步驟工作正常。 >"C:\Program Files (x86)\Python36-32\python" -m pip install pylint Collecting pylint Do