You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Oh wait, I didn't realize that you were overriding an internal API. But if @staticmethod works let's close this issue. (I think mypy was trying to tell you that. :-)
Traceback (most recent call last):
File "auto_name_enum.py", line 5, in <module>
class AutoNameEnum(Enum):
File "auto_name_enum.py", line 12, in AutoNameEnum
foo = auto()
File "/Users/okumura/.pyenv/versions/3.8.1/lib/python3.8/enum.py", line 104, in __setitem__
value.value = self._generate_next_value(key, 1, len(self._member_names), self._last_values[:])
TypeError: 'staticmethod' object is not callable
Reacted by Anton Abrosimov, Victor Engmark, Kevin Kirsche, Paulo S. Costa, 김동현(DongHyeon Kim)/MP, Andrew Wason, GalaxySnail, Noam Nol, Harshal Sheth, Jérôme Lafréchoux and 2 more
Run poetry run cdk deploy --all --require-approval never --strict --change-set-name "ci-${GITHUB_RUN_ID}"
poetry run cdk deploy --all --require-approval never --strict --change-set-name "ci-${GITHUB_RUN_ID}"
shell: /usr/bin/bash -e {0}
env: […]
Traceback (most recent call last):
File "/home/runner/work/geostore/geostore/app.py", line 7, in <module>
from infrastructure.application_stack import Application
File "/home/runner/work/geostore/geostore/infrastructure/application_stack.py", line 8, in <module>
from .constructs.api import API
File "/home/runner/work/geostore/geostore/infrastructure/constructs/api.py", line 18, in <module>
from .table import Table
File "/home/runner/work/geostore/geostore/infrastructure/constructs/table.py", line 6, in <module>
from geostore.parameter_store import ParameterName
File "/home/runner/work/geostore/geostore/geostore/parameter_store.py", line 24, in <module>
class ParameterName(Enum):
File "/home/runner/work/geostore/geostore/geostore/parameter_store.py", line 31, in ParameterName
GIT_COMMIT = auto()
File "/opt/hostedtoolcache/Python/3.9.15/x64/lib/python3.9/enum.py", line 142, in __setitem__
value.value = self._generate_next_value(
TypeError: 'staticmethod' object is not callable
Subprocess exited with error 1
Error: Process completed with exit code 1.
Activity
gvanrossum commentedon Oct 1, 2019
Maybe adding
@staticmethodhelps? Or move the helper out of the class (since it doesn't seem to have anything to do with the class)?gvanrossum commentedon Oct 1, 2019
Oh wait, I didn't realize that you were overriding an internal API. But if
@staticmethodworks let's close this issue. (I think mypy was trying to tell you that. :-)kokumura commentedon Jul 2, 2020
In Python 3.8,
@staticmethodwon't work.results:
Venom1991 commentedon Feb 17, 2021
This problem bit me just now and the
@staticmethodapproach seems to work in Python 3.9.1 (no exception is being thrown).l0b0 commentedon Jan 10, 2023
@Venom1991
@staticmethoddoesn't seem to work in Python 3.9.15:Is this caused by python/cpython#86844?
Suppress type issue caused by bug