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 io.open_code for reading code #22

Merged
merged 1 commit into from
Aug 30, 2024
Merged

Use io.open_code for reading code #22

merged 1 commit into from
Aug 30, 2024

Conversation

bswck
Copy link
Member

@bswck bswck commented Aug 30, 2024

No description provided.

@bswck bswck requested a review from jaraco August 30, 2024 13:12
@bswck
Copy link
Member Author

bswck commented Aug 30, 2024

Let me know if you prefer a version with the import inlined, __import__('io').open_code().

@jaraco
Copy link
Member

jaraco commented Aug 30, 2024

Looks good. Can you explain briefly what motivated this change? I read the docs for open_code and it says the behavior is the same (for an absolute path).

@bswck
Copy link
Member Author

bswck commented Aug 30, 2024

I mistakenly claimed that it's a recommended solution.
It's not.

So the only value I can see in this PR is very relative to what are our values:

  • it can be educative, as the io.open_code function isn't popular
  • it can be less readable, as the io.open_code function isn't popular

I leave the decision up to you (not like I have to--the decision was already yours ever since).

A decision that has not much of a meaning to the outcome of the code... I think.
But running into io.open_code, and then discussing this PR with my friends, helped me find myself again.

Oh gosh do I love computer science.

@jaraco
Copy link
Member

jaraco commented Aug 30, 2024

Okay. I normally would say not to changes that have little impact. In this case, because open_code implies mode='rb', I like it better. Let's merge it.

@jaraco jaraco merged commit cf26a0a into main Aug 30, 2024
26 checks passed
@jaraco jaraco deleted the ref/use-io-open-code branch August 30, 2024 17:54
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.

2 participants