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

Start using assignment expressions (:= aka walrus operator) #7

Draft
wants to merge 2 commits into
base: pypdfium2
Choose a base branch
from

Conversation

mara004
Copy link
Member

@mara004 mara004 commented Jan 17, 2024

There doesn't seem to be any real need yet, but it might be nice to have and get started with from a code style POV.

Yet, I believe otherwise the codebase itself might still be compatible with versions below 3.7, like maybe >= 3.4 or something, so this might yet be a bit of a concern. I believe opensuse leap still ships 3.6 ...

In dependencies.py:
- In a comment, rename "imported modules" to "linked modules"
- Check against "macro" only in one loop, not in both

In __main__.py: avoid an odd use of any() where regular `or` does the
trick.
@mara004 mara004 force-pushed the pypdfium2 branch 3 times, most recently from 242cc9b to 467ba81 Compare January 17, 2024 22:27
@mara004
Copy link
Member Author

mara004 commented Jan 19, 2024

Note to self: comparison is corrupt due to a force repush of a commit on the pypdfium2 branch.
Need to update the py38_walrus branch accordingly.

@mara004 mara004 force-pushed the pypdfium2 branch 6 times, most recently from cf38d94 to 535dded Compare January 19, 2024 22:47
@mara004 mara004 force-pushed the pypdfium2 branch 4 times, most recently from 683aadb to e7f92bf Compare January 28, 2024 00:00
@mara004
Copy link
Member Author

mara004 commented Feb 4, 2024

There's also

if Path.cwd() != Path("/"): # don't strip unix root
PRIVATE_PATHS_TABLE += [(str(Path.cwd()), ".")]

where we could cache Path.cwd() locally by assignment expression.

@mara004 mara004 force-pushed the pypdfium2 branch 12 times, most recently from c12e8d1 to 0f183c9 Compare February 10, 2024 22:46
@mara004 mara004 force-pushed the pypdfium2 branch 10 times, most recently from 8590bae to fd4eeb8 Compare February 16, 2024 18:34
@mara004 mara004 force-pushed the pypdfium2 branch 2 times, most recently from b933c9b to 20d76c1 Compare February 21, 2024 16:56
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.

1 participant