Re: [sage-devel] Sorting strings and integers

2017-08-07 Thread Daniel Krenn
On 2017-08-07 22:53, David Roe wrote: > >>> sorted([1,2,'a']) > Traceback (most recent call last): > File "", line 1, in > TypeError: '<' not supported between instances of 'str' and 'int' > [...] > Which still leaves the second part of Stefan's question: how do we get >

Re: [sage-devel] Sorting strings and integers

2017-08-07 Thread Jori Mäntysalo
On Mon, 7 Aug 2017, David Roe wrote: Yet for a user looking at the examples of using such a function, it's nicer to see sage: my_func(inputs) # unordered [A, C, B] rather than sage: set([str(c) for c in my_func(inputs)]) == set(["A","B","C"]) True Maybe just EXAMPLES:: sage:

Re: [sage-devel] Zulip

2017-08-07 Thread David Roe
Here's a status report from playing around with it for a few days. * I find it pretty interesting to watch the feeds of everything that's happening on trac (you can also just focus on a single component). * I think that it will be quite useful for having online Sage Days, which have happened at

Re: [sage-devel] Sorting strings and integers

2017-08-07 Thread Stefan
> What bad practice are you referring to? The output of some functions are > lists where the ordering is somewhat unpredictable. This different > ordering can reveal itself in testing on different platforms, or with a > changed package that Sage depends on. Yet for a user looking at the

Re: [sage-devel] Sorting strings and integers

2017-08-07 Thread David Roe
On Mon, Aug 7, 2017 at 5:14 PM, Vincent Delecroix <20100.delecr...@gmail.com > wrote: > On 07/08/2017 23:11, David Roe wrote: > >> On Mon, Aug 7, 2017 at 5:03 PM, Vincent Delecroix < >> 20100.delecr...@gmail.com >> >>> wrote: >>> >> >> On 07/08/2017 22:53, David Roe wrote: >>> >>> On Mon, Aug 7,

Re: [sage-devel] Sorting strings and integers

2017-08-07 Thread Vincent Delecroix
On 07/08/2017 23:11, David Roe wrote: On Mon, Aug 7, 2017 at 5:03 PM, Vincent Delecroix <20100.delecr...@gmail.com wrote: On 07/08/2017 22:53, David Roe wrote: On Mon, Aug 7, 2017 at 4:37 PM, Vincent Delecroix < 20100.delecr...@gmail.com wrote: On 07/08/2017 19:47, David Roe wrote:>

Re: [sage-devel] Sorting strings and integers

2017-08-07 Thread David Roe
On Mon, Aug 7, 2017 at 5:03 PM, Vincent Delecroix <20100.delecr...@gmail.com > wrote: > On 07/08/2017 22:53, David Roe wrote: > >> On Mon, Aug 7, 2017 at 4:37 PM, Vincent Delecroix < >> 20100.delecr...@gmail.com >> >>> wrote: >>> >> >> On 07/08/2017 19:47, David Roe wrote:> But I think that Sage

Re: [sage-devel] Sorting strings and integers

2017-08-07 Thread Vincent Delecroix
On 07/08/2017 22:53, David Roe wrote: On Mon, Aug 7, 2017 at 4:37 PM, Vincent Delecroix <20100.delecr...@gmail.com wrote: On 07/08/2017 19:47, David Roe wrote:> But I think that Sage integers should compare the same as python ints I agree and with Python 3 you get an error $ python

Re: [sage-devel] Sorting strings and integers

