Use __index__ if needed to pack integer values in struct#1383
Use __index__ if needed to pack integer values in struct#1383slozier merged 1 commit intoIronLanguages:masterfrom
Conversation
slozier
left a comment
There was a problem hiding this comment.
Looks good to me. Interesting that CPython has two different error messages for some of these.
Random thought, I wonder if trying to cast the BigInteger and catching the failure would be more performant than checking the range.
|
Intuitively, a direct cast should be faster for cases without overflow, but I was curious by how much, so I did some measurements. The results show that going through That said, those things are extremely fast (and hard to measure accurately). Converting by calling |
Resolves #1381.