> A big part of  keeping backwards incompatible changes to a minimum is to
have a clear
distinction between what is public API and what isn't.

Maybe we should start being more careful about naming things with
preprended underscores, letting that explicitly define what is and isn't
public. This could be applied to module names, module level variables, etc.
I think it is implicit that anything without leading underscores is public
API and that things with leading underscores that are documented like
public things are public.

Oscar, your idea looks helpful. It would resolve my concerns, but I'm not
sure how to evaluate if that is worth doing. My opinion is that if the
effort to deprecate isn't extreme, then we should do it. What "extreme" is
defined as, is certainly debatable.

Jason
moorepants.info
+01 530-601-9791


On Thu, May 14, 2020 at 12:23 PM Oscar Benjamin <[email protected]>
wrote:

> On Thu, 14 May 2020 at 19:57, Jason Moore <[email protected]> wrote:
> >
> > Is it possible to give a blanket deprecation warning if anyone does an
> import with a `*`? It could warn the user that functionality will change in
> the next version such that modules are not accessible via star imports.
>
> I think that using "from sympy import *" should be fine. We should
> stop putting all of the names there and design and document a coherent
> way to import things from the different packages but as long as almost
> all the functions most users want are at top-level they should be able
> to use star import to get them. Many more users would be affected by
> deprecating star-import in general than by removing the submodules
> from the star import.
>
> If we want to be extra-cautious here then we could do this:
>
> 1. Explicitly import all of the packages like sympy.physics that are
> implicitly exported in 1.5 and add them to __all__ in
> sympy/__init__.py. Those would then continue to be imported by "from
> sympy import *".
>
> 2. Make a wrapper object for each of the sympy.x.y modules that are
> implicitly exported in 1.5 that gives a deprecation warning on access
> and add them to __all__ as well. Those would continue to be imported
> by "from sympy import *" but would give a warning when used e.g.:
>
> >>> from sympy import *
> >>> add.Add
> DeprecationWarning: Import the add module as "import sympy.core.add as
> add" or "from sympy.core import add" not "from sympy import *" or
> "from sympy import add".
>
> --
> Oscar
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/CAHVvXxT71L2%2BumrL6a0DB_Nfj%3D%3DA2JMxtMGQ85xx%2B0_%2B9tWHrw%40mail.gmail.com
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAP7f1AjOcA65kTYSaVdQ6x9dCtuRBsQzMKNfj%2BWRwuycOvXAJw%40mail.gmail.com.

Reply via email to