Import ged4py after installl it by pip on python2.7
What I Did
pip install ged4py
Python 2.7.17 (default, Nov 7 2019, 10:07:09)
[GCC 7.4.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ged4py
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/yoan/PycharmProjects/peregrination/venv/local/lib/python2.7/site-packages/ged4py/__init__.py", line 22, in <module>
from .parser import GedcomReader # noqa: F401
File "/home/yoan/PycharmProjects/peregrination/venv/local/lib/python2.7/site-packages/ged4py/parser.py", line 45
level: int
^
SyntaxError: invalid syntax
I see with PyCharm the same error. The error is underlined with "red" as an error of syntax in the class :
class GedcomLine(NamedTuple):
"""Class representing single line in a GEDCOM file.
.. note::
Mostly for internal use by parser, most clients do not need to know
about this class.
Attributes
----------
level : `int`
xref_id : `str`, possibly empty or ``None``
tag : `str`, required, non-empty
value : `bytes`, possibly empty or ``None``
offset : `int`
"""
level: int
"""Record level number (`int`)"""
xref_id: str
"""Reference for this record (`str` or ``None``)"""
tag: str
"""Tag name (`str`)"""
value: bytes
"""Record value (`bytes`)"""
offset: int
"""Record offset in a file (`int`)"""
The error found by PyCharm show that every:
xxx: python_type
are underlined between the colon and the python type variable, saying that the "End of statement expected" , "Statement expected, found Py:COLON" for :
level: int
xref_id: str
tag: str
value: bytes
offset: int
EDIT :
This annotation is for variable annotation come from python 3.6 with PEP526 , or it's not compatible with Python 2.7 so the error came because of that specific annotation from python3.5. I is possible to make a compatibility fix ?
Thanks for help !
EDIT 2 : My bad... I just see Python2 is no longer supported sorry - false alert.
Description
Import ged4py after installl it by pip on python2.7
What I Did
I see with PyCharm the same error. The error is underlined with "red" as an error of syntax in the class :
class GedcomLine(NamedTuple): """Class representing single line in a GEDCOM file.
The error found by PyCharm show that every: xxx: python_type
are underlined between the colon and the python type variable, saying that the "End of statement expected" , "Statement expected, found Py:COLON" for : level: int xref_id: str tag: str value: bytes offset: int
EDIT :
This annotation is for variable annotation come from python 3.6 with PEP526 , or it's not compatible with Python 2.7 so the error came because of that specific annotation from python3.5. I is possible to make a compatibility fix ?
Thanks for help !
EDIT 2 : My bad... I just see Python2 is no longer supported sorry - false alert.