]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
python/nt_time: have a go at using 1_000_000 number separators.
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Fri, 23 Feb 2024 03:23:03 +0000 (16:23 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 29 Feb 2024 04:01:40 +0000 (04:01 +0000)
I noticed these are available in Python 3.6+, which is what we support,
and they're arguably nicer than using exponentiation.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/nt_time.py

index 347ff5ad7f09f6725d3d0c37bab30aa9b5c16dac..496dde576b4cd70b8cadf0523b54ed79ccfc5a62 100644 (file)
@@ -28,7 +28,7 @@ NtTimeDelta = NewType("NtTimeDelta", int)
 
 NT_EPOCH = datetime.datetime(1601, 1, 1, 0, 0, 0, 0, tzinfo=datetime.timezone.utc)
 NT_TICKS_PER_μSEC = 10
-NT_TICKS_PER_SEC = NT_TICKS_PER_μSEC * 10**6
+NT_TICKS_PER_SEC = NT_TICKS_PER_μSEC * 1_000_000
 
 
 def _validate_nt_time(nt_time: NtTime) -> None: