cosmopolitan/third_party/python/Modules
Justine Tunney dd8544c3bd
Delve into clock rabbit hole
The worst issue I had with consts.sh for clock_gettime is how it defined
too many clocks. So I looked into these clocks all day to figure out how
how they overlap in functionality. I discovered counter-intuitive things
such as how CLOCK_MONOTONIC should be CLOCK_UPTIME on MacOS and BSD, and
that CLOCK_BOOTTIME should be CLOCK_MONOTONIC on MacOS / BSD. Windows 10
also has some incredible new APIs, that let us simplify clock_gettime().

  - Linux CLOCK_REALTIME         -> GetSystemTimePreciseAsFileTime()
  - Linux CLOCK_MONOTONIC        -> QueryUnbiasedInterruptTimePrecise()
  - Linux CLOCK_MONOTONIC_RAW    -> QueryUnbiasedInterruptTimePrecise()
  - Linux CLOCK_REALTIME_COARSE  -> GetSystemTimeAsFileTime()
  - Linux CLOCK_MONOTONIC_COARSE -> QueryUnbiasedInterruptTime()
  - Linux CLOCK_BOOTTIME         -> QueryInterruptTimePrecise()

Documentation on the clock crew has been added to clock_gettime() in the
docstring and in redbean's documentation too. You can read that to learn
interesting facts about eight essential clocks that survived this purge.
This is original research you will not find on Google, OpenAI, or Claude

I've tested this change by porting *NSYNC to become fully clock agnostic
since it has extensive tests for spotting irregularities in time. I have
also included these tests in the default build so they no longer need to
be run manually. Both CLOCK_REALTIME and CLOCK_MONOTONIC are good across
the entire amd64 and arm64 test fleets.
2024-09-04 01:32:46 -07:00
..
_decimal Fix ctype.h and wctype.h 2024-07-21 15:54:17 -07:00
_io flip et / noet in modelines 2023-12-07 22:17:11 -05:00
_multiprocessing flip et / noet in modelines 2023-12-07 22:17:11 -05:00
_sqlite Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
cjkcodecs flip et / noet in modelines 2023-12-07 22:17:11 -05:00
clinic Reduce header complexity 2023-11-28 14:39:42 -08:00
expat Implement proper time zone support 2024-05-04 23:06:37 -07:00
_asynciomodule.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
_bisectmodule.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
_bz2module.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
_codecsmodule.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
_collectionsmodule.c Reduce header complexity 2023-11-28 14:39:42 -08:00
_cryptmodule.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
_csv.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
_datetimemodule.c Implement proper time zone support 2024-05-04 23:06:37 -07:00
_dbmmodule.c Reduce header complexity 2023-11-28 14:39:42 -08:00
_elementtree.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
_functoolsmodule.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
_gdbmmodule.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
_hashmbedtls.c Remove .internal from more header filenames 2024-08-04 12:52:25 -07:00
_heapqmodule.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
_json.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
_localemodule.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
_lol3.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
_lsprof.c Implement proper time zone support 2024-05-04 23:06:37 -07:00
_lzmamodule.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
_math.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
_math.h Reduce header complexity 2023-11-28 14:39:42 -08:00
_opcode.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
_operator.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
_pickle.c Retire third_party/quickjs/ 2024-01-17 12:35:46 -08:00
_posixsubprocess.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
_randommodule.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
_sre.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
_stat.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
_struct.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
_testbuffer.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
_testcapimodule.c Implement proper time zone support 2024-05-04 23:06:37 -07:00
_testmultiphase.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
_threadmodule.c Implement proper time zone support 2024-05-04 23:06:37 -07:00
_tracemalloc.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
_weakref.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
_winapi.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
arraymodule.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
atexitmodule.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
audioop.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
bextra.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
bextra.h Reduce header complexity 2023-11-28 14:39:42 -08:00
binascii.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
cmathmodule.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
config.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
errnomodule.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
faulthandler.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
fcntlmodule.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
fpectlmodule.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
fpetestmodule.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
fspath.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
gcmodule.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
getbuildinfo.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
getpath.c Bring back gc() function 2024-01-08 10:26:28 -08:00
grpmodule.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
hashlib.h Reduce header complexity 2023-11-28 14:39:42 -08:00
hashtable.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
hashtable.h Reduce header complexity 2023-11-28 14:39:42 -08:00
itertoolsmodule.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
main.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
mathmodule.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
mmapmodule.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
ossaudiodev.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
overlapped.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
parsermodule.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
posixmodule.c Implement proper time zone support 2024-05-04 23:06:37 -07:00
posixmodule.h Make numerous improvements 2021-09-28 01:52:34 -07:00
pwdmodule.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
pyexpat.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
README python-3.6.zip added from Github 2021-08-09 05:39:42 -07:00
resource.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
rotatingtree.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
rotatingtree.h Reduce header complexity 2023-11-28 14:39:42 -08:00
selectmodule.c Fix bugs in poll(), select(), ppoll(), and pselect() 2024-09-02 00:29:52 -07:00
signalmodule.c Implement proper time zone support 2024-05-04 23:06:37 -07:00
socketmodule.c Update Musl Libc code 2024-07-30 22:51:29 -07:00
socketmodule.h Update Musl Libc code 2024-07-30 22:51:29 -07:00
spwdmodule.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
sre.h Make numerous improvements 2021-09-28 01:52:34 -07:00
sre_constants.h Reduce header complexity 2023-11-28 14:39:42 -08:00
sre_lib.inc flip et / noet in modelines 2023-12-07 22:17:11 -05:00
symtablemodule.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
syslogmodule.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
termios.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
testcapi_long.inc flip et / noet in modelines 2023-12-07 22:17:11 -05:00
timemodule.c Delve into clock rabbit hole 2024-09-04 01:32:46 -07:00
tkinter.h Reduce header complexity 2023-11-28 14:39:42 -08:00
tlsmodule.c Remove .internal from more header filenames 2024-08-04 12:52:25 -07:00
tokenbucket.c Remove .internal from more header filenames 2024-08-04 12:52:25 -07:00
unicodedata.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
unicodedata.h Reduce header complexity 2023-11-28 14:39:42 -08:00
unicodedata_3.2.0.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
unicodedata_aliases.c Reduce header complexity 2023-11-28 14:39:42 -08:00
unicodedata_bidirectionalnames.c Reduce header complexity 2023-11-28 14:39:42 -08:00
unicodedata_categorynames.c Reduce header complexity 2023-11-28 14:39:42 -08:00
unicodedata_codehash.c Reduce header complexity 2023-11-28 14:39:42 -08:00
unicodedata_comp.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
unicodedata_decomp.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
unicodedata_decompprefix.c Reduce header complexity 2023-11-28 14:39:42 -08:00
unicodedata_eastasianwidthnames.c Reduce header complexity 2023-11-28 14:39:42 -08:00
unicodedata_extendedcase.c Reduce header complexity 2023-11-28 14:39:42 -08:00
unicodedata_findnfcindex.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
unicodedata_getcode.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
unicodedata_getdecomprecord.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
unicodedata_getrecord.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
unicodedata_islinebreak.c Reduce header complexity 2023-11-28 14:39:42 -08:00
unicodedata_isnormalized.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
unicodedata_isunifiedideograph.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
unicodedata_iswhitespace.c Reduce header complexity 2023-11-28 14:39:42 -08:00
unicodedata_lexicon.c Reduce header complexity 2023-11-28 14:39:42 -08:00
unicodedata_namedsequences.c Reduce header complexity 2023-11-28 14:39:42 -08:00
unicodedata_nfcfirst.c Reduce header complexity 2023-11-28 14:39:42 -08:00
unicodedata_nfclast.c Reduce header complexity 2023-11-28 14:39:42 -08:00
unicodedata_nfcnfkc.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
unicodedata_nfdnfkd.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
unicodedata_phrasebook.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
unicodedata_records.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
unicodedata_tonumeric.c Reduce header complexity 2023-11-28 14:39:42 -08:00
unicodedata_typerecords.c Release Cosmopolitan v3.3 2024-02-20 13:27:59 -08:00
unicodedata_ucd.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
unicodedata_unidata.h Productionize new APE loader and more 2021-10-02 08:27:03 -07:00
winreparse.h Reduce header complexity 2023-11-28 14:39:42 -08:00
xxlimited.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
xxmodule.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00
xxsubtype.c Implement proper time zone support 2024-05-04 23:06:37 -07:00
zipimport.c Implement proper time zone support 2024-05-04 23:06:37 -07:00
zlibmodule.c flip et / noet in modelines 2023-12-07 22:17:11 -05:00

Source files for standard library extension modules,
and former extension modules that are now builtin modules.