Skip to content

RT_UNARY_OP_NOT is implemented as if it was RT_UNARY_OP_BOOL #229

@pfalcon

Description

@pfalcon

It seems that for almost (?) all scalar types it is implemented in a way like:

case RT_UNARY_OP_NOT: if (val != 0) { return mp_const_true;} else { return mp_const_false; }

With the effect of

>>> not 0
False

Python does not define not (http://docs.python.org/3.3/reference/datamodel.html#special-method-names), so we'd rather have RT_UNARY_OP_BOOL instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions