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

Complete sequence API for list/tuple? #1845

Closed
birkenfeld opened this issue Aug 29, 2021 · 3 comments · Fixed by #1860
Closed

Complete sequence API for list/tuple? #1845

birkenfeld opened this issue Aug 29, 2021 · 3 comments · Fixed by #1860

Comments

@birkenfeld
Copy link
Member

I propose to add all methods present in PySequence (such as del_item) to PyList and PyTuple. It is quite convenient not to have to cast to PySequence for some operations but not for others.

@davidhewitt
Copy link
Member

Specifically on del_item - it should already be available thanks to deref to PyAny?

Though in general I'm in favour of making it easier for users, so happy to find improvements here.

We could also have .as_sequence() method on PyList and PyTuple to make the cast less awkward?

@birkenfeld
Copy link
Member Author

Well, there's a few inconsistencies: for example, since the del_item is the generic version it will take negative indices :)

@davidhewitt
Copy link
Member

Ah, that's a good point! In which case a specialized del_item on PyList would be a good idea!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants