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 to be backwards (this do
On Thu, Apr 16, 2009 at 08:18, Jess Austin wrote:
> hi,
>
> I'm new to python core development, and I've been advised to write to
> python-dev concerning a feature/patch I've placed at
> http://bugs.python.org/issue5434, with Rietveld at
> http://codereview.appspot.com/25079.
>
> This patch adds a
On Fri, Apr 17, 2009, BJ?rn Lindqvist wrote:
>
> It's not only about what people find intuitive. Why care about them?
> Most persons aren't programmers. It is about what application
> developers find useful too. I have often needed to calculate month
> deltas according to the proposal. I suspect ma
It's not only about what people find intuitive. Why care about them?
Most persons aren't programmers. It is about what application
developers find useful too. I have often needed to calculate month
deltas according to the proposal. I suspect many other programmers
have too. Writing a month add func
>> "2rd of March on leap years,
> ^^^
> The turd of March?
Yeah, it's from a little known Shakespearean play about a benevolent
dictator, Guidius van Rossumus. The name of the play escapes me at the
moment, but there's this critical scene where the BDFL is in mortal danger
because
James Y Knight fuhm.net> writes:
>
> It's a human-interface operation, and as such, everyone (ahem) "knows
> what it means" to say "2 months from now", but the details don't
> usually have to be thought about too much.
I don't think it's true. When you say "2 months from now", some people wi
Jess Austin gmail.com> writes:
>
> I have worked in utility/telecom billing, and needed to examine large
> numbers of invoice dates, fulfillment dates, disconnection dates,
> payment dates, collection event dates, etc. There would often be
> particular rules for the relationships among these dat
-On [20090417 04:55], s...@pobox.com (s...@pobox.com) wrote:
>Again, I think it needs to bake a bit. I understand the desire and need for
>doing date arithmetic with months. Python is mature enough though that I
>don't think you can just "toss this in". It should be available as a module
>outsid
On 2009-04-16 21:55, s...@pobox.com wrote:
Jess> If, on the other hand, one of the committers wants to toss this in
Jess> at some point, whether now or 3 versions down the road, the patch
Jess> is up at bugs.python.org (and I'm happy to make any suggested
Jess> modificatio
Steven D'Aprano wrote:
"2rd of March on leap years,
^^^
The turd of March?
--
Greg
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-de
Jess> If, on the other hand, one of the committers wants to toss this in
Jess> at some point, whether now or 3 versions down the road, the patch
Jess> is up at bugs.python.org (and I'm happy to make any suggested
Jess> modifications).
Again, I think it needs to bake a bit. I unde
On Fri, 17 Apr 2009 07:47:14 am 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 which kind of situ
On 16 Apr, 11:11 pm, f...@fuhm.net wrote:
On Apr 16, 2009, at 5:47 PM, Antoine Pitrou wrote:
It's a human-interface operation, and as such, everyone (ahem) "knows
what it means" to say "2 months from now", but the details don't
usually have to be thought about too much. Of course when you ha
On Fri, 17 Apr 2009 12:29:11 pm Steven D'Aprano wrote:
> Adding one month to 31st January could mean:
>
> 1: raise an exception
> 2: return 28th February (last day of February)
> 3: return 3rd April (1 month = 31 days)
> 4: return 2nd April (1 month = 30 days)
> 5: return 28th February (1 month =
On Fri, 17 Apr 2009 07:41:19 am Jess Austin wrote:
> Others have suggested raising an exception when a month calculation
> lands on an invalid date. Python already has that; it's spelled like
>
> this:
> >>> dt = date(2008, 1, 31)
> >>> dt.replace(month=dt.month + 1)
>
> Traceback (most recent ca
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
My thoughts on balance regarding monthdeltas:
-- Month operations are useful, people will want to do them
-- I think having a monthdelta object rather than a method makes sense to
me
-- I think the documentation is severely underdone. The functionality is
not intuitive
and therefore the
>> 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) + monthdelta(1)
datetime.date(2008, 2, 29)
>>> dat
On Apr 16, 2009, at 5:47 PM, Antoine Pitrou wrote:
IMHO, the question is rather what the use case is for the behaviour
you are
proposing. In which kind of situation is it acceptable to turn 31/2
silently
into 29/2?
Essentially any situation in which you'd actually want a "next month"
oper
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 which kind of situation is it acceptable to turn
On 2009-04-16 17:17, Paul Moore wrote:
2009/4/16 Robert Kern:
from dateutil.relativedelta import *
dt = relativedelta(months=1)
dt
relativedelta(months=+1)
from datetime import datetime
datetime(2009, 1, 15) + dt
datetime.datetime(2009, 2, 15, 0, 0)
datetime(2009, 1, 31) + dt
datetime.dat
2009/4/16 Robert Kern :
> On 2009-04-16 13:42, Paul Moore wrote:
>>
>> 2009/4/16 Ned Deily:
>>>
>>> In article
>>> ,
>>> Jess Austin wrote:
I'm new to python core development, and I've been advised to write to
python-dev concerning a feature/patch I've placed at
http://bugs.py
Jess Austin wrote:
What other behavior options besides "last-valid-day-of-the-month"
would you like to see?
- Add 30 days to the source date.
I'm sure there are others.
Followups to python-ideas.
___
Python-Dev mailing list
Python-Dev@python.org
htt
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 which kind of situation is it acceptable to turn 31/2 silently
into 29/2?
___
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
On 2009-04-16 13:42, Paul Moore wrote:
2009/4/16 Ned Deily:
In article
,
Jess Austin wrote:
I'm new to python core development, and I've been advised to write to
python-dev concerning a feature/patch I've placed at
http://bugs.python.org/issue5434, with Rietveld at
http://codereview.appspot.
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
following be?
print(date(200
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
2009/4/16 Ned Deily :
> In article
> ,
> Jess Austin wrote:
>> I'm new to python core development, and I've been advised to write to
>> python-dev concerning a feature/patch I've placed at
>> http://bugs.python.org/issue5434, with Rietveld at
>> http://codereview.appspot.com/25079.
>
> Without ha
2009/4/16 Antoine Pitrou :
> Paul Moore gmail.com> writes:
>>
>> Oh, certainly! But in the absence of "intuitive", I've found in the
>> past that "standardised" is often better than nothing (For
>> example, I use Oracle's add_months function fairly often - it's not
>> perfect, and not always intu
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
In article
,
Jess Austin wrote:
> I'm new to python core development, and I've been advised to write to
> python-dev concerning a feature/patch I've placed at
> http://bugs.python.org/issue5434, with Rietveld at
> http://codereview.appspot.com/25079.
Without having looked at the code, I wonder
Paul Moore gmail.com> writes:
>
> Oh, certainly! But in the absence of "intuitive", I've found in the
> past that "standardised" is often better than nothing (For
> example, I use Oracle's add_months function fairly often - it's not
> perfect, and not always intuitive, but at least it's well-def
2009/4/16 :
> >>> 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)
>
> I have this funny feeling that arithmetic using monthdelta wouldn't always
> be intuitive.
2009/4/16 Jess Austin :
> I'm new to python core development, and I've been advised to write to
> python-dev concerning a feature/patch I've placed at
> http://bugs.python.org/issue5434, with Rietveld at
> http://codereview.appspot.com/25079.
>
> This patch adds a "monthdelta" class and a "monthmod
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 date,
> > rather than an
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 manipulation, it should be a function
> or a method, like you would do
On Thu, Apr 16, 2009 at 10:45, 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)
>
> I have this funny feeling that arithmetic using monthdelta would
On Apr 16, 2009, at 1:10 AM, 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 date,
rather than an exact period offset from a
>>> 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)
I have this funny feeling that arithmetic using monthdelta wouldn't always
be intuitive.
Skip
On Thu, Apr 16, 2009 at 01:18:01AM -0500, Jess Austin wrote:
> I'm new to python core development, and I've been advised to write to
> python-dev concerning a feature/patch I've placed at
> http://bugs.python.org/issue5434, with Rietveld at
> http://codereview.appspot.com/25079.
I have read the
Hi Jess,
I'm sorry if I'm failing to understand the use of this function from not
looking closely at your code. I'm a bit dubious about the usefulness of this
(I'm not sure I understand the use cases), but I'm very open to being
convinced. Datetime semantics are very important in some areas -- I u
44 matches
Mail list logo