Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

delete_me #84405

Closed
keyboardAnt mannequin opened this issue Apr 8, 2020 · 2 comments
Closed

delete_me #84405

keyboardAnt mannequin opened this issue Apr 8, 2020 · 2 comments
Labels
type-bug An unexpected behavior, bug, or error

Comments

@keyboardAnt
Copy link
Mannequin

keyboardAnt mannequin commented Apr 8, 2020

BPO 40224
Nosy @ronaldoussoren, @ned-deily, @keyboardAnt

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2020-04-08.12:23:36.919>
created_at = <Date 2020-04-08.11:45:10.407>
labels = ['type-bug', 'invalid']
title = 'delete_me'
updated_at = <Date 2020-04-08.12:23:36.918>
user = 'https://github.com/keyboardAnt'

bugs.python.org fields:

activity = <Date 2020-04-08.12:23:36.918>
actor = 'ronaldoussoren'
assignee = 'none'
closed = True
closed_date = <Date 2020-04-08.12:23:36.919>
closer = 'ronaldoussoren'
components = []
creation = <Date 2020-04-08.11:45:10.407>
creator = 'keyboardAnt'
dependencies = []
files = []
hgrepos = []
issue_num = 40224
keywords = []
message_count = 2.0
messages = ['365977', '365982']
nosy_count = 3.0
nosy_names = ['ronaldoussoren', 'ned.deily', 'keyboardAnt']
pr_nums = []
priority = 'normal'
resolution = 'not a bug'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue40224'
versions = []

@keyboardAnt
Copy link
Mannequin Author

keyboardAnt mannequin commented Apr 8, 2020

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

@keyboardAnt keyboardAnt mannequin added OS-mac 3.8 only security fixes and removed OS-mac 3.8 only security fixes labels Apr 8, 2020
@keyboardAnt keyboardAnt mannequin changed the title Execute a @staticmethod (Python 3.8.2) delete_me Apr 8, 2020
@keyboardAnt keyboardAnt mannequin removed OS-mac 3.8 only security fixes labels Apr 8, 2020
@keyboardAnt keyboardAnt mannequin changed the title Execute a @staticmethod (Python 3.8.2) delete_me Apr 8, 2020
@ronaldoussoren
Copy link
Contributor

This is expected behavior, the call to "C.sm()" happens before "C" is created.

@ronaldoussoren ronaldoussoren added invalid type-bug An unexpected behavior, bug, or error labels Apr 8, 2020
@ronaldoussoren ronaldoussoren added invalid type-bug An unexpected behavior, bug, or error labels Apr 8, 2020
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant