I have started [1] writing documentation for the new PEP 495 (Local Time Disambiguation) features and ran into the following problem. The current documentation is rather inconsistent in presenting the method signatures. For example:
date.replace(year, month, day) [2], but datetime.replace([year[, month[, day[, hour[, minute[, second[, microsecond[, tzinfo]]]]]]]]) [3]. The new signature for datetime.replace in the Python implementation is def replace(self, hour=None, minute=None, second=None, microsecond=None, tzinfo=True, *, fold=None): but the C implementation does not accept True for tzinfo or None for the other arguments. The defaults in the Python implementation are really just sentinels to detect which arguments are not provided. How should I present the signature of the new replace method in the documentation? [1]: http://bugs.python.org/issue27595 [2]: https://docs.python.org/3/library/datetime.html#datetime.date.replace [3]: https://docs.python.org/3/library/datetime.html#datetime.datetime.replace _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com