[New-bugs-announce] [issue40224] Execute a @staticmethod (Python 3.8.2)

keyboardAnt report at bugs.python.org
Wed Apr 8 07:45:10 EDT 2020


New submission from keyboardAnt <nadav0012 at gmail.com>:

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 <report at bugs.python.org>
<https://bugs.python.org/issue40224>
_______________________________________


More information about the New-bugs-announce mailing list