Am 09.07.2017 um 19:07 schrieb Justin Pryzby:
Could you elaborate on that ? I would like the idea of a standard
function, returning its length, the same thing as ntuples(), but how
would one call it ? It seems len() function only works for sequences
and mappings.
If you implement a __len__ method, it should just work:
>>> class Lengthy:
... def __len__(self): return 42
...
>>> print(len(Lengthy()))
42
_______________________________________________
PyGreSQL mailing list
[email protected]
https://mail.vex.net/mailman/listinfo.cgi/pygresql