popsim-consortium / demes-python

Tools for describing and manipulating demographic models.
https://popsim-consortium.github.io/demes-docs/
ISC License
18 stars 6 forks source link

document Graph.__getitem__() and Graph.__contains__() #112

Closed grahamgower closed 3 years ago

grahamgower commented 3 years ago

I'm not sure of the best/usual approach to documenting these, because the dunder methods are called via specific python syntax. But these are definitely intended to be part of the API.

jeromekelleher commented 3 years ago

This is probably done as part of an "API Quickstart" section or something, which goes through a quick example of using the Python API, illustarting these features.

Formally, I guess the best place to document dunder methods like this is in the class docstring, where we list the behaviour on ==, in, etc.