On Thu, Mar 07, 2002 at 04:35:12PM -0800, Bob Miller wrote: >Ralph Zeller wrote: >> I'm new to Python, too. I was wondering if there is a way to >> inherit some of the list properties like min, max, len, etc
With Python 2.2, they've started the Great Type/Class Unification (tm) project, and you can now sub-class a list directly: >>> class foo(list): ... pass ... >>> l = foo() >>> print l [] This will not work in 2.1 or below, though... >> Another newbie question--rather than parse the date/time yourself, >> would it make any sense to use a module like mxDateTime? I know >> it's overkill (bloat) but it might be more flexible. > >It's not part of the base Python distribution. There's a Perl CPAN I'm not actually all that fond of mxDateTime, but it's certainly an option. There is currently a plan to include more date/time manipulation code in the standard Python release, which is way past time. Until then, you probably want to use mxDateTime though... >it'd make it harder for all us club members to run the script. I'd >use the same argument against mxDateTime. There is that... I actually built my own module the last time I looked at mxDateTime. I was mostly interested in parsing dates and being able to compare them. The base code is 86 lines, so it's not that much code. It's definitely something that needs to be in the standard library though. It probably will be at 2.3. Sean -- "Isn't having a smoking section in a restaurant kind of like having a peeing section in a swimming pool?" -- David Broadfoot Sean Reifschneider, Inimitably Superfluous <[EMAIL PROTECTED]> tummy.com - Linux Consulting since 1995. Qmail, KRUD, Firewalls, Python
