Hello there,

> nuitka/nodes/NodeBases.py:273 E0237 assigning-non-slot
> NodeBase.setCompatibleSourceReference Assigning to attribute
> 'effective_source_ref' not defined in class slots
> nuitka/nodes/NodeBases.py:272 I0021 useless-suppression  Useless
> suppression of 'attribute-defined-outside-init'

The code of mine does this as of recently:

    __slots__ = "parent", "source_ref"

    # Avoid the attribute unless it's really necessary.
    if Options.isFullCompat():
        __slots__ += ("effective_source_ref",)

That saves a bunch of memory. Basically I have an optional slot, that
is only assigned when necessary, when Nuitka is run in a non-default
mode used for testing.

But PyLint now goes with the first slot declaration and complains. So
that is a bug in a new feature or a regression.

Yours,
Kay
_______________________________________________
code-quality mailing list
code-quality@python.org
https://mail.python.org/mailman/listinfo/code-quality

Reply via email to