In unpacking assignments, an unstarred target list must have the correct number of targets. (Assignment statements)
math.ceil could return a float or an Integral type when passed a float, and should return an Integral when passed other types. To convert the float to an int, you can use round without ndigits. To convert an Integral (including int) to an int, you should be able to use the int constructor.
round without ndigits converts float to int. In general it should return an Integral, which should be convertable to int with the int constructor.
cgi.parse_multipart(fp, pdict): fp is a BufferedIOBase reader; pdict is a mapping and must have the lowercase text key “boundary”, with a value in bytes. The result is different to parse_qs in that the keys are the field names in text, but the value list items are byte strings, not decoded to text.
cgi.parse_header works with text strings of the Content-Type header field format. It returns a tuple of two items; the first is the raw type/subtype string; the second is a dictionary mapping attribute=value pairs. Attribute names are converted to lowercase, and their values are de-quoted.
In a character set “[. . .]”, put the closing square bracket “]” at the start to count as a regular character or the start[?] of a character range. (Escaping it with a backslash, “\]”, also specifies a regular character.) Put the ASCII hyphen “-” at the end to count as a single character (or escape it with a backslash, or put it at the start). You cannot have a range ending in a closing square bracket. The ASCII caret “^” has to be after the first character to lose its special meaning. The opening square bracket “[” cannot be the first character in the set.
The six special sequence character classes (\d, \D, \s, \S, \w, and \W) are accepted within a character set / character class that uses square brackets (How-to). The escape sequence \b specifies the backspace control character. It is not clear how to specify a backslash in a character set. It may be safer to put it as an alternative to the character set: (?:[. . .] | \\).
Unclear if other escape sequences are valid inside square bracket character sets. Better to encode them directly (without raw strings)The ConfigParser.get method has a keyword-only fallback parameter, and the config option is presumed to exist if no fallback is given. However the “mapping protocol access” ConfigParser[section].get method is compatible with dict.get. You cannot use any setdefault methods; the mapping protocol access is supposed have them, but their signatures and behaviour are not defined.
Section objects (ConfigParser[section]) include getter converters corresponding to ConfigParser by default: getint, getfloat and getboolean. Their signatures are compatible with (key, *, / [, fallback]). (Fallback Values)
Members: __str__ is a “human-readable” representation; __repr__ includes that and more information.
The time.time function is only guaranteed 1 s precision. Outside of Windows, whether leap seconds are considered can vary, and the zero reference point (“epoch”) can also vary before Python 3.11. The range can be limited to 1970–2038. On the other hand, datetime.datetime.now is supposed to have better precision where possible, and datetime objects have better range and always count 60 s per minute.
For time.strptime, it is implied that non-directive punctuation in the format string matches corresponding literal punctuation in the parsed value. It is implied that the format ' %d' can handle a doubled space instead of a leading zero.
For datetime module strptime methods, many numeric directives allow a leading zero to be omitted. It is implied that multiple leading zeros could be omitted, as long as some digits remain. However, multiple numeric fields should not be bunched up without punctuation unless all leading zeros are included.