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

Can I use isinstance(foo, list[str]) #2114

Open
mzagozen opened this issue Jan 22, 2025 · 1 comment
Open

Can I use isinstance(foo, list[str]) #2114

mzagozen opened this issue Jan 22, 2025 · 1 comment

Comments

@mzagozen
Copy link
Collaborator

Is is possible to use isintance(foo, list[str])?

actonc exited with code 1 / 0
std_err: Building project in /home/mzagozen/foss/orchestron/acton-yang

ERROR: Error when compiling yang.schema module: Syntax error

/home/mzagozen/foss/orchestron/acton-yang/src/yang/schema.act:1357:49:
     |
1357 |                 elif isinstance(attr_value, list[str]):
     |                                                 ^
unexpected '['
expecting '.' or a closing parenthesis

❯ actonc --version
acton 0.24.1.20250122.13.43.16
@plajjan
Copy link
Contributor

plajjan commented Jan 27, 2025

I have seen this error before (and worked around it)... but always presumed it was a type error. I just noticed this is actually a syntax error and not a type error. If the parser was to be fixed, could we actually support this? @nordlander ?

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

No branches or pull requests

2 participants