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

Instantiate correct [R]JP subclasses #105

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

handrews
Copy link
Contributor

@handrews handrews commented Jun 21, 2023

Fixes #103 (the rest of it).

Always return an instance of the subclass where appropriate. For RelativeJSONPointer, add a class property for the matching JSONPointer subclass.

@codecov
Copy link

codecov bot commented Jun 21, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.09% ⚠️

Comparison is base (e6f71d0) 92.73% compared to head (4d00a43) 92.65%.

❗ Current head 4d00a43 differs from pull request most recent head c4b691f. Consider uploading reports for the commit c4b691f to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #105      +/-   ##
==========================================
- Coverage   92.73%   92.65%   -0.09%     
==========================================
  Files          23       23              
  Lines        2052     2041      -11     
  Branches      435      431       -4     
==========================================
- Hits         1903     1891      -12     
  Misses         97       97              
- Partials       52       53       +1     
Files Changed Coverage Δ
jschon/jsonpointer.py 99.36% <100.00%> (+0.03%) ⬆️

... and 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@handrews
Copy link
Contributor Author

I'm going to take this down and do it as part of a comprehensive approach as is being discussed in #108

@handrews handrews closed this Jul 18, 2023
Always return an instance of the subclass where appropraite.
For RelativeJSONPointer, add a class property for the matching
JSONPointer subclass.
@handrews
Copy link
Contributor Author

handrews commented Aug 7, 2023

I'm re-opening this as its own PR to finish #103.

As discussed in #108 (reply in thread), I no longer think the class attribute approach is good for the rest of the library. I also no longer have immediate need to subclass these, but they should be subclassable (as this PR implements with cls() and type(self)() construction), and connecting paired subclasses and optional exception classes is straightforward for this self-contained area.

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.

Extensibility of [Relative]JSONPointer classes?
1 participant