6 5 New Modules 5.1 zoneinfo 5.2 graphlib 6 Improved Modules 6.1 ast Added the indent option to$_{dump()}$ which allows it to produce a multiline indented output. (Contributed by Serhiy Storchaka in bpo-37995.) Added$_{ast.unparse()}$ as a function in the$_{ast}$module that can be used to unparse an$_{ast.AST}$object and produce a string with code that would produce an equivalent$_{ast.AST}$object when parsed. (Contributed by Pablo Galindo and Batuhan Taskaya in bpo-38870.) Added docstrings to AST nodes that contains the ASDL signature used to construct that node. (Contributed by Batuhan Taskaya in bpo-39638.) A new module,$_{graphlib}$, was added that contains the$_{graphlib.TopologicalSorter}$ class to offer func- tionality to perform topological sorting of graphs. (Contributed by Pablo Galindo, Tim Peters and Larry Hastings in bpo-17005.) As a fall-back source of data for platforms that don’t ship the IANA database, the$_{tzdata}$ module was released as a first-party package – distributed via PyPI and maintained by the CPython core team. See also: PEP 615 – Support for the IANA Time Zone Database in the Standard Library PEP written and imple- mented by Paul Ganssle >>> from zoneinfo import ZoneInfo >>> from datetime import datetime, timedelta >>> # Daylight saving time >>> dt =datetime(2020 ,10 ,31 ,12 , tzinfo=ZoneInfo("America/Los_Angeles")) >>> print(dt) 2020-10-31 12:00:00-07:00 >>> dt.tzname() 'PDT' >>> # Standard time >>> dt +=timedelta(days =7) >>> print(dt) 2020-11-07 12:00:00-08:00 >>> print(dt.tzname()) PST The zoneinfo module brings support for the IANA time zone database to the standard library. It adds $_{zoneinfo.ZoneInfo}$, a concrete$_{datetime.tzinfo}$ implementation backed by the system’s time zone data. Example: