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

Cannot set attributes on staticmethod #58259

Closed
alex opened this issue Feb 18, 2012 · 4 comments
Closed

Cannot set attributes on staticmethod #58259

alex opened this issue Feb 18, 2012 · 4 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement

Comments

@alex
Copy link
Member

alex commented Feb 18, 2012

BPO 14051
Nosy @gvanrossum, @benjaminp, @alex, @durban

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 2012-02-19.06:14:40.082>
created_at = <Date 2012-02-18.17:45:28.824>
labels = ['interpreter-core', 'type-feature']
title = 'Cannot set attributes on staticmethod'
updated_at = <Date 2012-02-19.16:42:45.992>
user = 'https://github.com/alex'

bugs.python.org fields:

activity = <Date 2012-02-19.16:42:45.992>
actor = 'benjamin.peterson'
assignee = 'none'
closed = True
closed_date = <Date 2012-02-19.06:14:40.082>
closer = 'python-dev'
components = ['Interpreter Core']
creation = <Date 2012-02-18.17:45:28.824>
creator = 'alex'
dependencies = []
files = []
hgrepos = []
issue_num = 14051
keywords = []
message_count = 4.0
messages = ['153649', '153670', '153706', '153710']
nosy_count = 6.0
nosy_names = ['gvanrossum', 'benjamin.peterson', 'Arfrever', 'alex', 'daniel.urban', 'python-dev']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue14051'
versions = ['Python 3.3']

@alex
Copy link
Member Author

alex commented Feb 18, 2012

This is inconsistant with regular functions, which unfortunately prevents them from being used interchangeably.

@pitrou pitrou added interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement labels Feb 18, 2012
@python-dev
Copy link
Mannequin

python-dev mannequin commented Feb 19, 2012

New changeset f46deae68e34 by Benjamin Peterson in branch 'default':
allow arbitrary attributes on classmethod and staticmethod (closes bpo-14051)
http://hg.python.org/cpython/rev/f46deae68e34

@python-dev python-dev mannequin closed this as completed Feb 19, 2012
@gvanrossum
Copy link
Member

Wouldn't it make more sense to somehow share the dict with the underlying function?

@benjaminp
Copy link
Contributor

You can wrap anything with staticmethod, so it might not have a __dict__.

@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
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

4 participants