-
Notifications
You must be signed in to change notification settings - Fork 782
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
feature suggestion: extending PyTuple #1647
Comments
At the moment this is disabled because we weren't confident that subclassing The complexity is during I actually have a patch which might tentatively fix the above (among with some other problems). If you give me a few days, I'll try to push that patch and cc you. Once it works, we can try subclassing |
Sounds good, thanks.
…On Tue, Jun 1, 2021 at 9:13 PM David Hewitt ***@***.***> wrote:
At the moment this is disabled because we weren't confident that
subclassing PyTuple would work correctly.
The complexity is during __new__ implementation. A subclass of PyTuple
needs to pass the number of items in the tuple up to the PyTuple base
class, which we don't do correctly right now. In addition, the items are
laid out in memory after the main class data. This shouldn't be a problem,
but we weren't sure.
I actually have a patch which might tentatively fix the above (among with
some other problems). If you give me a few days, I'll try to push that
patch and cc you. Once it works, we can try subclassing PyTuple and see
whether we can make it work.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1647 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASHRLMPOXW7OKIA5J55GPLLTQUPOPANCNFSM454HPREQ>
.
|
As an alternative, for the specific case of creating This is what CPython uses internally to create From the docs:
|
Right now it is impossible to
I'd like to do that to get a rust namedtuple like class.
What would that entail?
The text was updated successfully, but these errors were encountered: