Skip to content

Simplify compare functions for sorting - #222

Merged
mielvds merged 3 commits into
masterfrom
code-improvements
Dec 18, 2025
Merged

Simplify compare functions for sorting#222
mielvds merged 3 commits into
masterfrom
code-improvements

Conversation

@mielvds

@mielvds mielvds commented Dec 12, 2025

Copy link
Copy Markdown
Collaborator

This PR removes some of 'old-style' python code and fixes linter issues:

  • remove the need for the cmp() function wrt to sorting
  • use isinstance() and is to do type checking (instead of for instance type(x) == bool)
  • change not X in Y to X not in Y
  • always raise specific error

@mielvds
mielvds marked this pull request as ready for review December 16, 2025 10:54

@davidlehn davidlehn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

  • Thanks for cleanup.
  • I think much this style was originally due to manual js to py conversion.

Comment thread lib/pyld/jsonld.py Outdated
Comment thread lib/pyld/jsonld.py Outdated
@mielvds
mielvds merged commit f5f51ed into master Dec 18, 2025
15 checks passed
@mielvds
mielvds deleted the code-improvements branch December 18, 2025 20: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.

3 participants