edgedb-python icon indicating copy to clipboard operation
edgedb-python copied to clipboard

Support slicing edgedb.Tuple

Open fmoor opened this issue 3 years ago • 4 comments

Working towards https://github.com/edgedb/edgedb-python/issues/296

fmoor avatar Jun 24 '22 18:06 fmoor

I have never touched a c extension before :/

fmoor avatar Jun 24 '22 18:06 fmoor

@elprans @fmoor I think we should pause and re-evaluate if we can just use standard Python tuple instead of a custom edgedb.Tuple. We'll still have to have edgedb.NamedTuple fwiw, but I don't see any support of new slicing capabilities added to it. Why?

1st1 avatar Jul 20 '22 19:07 1st1

We'll still have to have edgedb.NamedTuple fwiw, but I don't see any support of new slicing capabilities added to it. Why?

I had never worked on a C extension before so I was starting small.

fmoor avatar Jul 20 '22 19:07 fmoor

I had never worked on a C extension before so I was starting small.

NP, but since this is now done and looks good, I suggest to generalize the functions into _EdgeGeneric_* family and reuse them from both the namedtuple and tuple (because both types support slicing etc).

1st1 avatar Jul 21 '22 16:07 1st1

Closing this one -- we got rid of edgedb.Tuple

1st1 avatar Oct 20 '22 16:10 1st1