Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

No problem is insoluble. -- Dr. Janet Wallace, "The Deadly Years", stardate 3479.4


devel / comp.lang.python / Re: Pre-Pre-PEP: The datetime.timedeltacal class

SubjectAuthor
o Re: Pre-Pre-PEP: The datetime.timedeltacal classRandom832

1
Re: Pre-Pre-PEP: The datetime.timedeltacal class

<mailman.162.1650406829.20749.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=17926&group=comp.lang.python#17926

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: random...@fastmail.com (Random832)
Newsgroups: comp.lang.python
Subject: Re: Pre-Pre-PEP: The datetime.timedeltacal class
Date: Tue, 19 Apr 2022 18:19:59 -0400
Lines: 17
Message-ID: <mailman.162.1650406829.20749.python-list@python.org>
References: <20220416173551.fk6voaa3o25iuewm@hjp.at>
<4bf6b4bf-f2b5-4a59-a72c-e7bfaa84293f@www.fastmail.com>
Mime-Version: 1.0
Content-Type: text/plain
X-Trace: news.uni-berlin.de 3bRHgVC36SNx14G0pxprrQU0hMf0lgmco1pyXcV3b0VA==
Return-Path: <random832@fastmail.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=fastmail.com header.i=@fastmail.com header.b=vWLVN1Yz;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.125
X-Spam-Level: *
X-Spam-Evidence: '*H*': 0.75; '*S*': 0.00; '(e.g.': 0.05; 'datetime':
0.09; 'subject:class': 0.09; '2022,': 0.16; 'bite': 0.16;
'daylight': 0.16; 'from:addr:fastmail.com': 0.16; 'holzer': 0.16;
'received:10.202': 0.16; 'received:10.202.2': 0.16;
'received:internal': 0.16; 'received:messagingengine.com': 0.16;
'subject:Pre': 0.16; 'subject:skip:d 20': 0.16; 'wrote:': 0.16;
'uses': 0.19; '16,': 0.19; 'to:addr:python-list': 0.20; 'input':
0.21; 'sat,': 0.22; 'do,': 0.26; 'object': 0.26; 'header:User-
Agent:1': 0.30; "doesn't": 0.32; 'concerned': 0.32; 'same,': 0.32;
'specified': 0.32; "i'm": 0.33; 'header:In-Reply-To:1': 0.34;
'months': 0.35; 'received:66': 0.35; 'also,': 0.36; 'possibly':
0.36; 'though': 0.37; 'added': 0.39; 'adding': 0.39; 'least':
0.39; 'handle': 0.39; 'subject:PEP': 0.39; 'calendar': 0.40;
'seconds': 0.40; 'something': 0.40; 'included': 0.61; "there's":
0.61; 'day,': 0.62; 'finally': 0.62; 'here': 0.62; 'come': 0.62;
'hours': 0.63; 'research': 0.64; 'look': 0.65; 'received:userid':
0.66; 'day': 0.66; 'time.': 0.66; 'back': 0.67; 'depending': 0.70;
'subject:The': 0.70; 'choice': 0.76; 'guarantee': 0.76; 'zone':
0.76; 'direction.': 0.84; 'savings': 0.84; 'opposite': 0.91;
'performs': 0.93
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h=
cc:content-type:date:date:from:from:in-reply-to:in-reply-to
:message-id:mime-version:references:reply-to:sender:subject
:subject:to:to; s=fm1; t=1650406827; x=1650493227; bh=vdCTcvD0rJ
lCTrW5CE4UPkDk8rlJQNEgW+77DEtOuI8=; b=vWLVN1YzZlhpKlps5Q+vUYfgN/
WN7n6y/D44WqfWECw3vFyRra82tlxG6Bv0fHb8FGol2GZG6kzx8cf7eoYuF8l8aO
6pgElrI2OYlJJTuS4RzSjeTwGnWwDm1iybvuzYdAtVy+PfhVqSryZG9kDK6W8xxf
r+VJYk3/fk1XBeSsOT4gTlrvsR7u7x92RbZcGRWCy6hj3xXKnrz6YcczRh8xwElW
/XfzdsP0i+f+8zy1ze9mr+le+ugSNy7JjoibYAJ3TWmCrwkJHuTMRevoaT/VgfI3
9XHhnixD/OUQ07492e5DZtCnt/yaF2CdLxtIbvxoK2XDhvGm63hlYNAU/PuA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
messagingengine.com; h=cc:content-type:date:date:from:from
:in-reply-to:in-reply-to:message-id:mime-version:references
:reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy
:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1650406827; x=
1650493227; bh=vdCTcvD0rJlCTrW5CE4UPkDk8rlJQNEgW+77DEtOuI8=; b=A
dlPXSpUzaw0XYmIyL0KkIgJ+dANEhIRyf/dLGNmdKBsll1JX8A6sReO0x3fJ6zpW
nfwJTHUU0x0gDY7pkWOT4qjSomSHPtH2US5t/36dZHLQluNJjVj/DBqQjlrae0UX
+fUBcZ/iniODObO1RG+0QEDI8tcqOef7tJYRXqAkfR+VvbyPQBCVpJoPKQiXxta8
lwfW0YDz9vbWhsK4FBuDR0lw4SQZ5pglY6QOSBcbES15IuPZAkVYICFR5yRADwdR
mxptXBi/nhX//gngAUKhQb7Y5U/He8FNdJbE2SAiVknkTjAR4o7g/Dp78gicBKWJ
MRtrvBxolYeWH/L9NW56A==
X-ME-Sender: <xms:qzVfYscYw6vaUJhRKeF6QpPSzZLrFimNFOT9goi27mefDf3Pio7pnw>
<xme:qzVfYuNyvhvgoKtmE5MtwwsqWJcdFrufEx85bHs8SqQbOp8OTGSGbWDhREa2Hmul5
ITm5eJYEEhkbuqU>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrvddtgedgtdekucetufdoteggodetrfdotf
fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
cujfgurhepofgfggfkjghffffhvffutgesthdtredtreertdenucfhrhhomheptfgrnhgu
ohhmkeefvdcuoehrrghnughomhekfedvsehfrghsthhmrghilhdrtghomheqnecuggftrf
grthhtvghrnhepieefvedtveelffehudejgfejieffffehleetfeefheelkeeuheelfeeu
leegudffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh
eprhgrnhguohhmkeefvdesfhgrshhtmhgrihhlrdgtohhm
X-ME-Proxy: <xmx:qzVfYtg086WgNqu82kBlWibewUTiLN-KPx7vNvFvuiWx37f6Em2m1g>
<xmx:qzVfYh_8CnbGXQ6ezK-I1lP3nWR-6vSyZrkc12TqdTeGmy54R-Uxgw>
<xmx:qzVfYov3CKynCLJ8qAZIe5DxXqmeg5Fb24F_VPLpF6U9UXsFPsz5nA>
<xmx:qzVfYm41nQp6hFwdHcfEH4dQj5LM4_IkKGQ1JXvn3usIDaaQMYyryA>
X-Mailer: MessagingEngine.com Webmail Interface
User-Agent: Cyrus-JMAP/3.7.0-alpha0-568-g521196dd5d-fm-20220414.001-g521196dd
In-Reply-To: <20220416173551.fk6voaa3o25iuewm@hjp.at>
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <4bf6b4bf-f2b5-4a59-a72c-e7bfaa84293f@www.fastmail.com>
X-Mailman-Original-References: <20220416173551.fk6voaa3o25iuewm@hjp.at>
 by: Random832 - Tue, 19 Apr 2022 22:19 UTC

On Sat, Apr 16, 2022, at 13:35, Peter J. Holzer wrote:
> When adding a timedeltacal object to a datetime, the fields are added
> from most to least significant: First a new date is computed by
> advancing the number of months specified [TODO: Research how other
> systems handle overflow (e.g. 2022-01-31 + 1 month: 2022-02-31 doesn't
> exist)], then advance the number of days. Finally add the number of
> seconds and microseconds, taking into accout daylight savings time
> switches if the datetime is time zone aware.
>
> Subtracting a timedeltacal object from a datetime is the same, just in
> the opposite direction.
>
> Note that t + d - d is in general not equal to t.

I'm not sure there's a guarantee that t + n day + m second may not be equal to t + m second + n day, either. This is possibly also something that we can look at what existing implementations do, though I'm concerned that the choice of "fold" rather than "isdst" may come back to bite us here [C actually uses a three-state isdst input for mktime which performs these operations]

Also, what about hours? "12 calendar hours" may be 13 or 11 hours depending on if a DST transition is included in the given time.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor