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

bpo-33816: Remove outdated metaclass example #7566

Merged
merged 2 commits into from Nov 16, 2018

Conversation

andresdelfino
Copy link
Contributor

@andresdelfino andresdelfino commented Jun 9, 2018

@ncoghlan
Copy link
Contributor

ncoghlan commented Nov 11, 2018

Perhaps it would make sense to keep the example, but caveat it as being redundant given the move to class namespaces being ordered by default?

Copy link
Contributor

@ncoghlan ncoghlan left a comment

Outright removal is better than keeping the misleading example, so approving as is. However, see my comment above about potentially qualifying the example as no longer being necessary, rather than removing it entirely.

@andresdelfino
Copy link
Contributor Author

andresdelfino commented Nov 11, 2018

Perhaps it would make sense to keep the example, but caveat it as being redundant given the move to class namespaces being ordered by default?

The thing is that the example also depends on the fact that a specialized type like OrderedDict was needed to get an insertion-order-preserving dictionary. I think examples of the like "that thing can be implemented with this API like this:" are good, but this particular example depends on several things that have changed.

IMHO, a new example that shows a real benefit from metaclasses would be better.

@methane
Copy link
Member

methane commented Nov 16, 2018

I think we must not waiting removing bad document until someone writing better document
when we don't know when the better document is finished.

Additionally, metaclass is very complex feature. I don't want to promote using it.
Actually, Python is evolved to solve typical problem without metaclass: __init_subclass__, __class_getitem__, and PEP 520. (Maybe more)

Lack of "typical usecase" is OK. Lack of "example of typical usecase" is OK too.
People can read stdlib's code to know how metaclass is used.

@methane methane merged commit c2ccac7 into python:master Nov 16, 2018
@miss-islington
Copy link
Contributor

miss-islington commented Nov 16, 2018

Thanks @andresdelfino for the PR, and @methane for merging it 🌮🎉.. I'm working now to backport this PR to: 3.6, 3.7.
🐍🍒🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 16, 2018
(cherry picked from commit c2ccac7)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
@bedevere-bot
Copy link

bedevere-bot commented Nov 16, 2018

GH-10567 is a backport of this pull request to the 3.7 branch.

@bedevere-bot
Copy link

bedevere-bot commented Nov 16, 2018

GH-10568 is a backport of this pull request to the 3.6 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 16, 2018
(cherry picked from commit c2ccac7)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
@andresdelfino andresdelfino deleted the patch-4 branch Nov 16, 2018
miss-islington added a commit that referenced this pull request Nov 16, 2018
(cherry picked from commit c2ccac7)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
miss-islington added a commit that referenced this pull request Nov 16, 2018
(cherry picked from commit c2ccac7)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants