re-arrange mplDeprecation imports #1946

merged 2 commits into from Apr 29, 2013


None yet

3 participants


in #1917 @nellev requested I import mplDeprecation directly from cbook. On further investigation I found that none of the current code did that.

This PR changes the import scheme to import directly from cbook everywhere.

@tacaswell tacaswell Removed the import from cbook into the matplotlib name space in __init__
and changed all cases of

from matplotlib import MatplotlibDeprecationWarning as mplDeprecation


from cbook import mplDeprecation
NelleV commented Apr 25, 2013

Thanks for doing this work.

You should explicitely import cbook: either use from .cbook import blah or from matplotlib.cbook import blah.
I personnally prefer the first version, but matplotlib's codebase uses the latter (and it is the recommanded way of importing a intra package module).


Should lines like

iterable = cbook.iterable
is_string_like = cbook.is_string_like
is_sequence_of_strings = cbook.is_sequence_of_strings

(from be changed to from matplotlib.cbook import blah ?

NelleV commented Apr 25, 2013

I think it would be cleaner, but I think this is a question of personal taste so I'll leave it up to you.


My inclination is to not change code that works, so I will leave it ;)

@efiring efiring merged commit 3b972d6 into matplotlib:master Apr 29, 2013

1 check passed

default The Travis build passed
@tacaswell tacaswell deleted the tacaswell:mpldeprec_imports branch Apr 29, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment