Skip to content

Extract "Unsupported operand types" exception to separate method #199

Description

@BojanKogoj

Returning exception in call_or_unsupported should be extracted to a separate method.
Also, use it to replace incorrect exceptions in objfloat.rs (and others).

This should fix wrong exceptions, such as

>>>>> 1.1 - "a"
Traceback (most recent call last):
  File <unknown>, line 0, in <module>
TypeError: Cannot add RefCell { value: [PyObj float 1.1] } and RefCell { value: [PyObj str "a"] }

should be

>>> 1.1 - "a"
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for -: 'float' and 'str'

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions