Zeitpunkt Nutzer Delta Tröts TNR Titel Version maxTL Sa 06.07.2024 00:00:28 51.030 +43 2.171.323 42,5 Vivaldi Social 4.2.10 1.337 Fr 05.07.2024 00:00:08 50.987 +26 2.167.586 42,5 Vivaldi Social 4.2.10 1.337 Do 04.07.2024 00:00:11 50.961 +42 2.163.949 42,5 Vivaldi Social 4.2.9 1.337 Mi 03.07.2024 00:00:04 50.919 +42 2.160.792 42,4 Vivaldi Social 4.2.9 1.337 Di 02.07.2024 00:01:14 50.877 +42 2.156.674 42,4 Vivaldi Social 4.2.9 1.337 Mo 01.07.2024 00:01:17 50.835 +40 2.153.375 42,4 Vivaldi Social 4.2.9 1.337 So 30.06.2024 00:00:05 50.795 +42 2.150.142 42,3 Vivaldi Social 4.2.9 1.337 Sa 29.06.2024 00:03:01 50.753 +38 2.148.751 42,3 Vivaldi Social 4.2.9 1.337 Fr 28.06.2024 00:04:34 50.715 +56 2.144.639 42,3 Vivaldi Social 4.2.9 1.337 Do 27.06.2024 00:00:09 50.659 0 2.144.966 42,3 Vivaldi Social 4.2.9 1.337
pelavarre (@pelavarre) · 11/2022 · Tröts: 1.773 · Folger: 59
Sa 06.07.2024 21:12
Python 3 will let you escape this mess, but not simply
a ) Str vs Int counts as a mix of datatypes, but None vs Str counts as a mix too, so still a bit wrong here, at key=str
$ python3 -c 'print(sorted([None, 3, 50, 100, "pdfa", "pdfb"], key=str))'
[100, 3, 50, None, 'pdfa', 'pdfb']
$
b ) Still a bit wrong here, if you mix "" Empty Str with None Not-a-Str, at key=lambda
$ python3 -c 'print(sorted(["", None, "", 3, 50, 100, "pdfa", "pdfb"], key=lambda _: "" if (_ is None) else str(_)))'
['', None, '', 100, 3, 50, 'pdfa', 'pdfb']
$
Finally we can get Python 3 back to something more reasonably relaxed, like Python 2, with enough Code packed into the Key Lambda
$ python3 -c 'print(sorted(["", None, "", 3, 50, 100, "pdfa", "pdfb"], key=lambda _: "" if (_ is None) else ("s" + str(_))))'
[None, '', '', 100, 3, 50, 'pdfa', 'pdfb']
$
Is there a better way to say don't bother me about this, in Python 3?
I wish there were, I fear there isn't
# PyThOn Is EaSy
@shriramk for your PyThOn collection 💙 💛
[Öffentlich] Antw.: 0 Wtrl.: 0 Fav.: 0 · via Web