Repository navigation
Remove astropy.utils.console._IPython - #18153
Conversation
|
Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.
|
| return cls._OutStream | ||
|
|
||
| @classproperty | ||
| def ipyio(cls): |
There was a problem hiding this comment.
This method is not used anywhere.
| if hasattr(file, "isatty"): | ||
| return file.isatty() | ||
|
|
||
| if _IPython.OutStream is None or (not isinstance(file, _IPython.OutStream)): |
There was a problem hiding this comment.
If ipykernel is not available then _IPython.OutStream is None.
If ipykernel is available then _IPython.OutStream is ipykernel.iostream.OutStream, which does have a isatty() method (see the documentation for current stable ipykernel (v6.29) or the source code for v6.16, which is the oldest version astropy supports). Therefore, if file is an _IPython.OutStream instance then it would have been handled by the if hasattr(file, "isatty") block earlier.
Either way, the expression in this if-statement is true, so if code execution ever reaches this point we are guaranteed to return False and the getattr() call below is never performed.
|
I didn't write these originally so I don't know the original motivation or how to effectively test that this refactoring didn't accidentally break some IPython use cases. @astrofrog you remember? |
|
Hi humans 👋 - this pull request hasn't had any new commits for approximately 4 months. I plan to close this in 30 days if the pull request doesn't have any new commits by then. In lieu of a stalled pull request, please consider closing this and open an issue instead if a reminder is needed to revisit in the future. Maintainers may also choose to add keep-open label to keep this PR open but it is discouraged unless absolutely necessary. If this PR still needs to be reviewed, as an author, you can rebase it to reset the clock. If you believe I commented on this pull request incorrectly, please report this here. |
|
Can we defer this for v8.0? So if it does somehow break downstream, it wouldn't be right before a release candidate? |
|
I don't agree that this PR was opened so late that it shouldn't be merged. |
|
I was hoping other devs would chime in and then I forgot about it until now, sorry! |
|
Hi humans 👋 - this pull request hasn't had any new commits for approximately 4 months. I plan to close this in 30 days if the pull request doesn't have any new commits by then. In lieu of a stalled pull request, please consider closing this and open an issue instead if a reminder is needed to revisit in the future. Maintainers may also choose to add keep-open label to keep this PR open but it is discouraged unless absolutely necessary. If this PR still needs to be reviewed, as an author, you can rebase it to reset the clock. If you believe I commented on this pull request incorrectly, please report this here. |
pllim
left a comment
There was a problem hiding this comment.
No other devs objected and we're in v8 dev cycle now, so let's merge and see... 🤞
Thanks!
Description
The class is used in only a couple of places that are simple enough to rewrite.