Skip to content

isinstance(x, (numbers.Integral, np.integer)) vs isinstance(x, six.integer_types) #5786

@betatim

Description

@betatim

During #5678 it came up that one should prefer isinstance(x, six.integer_types) to detect that a variable contains an integral number over isinstance(x, (numbers.Integral, np.integer)). There are a few occurrences of the latter spread around the code base according to a quick grep. Switching those would make a nice first contribution.

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