Modernize type hints in shape module#2041
Draft
DavidMStraub wants to merge 1 commit into
Draft
Conversation
Author
|
Oops, probably bad idea to do this before #2038. @adam-urbanczyk, please let me know how you'd like me to proceed. I could resubmit this after #2038 is merged. |
Member
|
Yup, let's do this after 2038 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First of all sorry for submitting a PR modifying 300 lines without opening an issue first.
Background: as a user of the CadQuery functional API (also in teaching), I wanted to help improve the doc strings (and in some cases type hints) in the
shapesmodule. But first, I realized type hints are a bit dated and can be updated in style since 3.11 is now the minimum Python version supported by CadQuery.This PR does not contain any runtime or type hint changes, only updates notations:
from __future__ import annotations(which can be easily dropped later).I know it's also not 100% consistent to only do this with one module for now, but it would unblock me for making further improvements here.