Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting rid of core.compatibility #22352

Open
oscargus opened this issue Oct 22, 2021 · 4 comments
Open

Getting rid of core.compatibility #22352

oscargus opened this issue Oct 22, 2021 · 4 comments
Labels
Code quality core Deprecation Removal Tracks the removal of a deprecated feature. See github.com/sympy/sympy/wiki/Deprecating-policy utilities

Comments

@oscargus
Copy link
Contributor

oscargus commented Oct 22, 2021

core.compatibility was used to support both Python 2 and 3. However, it was also the location for some other support functions. Since only Python 3 is now supported, the remaining functions are moved to more suitable locations.

These are:

  • as_int => utilities.misc
  • is_sequence => utilities.iterables
  • iterable => utilities.iterables
  • ordered => core.sorting
  • default_sort_key => core.sorting
@oscargus oscargus added core Deprecation Removal Tracks the removal of a deprecated feature. See github.com/sympy/sympy/wiki/Deprecating-policy utilities Code quality labels Oct 22, 2021
@ThePauliPrinciple
Copy link
Contributor

Since these functions are more generic than providing compatibility, should these still be available in core.compatibility for some time?

@oscargus
Copy link
Contributor Author

Yes, it seems to be the policy to keep a deprecated stub, calling the correct location. To make it even more confusing, ordered and default_sort_key had their import location (although not heavily used) in utilities.iterables.

@asmeurer
Copy link
Member

asmeurer commented Feb 2, 2022

Right now there are deprecations on each individual function, but would it be better to completely deprecate the submodule, so that just importing it raises the deprecation warning? The plan is to completely delete the file.

@asmeurer
Copy link
Member

asmeurer commented Feb 4, 2022

I am updating this to deprecate the entire submodule in #22900. ordered and default_sort_key are in the top-level namespace and should be imported directly, like from sympy import ordered, default_sort_key. The remaining helper functions are only designed for used internal use and should not be imported by user code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code quality core Deprecation Removal Tracks the removal of a deprecated feature. See github.com/sympy/sympy/wiki/Deprecating-policy utilities
Projects
None yet
Development

No branches or pull requests

3 participants