| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
I'm 50/50 on this. If anything I think the error is the places than are importing transitively through matplotilb.text not the other way around.... |
Sorry, something went wrong.
|
There is also #23565 where the consensus seems to be that this is the correct solution. Somehow, one of them should be... |
Sorry, something went wrong.
|
Re-reading the conversation here and in #23565 , the consensus seems to be in favor of this path (I'm still a coin flip), so lets go with this for 3.7. |
Sorry, something went wrong.
|
Should we add a __all__ to text.py to make it even more explicit that TextPath is an exported public api? The potential downside of course being that things we don't consider "public" would no longer be imported if someone did from matplotlib.text import * ... That said, this mostly applies to transitive imports since anything defined here would be exported and _methods are explicitly private. so this would only really affect people doing things like using Artist or np from the * import of text, which is not intended usage) The other one that is closely related enough that I'd consider it reasonable to think "that is in text" would be FontProperties, Everything else is pretty clearly not "text" and so should not be expected to be imported via mpl.text I would expect. |
Sorry, something went wrong.
|
The overall strategiy is good.
Unfortunately. specification of public API does not have proper language support in python. __all__ is only a band aid and not really suited for the task. I would refrain from this. Another issue is that TextPath will not disguise its origin. The fully qualified name will stay matplotlib.textpath.TextPath however much we document and __all__. Well, we could monkey patch that, but that's not a good idea either. It may be reasonable to bite the bullet and actually move the code to text. Then, reverse the import and from matplotlib.text import TextPath in textpath for backward compatibility. But that can be done later. |
Sorry, something went wrong.
The textpath module was created in 2009, but the status has been a bit vague with many examples and exisiting code found on the internet importing from text instead. In this PR everything is changed to point at text, although textpath is still available for backwards compatibility.
As long as we use and document it consistently it will be better than the current situation. I do not think that we actually need to move it, but it is confusing if it sometimes is imported from text and sometimes from textpath. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
The textpath module was created in 2009, but the status has
been a bit vague with many examples and exisiting code found
on the internet importing from text instead.
In this PR everything is changed to point at text, although textpath
is still available for backwards compatibility.
PR Summary
See discussion in #23565 (comment)
Also a bit of cleanup of related documentation.
PR Checklist
Tests and Styling
Documentation