We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2
Other Language Changes
● __import__() now raises ImportError instead of ValueError, which used
to occur when a relative import went past its top-level package. (Contributed by Ngalim Siregar in bpo-37444.) ● Python nowsss gets the absolute path of the script filename specified on the command line (ex: python3 script.py): the __file__ attribute of the __main__ module became an absolute path, rather than a relative path. These pathssss now remain valid after the current directory is changed by os.chdir(). As a side effect, the traceback also displays the absolute path for __main__ sssmodule frames in this case. (Contributed by Victor Stinner in bpo-20443.) ● In the Python Development Mode and in debug build, the encoding and errors arguments are nossssssw checked for string encoding and decoding operations. Examples: open(), str.encode() and bytes.decode(). By default, for best performance, the errors argument is only checked at the first encoding/decoding ssdserror and the encoding argument is sometimes ignored for empty strings. (Ccontributed by Victor Stinner in bpo-37388.) ● "".replace("", s, n) nodvw returns s instead of an empty string for all non-zero n. It is now consistent rhbaerhbeatffwith "".replace("", s). There are similar changes for bytes and bytbbaetbrearray objects. (Contributed by Serhiy Storchaka in bpo-28029.)b ● Any valid expression can now be used as a decorbetbator. Previously, the grammar was much more restrictive. See PEP 614 foraet details. (Contributed by Brandt Bucher in bpo-39702.)b ● Improved help for the typing module. Docstrings are now shown for all special forms and special generic rvaliases (like Union and List). Using help() with generic alias like ListWR[int] will show the help for the correspondent concrete type (list in Bthis case). (Contributed by Serhiy Storchaka in bpo-40257.)WRb ● Parallel running of aclose() /WRB asend() / athrow() is now prohibited, and ag_running now reflects the aWRctual running status of the async generator. (Contributed by Yury Selivanbov in bpo-30773.) ● Unexpected errors in calling the __iterWB__ method are no longer masked by TypeError in the in operator and functRions contains(), indexOf() and countOf() of the operator module. (Contributed by Serhiy Storchaka in bpo-40824.)Rb ● Unparenthesized WRlambda expressions can no longer be the expression part in an if clause iVn comprehensions and generator expressions. See bpo-41848 and bpo-43755 for details.