Re: [Python-Dev] email package status in 3.X

2010-06-21 Thread Jess Austin
On Mon, Jun 22, 2010 at 7:27:31 PM, Steven D'Aprano st...@pearwood.info wrote: On Tue, 22 Jun 2010 08:03:58 am Nick Coghlan wrote: So, to boil down the ebytes idea, it is basically a request for a second string type that holds an octet stream plus an encoding name, rather than a Unicode

Re: [Python-Dev] Issue5434: datetime.monthdelta

2009-04-22 Thread Jess Austin
On Thu, Apr 16, 2009 at 8:01 PM, Jess Austin jess.aus...@gmail.com wrote: These operations are useful in particular contexts.  What I've submitted is also useful, and currently isn't easy in core, batteries-included python.  While I would consider the foregoing interpretation of the Zen

[Python-Dev] Issue5434: datetime.monthdelta

2009-04-16 Thread Jess Austin
execution. thanks, Jess Austin ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] Issue5434: datetime.monthdelta

2009-04-16 Thread Jess Austin
On Thu, Apr 16, 2009 at 3:45 AM, s...@pobox.com wrote:     date(2008, 1, 30) + monthdelta(1)    datetime.date(2008, 2, 29) What would this loop would print?    for d in range(1, 32):        print date(2008, 1, d) + monthdelta(1) for d in range(1, 32): ... print(date(2008, 1, d) +

Re: [Python-Dev] Issue5434: datetime.monthdelta

2009-04-16 Thread Jess Austin
On Thu, Apr 16, 2009 at 5:16 AM, Dirkjan Ochtman dirk...@ochtman.nl wrote: On Thu, Apr 16, 2009 at 11:54, Amaury Forgeot d'Arc amaur...@gmail.com wrote: In my opinion: arithmetic with months is a mess. There is no such month interval or year interval with a precise definition. If we adopt

Re: [Python-Dev] Issue5434: datetime.monthdelta

2009-04-16 Thread Jess Austin
Thanks for everyone's comments! On Thu, Apr 16, 2009 at 9:54 AM, Paul Moore p.f.mo...@gmail.com wrote: I like the idea in principle. In practice, of course, month calculations are inherently ill-defined, so you need to be very specific in documenting all of the edge cases, and you should have

Re: [Python-Dev] Python-Dev Digest, Vol 69, Issue 143

2009-04-16 Thread Jess Austin
Jared Grubb jared.gr...@gmail.com wrote: On 16 Apr 2009, at 11:42, Paul Moore wrote: The key thing missing (I believe) from dateutil is any equivalent of monthmod. I agree with that. It's well-defined and it makes a lot of sense. +1 But, I dont think monthdelta can be made to work... what

Re: [Python-Dev] Issue5434: datetime.monthdelta

2009-04-16 Thread Jess Austin
Jon Ribbens jon+python-...@unequivocal.co.uk wrote: On Thu, Apr 16, 2009 at 12:10:36PM +0400, Oleg Broytmann wrote: This patch adds a monthdelta class and a monthmod function to the datetime module.  The monthdelta class is much like the existing timedelta class, except that it represents

Re: [Python-Dev] Issue5434: datetime.monthdelta

2009-04-16 Thread Jess Austin
Antoine Pitrou solip...@pitrou.net wrote: Jess Austin jess.austin at gmail.com writes: What other behavior options besides last-valid-day-of-the-month would you like to see? IMHO, the question is rather what the use case is for the behaviour you are proposing. In which kind of situation

Re: [Python-Dev] Issue5434: datetime.monthdelta

2009-04-16 Thread Jess Austin
On Thu, Apr 16, 2009 at 7:18 PM, s...@pobox.com wrote:     I have this funny feeling that arithmetic using monthdelta wouldn't     always be intuitive.    Jess I think that's true, especially since these calculations are not    Jess necessarily invertible:     date(2008, 1, 30) +

Re: [Python-Dev] Adding PEP consistent aliases for names that don't currently conform

2009-03-23 Thread Jess Austin
at Issue 5520 to completely apply.  It will fail one test without the patch at Issue 5516.  Both of these are (inexpertly) linked from the roundup page for this issue. I hope this will be helpful. cheers, Jess Austin ___ Python-Dev mailing list Python-Dev

Re: [Python-Dev] tally (and other accumulators)

2006-04-05 Thread Jess Austin
Alex wrote: On Apr 4, 2006, at 10:53 PM, Jess Austin wrote: Alex wrote: import collections def tally(seq): d = collections.defaultdict(int) for item in seq: d[item] += 1 return dict(d) I'll stop lurking and submit the following: def tally(seq

Re: [Python-Dev] tally (and other accumulators)

2006-04-04 Thread Jess Austin
Alex wrote: import collections def tally(seq): d = collections.defaultdict(int) for item in seq: d[item] += 1 return dict(d) I'll stop lurking and submit the following: def tally(seq): return dict((group[0], len(tuple(group[1]))) for group in