-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
don't use get_ipython
from builtins in library code
#3286
Conversation
library entry point for get_ipython does not rely on injection into globals
It's been deprecated for three releases. Come on guys.
We used to have a variable called something like |
If I remember correctly, we removed it in 0.11 but put it back in 0.12. |
I am +1 on these changes, but I would rather create a new module than reusing |
What is the reasoning for removing a module that does one thing (just because it has a 'deprecation' note in the docstring, though we have actually been using it all along) and creating a new module that does the exact same thing? |
Mostly history.
|
""" | ||
|
||
#----------------------------------------------------------------------------- | ||
# Copyright (C) 2008-2011 The IPython Development Team | ||
# Copyright (C) 2013 The IPython Development Team |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? I thought it was standard practice to leave the dates for which copyright applies (basically from file creation onwards)...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what we have been doing all over IPython - I believe you were a part of that conversation many months ago. Updating the copyright to the current date when we update a file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I guess it was keeping the starting date, omitting the -END one.
2008-2011
-> 2008[Nothing]
so you don't have to update the second year every year.
But It is always confusing me too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gotcha, thanks. in any case, this is a new file now, so 2013 seems right.
I still think per-file copyright is utterly pointless (like putting copyright notice on every page of a book).
I also agree that I'm slightly -1 on putting actual code in As for the more generic question of how to detect that IPython is active, I think it's an important discussion we should try to sort out for 1.0. I don't think this PR is the place for it: perhaps it's better to wrap up this cleanup and think about that separately, as that question has lots of little edge cases we should consider carefully. |
move |
Yup, looks good to me. Now's the time to break backwards compatibility :) One last thing before merging: a note in the docs, in the backw. compat. section, indicating this break (the flat out removal of |
the core.ipapi deprecation has always seemed weird to me - we moved IPython.ipapi to IPython.core.ipapi, breaking all old code, at the same time as deprecating it, so there should never have been any code that ever used |
I think this looks good now, is there anything left to finish? |
don't use `get_ipython` from builtins in library code mainly adds IPython.get_ipython() as a library-level handle that does the same thing.
don't use `get_ipython` from builtins in library code mainly adds IPython.get_ipython() as a library-level handle that does the same thing.
mainly adds
IPython.get_ipython()
as a library-level handle that does the same thing.We still use
get_ipython
from builtins in two ways:The same instance mechanism should still work there, it doesn't need to be a special case.
get_ipython
from globals as a test for 'are we in IPython?`,which seems appropriate, though we can perhaps define a single,
official test for that and make sure we use that everywhere.
This also fixes the issue discussed in #3285