Replies: 1 comment
-
Just saw this. Think this is good for colors as the API surface is small. For P2/V2 though there are a lot of functions that take those args, and might be annoying to convert them everywhere. 2 ideas.
For degree / rad / turns we could experiment with |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The following discussion doesn't have a high priority, but I wanted to say it out loud since it was on my mind for some time already.
When deciding what arguments can be passed to a function, we have to choose between using primitive Python types (such as
str
,tuple
,float
), for example,or domain-specific types (such as,
Color
,P2
,Degree
):The former are easier and more direct to use, the latter are more flexible and more precise. Currently, we use various techniques for supporting multiple types (e.g., union types, as done in
arc_between
; multiple constructors, as done inPath
; or multiple methods, as done inTransform
), but maybe we should settle for a more uniform approach? For example, I am happy with using union types, as I see it is quite common in other Python libraries. I for one would like to be able to pass strings for colors instead of instances ofColor
🙂Beta Was this translation helpful? Give feedback.
All reactions