On Mon, Jun 22, 2010 at 7:27:31 PM, Steven D'Aprano 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 character stream.
>
On Thu, Apr 16, 2009 at 8:01 PM, Jess Austin 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
On Thu, Apr 16, 2009 at 7:18 PM, 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) + monthd
Antoine Pitrou wrote:
> Jess Austin 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
Jon Ribbens 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 months offset from a
Jared Grubb 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 should the
>
Thanks for everyone's comments!
On Thu, Apr 16, 2009 at 9:54 AM, Paul Moore 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
> strong use case
On Thu, Apr 16, 2009 at 5:16 AM, Dirkjan Ochtman wrote:
> On Thu, Apr 16, 2009 at 11:54, Amaury Forgeot d'Arc
> 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 some kind of month manip
On Thu, Apr 16, 2009 at 4:54 AM, Amaury Forgeot d'Arc
wrote:
> FWIW, the Oracle database has two methods for adding months:
> 1- the add_months() function
> add_months(to_date('31-jan-2005'), 1)
> 2- the ANSI interval:
> to_date('31-jan-2005') + interval '1' month
>
> "add_months" is calenda
On Thu, Apr 16, 2009 at 3:45 AM, 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) + mont
e that
monthdeltas are "first-class" objects.
Please let me know what you think of the idea and/or its 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
On Tue, Mar 24, 2009 at 3:14 PM, Guido van Rossum wrote:
> Please don't do this. We need stable APIs. Trying to switch the entire
> community to use CapWord APIs for something as commonly used as
> datetime sounds like wasting a lot of cycles with no reason except the
> mythical "PEP 8 conformance
cts to have
CapWords names, and subclasses these objects to provide objects with
the old names. Use of methods (including __new__) of the derived
objects causes PendingDeprecations (if one has warning filters
appropriately set).
A warning: this patch requires the patch to the test refactoring at
I
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
> >> re
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
15 matches
Mail list logo