Skip to content

Invalid syntax #1501

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

Closed
WebcomCompany opened this issue Jul 4, 2022 · 1 comment
Closed

Invalid syntax #1501

WebcomCompany opened this issue Jul 4, 2022 · 1 comment

Comments

@WebcomCompany
Copy link

### Last Version Of IronPython 3.4.0 Error:

in c#:
{"invalid syntax"}

in Python Code:
_tensor_classes: Set[Type] = set()

This Error From Torch Library

@BCSharp
Copy link
Member

BCSharp commented Jul 5, 2022

@WebcomCompany, your report does not contain sufficient information to identify the issue, so I can offer only some general observations:

Last Version Of IronPython 3.4.0 Error:

  1. There is no 3.4.0 version of IronPython yet, so I assume you are working with 3.4.0b1

in c#:
{"invalid syntax"}

  1. invalid syntax is a message of SyntaxError, so I assume this is the exception you are getting (as opposed to, e.g. NameError: name '__annotations__' is not defined or ImportError: No module named 'typing').

in Python Code:
_tensor_classes: Set[Type] = set()

  1. This cannot be the source of the error because such statement does not produce SyntaxError (or any error for that matter) in IronPython 3.4:
IronPython 3.4.0b1 (3.4.0.0010)
[.NETCoreApp,Version=v6.0 on .NET 6.0.5 (64-bit)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> _tensor_classes: Set[Type] = set()  # no error
>>> _tensor_classes
set()
  1. Annotated assignment syntax has been introduced in Python 3.6 so you are trying to use a package designed for Python 3.6 (or later) with IronPython 3.4. Although IronPython 3.4 does include some partial support of later Python syntax (like annotated assignment syntax), module typing is not available. (Module typing is whence Set and Type come).
  2. Support for type annotations is more complete in IronPython 3.6, but this version of IronPython is still under preparation to become the main development branch.

This Error From Torch Library

  1. If you are trying to use package PyTorch with IronPython, then even IronPython 3.6 will not help you because PyTorch depends on Numpy and Numpy is presently not supported by IronPython.

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