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

Clean python 2 artifacts. Fix #826 #827

Merged
merged 3 commits into from
Dec 22, 2021
Merged

Conversation

penguinolog
Copy link
Contributor

  • IOError is OSError in python3
  • io.open -> open
  • return str() -> return '' directly
  • direct super() call
  • do not subclass object

* `IOError` is `OSError` in python3
* `io.open` -> `open`
* `return str()` -> `return ''` directly
* direct `super()` call
* do not subclass `object`
Copy link
Collaborator

@davidbrochart davidbrochart left a comment

Choose a reason for hiding this comment

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

You also made the following changes:

  • replace .format() with f-strings
  • replace set([1, 2]) with {1, 2}

ipykernel/zmqshell.py Outdated Show resolved Hide resolved
Co-authored-by: David Brochart <david.brochart@gmail.com>
@@ -378,7 +378,7 @@ def connect_info(self, arg_s):
print ("Paste the above JSON into a file, and connect with:\n"
" $> jupyter <app> --existing <file>\n"
"or, if you are local, you can connect with just:\n"
" $> jupyter <app> --existing {0}\n"
f" $> jupyter <app> --existing {connection_file}\n"
"or even just:\n"
" $> jupyter <app> --existing\n"
"if this is the most recent Jupyter kernel you have started.".format(
Copy link
Collaborator

Choose a reason for hiding this comment

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

You also need to remove .format(connection_file).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it was removed, like almost all other format calls in next commit

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks!

f-strings is faster, than `str().format`
@blink1073 blink1073 merged commit b7783dd into ipython:main Dec 22, 2021
@penguinolog penguinolog deleted the py2_artifacts branch December 22, 2021 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants