Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mypyc] Support __pow__, __rpow__, and __ipow__ dunders #14616

Merged
merged 2 commits into from
Feb 16, 2023

Commits on Feb 5, 2023

  1. [mypyc] Support __pow__, __rpow__, and __ipow__ dunders

    Unlike every other slot, power slots are ternary. Lots of special casing
    had to be done in generate_bin_op_wrapper() to support the third slot
    argument.
    
    - Ternary pow() does NOT fallback to __rpow__ if __pow__ returns
      NotImplemented unlike binary ops.
    - Ternary pow() does NOT try the right operand's __rpow__ first if it's
      a subclass of the left operand and redefines __rpow__ unlike binary
      ops.
    
    Add in the fact it's allowed and common to only define __(r|i)pow__ to
    take two arguments and you get a mess of a patch...
    ichard26 committed Feb 5, 2023
    Configuration menu
    Copy the full SHA
    bf3ebf7 View commit details
    Browse the repository at this point in the history

Commits on Feb 15, 2023

  1. Address test failures

    ichard26 committed Feb 15, 2023
    Configuration menu
    Copy the full SHA
    86d9e4c View commit details
    Browse the repository at this point in the history