Skip to content

Refactor with AsNumber::number_downcast_exact - #4637

Merged
youknowone merged 3 commits into
RustPython:mainfrom
youknowone:refactor-asnumber
Mar 7, 2023
Merged

youknowone merged 3 commits into
RustPython:mainfrom
youknowone:refactor-asnumber

Conversation

@youknowone

@youknowone youknowone commented Mar 5, 2023 •

Copy link
Copy Markdown
Member

this is including #4636

@youknowone
youknowone requested review from DimitrisJim, fanninpm and qingshi163 and removed request for fanninpm March 6, 2023 13:19
Comment thread vm/src/builtins/int.rs Outdated
and: atomic_func!(|num, other, vm| PyInt::number_op(num, other, |a, b, _vm| a & b, vm)),
xor: atomic_func!(|num, other, vm| PyInt::number_op(num, other, |a, b, _vm| a ^ b, vm)),
or: atomic_func!(|num, other, vm| PyInt::number_op(num, other, |a, b, _vm| a | b, vm)),
int: atomic_func!(|num, other| Ok(PyInt::number_downcast_exact(num, other))),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: other -> vm.

@DimitrisJim DimitrisJim left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me, does it need to be rebased first?

@youknowone
youknowone merged commit b10421a into RustPython:main Mar 7, 2023
@youknowone
youknowone deleted the refactor-asnumber branch March 7, 2023 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants