Hello, I run my application with CPython & utilize its -OO flag which remove docstrings. I run into the following error when doing so with galois:
File "/tmp/.mount_hl1500PdhjIa/usr/lib/python3.12/site-packages/galois/__init__.py", line 24, in <module>
from ._fields import *
File "/tmp/.mount_hl1500PdhjIa/usr/lib/python3.12/site-packages/galois/_fields/__init__.py", line 4, in <module>
from ._array import *
File "/tmp/.mount_hl1500PdhjIa/usr/lib/python3.12/site-packages/galois/_fields/_array.py", line 25, in <module>
class FieldArray(Array, metaclass=FieldArrayMeta):
File "/tmp/.mount_hl1500PdhjIa/usr/lib/python3.12/site-packages/galois/_fields/_array.py", line 214, in FieldArray
@extend_docstring(
^^^^^^^^^^^^^^^^^
File "/tmp/.mount_hl1500PdhjIa/usr/lib/python3.12/site-packages/galois/_helper.py", line 112, in decorator
parent_docstring = parent_docstring.replace(from_str, to_str)
^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'replace'
I believe the getattr call with a default empty string does not work here since CPython is replacing existing docstrings with None.
I will create a PR to resolve this issue and handle the None docstring case shortly.
Hello, I run my application with CPython & utilize its
-OO
flag which remove docstrings. I run into the following error when doing so withgalois
:I believe the
getattr
call with a default empty string does not work here since CPython is replacing existing docstrings withNone
.I will create a PR to resolve this issue and handle the
None
docstring case shortly.