Re: [sage-devel] Re: About __len__

2015-04-14 Thread Volker Braun
On Tuesday, April 14, 2015 at 12:43:49 PM UTC+2, vdelecroix wrote: > > If you want to do math, use `.cardinality()` If you want to do computer programming, then use plain Python and import whatever parts of Sage you want. Moreover there is a nice difference between `len(S)` and > `S.cardinali

Re: [sage-devel] Re: About __len__

2015-04-14 Thread Vincent Delecroix
On 14/04/15 12:38, Volker Braun wrote: The behavior of len is just a CPython implementation detail. One that is perfectly fine if you have actual containers but really crappy if you want to do math. Its not like we would break len, it is still in line with the Python docs. If you want to do mat

Re: [sage-devel] Re: About __len__

2015-04-14 Thread Volker Braun
The behavior of len is just a CPython implementation detail. One that is perfectly fine if you have actual containers but really crappy if you want to do math. Its not like we would break len, it is still in line with the Python docs. On Tuesday, April 14, 2015 at 12:25:58 PM UTC+2, vdelecroix

Re: [sage-devel] Re: About __len__

2015-04-14 Thread Vincent Delecroix
On 14/04/15 12:20, Volker Braun wrote: The output of the magic __len__ method must be a (non-long) int in CPython. So > 64-bit integers are not supported. On the commandline we should probably overwrite len with a version that looks at cardinality() first I am very against overriding more