Created on 2018-06-09 17:59 by adelfino, last changed 2022-04-11 14:59 by admin.
Pull Requests |
|
|
|
URL |
Status |
Linked |
Edit |
PR 7566 |
merged |
adelfino,2018-06-09 20:06 |
|
PR 10567 |
merged |
miss-islington,2018-11-16 11:42 |
|
PR 10568 |
merged |
miss-islington,2018-11-16 11:42 |
|
Messages (7) |
|
|
msg319166 - (view) |
Author: Andrés Delfino (adelfino) *  |
Date: 2018-06-09 17:59 |
Since Python 3.6, when PEP 520 was accepted, class attribute definition order is preserved. That alone is sufficient to replace the example, but then 3.7 came with guaranteed dictionary insertion order. The metaclass example uses OrderedDict, what may cause confusing to new programmers, since it is not needed. I'm creating this issue in case someone who actually has used metaclasses can come up with an example, but I'll try to find/think of an example myself. |
|
|
msg319167 - (view) |
Author: Andrés Delfino (adelfino) *  |
Date: 2018-06-09 18:00 |
I'm talking about the example in Data Model, 3.3.3.6. |
|
|
msg319176 - (view) |
Author: Raymond Hettinger (rhettinger) *  |
Date: 2018-06-09 19:54 |
Probably, the entire section with the OrderedClass example should be removed. Once class dicts became ordered by default, the __prepare__ attribute lost its principal motivating use case. |
|
|
msg319178 - (view) |
Author: Andrés Delfino (adelfino) *  |
Date: 2018-06-09 20:01 |
To what section are you refering by "the entire section"? On a side note: I'll make a PR to remove the example. IMHO, there should be an example to give some idea of what a metaclass can do, but the current example is no longer useful and it's confusing because of how dicts now work. |
|
|
msg329989 - (view) |
Author: Inada Naoki (methane) *  |
Date: 2018-11-16 11:42 |
New changeset c2ccac7b9f9a1132ca36255b0ddfeecef4371aa3 by INADA Naoki (Andrés Delfino) in branch 'master': bpo-33816: Remove outdated metaclass example (GH-7566) https://github.com/python/cpython/commit/c2ccac7b9f9a1132ca36255b0ddfeecef4371aa3 |
|
|
msg329990 - (view) |
Author: miss-islington (miss-islington) |
Date: 2018-11-16 11:51 |
New changeset 1b80a373d104480c51cacb8b07ec3b61e21d5fa0 by Miss Islington (bot) in branch '3.7': bpo-33816: Remove outdated metaclass example (GH-7566) https://github.com/python/cpython/commit/1b80a373d104480c51cacb8b07ec3b61e21d5fa0 |
|
|
msg329991 - (view) |
Author: miss-islington (miss-islington) |
Date: 2018-11-16 11:58 |
New changeset 46fa7a60e08fc7486ecab726af93fa2cfe225305 by Miss Islington (bot) in branch '3.6': bpo-33816: Remove outdated metaclass example (GH-7566) https://github.com/python/cpython/commit/46fa7a60e08fc7486ecab726af93fa2cfe225305 |
|
|
History |
|
|
|
Date |
User |
Action |
Args |
2022-04-11 14:59:01 |
admin |
set |
github: 77997 |
2018-11-16 11:58:12 |
miss-islington |
set |
messages: + |
2018-11-16 11:51:23 |
miss-islington |
set |
nosy: + miss-islingtonmessages: + |
2018-11-16 11:42:25 |
miss-islington |
set |
pull_requests: + <pull%5Frequest9817> |
2018-11-16 11:42:13 |
miss-islington |
set |
pull_requests: + <pull%5Frequest9816> |
2018-11-16 11:42:04 |
methane |
set |
nosy: + methanemessages: + |
2018-06-09 20:06:49 |
adelfino |
set |
keywords: + patchstage: patch reviewpull_requests: + <pull%5Frequest7197> |
2018-06-09 20:01:51 |
adelfino |
set |
messages: + |
2018-06-09 19:54:22 |
rhettinger |
set |
nosy: + rhettingermessages: + |
2018-06-09 18:00:40 |
adelfino |
set |
messages: + |
2018-06-09 17:59:20 |
adelfino |
create |
|