Skip to content

Use Self type from PEP 673 #327

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

Merged
merged 2 commits into from
Apr 16, 2023
Merged

Use Self type from PEP 673 #327

merged 2 commits into from
Apr 16, 2023

Conversation

jayqi
Copy link
Member

@jayqi jayqi commented Apr 16, 2023

This PR replaces the custom type variable DerivedCloudPath with the special type Self added in Python 3.11 (adds typing_extensions backport dependency for older Python versions). This works in a functionally identical way as what we had before, as explained in the official docs, but is a part of the standard library and much more readable.

For more context, see PEP 673.

@github-actions
Copy link
Contributor

github-actions bot commented Apr 16, 2023

@github-actions github-actions bot temporarily deployed to pull request April 16, 2023 04:13 Inactive
@codecov
Copy link

codecov bot commented Apr 16, 2023

Codecov Report

Merging #327 (a73fa00) into master (a0dd927) will decrease coverage by 0.2%.
The diff coverage is 100.0%.

Additional details and impacted files
@@           Coverage Diff            @@
##           master    #327     +/-   ##
========================================
- Coverage    94.5%   94.3%   -0.2%     
========================================
  Files          22      22             
  Lines        1463    1466      +3     
========================================
  Hits         1383    1383             
- Misses         80      83      +3     
Impacted Files Coverage Δ
cloudpathlib/cloudpath.py 92.9% <100.0%> (-0.4%) ⬇️

... and 1 file with indirect coverage changes

@github-actions github-actions bot temporarily deployed to pull request April 16, 2023 04:19 Inactive
@jayqi jayqi requested a review from pjbull April 16, 2023 19:04
@pjbull
Copy link
Member

pjbull commented Apr 16, 2023

Nice!

@pjbull pjbull merged commit 28b2eb5 into master Apr 16, 2023
@jayqi jayqi deleted the jyq-selftype branch April 16, 2023 22:58
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