calendar.py doesn't use lists???

Steve Holden sholden at holdenweb.com
Mon Apr 22 19:10:52 EDT 2002


"Aaron Watters" <aaron at reportlab.com> wrote in message
news:9a6d7d9d.0204221405.7d394207 at posting.google.com...
> Hi guys.  I got an irksome problem.  It's possible that
> it's fixed in python 2.2.1, but even if it is, it irks me.
>
In order to be fixed it has to be broken. Please read on ...

> I tried the following script:
>
> """
> import sys
> print sys.version
> if 1:
>     from calendar import month_abbr, month_name
>     # hey python guys, i want lists!!
>     for x in (month_abbr, month_name):
>         print type(x)
>     month_abbr = list(month_abbr)
>     month_name = list(month_name)
>     print month_abbr
>     print month_name
> """
>
> Using python 2.1 I get this output
>
> """
> 2.1.1 (#20, Jul 26 2001, 11:38:51) [MSC 32 bit (Intel)]
> <type 'list'>
> <type 'list'>
> ['   ', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
'Oct', 'N
> ov', 'Dec']
> ['', 'January', 'February', 'March', 'April', 'May', 'June', 'July',
'August', '
> September', 'October', 'November', 'December']
> """
>
> (completing normally)
>
> Using Python 2.2 I get this
>
> """
> 2.2 (#28, Dec 21 2001, 12:21:22) [MSC 32 bit (Intel)]
> <type 'instance'>
> <type 'instance'>
> [CRASH AND BURN... WINDOWS XP SUGGESTS I SEND A COMPLAINT TO MICROSOFT...]
> """
>
Interestingly, both cygwin2.2 and Windows2K 2.2 also fail. There's clearly
some drastic problem here...

> Of course it may be that this is fixed in python 2.2.1 but...
>
> WHO'S GOOFY IDEA WAS THIS?
>
Well, reading the source gives co clue to the guilty party. We could find
out in SourceForge if we really wanted. It wasn't me, honest.

> Seriously, why did you need to change these sequences from
> lists where they worked with my code, to somethingsimilartolists
> that broke my code?
>
Well, let's take a look at the documentation, shall we. In "5.13 calendar --
General calendar-related functions" for Python 2.2 there is no mention of
these attributes. Nothing in 2.1 or 1.5.2 either. So offhand I'd say the
author was free to replace those sequences with
somethingbearingnodamnedresemblanceatalltolists without anyone having any
right to complain.

> Irked.  In general I've noticed a tendancy with recent python
> releases towards changing stuff for the fun of changing stuff,
> I'm sorry to say.  Please remember that when you fix something
> that isn't broken, you might just be breaking somebody else's code.
>
> Sorry to whine.
>
It's easy to understand why you are pissed, but having broken encapsulation
the way you did it's a little unfair to whine at the developers. There's
been a lot of complaining about language change recently, but precious
little hard evidence of real code breakage. As a well-known programmer in
the Python community your opinion counts, so please be careful not to spread
FUD. I have to say in this case that the code breakage you report is not
Python's fault (though the crash and burn behavior should be fixed:
segfaults are a bit OTT).

Suppose I were to mail you and complain that gadfly.privatevar no longer
contains a floogle instance since you updated it. Would I have a leg to
stand on? Answer: only if your documentation included a description of that
attribute.

Thanks for Gadfly, by the way. A brilliant piece of software that helps
Python-only users get into relational databases.

regards
 Steve
--
home: http://www.holdenweb.com/    book: http://pydish.holdenweb.com/pwp/






More information about the Python-list mailing list