3MFConsortium / lib3mf

lib3mf is an implementation of the 3D Manufacturing Format file standard
http://3mf.io
BSD 2-Clause "Simplified" License
228 stars 92 forks source link

Possible issue in Python wrapper #349

Closed vijaiaeroastro closed 5 months ago

vijaiaeroastro commented 6 months ago

@martinweismann When i try to import all available symbols in Lib3MF Python wrapper using

from Lib3MF import *

I get the following error

Python 3.11.5 (main, Sep 11 2023, 13:54:46) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import Lib3MF
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/vijai/Code/tG/3MFPython/lib3mfPy/Lib3MF/__init__.py", line 14, in <module>
    from .Lib3MF import *  # Import necessary classes
    ^^^^^^^^^^^^^^^^^^^^^
  File "/home/vijai/Code/tG/3MFPython/lib3mfPy/Lib3MF/Lib3MF.py", line 547
    None = 0
    ^^^^
SyntaxError: cannot assign to None

The issue comes from this

class BeamLatticeBallMode(CTypesEnum):
    None = 0 # This is where the issue comes from. None is a reserved type in Python
    Mixed = 1
    All = 2
vijaiaeroastro commented 5 months ago

Closing this issue as a fix already exists for this.