Repository navigation
Use PyInt::try_to_primitive. - #3187
Conversation
b38f143 to
0f1e427
Compare
| .try_to_primitive(vm) | ||
| { | ||
| Ok(hint) => Ok(Some(hint)), | ||
| Err(_) => Err(vm.new_value_error("__length_hint__() should return >= 0".to_owned())), |
There was a problem hiding this comment.
The original intend looks like distinguising overflow error and negative value error. Is this still covered well?
There was a problem hiding this comment.
ah, good point. I'll address that.
|
An idea. Sometimes, there will be some features we cannot move from BigInt to PyInt. Would it be better if I didn't move try_to_primitive into PyInt but adding |
0f1e427 to
2f6deb8
Compare
|
@youknowone are there places that would need that now? |
|
Probably |
clean up after #3142