[go: nahoru, domu]

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

add comment asking for maintaining the location of the deprecated decorator #328

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

falexwolf
Copy link
Member
@falexwolf falexwolf commented Feb 22, 2020

I started using @flying-sheep's awesome decorator in a few other packages. Can we leave it where it is?

Or shall we move it somewhere more sensible?

For instance, we have utils be replaced by _utils so that it doesn't appear in the auto-suggest anymore? The old story...

Copy link
Member
@flying-sheep flying-sheep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Alex! A suggestion so your expectations are aligned with what people do: You should generally never use things that aren’t documented. In most Python projects, “privateness” not indicated by the name starting with _, but by the fact that it appears at that location in the docs.

And that means that if you use something private, it can and will break without notice, and nobody did something wrong.

The best idea for something small like this here is IMHO (I’m speaking generally, I’m aware we’re AnnData’s maintainers and can control this here):

  1. Ask people to export it to officially document, export and support it.
    If they do that and you don’t want to wait for it to be released you can do the following safely now:

    try:
        from new_location import thing
    except ImportError:
        from old_undocumented_location import thing
  2. If they won’t export it and it’s feasible to not have the thing, you should add a test to get notified if they changed it, and create a dummy so people’s code depending on your project doesn’t break:

    try:
        from undocumented_location import thing
    except ImportError:
        thing = None  # or something else that is quick to define and doesn’t break your code
  3. If they won’t export it and you need the thing, you should copy it to a location where you can depend on it existing. E.g. a new package you maintain if you need it in multiple locations.

I happen to maintain https://pypi.org/project/legacy-api-wrap/

Maybe that’s a good spot for it?

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.

None yet

2 participants