single-cell-data / SOMA

A flexible and extensible API for annotated 2D matrix data stored in multiple underlying formats.
MIT License
69 stars 9 forks source link

Add a note about why the fields of Slice are `@property`s. #175

Closed thetorpedodog closed 9 months ago

thetorpedodog commented 9 months ago

After talking just now I was looking at the protocol and wondered: Why do we not just say class Slice(Protocol[_T_co]): start: Optional[_T_co] etc.? The Named example protocol in the Python docs uses that syntax.

Then I tried it and found out why.