2017-08-07 Thread David Roe
On Mon, Aug 7, 2017 at 4:37 PM, Vincent Delecroix <20100.delecr...@gmail.com > wrote: > On 07/08/2017 19:47, David Roe wrote:> But I think that Sage > >> integers should compare the same as python ints >> > I agree and with Python 3 you get an error > > $ python > Python 3.6.2 (default, Jul 20

Re: [sage-devel] Sorting strings and integers

2017-08-07 Thread Vincent Delecroix
On 07/08/2017 19:47, David Roe wrote:> But I think that Sage integers should compare the same as python ints I agree and with Python 3 you get an error $ python Python 3.6.2 (default, Jul 20 2017, 03:52:27) [GCC 7.1.1 20170630] on linux Type "help", "copyright", "credits" or "license" for more

Re: [sage-devel] Sorting strings and integers

2017-08-07 Thread David Roe
This does seem to be new. In Sage 7.2 (just one that I had handy), sage: sorted([1,2,'a']) [1, 2, 'a'] sage: sorted([1r,2r,'a']) [1, 2, 'a'] This isn't that surprising, since the semantics of comparison have been changing because of the upcoming switch to python 3. But I think that Sage integers

Re: [sage-devel] python3 (not yet, and not for soon)

2017-08-07 Thread Erik Bray
On Mon, Aug 7, 2017 at 12:45 PM, Jeroen Demeyer wrote: > On 2017-08-07 12:00, François Bissey wrote: >> >> Looking at this more closely. Why isn’t the “bytes” conversion >> done earlier - before checking that the file exists. > > > +1 > > I know that Erik Bray will

[sage-devel] Sorting strings and integers

2017-08-07 Thread Stefan
Is this behavior new? I got it on my MacBook running the latest development version. And, more importantly, what is the recommended way of writing doctests for functions that return frozen sets with strings and integers? In particular in light of Python 3 coming up... sage: sorted([1,2,'a'])

[sage-devel] Re: Sage 8.0 released (desire binary for OSX 10.11.6)

2017-08-07 Thread Bruce
On Sunday, August 6, 2017 at 3:40:07 PM UTC-7, Volker Braun wrote: > > Binaries for OSX 10.12.6 are at > http://files.sagemath.org/osx/intel/index.html > > May also work on older versions of OSX, but I have no way of testing > I just tested it. The OSX 10.12.6 binary does not work on OSX

Re: [sage-devel] Possible Cython bug

2017-08-07 Thread Jeroen Demeyer
The simplest workaround is to use F[i] instead of F[i] -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this

Re: [sage-devel] Possible Cython bug

2017-08-07 Thread Jeroen Demeyer
See https://github.com/cython/cython/issues/1807 -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group,

Re: [sage-devel] Possible Cython bug

2017-08-07 Thread Jeroen Demeyer
It is a Cython bug. Most simple example: sage: %%cython : def get(obj, int i): : return obj[i] sage: class D(dict): pass sage: d = D([(-1, "hello")]); d {-1: 'hello'} sage: get(d, -1) ... KeyError: 0 sage: d[-1] 'hello' -- You received this message because you are subscribed to

Re: [sage-devel] python3 (not yet, and not for soon)

2017-08-07 Thread Frédéric Chapoton
The core-dumped is supposed to be fixed by the pynac upgrading ticket https://trac.sagemath.org/ticket/23325 . So it does not require any further work hopefuly. Le lundi 7 août 2017 11:54:14 UTC+2, Erik Bray a écrit : > > Hi Frédéric, all, > > Regarding > > > * There remains to make a proper

Re: [sage-devel] python3 (not yet, and not for soon)

2017-08-07 Thread Jeroen Demeyer
On 2017-08-07 12:00, François Bissey wrote: Looking at this more closely. Why isn’t the “bytes” conversion done earlier - before checking that the file exists. +1 I know that Erik Bray will disagree with this, but I would advocate to use "bytes" as much as possible when dealing with

Re: [sage-devel] Re: Possible Cython bug

2017-08-07 Thread Jeroen Demeyer
On 2017-08-04 10:49, Vincent Delecroix wrote: Indeed, this is a subtle issue Cython thinks that F is a sequence because Family does support the sequence protocol (this is lost somewhere in the macro __Pyx_GetItemInt). As a consequence, Cython translates a negative index "-i" into "len(sequence)

Re: [sage-devel] python3 (not yet, and not for soon)

2017-08-07 Thread 'Julien Puydt' via sage-devel
Hi, Le 07/08/2017 à 11:54, Erik Bray a écrit : > I'm working on a better solution to this as part of a more general > reworking of how Sage's dist handles dependencies that can be > fulfilled by multiple packages (in this case the dependency being > 'python'--specifically the Python used for

Re: [sage-devel] python3 (not yet, and not for soon)

2017-08-07 Thread François Bissey
Looking at this more closely. Why isn’t the “bytes” conversion done earlier - before checking that the file exists. Is there a reason why the string is converted before dl-opening the library? > On 7/08/2017, at 18:51, François Bissey wrote: > >> On 7/08/2017, at 18:23,

Re: [sage-devel] python3 (not yet, and not for soon)

2017-08-07 Thread Erik Bray
Hi Frédéric, all, Regarding > * There remains to make a proper python3 install setup, in order to make it > easier to debug. Currently, "make" with "SAGE_PYTHON3=yes" always rebuilds > everything, which is *very annoying*. Happily, using only "sage -b" take > much less time. For instance, an

Re: [sage-devel] python3 (not yet, and not for soon)

2017-08-07 Thread François Bissey
> On 7/08/2017, at 18:23, Frédéric Chapoton wrote: > > Thanks ! Could you make a ticket for this change to singular, please ? > Sure will do. > And building the doc is not yet something that could be tried with hope of > success, I think. Maybe better after

Re: [sage-devel] python3 (not yet, and not for soon)

2017-08-07 Thread Frédéric Chapoton
Thanks ! Could you make a ticket for this change to singular, please ? And building the doc is not yet something that could be tried with hope of success, I think. Maybe better after https://trac.sagemath.org/ticket/14153 Le lundi 7 août 2017 03:25:04 UTC+2, François Bissey a écrit : > > > >

[sage-devel] Re: Regression: sage 8.0 startup time

2017-08-07 Thread Ralf Stephan
BTW, isn't that the well-known complex I initialization issue that has to be done on startup by Pynac? -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to