New submission from keyboardAnt <[email protected]>:
Executing the following code* raise a NameError**. Is it on purpose?
Attached minimal example to reproduce.
class C:
val = C.sm()
@staticmethod
def sm():
return 'val'
*With Python 3.8.2, on MacOS.
**"NameError: name 'C' is not defined"
Best regards
----------
components: macOS
files: example.py
messages: 365977
nosy: keyboardAnt, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: Execute a @staticmethod (Python 3.8.2)
versions: Python 3.8
Added file: https://bugs.python.org/file49042/example.py
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue40224>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com