Skip to content

Replace is_numlike by isinstance(..., numbers.Number).#10468

Merged
QuLogic merged 1 commit intomatplotlib:masterfrom
anntzer:numlike
Feb 15, 2018
Merged

Replace is_numlike by isinstance(..., numbers.Number).#10468
QuLogic merged 1 commit intomatplotlib:masterfrom
anntzer:numlike

Conversation

@anntzer
Copy link
Contributor

@anntzer anntzer commented Feb 15, 2018

Since we bumped the min numpy version to 1.10, numpy scalars are now
also instances of numbers.Number.

Closes #7795.

(Related note: we can't do the same with iterable/isinstance(..., Iterable) as documented at https://docs.python.org/3/library/collections.abc.html#collections.abc.Iterable.)

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code is PEP 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

@anntzer anntzer added this to the v3.0 milestone Feb 15, 2018
Since we bumped the min numpy version to 1.10, numpy scalars are now
also instances of numbers.Number.
@QuLogic QuLogic merged commit 962847d into matplotlib:master Feb 15, 2018
@anntzer anntzer deleted the numlike branch February 15, 2018 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect uses of is_numlike

3 participants