Sage humour

Developing Sage can be serious fun and Sage has been used for serious work in mathematics and computer science. But this doesn’t mean that you can’t use the CAS for some light-heartedness. Observe the following Easter egg:

sage: import this
The Zen of Python, by Tim Peters

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!

You could also execute the above command from within a Python or IPython shell. While managing the release of Sage 4.3.2.alpha0, I noticed the following humourous bug report from Tom Boothby at ticket #5501:

The following explodes in sage 3.4:

sage: R = RealIntervalField(4000)
sage: s = 1/R(3)
sage: t = loads(dumps(s))
Traceback (most recent call last):
  File "pikltest.py", line 6, in 
    t = loads(dumps(s))
  File "sage_object.pyx", line 623, in 
sage.structure.sage_object.loads (sage/structure/sage_object.c:6159)
RuntimeError: ('Unable to convert number to real interval.',
 , 
(Real Interval Field with 4000 bits of precision, 
'[a.lalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalala
lalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalala
lalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalala
lalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalala
lalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalala
lalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalala
lalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalala
lalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalala
lalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalala
lalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalala
lalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalala
lalalalalalalalalalalalalalalalalalalalalalalalalalalal0@-1 .. 
a.lalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalala
lalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalala
lalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalala
lalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalala
lalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalala
lalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalala
lalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalala
lalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalala
lalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalala
lalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalala
lalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalala
lalalalalalalalalalalalalalalalalalalalalalalalalalalg@-1]', 32))
invalid data stream
invalid load key, 'x'.
Unable to load pickled data.

Furthermore, it dumps the contents of dumps(s) to the console, which I’m told is a no-no because when one uses ~20kbits of precision with 24 processes via @parallel, the error messages are ridiculously huge.

On a personal note, I’d prefer if my CAS didn’t stick its fingers in its ears and chant “lalalala…” whenever it doesn’t like what I’m doing. This is *not* how a mature system should behave.

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: