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

Use pathlib for edit magic command #12544

Merged
merged 4 commits into from Sep 7, 2020

Conversation

rchiodo
Copy link
Contributor

@rchiodo rchiodo commented Sep 4, 2020

Change 'with open' to use Pathlib instead.
See #12515.

Copy link
Contributor

@ashwinvis ashwinvis left a comment

Choose a reason for hiding this comment

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

Path.read_text method can be used to condense this code further. Should work on Python >= 3.5

IPython/core/magics/code.py Outdated Show resolved Hide resolved
IPython/core/magics/code.py Outdated Show resolved Hide resolved
IPython/core/magics/code.py Outdated Show resolved Hide resolved
IPython/core/magics/code.py Outdated Show resolved Hide resolved
Carreau and others added 2 commits September 7, 2020 09:41
Co-authored-by: Ashwin Vishnu <9155111+ashwinvis@users.noreply.github.com>
@Carreau
Copy link
Member

Carreau commented Sep 7, 2020

Good teamwork !

I've push some formatting changes and will merge once tests are passing.

@Carreau Carreau added this to the 8.0 milestone Sep 7, 2020
@Carreau Carreau merged commit fedd6a8 into ipython:master Sep 7, 2020
@rchiodo rchiodo deleted the rchiodo/add_pathlib_to_edit branch September 10, 2020 18:25
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.

None yet

3 participants