Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Panicked when using annotation with beartype #4848

Copy link
Copy link
Open
@xiaxinmeng

Description

@xiaxinmeng
Issue body actions

RustPython gets panicked when running the following code. It seems that the annotation cannot be handled well with beartype.

test.py

from beartype import beartype
from beartype.vale import IsDependent
import numpy as np

@beartype
def spam(first: np.ndarray, second: np.ndarray) -> Annotated[
    np.ndarray, IsDependent[lambda result, first, second: 
        result.shape == (first.shape[0], second.shape[1])]]:
    """Matrix multiplication"""
    return a @ b

Crash message:

thread 'main' panicked at 'The symbol must be present in the symbol table, even when it is undefined in python.', compiler/codegen/src/compile.rs:478:57
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Environment:
Ubuntu 18.04
rustpython v0.2.0 #6c6290d

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.