Message402793
| Author |
seberg |
| Recipients |
Alexander.Belopolsky, Arfrever, Christian.Tismer, Robin.Schreiber, amaury.forgeotdarc, belopolsky, haberman2, jcea, jhaberman, lekma, loewis, mattip, petr.viktorin, pitrou, seberg, steve.dower |
| Date |
2021年09月28日.17:01:34 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1632848494.89.0.0703628309502.issue15870@roundup.psfhosted.org> |
| In-reply-to |
| Content |
Just to note, that there are two – somewhat distinct – issues here in my opinion:
1. `FromSpec` does not scan `bases` for the correct metaclass, which it could; this could even be considered a bug?
2. You cannot pass in a desired metaclass, which may require a new API function.
My patch tries to address the first (the class creator has to take care that this is reasonable for the metaclass). I had hoped the `slot` mechanism can avoid the API discussion for the second one, but I guess not.
On the discussion on `tp_type/meta` being incorrect usage:
I am slightly surprised we actually care about static C-definitions?
There is no reason that a `spec` should be declared static (aside that you have to move it into the function otherwise)? Everything is copied by `_FromSpec` after all.
However, I suppose that would replace a safe-by-design API with a "best practice" to never define the spec/slots statically (a best practice that is probably not generally followed or even advertised currently, I guess). |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2021年09月28日 17:01:34 | seberg | set | recipients:
+ seberg, loewis, jcea, amaury.forgeotdarc, belopolsky, pitrou, Arfrever, petr.viktorin, lekma, Alexander.Belopolsky, mattip, Robin.Schreiber, steve.dower, Christian.Tismer, jhaberman, haberman2 |
| 2021年09月28日 17:01:34 | seberg | set | messageid: <1632848494.89.0.0703628309502.issue15870@roundup.psfhosted.org> |
| 2021年09月28日 17:01:34 | seberg | link | issue15870 messages |
| 2021年09月28日 17:01:34 | seberg | create |
|