Replies: 1 comment 2 replies
-
Yeah most other languages behave in a similar manner by allowing coercion of a value to the type that it already is. I might be able to get this done in the next few weeks but no promises. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm dealing with a case where the incoming value could be either an integer or the string representation of an integer, e.g. "2". I need to modify it with string operations. This is easy enough if it is an integer, as I just apply the to_str method. However, if the value came in as a string originally, .to_str appears to return None. Is there any way I can set up .to_str to simply return the string? Shouldn't this be a default behavior?
Beta Was this translation helpful? Give feedback.
All reactions