diff --git a/.scripts/poetry.lock b/.scripts/poetry.lock index 8243c0c0d0..7c0ba58669 100644 --- a/.scripts/poetry.lock +++ b/.scripts/poetry.lock @@ -173,13 +173,13 @@ files = [ [[package]] name = "hstspreload" -version = "2023.1.1" +version = "2024.1.5" description = "Chromium HSTS Preload list as a Python package" optional = false python-versions = ">=3.6" files = [ - {file = "hstspreload-2023.1.1-py3-none-any.whl", hash = "sha256:ac8a56dd603b4bf55292fc7a157e0deea18ee5e2e5c114d131da8949cc7a54bb"}, - {file = "hstspreload-2023.1.1.tar.gz", hash = "sha256:b2330a88b3fe3344c9eb431257e1ff3ae06c3bc2ff87ca686a5f253e2881a6c1"}, + {file = "hstspreload-2024.1.5-py3-none-any.whl", hash = "sha256:f2bb05cc456bdf38bd9da7c6aa40a7bd7fc60850e5b5a52861877cd7120eb783"}, + {file = "hstspreload-2024.1.5.tar.gz", hash = "sha256:f9ee02a6f8225543686a6a49b7227916e0cc663ed3c49389fa0a31d7a31469d9"}, ] [[package]] @@ -242,111 +242,96 @@ files = [ [[package]] name = "lxml" -version = "4.9.4" +version = "5.1.0" description = "Powerful and Pythonic XML processing library combining libxml2/libxslt with the ElementTree API." optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, != 3.4.*" +python-versions = ">=3.6" files = [ - {file = "lxml-4.9.4-cp27-cp27m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:e214025e23db238805a600f1f37bf9f9a15413c7bf5f9d6ae194f84980c78722"}, - {file = "lxml-4.9.4-cp27-cp27m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:ec53a09aee61d45e7dbe7e91252ff0491b6b5fee3d85b2d45b173d8ab453efc1"}, - {file = "lxml-4.9.4-cp27-cp27m-win32.whl", hash = "sha256:7d1d6c9e74c70ddf524e3c09d9dc0522aba9370708c2cb58680ea40174800013"}, - {file = "lxml-4.9.4-cp27-cp27m-win_amd64.whl", hash = "sha256:cb53669442895763e61df5c995f0e8361b61662f26c1b04ee82899c2789c8f69"}, - {file = "lxml-4.9.4-cp27-cp27mu-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:647bfe88b1997d7ae8d45dabc7c868d8cb0c8412a6e730a7651050b8c7289cf2"}, - {file = "lxml-4.9.4-cp27-cp27mu-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:4d973729ce04784906a19108054e1fd476bc85279a403ea1a72fdb051c76fa48"}, - {file = "lxml-4.9.4-cp310-cp310-macosx_11_0_x86_64.whl", hash = "sha256:056a17eaaf3da87a05523472ae84246f87ac2f29a53306466c22e60282e54ff8"}, - {file = "lxml-4.9.4-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:aaa5c173a26960fe67daa69aa93d6d6a1cd714a6eb13802d4e4bd1d24a530644"}, - {file = "lxml-4.9.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:647459b23594f370c1c01768edaa0ba0959afc39caeeb793b43158bb9bb6a663"}, - {file = "lxml-4.9.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:bdd9abccd0927673cffe601d2c6cdad1c9321bf3437a2f507d6b037ef91ea307"}, - {file = "lxml-4.9.4-cp310-cp310-manylinux_2_28_x86_64.whl", hash = "sha256:00e91573183ad273e242db5585b52670eddf92bacad095ce25c1e682da14ed91"}, - {file = "lxml-4.9.4-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:a602ed9bd2c7d85bd58592c28e101bd9ff9c718fbde06545a70945ffd5d11868"}, - {file = "lxml-4.9.4-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:de362ac8bc962408ad8fae28f3967ce1a262b5d63ab8cefb42662566737f1dc7"}, - {file = "lxml-4.9.4-cp310-cp310-win32.whl", hash = "sha256:33714fcf5af4ff7e70a49731a7cc8fd9ce910b9ac194f66eaa18c3cc0a4c02be"}, - {file = "lxml-4.9.4-cp310-cp310-win_amd64.whl", hash = "sha256:d3caa09e613ece43ac292fbed513a4bce170681a447d25ffcbc1b647d45a39c5"}, - {file = "lxml-4.9.4-cp311-cp311-macosx_11_0_universal2.whl", hash = "sha256:359a8b09d712df27849e0bcb62c6a3404e780b274b0b7e4c39a88826d1926c28"}, - {file = "lxml-4.9.4-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:43498ea734ccdfb92e1886dfedaebeb81178a241d39a79d5351ba2b671bff2b2"}, - {file = "lxml-4.9.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:4855161013dfb2b762e02b3f4d4a21cc7c6aec13c69e3bffbf5022b3e708dd97"}, - {file = "lxml-4.9.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:c71b5b860c5215fdbaa56f715bc218e45a98477f816b46cfde4a84d25b13274e"}, - {file = "lxml-4.9.4-cp311-cp311-manylinux_2_28_aarch64.whl", hash = "sha256:9a2b5915c333e4364367140443b59f09feae42184459b913f0f41b9fed55794a"}, - {file = "lxml-4.9.4-cp311-cp311-manylinux_2_28_x86_64.whl", hash = "sha256:d82411dbf4d3127b6cde7da0f9373e37ad3a43e89ef374965465928f01c2b979"}, - {file = "lxml-4.9.4-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:273473d34462ae6e97c0f4e517bd1bf9588aa67a1d47d93f760a1282640e24ac"}, - {file = "lxml-4.9.4-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:389d2b2e543b27962990ab529ac6720c3dded588cc6d0f6557eec153305a3622"}, - {file = "lxml-4.9.4-cp311-cp311-win32.whl", hash = "sha256:8aecb5a7f6f7f8fe9cac0bcadd39efaca8bbf8d1bf242e9f175cbe4c925116c3"}, - {file = "lxml-4.9.4-cp311-cp311-win_amd64.whl", hash = "sha256:c7721a3ef41591341388bb2265395ce522aba52f969d33dacd822da8f018aff8"}, - {file = "lxml-4.9.4-cp312-cp312-macosx_11_0_universal2.whl", hash = "sha256:dbcb2dc07308453db428a95a4d03259bd8caea97d7f0776842299f2d00c72fc8"}, - {file = "lxml-4.9.4-cp312-cp312-manylinux_2_28_aarch64.whl", hash = "sha256:01bf1df1db327e748dcb152d17389cf6d0a8c5d533ef9bab781e9d5037619229"}, - {file = "lxml-4.9.4-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:e8f9f93a23634cfafbad6e46ad7d09e0f4a25a2400e4a64b1b7b7c0fbaa06d9d"}, - {file = "lxml-4.9.4-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:3f3f00a9061605725df1816f5713d10cd94636347ed651abdbc75828df302b20"}, - {file = "lxml-4.9.4-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:953dd5481bd6252bd480d6ec431f61d7d87fdcbbb71b0d2bdcfc6ae00bb6fb10"}, - {file = "lxml-4.9.4-cp312-cp312-win32.whl", hash = "sha256:266f655d1baff9c47b52f529b5f6bec33f66042f65f7c56adde3fcf2ed62ae8b"}, - {file = "lxml-4.9.4-cp312-cp312-win_amd64.whl", hash = "sha256:f1faee2a831fe249e1bae9cbc68d3cd8a30f7e37851deee4d7962b17c410dd56"}, - {file = "lxml-4.9.4-cp35-cp35m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:23d891e5bdc12e2e506e7d225d6aa929e0a0368c9916c1fddefab88166e98b20"}, - {file = "lxml-4.9.4-cp35-cp35m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:e96a1788f24d03e8d61679f9881a883ecdf9c445a38f9ae3f3f193ab6c591c66"}, - {file = "lxml-4.9.4-cp36-cp36m-macosx_11_0_x86_64.whl", hash = "sha256:5557461f83bb7cc718bc9ee1f7156d50e31747e5b38d79cf40f79ab1447afd2d"}, - {file = "lxml-4.9.4-cp36-cp36m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:fdb325b7fba1e2c40b9b1db407f85642e32404131c08480dd652110fc908561b"}, - {file = "lxml-4.9.4-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3d74d4a3c4b8f7a1f676cedf8e84bcc57705a6d7925e6daef7a1e54ae543a197"}, - {file = "lxml-4.9.4-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:ac7674d1638df129d9cb4503d20ffc3922bd463c865ef3cb412f2c926108e9a4"}, - {file = "lxml-4.9.4-cp36-cp36m-manylinux_2_28_x86_64.whl", hash = "sha256:ddd92e18b783aeb86ad2132d84a4b795fc5ec612e3545c1b687e7747e66e2b53"}, - {file = "lxml-4.9.4-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2bd9ac6e44f2db368ef8986f3989a4cad3de4cd55dbdda536e253000c801bcc7"}, - {file = "lxml-4.9.4-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:bc354b1393dce46026ab13075f77b30e40b61b1a53e852e99d3cc5dd1af4bc85"}, - {file = "lxml-4.9.4-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:f836f39678cb47c9541f04d8ed4545719dc31ad850bf1832d6b4171e30d65d23"}, - {file = "lxml-4.9.4-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:9c131447768ed7bc05a02553d939e7f0e807e533441901dd504e217b76307745"}, - {file = "lxml-4.9.4-cp36-cp36m-win32.whl", hash = "sha256:bafa65e3acae612a7799ada439bd202403414ebe23f52e5b17f6ffc2eb98c2be"}, - {file = "lxml-4.9.4-cp36-cp36m-win_amd64.whl", hash = "sha256:6197c3f3c0b960ad033b9b7d611db11285bb461fc6b802c1dd50d04ad715c225"}, - {file = "lxml-4.9.4-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:7b378847a09d6bd46047f5f3599cdc64fcb4cc5a5a2dd0a2af610361fbe77b16"}, - {file = "lxml-4.9.4-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:1343df4e2e6e51182aad12162b23b0a4b3fd77f17527a78c53f0f23573663545"}, - {file = "lxml-4.9.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:6dbdacf5752fbd78ccdb434698230c4f0f95df7dd956d5f205b5ed6911a1367c"}, - {file = "lxml-4.9.4-cp37-cp37m-manylinux_2_28_x86_64.whl", hash = "sha256:506becdf2ecaebaf7f7995f776394fcc8bd8a78022772de66677c84fb02dd33d"}, - {file = "lxml-4.9.4-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:ca8e44b5ba3edb682ea4e6185b49661fc22b230cf811b9c13963c9f982d1d964"}, - {file = "lxml-4.9.4-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:9d9d5726474cbbef279fd709008f91a49c4f758bec9c062dfbba88eab00e3ff9"}, - {file = "lxml-4.9.4-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:bbdd69e20fe2943b51e2841fc1e6a3c1de460d630f65bde12452d8c97209464d"}, - {file = "lxml-4.9.4-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:8671622256a0859f5089cbe0ce4693c2af407bc053dcc99aadff7f5310b4aa02"}, - {file = "lxml-4.9.4-cp37-cp37m-win32.whl", hash = "sha256:dd4fda67f5faaef4f9ee5383435048ee3e11ad996901225ad7615bc92245bc8e"}, - {file = "lxml-4.9.4-cp37-cp37m-win_amd64.whl", hash = "sha256:6bee9c2e501d835f91460b2c904bc359f8433e96799f5c2ff20feebd9bb1e590"}, - {file = "lxml-4.9.4-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:1f10f250430a4caf84115b1e0f23f3615566ca2369d1962f82bef40dd99cd81a"}, - {file = "lxml-4.9.4-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:3b505f2bbff50d261176e67be24e8909e54b5d9d08b12d4946344066d66b3e43"}, - {file = "lxml-4.9.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:1449f9451cd53e0fd0a7ec2ff5ede4686add13ac7a7bfa6988ff6d75cff3ebe2"}, - {file = "lxml-4.9.4-cp38-cp38-manylinux_2_28_x86_64.whl", hash = "sha256:4ece9cca4cd1c8ba889bfa67eae7f21d0d1a2e715b4d5045395113361e8c533d"}, - {file = "lxml-4.9.4-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:59bb5979f9941c61e907ee571732219fa4774d5a18f3fa5ff2df963f5dfaa6bc"}, - {file = "lxml-4.9.4-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:b1980dbcaad634fe78e710c8587383e6e3f61dbe146bcbfd13a9c8ab2d7b1192"}, - {file = "lxml-4.9.4-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:9ae6c3363261021144121427b1552b29e7b59de9d6a75bf51e03bc072efb3c37"}, - {file = "lxml-4.9.4-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:bcee502c649fa6351b44bb014b98c09cb00982a475a1912a9881ca28ab4f9cd9"}, - {file = "lxml-4.9.4-cp38-cp38-win32.whl", hash = "sha256:a8edae5253efa75c2fc79a90068fe540b197d1c7ab5803b800fccfe240eed33c"}, - {file = "lxml-4.9.4-cp38-cp38-win_amd64.whl", hash = "sha256:701847a7aaefef121c5c0d855b2affa5f9bd45196ef00266724a80e439220e46"}, - {file = "lxml-4.9.4-cp39-cp39-macosx_11_0_x86_64.whl", hash = "sha256:f610d980e3fccf4394ab3806de6065682982f3d27c12d4ce3ee46a8183d64a6a"}, - {file = "lxml-4.9.4-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:aa9b5abd07f71b081a33115d9758ef6077924082055005808f68feccb27616bd"}, - {file = "lxml-4.9.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:365005e8b0718ea6d64b374423e870648ab47c3a905356ab6e5a5ff03962b9a9"}, - {file = "lxml-4.9.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:16b9ec51cc2feab009e800f2c6327338d6ee4e752c76e95a35c4465e80390ccd"}, - {file = "lxml-4.9.4-cp39-cp39-manylinux_2_28_x86_64.whl", hash = "sha256:a905affe76f1802edcac554e3ccf68188bea16546071d7583fb1b693f9cf756b"}, - {file = "lxml-4.9.4-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:fd814847901df6e8de13ce69b84c31fc9b3fb591224d6762d0b256d510cbf382"}, - {file = "lxml-4.9.4-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:91bbf398ac8bb7d65a5a52127407c05f75a18d7015a270fdd94bbcb04e65d573"}, - {file = "lxml-4.9.4-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:f99768232f036b4776ce419d3244a04fe83784bce871b16d2c2e984c7fcea847"}, - {file = "lxml-4.9.4-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:bb5bd6212eb0edfd1e8f254585290ea1dadc3687dd8fd5e2fd9a87c31915cdab"}, - {file = "lxml-4.9.4-cp39-cp39-win32.whl", hash = "sha256:88f7c383071981c74ec1998ba9b437659e4fd02a3c4a4d3efc16774eb108d0ec"}, - {file = "lxml-4.9.4-cp39-cp39-win_amd64.whl", hash = "sha256:936e8880cc00f839aa4173f94466a8406a96ddce814651075f95837316369899"}, - {file = "lxml-4.9.4-pp310-pypy310_pp73-macosx_11_0_x86_64.whl", hash = "sha256:f6c35b2f87c004270fa2e703b872fcc984d714d430b305145c39d53074e1ffe0"}, - {file = "lxml-4.9.4-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:606d445feeb0856c2b424405236a01c71af7c97e5fe42fbc778634faef2b47e4"}, - {file = "lxml-4.9.4-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:a1bdcbebd4e13446a14de4dd1825f1e778e099f17f79718b4aeaf2403624b0f7"}, - {file = "lxml-4.9.4-pp37-pypy37_pp73-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:0a08c89b23117049ba171bf51d2f9c5f3abf507d65d016d6e0fa2f37e18c0fc5"}, - {file = "lxml-4.9.4-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:232fd30903d3123be4c435fb5159938c6225ee8607b635a4d3fca847003134ba"}, - {file = "lxml-4.9.4-pp37-pypy37_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:231142459d32779b209aa4b4d460b175cadd604fed856f25c1571a9d78114771"}, - {file = "lxml-4.9.4-pp38-pypy38_pp73-macosx_11_0_x86_64.whl", hash = "sha256:520486f27f1d4ce9654154b4494cf9307b495527f3a2908ad4cb48e4f7ed7ef7"}, - {file = "lxml-4.9.4-pp38-pypy38_pp73-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:562778586949be7e0d7435fcb24aca4810913771f845d99145a6cee64d5b67ca"}, - {file = "lxml-4.9.4-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:a9e7c6d89c77bb2770c9491d988f26a4b161d05c8ca58f63fb1f1b6b9a74be45"}, - {file = "lxml-4.9.4-pp38-pypy38_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:786d6b57026e7e04d184313c1359ac3d68002c33e4b1042ca58c362f1d09ff58"}, - {file = "lxml-4.9.4-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:95ae6c5a196e2f239150aa4a479967351df7f44800c93e5a975ec726fef005e2"}, - {file = "lxml-4.9.4-pp39-pypy39_pp73-macosx_11_0_x86_64.whl", hash = "sha256:9b556596c49fa1232b0fff4b0e69b9d4083a502e60e404b44341e2f8fb7187f5"}, - {file = "lxml-4.9.4-pp39-pypy39_pp73-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:cc02c06e9e320869d7d1bd323df6dd4281e78ac2e7f8526835d3d48c69060683"}, - {file = "lxml-4.9.4-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:857d6565f9aa3464764c2cb6a2e3c2e75e1970e877c188f4aeae45954a314e0c"}, - {file = "lxml-4.9.4-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:c42ae7e010d7d6bc51875d768110c10e8a59494855c3d4c348b068f5fb81fdcd"}, - {file = "lxml-4.9.4-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:f10250bb190fb0742e3e1958dd5c100524c2cc5096c67c8da51233f7448dc137"}, - {file = "lxml-4.9.4.tar.gz", hash = "sha256:b1541e50b78e15fa06a2670157a1962ef06591d4c998b998047fff5e3236880e"}, + {file = "lxml-5.1.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:704f5572ff473a5f897745abebc6df40f22d4133c1e0a1f124e4f2bd3330ff7e"}, + {file = "lxml-5.1.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:9d3c0f8567ffe7502d969c2c1b809892dc793b5d0665f602aad19895f8d508da"}, + {file = "lxml-5.1.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:5fcfbebdb0c5d8d18b84118842f31965d59ee3e66996ac842e21f957eb76138c"}, + {file = "lxml-5.1.0-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2f37c6d7106a9d6f0708d4e164b707037b7380fcd0b04c5bd9cae1fb46a856fb"}, + {file = "lxml-5.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2befa20a13f1a75c751f47e00929fb3433d67eb9923c2c0b364de449121f447c"}, + {file = "lxml-5.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:22b7ee4c35f374e2c20337a95502057964d7e35b996b1c667b5c65c567d2252a"}, + {file = "lxml-5.1.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:bf8443781533b8d37b295016a4b53c1494fa9a03573c09ca5104550c138d5c05"}, + {file = "lxml-5.1.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:82bddf0e72cb2af3cbba7cec1d2fd11fda0de6be8f4492223d4a268713ef2147"}, + {file = "lxml-5.1.0-cp310-cp310-win32.whl", hash = "sha256:b66aa6357b265670bb574f050ffceefb98549c721cf28351b748be1ef9577d93"}, + {file = "lxml-5.1.0-cp310-cp310-win_amd64.whl", hash = "sha256:4946e7f59b7b6a9e27bef34422f645e9a368cb2be11bf1ef3cafc39a1f6ba68d"}, + {file = "lxml-5.1.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:14deca1460b4b0f6b01f1ddc9557704e8b365f55c63070463f6c18619ebf964f"}, + {file = "lxml-5.1.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:ed8c3d2cd329bf779b7ed38db176738f3f8be637bb395ce9629fc76f78afe3d4"}, + {file = "lxml-5.1.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:436a943c2900bb98123b06437cdd30580a61340fbdb7b28aaf345a459c19046a"}, + {file = "lxml-5.1.0-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:acb6b2f96f60f70e7f34efe0c3ea34ca63f19ca63ce90019c6cbca6b676e81fa"}, + {file = "lxml-5.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:af8920ce4a55ff41167ddbc20077f5698c2e710ad3353d32a07d3264f3a2021e"}, + {file = "lxml-5.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7cfced4a069003d8913408e10ca8ed092c49a7f6cefee9bb74b6b3e860683b45"}, + {file = "lxml-5.1.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:9e5ac3437746189a9b4121db2a7b86056ac8786b12e88838696899328fc44bb2"}, + {file = "lxml-5.1.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:f4c9bda132ad108b387c33fabfea47866af87f4ea6ffb79418004f0521e63204"}, + {file = "lxml-5.1.0-cp311-cp311-win32.whl", hash = "sha256:bc64d1b1dab08f679fb89c368f4c05693f58a9faf744c4d390d7ed1d8223869b"}, + {file = "lxml-5.1.0-cp311-cp311-win_amd64.whl", hash = "sha256:a5ab722ae5a873d8dcee1f5f45ddd93c34210aed44ff2dc643b5025981908cda"}, + {file = "lxml-5.1.0-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:9aa543980ab1fbf1720969af1d99095a548ea42e00361e727c58a40832439114"}, + {file = "lxml-5.1.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:6f11b77ec0979f7e4dc5ae081325a2946f1fe424148d3945f943ceaede98adb8"}, + {file = "lxml-5.1.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:a36c506e5f8aeb40680491d39ed94670487ce6614b9d27cabe45d94cd5d63e1e"}, + {file = "lxml-5.1.0-cp312-cp312-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f643ffd2669ffd4b5a3e9b41c909b72b2a1d5e4915da90a77e119b8d48ce867a"}, + {file = "lxml-5.1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:16dd953fb719f0ffc5bc067428fc9e88f599e15723a85618c45847c96f11f431"}, + {file = "lxml-5.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:16018f7099245157564d7148165132c70adb272fb5a17c048ba70d9cc542a1a1"}, + {file = "lxml-5.1.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:82cd34f1081ae4ea2ede3d52f71b7be313756e99b4b5f829f89b12da552d3aa3"}, + {file = "lxml-5.1.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:19a1bc898ae9f06bccb7c3e1dfd73897ecbbd2c96afe9095a6026016e5ca97b8"}, + {file = "lxml-5.1.0-cp312-cp312-win32.whl", hash = "sha256:13521a321a25c641b9ea127ef478b580b5ec82aa2e9fc076c86169d161798b01"}, + {file = "lxml-5.1.0-cp312-cp312-win_amd64.whl", hash = "sha256:1ad17c20e3666c035db502c78b86e58ff6b5991906e55bdbef94977700c72623"}, + {file = "lxml-5.1.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:24ef5a4631c0b6cceaf2dbca21687e29725b7c4e171f33a8f8ce23c12558ded1"}, + {file = "lxml-5.1.0-cp36-cp36m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8d2900b7f5318bc7ad8631d3d40190b95ef2aa8cc59473b73b294e4a55e9f30f"}, + {file = "lxml-5.1.0-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:601f4a75797d7a770daed8b42b97cd1bb1ba18bd51a9382077a6a247a12aa38d"}, + {file = "lxml-5.1.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b4b68c961b5cc402cbd99cca5eb2547e46ce77260eb705f4d117fd9c3f932b95"}, + {file = "lxml-5.1.0-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:afd825e30f8d1f521713a5669b63657bcfe5980a916c95855060048b88e1adb7"}, + {file = "lxml-5.1.0-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:262bc5f512a66b527d026518507e78c2f9c2bd9eb5c8aeeb9f0eb43fcb69dc67"}, + {file = "lxml-5.1.0-cp36-cp36m-win32.whl", hash = "sha256:e856c1c7255c739434489ec9c8aa9cdf5179785d10ff20add308b5d673bed5cd"}, + {file = "lxml-5.1.0-cp36-cp36m-win_amd64.whl", hash = "sha256:c7257171bb8d4432fe9d6fdde4d55fdbe663a63636a17f7f9aaba9bcb3153ad7"}, + {file = "lxml-5.1.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:b9e240ae0ba96477682aa87899d94ddec1cc7926f9df29b1dd57b39e797d5ab5"}, + {file = "lxml-5.1.0-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a96f02ba1bcd330807fc060ed91d1f7a20853da6dd449e5da4b09bfcc08fdcf5"}, + {file = "lxml-5.1.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3e3898ae2b58eeafedfe99e542a17859017d72d7f6a63de0f04f99c2cb125936"}, + {file = "lxml-5.1.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:61c5a7edbd7c695e54fca029ceb351fc45cd8860119a0f83e48be44e1c464862"}, + {file = "lxml-5.1.0-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:3aeca824b38ca78d9ee2ab82bd9883083d0492d9d17df065ba3b94e88e4d7ee6"}, + {file = "lxml-5.1.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:8f52fe6859b9db71ee609b0c0a70fea5f1e71c3462ecf144ca800d3f434f0764"}, + {file = "lxml-5.1.0-cp37-cp37m-win32.whl", hash = "sha256:d42e3a3fc18acc88b838efded0e6ec3edf3e328a58c68fbd36a7263a874906c8"}, + {file = "lxml-5.1.0-cp37-cp37m-win_amd64.whl", hash = "sha256:eac68f96539b32fce2c9b47eb7c25bb2582bdaf1bbb360d25f564ee9e04c542b"}, + {file = "lxml-5.1.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:ae15347a88cf8af0949a9872b57a320d2605ae069bcdf047677318bc0bba45b1"}, + {file = "lxml-5.1.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:c26aab6ea9c54d3bed716b8851c8bfc40cb249b8e9880e250d1eddde9f709bf5"}, + {file = "lxml-5.1.0-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:342e95bddec3a698ac24378d61996b3ee5ba9acfeb253986002ac53c9a5f6f84"}, + {file = "lxml-5.1.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:725e171e0b99a66ec8605ac77fa12239dbe061482ac854d25720e2294652eeaa"}, + {file = "lxml-5.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3d184e0d5c918cff04cdde9dbdf9600e960161d773666958c9d7b565ccc60c45"}, + {file = "lxml-5.1.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:98f3f020a2b736566c707c8e034945c02aa94e124c24f77ca097c446f81b01f1"}, + {file = "lxml-5.1.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:6d48fc57e7c1e3df57be5ae8614bab6d4e7b60f65c5457915c26892c41afc59e"}, + {file = "lxml-5.1.0-cp38-cp38-win32.whl", hash = "sha256:7ec465e6549ed97e9f1e5ed51c657c9ede767bc1c11552f7f4d022c4df4a977a"}, + {file = "lxml-5.1.0-cp38-cp38-win_amd64.whl", hash = "sha256:b21b4031b53d25b0858d4e124f2f9131ffc1530431c6d1321805c90da78388d1"}, + {file = "lxml-5.1.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:52427a7eadc98f9e62cb1368a5079ae826f94f05755d2d567d93ee1bc3ceb354"}, + {file = "lxml-5.1.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:6a2a2c724d97c1eb8cf966b16ca2915566a4904b9aad2ed9a09c748ffe14f969"}, + {file = "lxml-5.1.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:843b9c835580d52828d8f69ea4302537337a21e6b4f1ec711a52241ba4a824f3"}, + {file = "lxml-5.1.0-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9b99f564659cfa704a2dd82d0684207b1aadf7d02d33e54845f9fc78e06b7581"}, + {file = "lxml-5.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4f8b0c78e7aac24979ef09b7f50da871c2de2def043d468c4b41f512d831e912"}, + {file = "lxml-5.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9bcf86dfc8ff3e992fed847c077bd875d9e0ba2fa25d859c3a0f0f76f07f0c8d"}, + {file = "lxml-5.1.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:49a9b4af45e8b925e1cd6f3b15bbba2c81e7dba6dce170c677c9cda547411e14"}, + {file = "lxml-5.1.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:280f3edf15c2a967d923bcfb1f8f15337ad36f93525828b40a0f9d6c2ad24890"}, + {file = "lxml-5.1.0-cp39-cp39-win32.whl", hash = "sha256:ed7326563024b6e91fef6b6c7a1a2ff0a71b97793ac33dbbcf38f6005e51ff6e"}, + {file = "lxml-5.1.0-cp39-cp39-win_amd64.whl", hash = "sha256:8d7b4beebb178e9183138f552238f7e6613162a42164233e2bda00cb3afac58f"}, + {file = "lxml-5.1.0-pp310-pypy310_pp73-macosx_10_9_x86_64.whl", hash = "sha256:9bd0ae7cc2b85320abd5e0abad5ccee5564ed5f0cc90245d2f9a8ef330a8deae"}, + {file = "lxml-5.1.0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d8c1d679df4361408b628f42b26a5d62bd3e9ba7f0c0e7969f925021554755aa"}, + {file = "lxml-5.1.0-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:2ad3a8ce9e8a767131061a22cd28fdffa3cd2dc193f399ff7b81777f3520e372"}, + {file = "lxml-5.1.0-pp37-pypy37_pp73-macosx_10_9_x86_64.whl", hash = "sha256:304128394c9c22b6569eba2a6d98392b56fbdfbad58f83ea702530be80d0f9df"}, + {file = "lxml-5.1.0-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d74fcaf87132ffc0447b3c685a9f862ffb5b43e70ea6beec2fb8057d5d2a1fea"}, + {file = "lxml-5.1.0-pp37-pypy37_pp73-win_amd64.whl", hash = "sha256:8cf5877f7ed384dabfdcc37922c3191bf27e55b498fecece9fd5c2c7aaa34c33"}, + {file = "lxml-5.1.0-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:877efb968c3d7eb2dad540b6cabf2f1d3c0fbf4b2d309a3c141f79c7e0061324"}, + {file = "lxml-5.1.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3f14a4fb1c1c402a22e6a341a24c1341b4a3def81b41cd354386dcb795f83897"}, + {file = "lxml-5.1.0-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:25663d6e99659544ee8fe1b89b1a8c0aaa5e34b103fab124b17fa958c4a324a6"}, + {file = "lxml-5.1.0-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:8b9f19df998761babaa7f09e6bc169294eefafd6149aaa272081cbddc7ba4ca3"}, + {file = "lxml-5.1.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5e53d7e6a98b64fe54775d23a7c669763451340c3d44ad5e3a3b48a1efbdc96f"}, + {file = "lxml-5.1.0-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:c3cd1fc1dc7c376c54440aeaaa0dcc803d2126732ff5c6b68ccd619f2e64be4f"}, + {file = "lxml-5.1.0.tar.gz", hash = "sha256:3eea6ed6e6c918e468e693c41ef07f3c3acc310b70ddd9cc72d9ef84bc9564ca"}, ] [package.extras] cssselect = ["cssselect (>=0.7)"] html5 = ["html5lib"] htmlsoup = ["BeautifulSoup4"] -source = ["Cython (==0.29.37)"] +source = ["Cython (>=3.0.7)"] [[package]] name = "polib" diff --git a/c-api/conversion.po b/c-api/conversion.po index e09bc01216..d7c2b52620 100644 --- a/c-api/conversion.po +++ b/c-api/conversion.po @@ -1,4 +1,4 @@ -# Copyright (C) 2001-2023, Python Software Foundation +# Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2024-01-27 00:03+0000\n" "PO-Revision-Date: 2023-12-11 18:26+0000\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -112,6 +112,51 @@ msgstr "以下函式提供與區域設定無關 (locale-independent) 的字串 #: ../../c-api/conversion.rst:53 msgid "" +"Convert the initial part of the string in ``str`` to an :c:expr:`unsigned " +"long` value according to the given ``base``, which must be between ``2`` and " +"``36`` inclusive, or be the special value ``0``." +msgstr "" + +#: ../../c-api/conversion.rst:57 +msgid "" +"Leading white space and case of characters are ignored. If ``base`` is zero " +"it looks for a leading ``0b``, ``0o`` or ``0x`` to tell which base. If " +"these are absent it defaults to ``10``. Base must be 0 or between 2 and 36 " +"(inclusive). If ``ptr`` is non-``NULL`` it will contain a pointer to the " +"end of the scan." +msgstr "" + +#: ../../c-api/conversion.rst:63 +msgid "" +"If the converted value falls out of range of corresponding return type, " +"range error occurs (:c:data:`errno` is set to :c:macro:`!ERANGE`) and :c:" +"macro:`!ULONG_MAX` is returned. If no conversion can be performed, ``0`` is " +"returned." +msgstr "" + +#: ../../c-api/conversion.rst:68 +msgid "See also the Unix man page :manpage:`strtoul(3)`." +msgstr "也請見 Unix 手冊頁面 :manpage:`strtoul(3)`。" + +#: ../../c-api/conversion.rst:75 +msgid "" +"Convert the initial part of the string in ``str`` to an :c:expr:`long` value " +"according to the given ``base``, which must be between ``2`` and ``36`` " +"inclusive, or be the special value ``0``." +msgstr "" + +#: ../../c-api/conversion.rst:79 +msgid "" +"Same as :c:func:`PyOS_strtoul`, but return a :c:expr:`long` value instead " +"and :c:macro:`LONG_MAX` on overflows." +msgstr "" + +#: ../../c-api/conversion.rst:82 +msgid "See also the Unix man page :manpage:`strtol(3)`." +msgstr "也請見 Unix 手冊頁面 :manpage:`strtol(3)`。" + +#: ../../c-api/conversion.rst:89 +msgid "" "Convert a string ``s`` to a :c:expr:`double`, raising a Python exception on " "failure. The set of accepted strings corresponds to the set of strings " "accepted by Python's :func:`float` constructor, except that ``s`` must not " @@ -122,7 +167,7 @@ msgstr "" "對應於 Python 的 :func:`float` 建構函式接受的字串集合,但 ``s`` 不得有前導或" "尾隨的空格。轉換與目前區域設定無關。" -#: ../../c-api/conversion.rst:59 +#: ../../c-api/conversion.rst:95 msgid "" "If ``endptr`` is ``NULL``, convert the whole string. Raise :exc:" "`ValueError` and return ``-1.0`` if the string is not a valid representation " @@ -131,7 +176,7 @@ msgstr "" "如果 ``endptr`` 為 ``NULL``,則轉換整個字串。如果字串不是浮點數的有效表示,則" "引發 :exc:`ValueError` 並回傳 ``-1.0``。" -#: ../../c-api/conversion.rst:63 +#: ../../c-api/conversion.rst:99 msgid "" "If endptr is not ``NULL``, convert as much of the string as possible and set " "``*endptr`` to point to the first unconverted character. If no initial " @@ -143,7 +188,7 @@ msgstr "" "個未轉換的字元。如果字串的初始片段都不是浮點數的有效表示,則設定 ``*endptr`` " "指向字串的開頭,引發 ValueError 並回傳 ``-1.0``。" -#: ../../c-api/conversion.rst:70 +#: ../../c-api/conversion.rst:106 msgid "" "If ``s`` represents a value that is too large to store in a float (for " "example, ``\"1e500\"`` is such a string on many platforms) then if " @@ -160,7 +205,7 @@ msgstr "" "``-1.0``。在這兩種情況下,將 ``*endptr`` 設定為指向轉換後的值之後的第一個字" "元。" -#: ../../c-api/conversion.rst:78 +#: ../../c-api/conversion.rst:114 msgid "" "If any other error occurs during the conversion (for example an out-of-" "memory error), set the appropriate Python exception and return ``-1.0``." @@ -168,7 +213,7 @@ msgstr "" "如果轉換期間發生任何其他錯誤(例如記憶體不足的錯誤),請設定適當的 Python 例" "外並回傳 ``-1.0``。" -#: ../../c-api/conversion.rst:87 +#: ../../c-api/conversion.rst:123 msgid "" "Convert a :c:expr:`double` *val* to a string using supplied *format_code*, " "*precision*, and *flags*." @@ -176,7 +221,7 @@ msgstr "" "使用提供的 *format_code*、*precision* 和 *flags* 將 :c:expr:`double` *val* 轉" "換為字串。" -#: ../../c-api/conversion.rst:90 +#: ../../c-api/conversion.rst:126 msgid "" "*format_code* must be one of ``'e'``, ``'E'``, ``'f'``, ``'F'``, ``'g'``, " "``'G'`` or ``'r'``. For ``'r'``, the supplied *precision* must be 0 and is " @@ -186,7 +231,7 @@ msgstr "" "``'r'`` 其中之一。對於 ``'r'``,提供的 *precision* 必須為 0 並會被忽略。" "``'r'`` 格式碼指定標準 :func:`repr` 格式。" -#: ../../c-api/conversion.rst:95 +#: ../../c-api/conversion.rst:131 msgid "" "*flags* can be zero or more of the values ``Py_DTSF_SIGN``, " "``Py_DTSF_ADD_DOT_0``, or ``Py_DTSF_ALT``, or-ed together:" @@ -194,20 +239,20 @@ msgstr "" "*flags* 可以是零個或多個值 ``Py_DTSF_SIGN``、``Py_DTSF_ADD_DOT_0`` 或 " "``Py_DTSF_ALT``,會被聯集在一起:" -#: ../../c-api/conversion.rst:98 +#: ../../c-api/conversion.rst:134 msgid "" "``Py_DTSF_SIGN`` means to always precede the returned string with a sign " "character, even if *val* is non-negative." msgstr "" "``Py_DTSF_SIGN`` 代表總是在回傳的字串前面加上符號字元,即使 *val* 非負數。" -#: ../../c-api/conversion.rst:101 +#: ../../c-api/conversion.rst:137 msgid "" "``Py_DTSF_ADD_DOT_0`` means to ensure that the returned string will not look " "like an integer." msgstr "``Py_DTSF_ADD_DOT_0`` 代表確保回傳的字串看起來不會像整數。" -#: ../../c-api/conversion.rst:104 +#: ../../c-api/conversion.rst:140 msgid "" "``Py_DTSF_ALT`` means to apply \"alternate\" formatting rules. See the " "documentation for the :c:func:`PyOS_snprintf` ``'#'`` specifier for details." @@ -215,7 +260,7 @@ msgstr "" "``Py_DTSF_ALT`` 代表要套用「備用的 (alternate)」格式化規則。有關詳細資訊,請" "參閱 :c:func:`PyOS_snprintf` ``'#'`` 的文件。" -#: ../../c-api/conversion.rst:108 +#: ../../c-api/conversion.rst:144 msgid "" "If *ptype* is non-``NULL``, then the value it points to will be set to one " "of ``Py_DTST_FINITE``, ``Py_DTST_INFINITE``, or ``Py_DTST_NAN``, signifying " @@ -226,7 +271,7 @@ msgstr "" "``Py_DTST_INFINITE`` 或 ``Py_DTST_NAN`` 其中之一,分別代表 *val* 是有限數、無" "限數或非數。" -#: ../../c-api/conversion.rst:112 +#: ../../c-api/conversion.rst:148 msgid "" "The return value is a pointer to *buffer* with the converted string or " "``NULL`` if the conversion failed. The caller is responsible for freeing the " @@ -235,7 +280,7 @@ msgstr "" "回傳值是指向 *buffer* 的指標,其中包含轉換後的字串,如果轉換失敗則回傳 " "``NULL``。呼叫者負責透過呼叫 :c:func:`PyMem_Free` 來釋放回傳的字串。" -#: ../../c-api/conversion.rst:121 +#: ../../c-api/conversion.rst:157 msgid "" "Case insensitive comparison of strings. The function works almost " "identically to :c:func:`!strcmp` except that it ignores the case." @@ -243,7 +288,7 @@ msgstr "" "不區分大小寫的字串比較。函式的作用方式幾乎與 :c:func:`!strcmp` 相同,只是它忽" "略大小寫。" -#: ../../c-api/conversion.rst:127 +#: ../../c-api/conversion.rst:163 msgid "" "Case insensitive comparison of strings. The function works almost " "identically to :c:func:`!strncmp` except that it ignores the case." diff --git a/c-api/exceptions.po b/c-api/exceptions.po index 04c8fe75ed..18e986259e 100644 --- a/c-api/exceptions.po +++ b/c-api/exceptions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-14 00:03+0000\n" +"POT-Creation-Date: 2024-01-01 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -454,7 +454,7 @@ msgstr "" #: ../../c-api/exceptions.rst:429 msgid "" "Return the exception currently being raised, clearing the error indicator at " -"the same time." +"the same time. Return ``NULL`` if the error indicator is not set." msgstr "" #: ../../c-api/exceptions.rst:432 diff --git a/c-api/memory.po b/c-api/memory.po index e2929793b8..53604c3883 100644 --- a/c-api/memory.po +++ b/c-api/memory.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-17 00:03+0000\n" +"POT-Creation-Date: 2024-01-22 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -329,16 +329,16 @@ msgstr "" #: ../../c-api/memory.rst:269 msgid "" "Same as :c:func:`PyMem_Malloc`, but allocates ``(n * sizeof(TYPE))`` bytes " -"of memory. Returns a pointer cast to :c:expr:`TYPE*`. The memory will not " -"have been initialized in any way." +"of memory. Returns a pointer cast to ``TYPE*``. The memory will not have " +"been initialized in any way." msgstr "" #: ../../c-api/memory.rst:276 msgid "" "Same as :c:func:`PyMem_Realloc`, but the memory block is resized to ``(n * " -"sizeof(TYPE))`` bytes. Returns a pointer cast to :c:expr:`TYPE*`. On " -"return, *p* will be a pointer to the new memory area, or ``NULL`` in the " -"event of failure." +"sizeof(TYPE))`` bytes. Returns a pointer cast to ``TYPE*``. On return, *p* " +"will be a pointer to the new memory area, or ``NULL`` in the event of " +"failure." msgstr "" #: ../../c-api/memory.rst:281 diff --git a/c-api/object.po b/c-api/object.po index 87c4863fc6..892b668dbc 100644 --- a/c-api/object.po +++ b/c-api/object.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-09-03 00:03+0000\n" +"POT-Creation-Date: 2024-01-27 09:40+0000\n" "PO-Revision-Date: 2018-05-23 14:32+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -200,34 +200,30 @@ msgstr "" #: ../../c-api/object.rst:174 msgid "" "Compare the values of *o1* and *o2* using the operation specified by *opid*, " -"which must be one of :c:macro:`Py_LT`, :c:macro:`Py_LE`, :c:macro:`Py_EQ`, :" -"c:macro:`Py_NE`, :c:macro:`Py_GT`, or :c:macro:`Py_GE`, corresponding to " -"``<``, ``<=``, ``==``, ``!=``, ``>``, or ``>=`` respectively. Returns ``-1`` " -"on error, ``0`` if the result is false, ``1`` otherwise. This is the " -"equivalent of the Python expression ``o1 op o2``, where ``op`` is the " -"operator corresponding to *opid*." +"like :c:func:`PyObject_RichCompare`, but returns ``-1`` on error, ``0`` if " +"the result is false, ``1`` otherwise." msgstr "" -#: ../../c-api/object.rst:183 +#: ../../c-api/object.rst:179 msgid "" "If *o1* and *o2* are the same object, :c:func:`PyObject_RichCompareBool` " "will always return ``1`` for :c:macro:`Py_EQ` and ``0`` for :c:macro:`Py_NE`." msgstr "" -#: ../../c-api/object.rst:188 +#: ../../c-api/object.rst:184 msgid "" "Format *obj* using *format_spec*. This is equivalent to the Python " "expression ``format(obj, format_spec)``." msgstr "" -#: ../../c-api/object.rst:191 +#: ../../c-api/object.rst:187 msgid "" "*format_spec* may be ``NULL``. In this case the call is equivalent to " "``format(obj)``. Returns the formatted string on success, ``NULL`` on " "failure." msgstr "" -#: ../../c-api/object.rst:199 +#: ../../c-api/object.rst:195 msgid "" "Compute a string representation of object *o*. Returns the string " "representation on success, ``NULL`` on failure. This is the equivalent of " @@ -235,13 +231,13 @@ msgid "" "function." msgstr "" -#: ../../c-api/object.rst:203 ../../c-api/object.rst:227 +#: ../../c-api/object.rst:199 ../../c-api/object.rst:223 msgid "" "This function now includes a debug assertion to help ensure that it does not " "silently discard an active exception." msgstr "" -#: ../../c-api/object.rst:211 +#: ../../c-api/object.rst:207 msgid "" "As :c:func:`PyObject_Repr`, compute a string representation of object *o*, " "but escape the non-ASCII characters in the string returned by :c:func:" @@ -250,7 +246,7 @@ msgid "" "Called by the :func:`ascii` built-in function." msgstr "" -#: ../../c-api/object.rst:222 +#: ../../c-api/object.rst:218 msgid "" "Compute a string representation of object *o*. Returns the string " "representation on success, ``NULL`` on failure. This is the equivalent of " @@ -258,7 +254,7 @@ msgid "" "function and, therefore, by the :func:`print` function." msgstr "" -#: ../../c-api/object.rst:236 +#: ../../c-api/object.rst:232 msgid "" "Compute a bytes representation of object *o*. ``NULL`` is returned on " "failure and a bytes object on success. This is equivalent to the Python " @@ -267,20 +263,20 @@ msgid "" "bytes object." msgstr "" -#: ../../c-api/object.rst:245 +#: ../../c-api/object.rst:241 msgid "" "Return ``1`` if the class *derived* is identical to or derived from the " "class *cls*, otherwise return ``0``. In case of an error, return ``-1``." msgstr "" -#: ../../c-api/object.rst:248 ../../c-api/object.rst:267 +#: ../../c-api/object.rst:244 ../../c-api/object.rst:263 msgid "" "If *cls* is a tuple, the check will be done against every entry in *cls*. " "The result will be ``1`` when at least one of the checks returns ``1``, " "otherwise it will be ``0``." msgstr "" -#: ../../c-api/object.rst:252 +#: ../../c-api/object.rst:248 msgid "" "If *cls* has a :meth:`~class.__subclasscheck__` method, it will be called to " "determine the subclass status as described in :pep:`3119`. Otherwise, " @@ -288,52 +284,52 @@ msgid "" "e. contained in ``cls.__mro__``." msgstr "" -#: ../../c-api/object.rst:257 +#: ../../c-api/object.rst:253 msgid "" "Normally only class objects, i.e. instances of :class:`type` or a derived " "class, are considered classes. However, objects can override this by having " "a :attr:`~class.__bases__` attribute (which must be a tuple of base classes)." msgstr "" -#: ../../c-api/object.rst:264 +#: ../../c-api/object.rst:260 msgid "" "Return ``1`` if *inst* is an instance of the class *cls* or a subclass of " "*cls*, or ``0`` if not. On error, returns ``-1`` and sets an exception." msgstr "" -#: ../../c-api/object.rst:271 +#: ../../c-api/object.rst:267 msgid "" "If *cls* has a :meth:`~class.__instancecheck__` method, it will be called to " "determine the subclass status as described in :pep:`3119`. Otherwise, " "*inst* is an instance of *cls* if its class is a subclass of *cls*." msgstr "" -#: ../../c-api/object.rst:275 +#: ../../c-api/object.rst:271 msgid "" "An instance *inst* can override what is considered its class by having a :" "attr:`~instance.__class__` attribute." msgstr "" -#: ../../c-api/object.rst:278 +#: ../../c-api/object.rst:274 msgid "" "An object *cls* can override if it is considered a class, and what its base " "classes are, by having a :attr:`~class.__bases__` attribute (which must be a " "tuple of base classes)." msgstr "" -#: ../../c-api/object.rst:287 +#: ../../c-api/object.rst:283 msgid "" "Compute and return the hash value of an object *o*. On failure, return " "``-1``. This is the equivalent of the Python expression ``hash(o)``." msgstr "" -#: ../../c-api/object.rst:290 +#: ../../c-api/object.rst:286 msgid "" "The return type is now Py_hash_t. This is a signed integer the same size " "as :c:type:`Py_ssize_t`." msgstr "" -#: ../../c-api/object.rst:297 +#: ../../c-api/object.rst:293 msgid "" "Set a :exc:`TypeError` indicating that ``type(o)`` is not :term:`hashable` " "and return ``-1``. This function receives special treatment when stored in a " @@ -341,21 +337,21 @@ msgid "" "that it is not hashable." msgstr "" -#: ../../c-api/object.rst:305 +#: ../../c-api/object.rst:301 msgid "" "Returns ``1`` if the object *o* is considered to be true, and ``0`` " "otherwise. This is equivalent to the Python expression ``not not o``. On " "failure, return ``-1``." msgstr "" -#: ../../c-api/object.rst:312 +#: ../../c-api/object.rst:308 msgid "" "Returns ``0`` if the object *o* is considered to be true, and ``1`` " "otherwise. This is equivalent to the Python expression ``not o``. On " "failure, return ``-1``." msgstr "" -#: ../../c-api/object.rst:321 +#: ../../c-api/object.rst:317 msgid "" "When *o* is non-``NULL``, returns a type object corresponding to the object " "type of object *o*. On failure, raises :exc:`SystemError` and returns " @@ -366,13 +362,13 @@ msgid "" "when a new :term:`strong reference` is needed." msgstr "" -#: ../../c-api/object.rst:333 +#: ../../c-api/object.rst:329 msgid "" "Return non-zero if the object *o* is of type *type* or a subtype of *type*, " "and ``0`` otherwise. Both parameters must be non-``NULL``." msgstr "" -#: ../../c-api/object.rst:342 +#: ../../c-api/object.rst:338 msgid "" "Return the length of object *o*. If the object *o* provides either the " "sequence and mapping protocols, the sequence length is returned. On error, " @@ -380,7 +376,7 @@ msgid "" "``len(o)``." msgstr "" -#: ../../c-api/object.rst:349 +#: ../../c-api/object.rst:345 msgid "" "Return an estimated length for the object *o*. First try to return its " "actual length, then an estimate using :meth:`~object.__length_hint__`, and " @@ -389,26 +385,26 @@ msgid "" "defaultvalue)``." msgstr "" -#: ../../c-api/object.rst:359 +#: ../../c-api/object.rst:355 msgid "" "Return element of *o* corresponding to the object *key* or ``NULL`` on " "failure. This is the equivalent of the Python expression ``o[key]``." msgstr "" -#: ../../c-api/object.rst:365 +#: ../../c-api/object.rst:361 msgid "" "Map the object *key* to the value *v*. Raise an exception and return ``-1`` " "on failure; return ``0`` on success. This is the equivalent of the Python " "statement ``o[key] = v``. This function *does not* steal a reference to *v*." msgstr "" -#: ../../c-api/object.rst:373 +#: ../../c-api/object.rst:369 msgid "" "Remove the mapping for the object *key* from the object *o*. Return ``-1`` " "on failure. This is equivalent to the Python statement ``del o[key]``." msgstr "" -#: ../../c-api/object.rst:379 +#: ../../c-api/object.rst:375 msgid "" "This is equivalent to the Python expression ``dir(o)``, returning a " "(possibly empty) list of strings appropriate for the object argument, or " @@ -418,7 +414,7 @@ msgid "" "`PyErr_Occurred` will return false." msgstr "" -#: ../../c-api/object.rst:388 +#: ../../c-api/object.rst:384 msgid "" "This is equivalent to the Python expression ``iter(o)``. It returns a new " "iterator for the object argument, or the object itself if the object is " @@ -426,7 +422,7 @@ msgid "" "object cannot be iterated." msgstr "" -#: ../../c-api/object.rst:396 +#: ../../c-api/object.rst:392 msgid "" "This is the equivalent to the Python expression ``aiter(o)``. Takes an :" "class:`AsyncIterable` object and returns an :class:`AsyncIterator` for it. " @@ -435,90 +431,90 @@ msgid "" "``NULL`` if the object cannot be iterated." msgstr "" -#: ../../c-api/object.rst:406 +#: ../../c-api/object.rst:402 msgid "Get a pointer to subclass-specific data reserved for *cls*." msgstr "" -#: ../../c-api/object.rst:408 +#: ../../c-api/object.rst:404 msgid "" "The object *o* must be an instance of *cls*, and *cls* must have been " "created using negative :c:member:`PyType_Spec.basicsize`. Python does not " "check this." msgstr "" -#: ../../c-api/object.rst:412 +#: ../../c-api/object.rst:408 msgid "On error, set an exception and return ``NULL``." msgstr "" -#: ../../c-api/object.rst:418 +#: ../../c-api/object.rst:414 msgid "" "Return the size of the instance memory space reserved for *cls*, i.e. the " "size of the memory :c:func:`PyObject_GetTypeData` returns." msgstr "" -#: ../../c-api/object.rst:421 +#: ../../c-api/object.rst:417 msgid "" "This may be larger than requested using :c:member:`-PyType_Spec.basicsize " "`; it is safe to use this larger size (e.g. with :c:" "func:`!memset`)." msgstr "" -#: ../../c-api/object.rst:424 +#: ../../c-api/object.rst:420 msgid "" "The type *cls* **must** have been created using negative :c:member:" "`PyType_Spec.basicsize`. Python does not check this." msgstr "" -#: ../../c-api/object.rst:428 +#: ../../c-api/object.rst:424 msgid "On error, set an exception and return a negative value." msgstr "" -#: ../../c-api/object.rst:434 +#: ../../c-api/object.rst:430 msgid "" "Get a pointer to per-item data for a class with :c:macro:" "`Py_TPFLAGS_ITEMS_AT_END`." msgstr "" -#: ../../c-api/object.rst:437 +#: ../../c-api/object.rst:433 msgid "" "On error, set an exception and return ``NULL``. :py:exc:`TypeError` is " "raised if *o* does not have :c:macro:`Py_TPFLAGS_ITEMS_AT_END` set." msgstr "" -#: ../../c-api/object.rst:197 ../../c-api/object.rst:209 -#: ../../c-api/object.rst:234 ../../c-api/object.rst:285 -#: ../../c-api/object.rst:319 ../../c-api/object.rst:340 +#: ../../c-api/object.rst:193 ../../c-api/object.rst:205 +#: ../../c-api/object.rst:230 ../../c-api/object.rst:281 +#: ../../c-api/object.rst:315 ../../c-api/object.rst:336 msgid "built-in function" msgstr "bulit-in function(內建函式)" -#: ../../c-api/object.rst:197 +#: ../../c-api/object.rst:193 msgid "repr" msgstr "repr" -#: ../../c-api/object.rst:209 +#: ../../c-api/object.rst:205 msgid "ascii" msgstr "ascii" -#: ../../c-api/object.rst:217 +#: ../../c-api/object.rst:213 msgid "string" msgstr "string(字串)" -#: ../../c-api/object.rst:217 +#: ../../c-api/object.rst:213 msgid "PyObject_Str (C function)" msgstr "PyObject_Str(C 函式)" -#: ../../c-api/object.rst:234 +#: ../../c-api/object.rst:230 msgid "bytes" msgstr "bytes(位元組)" -#: ../../c-api/object.rst:285 +#: ../../c-api/object.rst:281 msgid "hash" msgstr "hash(雜湊)" -#: ../../c-api/object.rst:319 +#: ../../c-api/object.rst:315 msgid "type" msgstr "type(型別)" -#: ../../c-api/object.rst:340 +#: ../../c-api/object.rst:336 msgid "len" msgstr "len" diff --git a/c-api/stable.po b/c-api/stable.po index ea5b0c5350..3bd34e00be 100644 --- a/c-api/stable.po +++ b/c-api/stable.po @@ -1,4 +1,4 @@ -# Copyright (C) 2001-2023, Python Software Foundation +# Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-29 12:27+0000\n" +"POT-Creation-Date: 2024-01-19 00:03+0000\n" "PO-Revision-Date: 2023-01-24 21:07+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -40,22 +40,24 @@ msgid "" "compatible across a minor release (if these are compiled the same way; see :" "ref:`stable-abi-platform` below). So, code compiled for Python 3.10.0 will " "work on 3.10.8 and vice versa, but will need to be compiled separately for " -"3.9.x and 3.10.x." +"3.9.x and 3.11.x." msgstr "" "CPython 的應用程式二進位介面 (Application Binary Interface, ABI) 在次要版本中" "是向前和向後相容的(如果它們以相同的方式編譯;請參閱下面的\\ :ref:`stable-" "abi-platform`\\)。因此,為 Python 3.10.0 編譯的程式碼將能夠在 3.10.8 上運" -"行,反之亦然,但 3.9.x 和 3.10.x 就需要分別編譯。" +"行,反之亦然,但 3.9.x 和 3.11.x 就需要分別編譯。" #: ../../c-api/stable.rst:21 msgid "There are two tiers of C API with different stability expectations:" -msgstr "" +msgstr "C API 有兩層級,有不同的穩定性期望:" #: ../../c-api/stable.rst:23 msgid "" ":ref:`Unstable API `, may change in minor versions without a " "deprecation period. It is marked by the ``PyUnstable`` prefix in names." msgstr "" +":ref:`不穩定 API `,可能會在次要版本中發生變化,而沒有棄用階" +"段。會在名稱中以 ``PyUnstable`` 前綴來標記。" #: ../../c-api/stable.rst:25 msgid "" @@ -63,13 +65,14 @@ msgid "" "releases. When :c:macro:`Py_LIMITED_API` is defined, only this subset is " "exposed from ``Python.h``." msgstr "" +":ref:`受限 API `,在多個次要版本之間相容。當有定義 :c:macro:" +"`Py_LIMITED_API` 時,只有這個子集會從 ``Python.h`` 公開。" #: ../../c-api/stable.rst:29 msgid "These are discussed in more detail below." -msgstr "" +msgstr "下面將更詳細地討論這些內容。" #: ../../c-api/stable.rst:31 -#, fuzzy msgid "" "Names prefixed by an underscore, such as ``_Py_InternalState``, are private " "API that can change without notice even in patch releases. If you need to " @@ -78,7 +81,9 @@ msgid "" "case." msgstr "" "帶有底線前綴的名稱是私有 API (private API),像是 ``_Py_InternalState``,即使" -"在補丁版本 (patch release) 中也可能被更改,不會另行通知。" +"在補丁版本 (patch release) 中也可能被更改,不會另行通知。如果你需要使用這個 " +"API,可以聯繫 `CPython 開發者 `_ 並針對你的使用方法來討論是否新增公開的 API。" #: ../../c-api/stable.rst:40 msgid "Unstable C API" @@ -91,17 +96,22 @@ msgid "" "without any deprecation warnings. However, it will not change in a bugfix " "release (e.g. from 3.10.0 to 3.10.1)." msgstr "" +"任何以 ``PyUnstable`` 前綴命名的 API 都會公開 CPython 實作細節,並可能在每個" +"次要版本中進行更改(例如從 3.9 到 3.10),而不會出現任何棄用警告。但是它不會" +"在錯誤修復發布版本中發生變化(例如從 3.10.0 到 3.10.1)。" #: ../../c-api/stable.rst:49 msgid "" "It is generally intended for specialized, low-level tools like debuggers." -msgstr "" +msgstr "它通常用於專門的低階工具,例如偵錯器。" #: ../../c-api/stable.rst:51 msgid "" "Projects that use this API are expected to follow CPython development and " "spend extra effort adjusting to changes." msgstr "" +"使用此 API 的專案應該要遵循 CPython 開發細節,並花費額外的力氣來針對這些變動" +"來做調整。" #: ../../c-api/stable.rst:56 msgid "Stable Application Binary Interface" diff --git a/c-api/structures.po b/c-api/structures.po index 4e4cf0b9df..8133a2ccdb 100644 --- a/c-api/structures.po +++ b/c-api/structures.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-10 19:07+0000\n" +"POT-Creation-Date: 2024-01-25 06:20+0000\n" "PO-Revision-Date: 2018-05-23 14:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -83,7 +83,7 @@ msgstr "" #: ../../c-api/structures.rst:63 msgid "See documentation of :c:type:`PyVarObject` above." -msgstr "" +msgstr "請見上面 :c:type:`PyVarObject` 的文件。" #: ../../c-api/structures.rst:68 msgid "" @@ -134,11 +134,11 @@ msgstr "" #: ../../c-api/structures.rst:120 msgid "Set the object *o* type to *type*." -msgstr "" +msgstr "將物件 *o* 的型別設為 *type*。" #: ../../c-api/structures.rst:127 msgid "Get the size of the Python object *o*." -msgstr "" +msgstr "取得 Python 物件 *o* 的大小。" #: ../../c-api/structures.rst:129 msgid "Use the :c:func:`Py_SET_SIZE` function to set an object size." @@ -152,7 +152,7 @@ msgstr "" #: ../../c-api/structures.rst:138 msgid "Set the object *o* size to *size*." -msgstr "" +msgstr "將物件 *o* 的大小設為 *size*。" #: ../../c-api/structures.rst:145 msgid "" @@ -169,7 +169,7 @@ msgstr "" #: ../../c-api/structures.rst:163 msgid "Implementing functions and methods" -msgstr "" +msgstr "實作函式與方法" #: ../../c-api/structures.rst:167 msgid "" @@ -302,7 +302,7 @@ msgstr "" #: ../../c-api/structures.rst:319 msgid ":c:expr:`METH_FASTCALL | METH_KEYWORDS`" -msgstr "" +msgstr ":c:expr:`METH_FASTCALL | METH_KEYWORDS`" #: ../../c-api/structures.rst:308 msgid "" @@ -324,7 +324,7 @@ msgstr "" #: ../../c-api/structures.rst:340 msgid ":c:expr:`METH_METHOD | METH_FASTCALL | METH_KEYWORDS`" -msgstr "" +msgstr ":c:expr:`METH_METHOD | METH_FASTCALL | METH_KEYWORDS`" #: ../../c-api/structures.rst:330 msgid "" @@ -407,52 +407,91 @@ msgid "" msgstr "" #: ../../c-api/structures.rst:404 -msgid "Accessing attributes of extension types" +msgid "" +"Turn *ml* into a Python :term:`callable` object. The caller must ensure that " +"*ml* outlives the :term:`callable`. Typically, *ml* is defined as a static " +"variable." msgstr "" #: ../../c-api/structures.rst:408 msgid "" +"The *self* parameter will be passed as the *self* argument to the C function " +"in ``ml->ml_meth`` when invoked. *self* can be ``NULL``." +msgstr "" + +#: ../../c-api/structures.rst:412 +msgid "" +"The :term:`callable` object's ``__module__`` attribute can be set from the " +"given *module* argument. *module* should be a Python string, which will be " +"used as name of the module the function is defined in. If unavailable, it " +"can be set to :const:`None` or ``NULL``." +msgstr "" + +#: ../../c-api/structures.rst:418 +msgid ":attr:`function.__module__`" +msgstr ":attr:`function.__module__`" + +#: ../../c-api/structures.rst:420 +msgid "" +"The *cls* parameter will be passed as the *defining_class* argument to the C " +"function. Must be set if :c:macro:`METH_METHOD` is set on ``ml->ml_flags``." +msgstr "" + +#: ../../c-api/structures.rst:429 +msgid "Equivalent to ``PyCMethod_New(ml, self, module, NULL)``." +msgstr "等價於 ``PyCMethod_New(ml, self, module, NULL)``。" + +#: ../../c-api/structures.rst:434 +msgid "Equivalent to ``PyCMethod_New(ml, self, NULL, NULL)``." +msgstr "等價於 ``PyCMethod_New(ml, self, NULL, NULL)``。" + +#: ../../c-api/structures.rst:438 +msgid "Accessing attributes of extension types" +msgstr "" + +#: ../../c-api/structures.rst:442 +msgid "" "Structure which describes an attribute of a type which corresponds to a C " "struct member. When defining a class, put a NULL-terminated array of these " "structures in the :c:member:`~PyTypeObject.tp_members` slot." msgstr "" -#: ../../c-api/structures.rst:413 +#: ../../c-api/structures.rst:447 msgid "Its fields are, in order:" msgstr "" -#: ../../c-api/structures.rst:417 +#: ../../c-api/structures.rst:451 msgid "" "Name of the member. A NULL value marks the end of a ``PyMemberDef[]`` array." msgstr "" -#: ../../c-api/structures.rst:420 +#: ../../c-api/structures.rst:454 msgid "The string should be static, no copy is made of it." msgstr "" -#: ../../c-api/structures.rst:424 +#: ../../c-api/structures.rst:458 msgid "" "The type of the member in the C struct. See :ref:`PyMemberDef-types` for the " "possible values." msgstr "" -#: ../../c-api/structures.rst:429 +#: ../../c-api/structures.rst:463 msgid "" "The offset in bytes that the member is located on the type’s object struct." msgstr "" -#: ../../c-api/structures.rst:433 +#: ../../c-api/structures.rst:467 msgid "" "Zero or more of the :ref:`PyMemberDef-flags`, combined using bitwise OR." msgstr "" -#: ../../c-api/structures.rst:437 +#: ../../c-api/structures.rst:471 msgid "" "The docstring, or NULL. The string should be static, no copy is made of it. " "Typically, it is defined using :c:macro:`PyDoc_STR`." msgstr "" -#: ../../c-api/structures.rst:441 +#: ../../c-api/structures.rst:475 msgid "" "By default (when :c:member:`~PyMemberDef.flags` is ``0``), members allow " "both read and write access. Use the :c:macro:`Py_READONLY` flag for read-" @@ -461,7 +500,7 @@ msgid "" "`T_OBJECT`) members can be deleted." msgstr "" -#: ../../c-api/structures.rst:450 +#: ../../c-api/structures.rst:484 msgid "" "For heap-allocated types (created using :c:func:`PyType_FromSpec` or " "similar), ``PyMemberDef`` may contain a definition for the special member " @@ -470,11 +509,11 @@ msgid "" "``Py_T_PYSSIZET`` and ``Py_READONLY``, for example::" msgstr "" -#: ../../c-api/structures.rst:462 +#: ../../c-api/structures.rst:496 msgid "(You may need to ``#include `` for :c:func:`!offsetof`.)" msgstr "" -#: ../../c-api/structures.rst:464 +#: ../../c-api/structures.rst:498 msgid "" "The legacy offsets :c:member:`~PyTypeObject.tp_dictoffset` and :c:member:" "`~PyTypeObject.tp_weaklistoffset` can be defined similarly using " @@ -483,77 +522,77 @@ msgid "" "and :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` instead." msgstr "" -#: ../../c-api/structures.rst:472 +#: ../../c-api/structures.rst:506 msgid "" "``PyMemberDef`` is always available. Previously, it required including " "``\"structmember.h\"``." msgstr "" -#: ../../c-api/structures.rst:477 +#: ../../c-api/structures.rst:511 msgid "" "Get an attribute belonging to the object at address *obj_addr*. The " "attribute is described by ``PyMemberDef`` *m*. Returns ``NULL`` on error." msgstr "" -#: ../../c-api/structures.rst:483 +#: ../../c-api/structures.rst:517 msgid "" "``PyMember_GetOne`` is always available. Previously, it required including " "``\"structmember.h\"``." msgstr "" -#: ../../c-api/structures.rst:488 +#: ../../c-api/structures.rst:522 msgid "" "Set an attribute belonging to the object at address *obj_addr* to object " "*o*. The attribute to set is described by ``PyMemberDef`` *m*. Returns " "``0`` if successful and a negative value on failure." msgstr "" -#: ../../c-api/structures.rst:494 +#: ../../c-api/structures.rst:528 msgid "" "``PyMember_SetOne`` is always available. Previously, it required including " "``\"structmember.h\"``." msgstr "" -#: ../../c-api/structures.rst:500 +#: ../../c-api/structures.rst:534 msgid "Member flags" msgstr "" -#: ../../c-api/structures.rst:502 +#: ../../c-api/structures.rst:536 msgid "The following flags can be used with :c:member:`PyMemberDef.flags`:" msgstr "" -#: ../../c-api/structures.rst:506 +#: ../../c-api/structures.rst:540 msgid "Not writable." -msgstr "" +msgstr "不可寫入。" -#: ../../c-api/structures.rst:510 +#: ../../c-api/structures.rst:544 msgid "" "Emit an ``object.__getattr__`` :ref:`audit event ` before " "reading." msgstr "" -#: ../../c-api/structures.rst:515 +#: ../../c-api/structures.rst:549 msgid "" "Indicates that the :c:member:`~PyMemberDef.offset` of this ``PyMemberDef`` " "entry indicates an offset from the subclass-specific data, rather than from " "``PyObject``." msgstr "" -#: ../../c-api/structures.rst:519 +#: ../../c-api/structures.rst:553 msgid "" "Can only be used as part of :c:member:`Py_tp_members ` :c:type:`slot ` when creating a class using " +"tp_members>` :c:type:`slot ` when creating a class using " "negative :c:member:`~PyType_Spec.basicsize`. It is mandatory in that case." msgstr "" -#: ../../c-api/structures.rst:524 +#: ../../c-api/structures.rst:558 msgid "" -"This flag is only used in :c:type:`PyTypeSlot`. When setting :c:member:" +"This flag is only used in :c:type:`PyType_Slot`. When setting :c:member:" "`~PyTypeObject.tp_members` during class creation, Python clears it and sets :" "c:member:`PyMemberDef.offset` to the offset from the ``PyObject`` struct." msgstr "" -#: ../../c-api/structures.rst:536 +#: ../../c-api/structures.rst:570 msgid "" "The :c:macro:`!RESTRICTED`, :c:macro:`!READ_RESTRICTED` and :c:macro:`!" "WRITE_RESTRICTED` macros available with ``#include \"structmember.h\"`` are " @@ -562,7 +601,7 @@ msgid "" "nothing." msgstr "" -#: ../../c-api/structures.rst:547 +#: ../../c-api/structures.rst:581 msgid "" "The :c:macro:`!READONLY` macro was renamed to :c:macro:`Py_READONLY`. The :c:" "macro:`!PY_AUDIT_READ` macro was renamed with the ``Py_`` prefix. The new " @@ -571,11 +610,11 @@ msgid "" "names." msgstr "" -#: ../../c-api/structures.rst:556 +#: ../../c-api/structures.rst:590 msgid "Member types" msgstr "" -#: ../../c-api/structures.rst:558 +#: ../../c-api/structures.rst:592 msgid "" ":c:member:`PyMemberDef.type` can be one of the following macros " "corresponding to various C types. When the member is accessed in Python, it " @@ -584,147 +623,147 @@ msgid "" "exception such as :exc:`TypeError` or :exc:`ValueError` is raised." msgstr "" -#: ../../c-api/structures.rst:566 +#: ../../c-api/structures.rst:600 msgid "" "Unless marked (D), attributes defined this way cannot be deleted using e.g. :" "keyword:`del` or :py:func:`delattr`." msgstr "" -#: ../../c-api/structures.rst:570 +#: ../../c-api/structures.rst:604 msgid "Macro name" -msgstr "" +msgstr "巨集名稱" -#: ../../c-api/structures.rst:570 +#: ../../c-api/structures.rst:604 msgid "C type" msgstr "" -#: ../../c-api/structures.rst:570 +#: ../../c-api/structures.rst:604 msgid "Python type" msgstr "" -#: ../../c-api/structures.rst:572 +#: ../../c-api/structures.rst:606 msgid ":c:expr:`char`" -msgstr "" - -#: ../../c-api/structures.rst:572 ../../c-api/structures.rst:573 -#: ../../c-api/structures.rst:574 ../../c-api/structures.rst:575 -#: ../../c-api/structures.rst:576 ../../c-api/structures.rst:577 -#: ../../c-api/structures.rst:578 ../../c-api/structures.rst:579 -#: ../../c-api/structures.rst:580 ../../c-api/structures.rst:581 -#: ../../c-api/structures.rst:582 +msgstr ":c:expr:`char`" + +#: ../../c-api/structures.rst:606 ../../c-api/structures.rst:607 +#: ../../c-api/structures.rst:608 ../../c-api/structures.rst:609 +#: ../../c-api/structures.rst:610 ../../c-api/structures.rst:611 +#: ../../c-api/structures.rst:612 ../../c-api/structures.rst:613 +#: ../../c-api/structures.rst:614 ../../c-api/structures.rst:615 +#: ../../c-api/structures.rst:616 msgid ":py:class:`int`" msgstr ":py:class:`int`" -#: ../../c-api/structures.rst:573 +#: ../../c-api/structures.rst:607 msgid ":c:expr:`short`" msgstr ":c:expr:`short`" -#: ../../c-api/structures.rst:574 +#: ../../c-api/structures.rst:608 msgid ":c:expr:`int`" msgstr ":c:expr:`int`" -#: ../../c-api/structures.rst:575 +#: ../../c-api/structures.rst:609 msgid ":c:expr:`long`" msgstr ":c:expr:`long`" -#: ../../c-api/structures.rst:576 +#: ../../c-api/structures.rst:610 msgid ":c:expr:`long long`" msgstr ":c:expr:`long long`" -#: ../../c-api/structures.rst:577 +#: ../../c-api/structures.rst:611 msgid ":c:expr:`unsigned char`" msgstr ":c:expr:`unsigned char`" -#: ../../c-api/structures.rst:578 +#: ../../c-api/structures.rst:612 msgid ":c:expr:`unsigned int`" msgstr ":c:expr:`unsigned int`" -#: ../../c-api/structures.rst:579 +#: ../../c-api/structures.rst:613 msgid ":c:expr:`unsigned short`" msgstr ":c:expr:`unsigned short`" -#: ../../c-api/structures.rst:580 +#: ../../c-api/structures.rst:614 msgid ":c:expr:`unsigned long`" msgstr ":c:expr:`unsigned long`" -#: ../../c-api/structures.rst:581 +#: ../../c-api/structures.rst:615 msgid ":c:expr:`unsigned long long`" msgstr ":c:expr:`unsigned long long`" -#: ../../c-api/structures.rst:582 +#: ../../c-api/structures.rst:616 msgid ":c:expr:`Py_ssize_t`" msgstr ":c:expr:`Py_ssize_t`" -#: ../../c-api/structures.rst:583 +#: ../../c-api/structures.rst:617 msgid ":c:expr:`float`" msgstr ":c:expr:`float`" -#: ../../c-api/structures.rst:583 ../../c-api/structures.rst:584 +#: ../../c-api/structures.rst:617 ../../c-api/structures.rst:618 msgid ":py:class:`float`" msgstr ":py:class:`float`" -#: ../../c-api/structures.rst:584 +#: ../../c-api/structures.rst:618 msgid ":c:expr:`double`" msgstr ":c:expr:`double`" -#: ../../c-api/structures.rst:585 +#: ../../c-api/structures.rst:619 msgid ":c:expr:`char` (written as 0 or 1)" msgstr ":c:expr:`char` (寫成 0 或 1)" -#: ../../c-api/structures.rst:585 +#: ../../c-api/structures.rst:619 msgid ":py:class:`bool`" msgstr ":py:class:`bool`" -#: ../../c-api/structures.rst:587 +#: ../../c-api/structures.rst:621 msgid ":c:expr:`const char *` (*)" msgstr ":c:expr:`const char *` (*)" -#: ../../c-api/structures.rst:587 ../../c-api/structures.rst:588 +#: ../../c-api/structures.rst:621 ../../c-api/structures.rst:622 msgid ":py:class:`str` (RO)" msgstr ":py:class:`str` (RO)" -#: ../../c-api/structures.rst:588 +#: ../../c-api/structures.rst:622 msgid ":c:expr:`const char[]` (*)" msgstr ":c:expr:`const char[]` (*)" -#: ../../c-api/structures.rst:589 +#: ../../c-api/structures.rst:623 msgid ":c:expr:`char` (0-127)" msgstr ":c:expr:`char` (0-127)" -#: ../../c-api/structures.rst:589 +#: ../../c-api/structures.rst:623 msgid ":py:class:`str` (**)" msgstr ":py:class:`str` (**)" -#: ../../c-api/structures.rst:590 +#: ../../c-api/structures.rst:624 msgid ":c:expr:`PyObject *`" msgstr ":c:expr:`PyObject *`" -#: ../../c-api/structures.rst:590 +#: ../../c-api/structures.rst:624 msgid ":py:class:`object` (D)" msgstr ":py:class:`object` (D)" -#: ../../c-api/structures.rst:593 +#: ../../c-api/structures.rst:627 msgid "" "(*): Zero-terminated, UTF8-encoded C string. With :c:macro:`!Py_T_STRING` " "the C representation is a pointer; with :c:macro:`!Py_T_STRING_INPLACE` the " "string is stored directly in the structure." msgstr "" -#: ../../c-api/structures.rst:598 +#: ../../c-api/structures.rst:632 msgid "(**): String of length 1. Only ASCII is accepted." msgstr "" -#: ../../c-api/structures.rst:600 +#: ../../c-api/structures.rst:634 msgid "(RO): Implies :c:macro:`Py_READONLY`." msgstr "" -#: ../../c-api/structures.rst:602 +#: ../../c-api/structures.rst:636 msgid "" "(D): Can be deleted, in which case the pointer is set to ``NULL``. Reading a " "``NULL`` pointer raises :py:exc:`AttributeError`." msgstr "" -#: ../../c-api/structures.rst:628 +#: ../../c-api/structures.rst:662 msgid "" "In previous versions, the macros were only available with ``#include " "\"structmember.h\"`` and were named without the ``Py_`` prefix (e.g. as " @@ -732,69 +771,69 @@ msgid "" "with the following deprecated types:" msgstr "" -#: ../../c-api/structures.rst:636 +#: ../../c-api/structures.rst:670 msgid "" "Like ``Py_T_OBJECT_EX``, but ``NULL`` is converted to ``None``. This results " "in surprising behavior in Python: deleting the attribute effectively sets it " "to ``None``." msgstr "" -#: ../../c-api/structures.rst:642 +#: ../../c-api/structures.rst:676 msgid "Always ``None``. Must be used with :c:macro:`Py_READONLY`." msgstr "" -#: ../../c-api/structures.rst:645 +#: ../../c-api/structures.rst:679 msgid "Defining Getters and Setters" msgstr "" -#: ../../c-api/structures.rst:649 +#: ../../c-api/structures.rst:683 msgid "" "Structure to define property-like access for a type. See also description of " "the :c:member:`PyTypeObject.tp_getset` slot." msgstr "" -#: ../../c-api/structures.rst:654 +#: ../../c-api/structures.rst:688 msgid "attribute name" -msgstr "" +msgstr "屬性名稱" -#: ../../c-api/structures.rst:658 +#: ../../c-api/structures.rst:692 msgid "C function to get the attribute." msgstr "" -#: ../../c-api/structures.rst:662 +#: ../../c-api/structures.rst:696 msgid "" -"Optional C function to set or delete the attribute, if omitted the attribute " -"is readonly." +"Optional C function to set or delete the attribute. If ``NULL``, the " +"attribute is read-only." msgstr "" -#: ../../c-api/structures.rst:666 +#: ../../c-api/structures.rst:701 msgid "optional docstring" -msgstr "" +msgstr "可選的文件字串" -#: ../../c-api/structures.rst:670 +#: ../../c-api/structures.rst:705 msgid "" "Optional function pointer, providing additional data for getter and setter." msgstr "" -#: ../../c-api/structures.rst:672 +#: ../../c-api/structures.rst:709 msgid "" "The ``get`` function takes one :c:expr:`PyObject*` parameter (the instance) " -"and a function pointer (the associated ``closure``)::" +"and a function pointer (the associated ``closure``):" msgstr "" -#: ../../c-api/structures.rst:677 +#: ../../c-api/structures.rst:712 msgid "" "It should return a new reference on success or ``NULL`` with a set exception " "on failure." msgstr "" -#: ../../c-api/structures.rst:680 +#: ../../c-api/structures.rst:717 msgid "" "``set`` functions take two :c:expr:`PyObject*` parameters (the instance and " -"the value to be set) and a function pointer (the associated ``closure``)::" +"the value to be set) and a function pointer (the associated ``closure``):" msgstr "" -#: ../../c-api/structures.rst:685 +#: ../../c-api/structures.rst:720 msgid "" "In case the attribute should be deleted the second parameter is ``NULL``. " "Should return ``0`` on success or ``-1`` with a set exception on failure." @@ -812,94 +851,94 @@ msgstr "classmethod" msgid "staticmethod" msgstr "staticmethod" -#: ../../c-api/structures.rst:529 +#: ../../c-api/structures.rst:563 msgid "READ_RESTRICTED" msgstr "READ_RESTRICTED" -#: ../../c-api/structures.rst:529 +#: ../../c-api/structures.rst:563 msgid "WRITE_RESTRICTED" msgstr "WRITE_RESTRICTED" -#: ../../c-api/structures.rst:529 +#: ../../c-api/structures.rst:563 msgid "RESTRICTED" msgstr "RESTRICTED" -#: ../../c-api/structures.rst:542 +#: ../../c-api/structures.rst:576 msgid "READONLY" msgstr "READONLY" -#: ../../c-api/structures.rst:605 +#: ../../c-api/structures.rst:639 msgid "T_BYTE" msgstr "T_BYTE" -#: ../../c-api/structures.rst:605 +#: ../../c-api/structures.rst:639 msgid "T_SHORT" msgstr "T_SHORT" -#: ../../c-api/structures.rst:605 +#: ../../c-api/structures.rst:639 msgid "T_INT" msgstr "T_INT" -#: ../../c-api/structures.rst:605 +#: ../../c-api/structures.rst:639 msgid "T_LONG" msgstr "T_LONG" -#: ../../c-api/structures.rst:605 +#: ../../c-api/structures.rst:639 msgid "T_LONGLONG" msgstr "T_LONGLONG" -#: ../../c-api/structures.rst:605 +#: ../../c-api/structures.rst:639 msgid "T_UBYTE" msgstr "T_UBYTE" -#: ../../c-api/structures.rst:605 +#: ../../c-api/structures.rst:639 msgid "T_USHORT" msgstr "T_USHORT" -#: ../../c-api/structures.rst:605 +#: ../../c-api/structures.rst:639 msgid "T_UINT" msgstr "T_UINT" -#: ../../c-api/structures.rst:605 +#: ../../c-api/structures.rst:639 msgid "T_ULONG" msgstr "T_ULONG" -#: ../../c-api/structures.rst:605 +#: ../../c-api/structures.rst:639 msgid "T_ULONGULONG" msgstr "T_ULONGULONG" -#: ../../c-api/structures.rst:605 +#: ../../c-api/structures.rst:639 msgid "T_PYSSIZET" msgstr "T_PYSSIZET" -#: ../../c-api/structures.rst:605 +#: ../../c-api/structures.rst:639 msgid "T_FLOAT" msgstr "T_FLOAT" -#: ../../c-api/structures.rst:605 +#: ../../c-api/structures.rst:639 msgid "T_DOUBLE" msgstr "T_DOUBLE" -#: ../../c-api/structures.rst:605 +#: ../../c-api/structures.rst:639 msgid "T_BOOL" msgstr "T_BOOL" -#: ../../c-api/structures.rst:605 +#: ../../c-api/structures.rst:639 msgid "T_CHAR" msgstr "T_CHAR" -#: ../../c-api/structures.rst:605 +#: ../../c-api/structures.rst:639 msgid "T_STRING" msgstr "T_STRING" -#: ../../c-api/structures.rst:605 +#: ../../c-api/structures.rst:639 msgid "T_STRING_INPLACE" msgstr "T_STRING_INPLACE" -#: ../../c-api/structures.rst:605 +#: ../../c-api/structures.rst:639 msgid "T_OBJECT_EX" msgstr "T_OBJECT_EX" -#: ../../c-api/structures.rst:605 +#: ../../c-api/structures.rst:639 msgid "structmember.h" msgstr "structmember.h" diff --git a/faq/design.po b/faq/design.po index 6fa942e574..9d6db0533b 100644 --- a/faq/design.po +++ b/faq/design.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-21 00:03+0000\n" +"POT-Creation-Date: 2024-01-11 00:04+0000\n" "PO-Revision-Date: 2023-08-31 11:34+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -793,14 +793,14 @@ msgid "" "differs by a single bit, could hash to ``1142331976``. The hash code is " "then used to calculate a location in an internal array where the value will " "be stored. Assuming that you're storing keys that all have different hash " -"values, this means that dictionaries take constant time -- O(1), in Big-O " -"notation -- to retrieve a key." +"values, this means that dictionaries take constant time -- *O*\\ (1), in Big-" +"O notation -- to retrieve a key." msgstr "" "字典利用內建 :func:`hash` 函式,對每個鍵做雜湊計算。雜湊結果依據鍵的值和個別" "執行緒 (processes) 的種子而有相當大的差距。例如,``'Python'`` 的雜湊是 " "``-539294296``,而只差一個字的 ``'python'`` 則是 ``1142331976``。雜湊結果接著" "被用來計算值在內部陣列儲存的位置。假設你存的鍵都有不同的雜湊值,那字典只需要" -"常數時間 — 用大 O 表示法 (Big-O notation) 就是 O(1) — 來找任意一個鍵。" +"常數時間 — 用大 O 表示法 (Big-O notation) 就是 *O*\\ (1) — 來找任意一個鍵。" #: ../../faq/design.rst:458 msgid "Why must dictionary keys be immutable?" diff --git a/glossary.po b/glossary.po index 3576f8f629..66431ba542 100644 --- a/glossary.po +++ b/glossary.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-07 00:03+0000\n" +"POT-Creation-Date: 2024-01-11 00:04+0000\n" "PO-Revision-Date: 2023-07-02 22:47+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1637,11 +1637,11 @@ msgstr "list(串列)" msgid "" "A built-in Python :term:`sequence`. Despite its name it is more akin to an " "array in other languages than to a linked list since access to elements is " -"O(1)." +"*O*\\ (1)." msgstr "" "一個 Python 內建的 :term:`sequence` (序列)。儘管它的名字是 list,它其實更類" "似其他語言中的一個陣列 (array) 而較不像一個鏈結串列 (linked list),因為存取元" -"素的時間複雜度是 O(1)。" +"素的時間複雜度是 *O*\\ (1)。" #: ../../glossary.rst:745 msgid "list comprehension" diff --git a/howto/urllib2.po b/howto/urllib2.po index 64aac1a827..97e6452385 100644 --- a/howto/urllib2.po +++ b/howto/urllib2.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2024-01-15 00:03+0000\n" "PO-Revision-Date: 2022-06-27 09:36+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -343,8 +343,8 @@ msgstr "" #: ../../howto/urllib2.rst:394 msgid "" "The response returned by urlopen (or the :exc:`~urllib.error.HTTPError` " -"instance) has two useful methods :meth:`info` and :meth:`geturl` and is " -"defined in the module :mod:`urllib.response`.." +"instance) has two useful methods :meth:`!info` and :meth:`!geturl` and is " +"defined in the module :mod:`urllib.response`." msgstr "" #: ../../howto/urllib2.rst:398 @@ -482,7 +482,7 @@ msgstr "" msgid "" "In the above example we only supplied our ``HTTPBasicAuthHandler`` to " "``build_opener``. By default openers have the handlers for normal situations " -"-- ``ProxyHandler`` (if a proxy setting such as an :envvar:`http_proxy` " +"-- ``ProxyHandler`` (if a proxy setting such as an :envvar:`!http_proxy` " "environment variable is set), ``UnknownHandler``, ``HTTPHandler``, " "``HTTPDefaultErrorHandler``, ``HTTPRedirectHandler``, ``FTPHandler``, " "``FileHandler``, ``DataHandler``, ``HTTPErrorProcessor``." diff --git a/library/argparse.po b/library/argparse.po index 4206e160ba..4ebe06b40a 100644 --- a/library/argparse.po +++ b/library/argparse.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2024-01-24 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:38+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1700,7 +1700,7 @@ msgid "" msgstr "" #: ../../library/argparse.rst:1939 -msgid "The *encodings* and *errors* keyword arguments." +msgid "Added the *encodings* and *errors* parameters." msgstr "" #: ../../library/argparse.rst:1944 diff --git a/library/array.po b/library/array.po index fc3b060231..0ab347c24f 100644 --- a/library/array.po +++ b/library/array.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2024-01-22 14:16+0000\n" "PO-Revision-Date: 2021-11-23 18:40+0800\n" "Last-Translator: Benson Chen \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -243,25 +243,28 @@ msgstr "這個模組定義了下方的型別:" #: ../../library/array.rst:78 msgid "" "A new array whose items are restricted by *typecode*, and initialized from " -"the optional *initializer* value, which must be a list, a :term:`bytes-like " -"object`, or iterable over elements of the appropriate type." +"the optional *initializer* value, which must be a :class:`bytes` or :class:" +"`bytearray` object, a Unicode string, or iterable over elements of the " +"appropriate type." msgstr "" -"一個新的陣列中的元素被 *typecode* 限制,並由選用的 *initializer* 參數初始" -"化,\\ *initializer* 必須是一個 list、\\ :term:`bytes-like object`\\ (類位元" -"組串物件)或包含適當型別變數的可疊代物件 (iterable)。" +"一個新的陣列中的元素被 *typecode* 限制,並由選用的 *initializer* 參數初始化," +"*initializer* 必須是一個 :class:`bytes` 或 :class:`bytearray` 物件、一個 " +"Unicode 字串或包含適當型別元素的可疊代物件 (iterable)。" #: ../../library/array.rst:83 msgid "" -"If given a list or string, the initializer is passed to the new array's :" -"meth:`fromlist`, :meth:`frombytes`, or :meth:`fromunicode` method (see " -"below) to add initial items to the array. Otherwise, the iterable " -"initializer is passed to the :meth:`extend` method." +"If given a :class:`bytes` or :class:`bytearray` object, the initializer is " +"passed to the new array's :meth:`frombytes` method; if given a Unicode " +"string, the initializer is passed to the :meth:`fromunicode` method; " +"otherwise, the initializer's iterator is passed to the :meth:`extend` method " +"to add initial items to the array." msgstr "" -"如果指定一個 list 或 string,新的陣列初始化時會傳入 :meth:`fromlist`\\ 、\\ :" -"meth:`frombytes` 或 :meth:`fromunicode` 方法(參照下方)將元素新增到其中。其" -"他情況時, 一個 iterable initializer 將被傳入 :meth:`extend` 方法之中。" +"如果給定的是一個 :class:`bytes` 或 :class:`bytearray` 物件,新的陣列初始化時" +"會傳入 :meth:`frombytes` 方法;如為 Unicode 字串則會傳入 :meth:`fromunicode` " +"方法;其他情況時, 一個 initializer 的可疊代物件將被傳入 :meth:`extend` 方法" +"之中來將初始項目新增至陣列。" -#: ../../library/array.rst:88 +#: ../../library/array.rst:90 msgid "" "Array objects support the ordinary sequence operations of indexing, slicing, " "concatenation, and multiplication. When using slice assignment, the " @@ -272,31 +275,31 @@ msgid "" msgstr "" "陣列支援常見的序列操作,包含索引 (indexing)、切片 (slicing)、串接 " "(concatenation)、相乘 (multiplication) 等。當使用切片進行賦值時,賦值的陣列必" -"須具備相同的 type code,其他型別的數值將導致 :exc:`TypeError`\\ 。陣列同時也" -"實作了緩衝區介面,可以在任何支援 :term:`bytes-like objects ` 的地方使用。" +"須具備相同的 type code,其他型別的數值將導致 :exc:`TypeError`。陣列同時也實作" +"了緩衝區介面,可以在任何支援 :term:`bytes-like objects ` " +"的地方使用。" -#: ../../library/array.rst:94 +#: ../../library/array.rst:96 msgid "" "Raises an :ref:`auditing event ` ``array.__new__`` with arguments " "``typecode``, ``initializer``." msgstr "" "引發\\ :ref:`稽核事件 (auditing event) ` ``array.__new__`` 並帶入引" -"數 ``typecode``\\ 、\\ ``initializer``\\。" +"數 ``typecode``、``initializer``。" -#: ../../library/array.rst:99 +#: ../../library/array.rst:101 msgid "The typecode character used to create the array." msgstr "typecode 字元被用在建立陣列時。" -#: ../../library/array.rst:104 +#: ../../library/array.rst:106 msgid "The length in bytes of one array item in the internal representation." msgstr "陣列當中的一個元素在內部需要的位元組長度。" -#: ../../library/array.rst:109 +#: ../../library/array.rst:111 msgid "Append a new item with value *x* to the end of the array." msgstr "新增一個元素 *x* 到陣列的最尾端。" -#: ../../library/array.rst:114 +#: ../../library/array.rst:116 msgid "" "Return a tuple ``(address, length)`` giving the current memory address and " "the length in elements of the buffer used to hold array's contents. The " @@ -313,7 +316,7 @@ msgstr "" "用,例如 :c:func:`!ioctl` 指令。只要陣列存在且沒有使用任何更改長度的操作時," "回傳的數值就有效。" -#: ../../library/array.rst:124 +#: ../../library/array.rst:126 msgid "" "When using array objects from code written in C or C++ (the only way to " "effectively make use of this information), it makes more sense to use the " @@ -325,7 +328,7 @@ msgstr "" "適當的做法是使用陣列物件支援的緩衝區介面。這個方法維護了向後兼容性,並應該在" "新的程式碼中避免。關於緩衝區介面的文件在\\ :ref:`bufferobjects`\\ 。" -#: ../../library/array.rst:133 +#: ../../library/array.rst:135 msgid "" "\"Byteswap\" all items of the array. This is only supported for values " "which are 1, 2, 4, or 8 bytes in size; for other types of values, :exc:" @@ -333,14 +336,14 @@ msgid "" "written on a machine with a different byte order." msgstr "" "\"Byteswap\" 所有陣列中的物件。這只有支援物件長度為 1、2、4 或 8 位元組的陣" -"列,其他型別的值會導致 :exc:`RuntimeError`\\ 。這在從機器讀取位元順序不同的檔" -"案時很有用。" +"列,其他型別的值會導致 :exc:`RuntimeError`。這在從機器讀取位元順序不同的檔案" +"時很有用。" -#: ../../library/array.rst:141 +#: ../../library/array.rst:143 msgid "Return the number of occurrences of *x* in the array." msgstr "回傳 *x* 在陣列中出現了幾次。" -#: ../../library/array.rst:146 +#: ../../library/array.rst:148 msgid "" "Append items from *iterable* to the end of the array. If *iterable* is " "another array, it must have *exactly* the same type code; if not, :exc:" @@ -348,24 +351,24 @@ msgid "" "iterable and its elements must be the right type to be appended to the array." msgstr "" "從 *iterable* 中新增元素到陣列的尾端,如果 *iterable* 是另一個陣列,它必須有" -"完全相同的 type code,如果不同會導致 :exc:`TypeError`\\ 。如果 *iterable* 不" -"是一個陣列,它必須可以被疊代 (iterable) 且其中的元素必須是可以被加入陣列中的" -"正確型別。" +"完全相同的 type code,如果不同會導致 :exc:`TypeError`。如果 *iterable* 不是一" +"個陣列,它必須可以被疊代 (iterable) 且其中的元素必須是可以被加入陣列中的正確" +"型別。" -#: ../../library/array.rst:154 +#: ../../library/array.rst:156 msgid "" -"Appends items from the string, interpreting the string as an array of " -"machine values (as if it had been read from a file using the :meth:" -"`fromfile` method)." +"Appends items from the :term:`bytes-like object`, interpreting its content " +"as an array of machine values (as if it had been read from a file using the :" +"meth:`fromfile` method)." msgstr "" -"從字串中新增元素。讀取時會將字串當作一個機器數值組成的陣列(就像從檔案中使" -"用 :meth:`fromfile` 方法讀出的資料)。" +"從 :term:`bytes-like object` 中新增元素。讀取時會將其內容當作一個機器數值組成" +"的陣列(就像從檔案中使用 :meth:`fromfile` 方法讀出的資料)。" -#: ../../library/array.rst:157 +#: ../../library/array.rst:160 msgid ":meth:`!fromstring` is renamed to :meth:`frombytes` for clarity." -msgstr "將 :meth:`!fromstring` 更名為 :meth:`frombytes`\\ ,使其更加清晰易懂。" +msgstr "將 :meth:`!fromstring` 更名為 :meth:`frombytes`,使其更加清晰易懂。" -#: ../../library/array.rst:163 +#: ../../library/array.rst:166 msgid "" "Read *n* items (as machine values) from the :term:`file object` *f* and " "append them to the end of the array. If less than *n* items are available, :" @@ -373,29 +376,29 @@ msgid "" "inserted into the array." msgstr "" "從 :term:`file object` *f* 讀取 *n* 個元素(作為機器數值),接著將這些元素加" -"入陣列的最尾端。如果只有少於 *n* 個有效的元素會導致 :exc:`EOFError`\\ ,但有" -"效的元素仍然會被加入陣列中。" +"入陣列的最尾端。如果只有少於 *n* 個有效的元素會導致 :exc:`EOFError`,但有效的" +"元素仍然會被加入陣列中。" -#: ../../library/array.rst:171 +#: ../../library/array.rst:174 msgid "" "Append items from the list. This is equivalent to ``for x in list: a." "append(x)`` except that if there is a type error, the array is unchanged." msgstr "" -"從 list 中新增元素。這等價於 ``for x in list: a.append(x)``\\ ,除了有型別錯" -"誤產生時,陣列會保持原狀不會被更改。" +"從 list 中新增元素。這等價於 ``for x in list: a.append(x)``,除了有型別錯誤產" +"生時,陣列會保持原狀不會被更改。" -#: ../../library/array.rst:177 +#: ../../library/array.rst:180 msgid "" -"Extends this array with data from the given unicode string. The array must " -"be a type ``'u'`` array; otherwise a :exc:`ValueError` is raised. Use " -"``array.frombytes(unicodestring.encode(enc))`` to append Unicode data to an " -"array of some other type." +"Extends this array with data from the given Unicode string. The array must " +"have type code ``'u'``; otherwise a :exc:`ValueError` is raised. Use ``array." +"frombytes(unicodestring.encode(enc))`` to append Unicode data to an array of " +"some other type." msgstr "" -"用給定的 unicode 字串擴展這個陣列。陣列必須是 ``u`` 型別的陣列;其他的型別會" -"導致 :exc:`ValueError` 錯誤。使用 ``array.frombytes(unicodestring." +"用給定的 Unicode 字串擴展這個陣列。陣列的 type code 必須是 ``u``;其他的型別" +"會導致 :exc:`ValueError` 被引發。使用 ``array.frombytes(unicodestring." "encode(enc))`` 來新增 Unicode 資料到一個其他型別的陣列。" -#: ../../library/array.rst:185 +#: ../../library/array.rst:188 msgid "" "Return the smallest *i* such that *i* is the index of the first occurrence " "of *x* in the array. The optional arguments *start* and *stop* can be " @@ -403,37 +406,37 @@ msgid "" "`ValueError` if *x* is not found." msgstr "" "回傳 *i* 的最小數值,使得 *i* 成為陣列之中第一次出現 *x* 的索引。選擇性的引" -"數 *start* 及 *stop* 則可以被用來在指定的陣列空間中搜尋 *x*\\ 。如果 *x* 不存" -"在將導致 :exc:`ValueError`\\ 。" +"數 *start* 及 *stop* 則可以被用來在指定的陣列空間中搜尋 *x*。如果 *x* 不存在" +"將導致 :exc:`ValueError`。" -#: ../../library/array.rst:190 +#: ../../library/array.rst:193 msgid "Added optional *start* and *stop* parameters." -msgstr "新增選擇性的參數 *start* 及 *stop*\\ 。" +msgstr "新增選擇性的參數 *start* 及 *stop*。" -#: ../../library/array.rst:196 +#: ../../library/array.rst:199 msgid "" "Insert a new item with value *x* in the array before position *i*. Negative " "values are treated as being relative to the end of the array." -msgstr "在位置 *i* 之前插入一個元素 *x*\\ 。負數的索引值會從陣列尾端開始數。" +msgstr "在位置 *i* 之前插入一個元素 *x*。負數的索引值會從陣列尾端開始數。" -#: ../../library/array.rst:202 +#: ../../library/array.rst:205 msgid "" "Removes the item with the index *i* from the array and returns it. The " "optional argument defaults to ``-1``, so that by default the last item is " "removed and returned." msgstr "" -"移除並回傳陣列索引值 *i* 的元素。選擇性的引數 *i* 預設為 ``-1``\\ ,所以預設" -"會刪除並回傳最後一個元素。" +"移除並回傳陣列索引值 *i* 的元素。選擇性的引數 *i* 預設為 ``-1``,所以預設會刪" +"除並回傳最後一個元素。" -#: ../../library/array.rst:209 +#: ../../library/array.rst:212 msgid "Remove the first occurrence of *x* from the array." -msgstr "從陣列中刪除第一個出現的 *x*\\ 。" +msgstr "從陣列中刪除第一個出現的 *x*。" -#: ../../library/array.rst:214 +#: ../../library/array.rst:217 msgid "Reverse the order of the items in the array." msgstr "反轉陣列中元素的順序。" -#: ../../library/array.rst:219 +#: ../../library/array.rst:222 msgid "" "Convert the array to an array of machine values and return the bytes " "representation (the same sequence of bytes that would be written to a file " @@ -442,59 +445,58 @@ msgstr "" "將陣列轉為另一個機器數值組成的陣列並回傳它的位元組表示(跟用 :meth:`tofile` " "方法寫入檔案時的位元序列相同)。" -#: ../../library/array.rst:223 +#: ../../library/array.rst:226 msgid ":meth:`!tostring` is renamed to :meth:`tobytes` for clarity." -msgstr "為了明確性,過去的 :meth:`!tostring` 已更名為 :meth:`tobytes`\\ 。" +msgstr "為了明確性,過去的 :meth:`!tostring` 已更名為 :meth:`tobytes`。" -#: ../../library/array.rst:229 +#: ../../library/array.rst:232 msgid "Write all items (as machine values) to the :term:`file object` *f*." -msgstr "將所有元素(作為機器數值)寫入 :term:`file object` *f*\\ 。" +msgstr "將所有元素(作為機器數值)寫入 :term:`file object` *f*。" -#: ../../library/array.rst:234 +#: ../../library/array.rst:237 msgid "Convert the array to an ordinary list with the same items." msgstr "不更改元素,將陣列轉為一般的 list。" -#: ../../library/array.rst:239 +#: ../../library/array.rst:242 msgid "" -"Convert the array to a unicode string. The array must be a type ``'u'`` " -"array; otherwise a :exc:`ValueError` is raised. Use ``array.tobytes()." -"decode(enc)`` to obtain a unicode string from an array of some other type." +"Convert the array to a Unicode string. The array must have a type ``'u'``; " +"otherwise a :exc:`ValueError` is raised. Use ``array.tobytes().decode(enc)`` " +"to obtain a Unicode string from an array of some other type." msgstr "" -"將陣列轉為一個字串。陣列的型別必須為 ``u``\\ 。其他型別的陣列會導致 :exc:" -"`ValueError` 錯誤。使用 ``array.tobytes().decode(enc)`` 將其他型別的陣列轉為" -"字串。" +"將陣列轉為一個 Unicode 字串。陣列的型別必須為 ``u``。其他型別的陣列會導致 :" +"exc:`ValueError` 錯誤。請使用 ``array.tobytes().decode(enc)`` 來為其他型別的" +"陣列轉為 Unicode 字串。" -#: ../../library/array.rst:244 +#: ../../library/array.rst:247 msgid "" -"When an array object is printed or converted to a string, it is represented " -"as ``array(typecode, initializer)``. The *initializer* is omitted if the " -"array is empty, otherwise it is a string if the *typecode* is ``'u'``, " -"otherwise it is a list of numbers. The string is guaranteed to be able to " +"The string representation of array objects has the form ``array(typecode, " +"initializer)``. The *initializer* is omitted if the array is empty, " +"otherwise it is a Unicode string if the *typecode* is ``'u'``, otherwise it " +"is a list of numbers. The string representation is guaranteed to be able to " "be converted back to an array with the same type and value using :func:" "`eval`, so long as the :class:`~array.array` class has been imported using " -"``from array import array``. Examples::" +"``from array import array``. Variables ``inf`` and ``nan`` must also be " +"defined if it contains corresponding floating point values. Examples::" msgstr "" -"當一個陣列物件被列印或轉換成字串時,它會被表示為 ``array(typecode, " -"initializer)``\\ 。若為空陣列則參數 *initializer* 被省略,若 *typecode* 是 " -"``'u'`` 將被表示為字串,其他情況則被表示為由數字組成的 list。只要 :class:" -"`~array.array` class(類別)透過 ``from array import array`` 的方式引入,便能" -"確保該字串能透過 :func:`eval` 轉換回一個擁有相同型別及數值的陣列。範例:\n" -"\n" -"::" - -#: ../../library/array.rst:261 +"陣列物件的字串表示形式為 ``array(typecode, initializer)``。若為空陣列則參數 " +"*initializer* 被省略,若 *typecode* 是 ``'u'`` 將被表示為 Unicode 字串,其他" +"情況則被表示為由數字組成的 list。只要 :class:`~array.array` class(類別)透" +"過 ``from array import array`` 的方式引入,便能確保該字串表示能透過 :func:" +"`eval` 轉換回一個擁有相同型別及數值的陣列。範例: ::" + +#: ../../library/array.rst:268 msgid "Module :mod:`struct`" msgstr ":mod:`struct` 模組" -#: ../../library/array.rst:261 +#: ../../library/array.rst:268 msgid "Packing and unpacking of heterogeneous binary data." msgstr "將包含不同資料類型的二進位資料包裝與解開包裝。" -#: ../../library/array.rst:265 +#: ../../library/array.rst:272 msgid "Module :mod:`xdrlib`" msgstr ":mod:`xdrlib` 模組" -#: ../../library/array.rst:264 +#: ../../library/array.rst:271 msgid "" "Packing and unpacking of External Data Representation (XDR) data as used in " "some remote procedure call systems." @@ -502,11 +504,11 @@ msgstr "" "將 External Data Representation (XDR) 的資料包裝與解開包裝,這用在一些遠端操" "作的系統 (remote procedure call systems)。" -#: ../../library/array.rst:267 +#: ../../library/array.rst:274 msgid "`NumPy `_" msgstr "`NumPy `_" -#: ../../library/array.rst:268 +#: ../../library/array.rst:275 msgid "The NumPy package defines another array type." msgstr "NumPy 套件定義了另一個陣列型別" diff --git a/library/asyncio-policy.po b/library/asyncio-policy.po index d3fd1d476e..e1847c9ed4 100644 --- a/library/asyncio-policy.po +++ b/library/asyncio-policy.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2024-01-11 00:04+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -298,7 +298,7 @@ msgstr "" #: ../../library/asyncio-policy.rst:240 msgid "" "There is no noticeable overhead when handling a big number of children " -"(*O(1)* each time a child terminates), but starting a thread per process " +"(*O*\\ (1) each time a child terminates), but starting a thread per process " "requires extra memory." msgstr "" @@ -328,7 +328,7 @@ msgstr "" #: ../../library/asyncio-policy.rst:259 msgid "" "The solution is safe but it has a significant overhead when handling a big " -"number of processes (*O(n)* each time a :py:data:`SIGCHLD` is received)." +"number of processes (*O*\\ (*n*) each time a :py:data:`SIGCHLD` is received)." msgstr "" #: ../../library/asyncio-policy.rst:269 @@ -341,8 +341,8 @@ msgstr "" #: ../../library/asyncio-policy.rst:276 msgid "" "This solution is as safe as :class:`MultiLoopChildWatcher` and has the same " -"*O(N)* complexity but requires a running event loop in the main thread to " -"work." +"*O*\\ (*n*) complexity but requires a running event loop in the main thread " +"to work." msgstr "" #: ../../library/asyncio-policy.rst:283 @@ -355,7 +355,7 @@ msgstr "" #: ../../library/asyncio-policy.rst:287 msgid "" "There is no noticeable overhead when handling a big number of children " -"(*O(1)* each time a child terminates)." +"(*O*\\ (1) each time a child terminates)." msgstr "" #: ../../library/asyncio-policy.rst:290 diff --git a/library/asyncio-stream.po b/library/asyncio-stream.po index e94d3e7c84..2ee50e7d8c 100644 --- a/library/asyncio-stream.po +++ b/library/asyncio-stream.po @@ -1,14 +1,14 @@ -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: # Adrian Liaw , 2018 -# Matt Wang , 2022 +# Matt Wang , 2022-2024 msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-11-27 00:03+0000\n" +"POT-Creation-Date: 2024-01-24 00:03+0000\n" "PO-Revision-Date: 2022-10-31 16:28+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -40,10 +40,7 @@ msgstr "" #: ../../library/asyncio-stream.rst:19 msgid "Here is an example of a TCP echo client written using asyncio streams::" -msgstr "" -"這是一個使用 asyncio 串流編寫的 TCP echo 客戶端範例:\n" -"\n" -"::" +msgstr "這是一個使用 asyncio 串流編寫的 TCP echo 客戶端範例: ::" #: ../../library/asyncio-stream.rst:42 msgid "See also the `Examples`_ section below." @@ -99,7 +96,7 @@ msgid "Added the *ssl_handshake_timeout* parameter." msgstr "新增 *ssl_handshake_timeout* 參數。" #: ../../library/asyncio-stream.rst:80 -msgid "Added *happy_eyeballs_delay* and *interleave* parameters." +msgid "Added the *happy_eyeballs_delay* and *interleave* parameters." msgstr "新增 *happy_eyeballs_delay* 和 *interleave* 參數。" #: ../../library/asyncio-stream.rst:83 ../../library/asyncio-stream.rst:125 @@ -347,10 +344,7 @@ msgstr "" #: ../../library/asyncio-stream.rst:289 ../../library/asyncio-stream.rst:301 msgid "The method should be used along with the ``drain()`` method::" -msgstr "" -"此方法應當與 ``drain()`` 方法一起使用:\n" -"\n" -"::" +msgstr "此方法應當與 ``drain()`` 方法一起使用: ::" #: ../../library/asyncio-stream.rst:296 msgid "" @@ -369,10 +363,7 @@ msgstr "此方法會關閉串流以及底層的 socket。" msgid "" "The method should be used, though not mandatory, along with the " "``wait_closed()`` method::" -msgstr "" -"此方法應與 ``wait_closed()`` 方法一起使用,但並非強制:\n" -"\n" -"::" +msgstr "此方法應與 ``wait_closed()`` 方法一起使用,但並非強制: ::" #: ../../library/asyncio-stream.rst:318 msgid "" @@ -399,10 +390,7 @@ msgstr "存取可選的傳輸資訊;詳情請見 :meth:`BaseTransport.get_extr #: ../../library/asyncio-stream.rst:337 msgid "Wait until it is appropriate to resume writing to the stream. Example::" -msgstr "" -"等待直到可以繼續寫入到串流。範例:\n" -"\n" -"::" +msgstr "等待直到可以繼續寫入到串流。範例: ::" #: ../../library/asyncio-stream.rst:343 msgid "" @@ -422,7 +410,7 @@ msgstr "" #: ../../library/asyncio-stream.rst:355 msgid "Parameters:" -msgstr "" +msgstr "參數:" #: ../../library/asyncio-stream.rst:357 msgid "*sslcontext*: a configured instance of :class:`~ssl.SSLContext`." @@ -476,10 +464,7 @@ msgstr "使用串流的 TCP echo 客戶端" #: ../../library/asyncio-stream.rst:402 msgid "TCP echo client using the :func:`asyncio.open_connection` function::" -msgstr "" -"使用 :func:`asyncio.open_connection` 函式的 TCP echo 客戶端:\n" -"\n" -"::" +msgstr "使用 :func:`asyncio.open_connection` 函式的 TCP echo 客戶端: ::" #: ../../library/asyncio-stream.rst:426 msgid "" @@ -496,10 +481,7 @@ msgstr "使用串流的 TCP echo 伺服器" #: ../../library/asyncio-stream.rst:435 msgid "TCP echo server using the :func:`asyncio.start_server` function::" -msgstr "" -"TCP echo 伺服器使用 :func:`asyncio.start_server` 函式:\n" -"\n" -"::" +msgstr "TCP echo 伺服器使用 :func:`asyncio.start_server` 函式: ::" #: ../../library/asyncio-stream.rst:469 msgid "" @@ -517,24 +499,15 @@ msgstr "獲取 HTTP 標頭" #: ../../library/asyncio-stream.rst:476 msgid "" "Simple example querying HTTP headers of the URL passed on the command line::" -msgstr "" -"查詢自命令列傳入之 URL 所帶有 HTTP 標頭的簡單範例:\n" -"\n" -"::" +msgstr "查詢自命令列傳入之 URL 所帶有 HTTP 標頭的簡單範例: ::" #: ../../library/asyncio-stream.rst:515 msgid "Usage::" -msgstr "" -"用法:\n" -"\n" -"::" +msgstr "用法: ::" #: ../../library/asyncio-stream.rst:519 msgid "or with HTTPS::" -msgstr "" -"或使用 HTTPS:\n" -"\n" -"::" +msgstr "或使用 HTTPS: ::" #: ../../library/asyncio-stream.rst:527 msgid "Register an open socket to wait for data using streams" @@ -545,9 +518,7 @@ msgid "" "Coroutine waiting until a socket receives data using the :func:" "`open_connection` function::" msgstr "" -"等待直到 socket 透過使用 :func:`open_connection` 函式接收到資料的協程:\n" -"\n" -"::" +"等待直到 socket 透過使用 :func:`open_connection` 函式接收到資料的協程: ::" #: ../../library/asyncio-stream.rst:564 msgid "" diff --git a/library/asyncio-task.po b/library/asyncio-task.po index 6c96adc696..e434d9df6f 100644 --- a/library/asyncio-task.po +++ b/library/asyncio-task.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-14 00:03+0000\n" +"POT-Creation-Date: 2024-01-25 06:20+0000\n" "PO-Revision-Date: 2018-05-23 14:39+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -241,11 +241,11 @@ msgid "" "tasks, gather them in a collection::" msgstr "" -#: ../../library/asyncio-task.rst:287 ../../library/asyncio-task.rst:1076 +#: ../../library/asyncio-task.rst:287 ../../library/asyncio-task.rst:1075 msgid "Added the *name* parameter." msgstr "新增 *name* 參數。" -#: ../../library/asyncio-task.rst:290 ../../library/asyncio-task.rst:1083 +#: ../../library/asyncio-task.rst:290 ../../library/asyncio-task.rst:1082 msgid "Added the *context* parameter." msgstr "新增 *context* 參數。" @@ -305,7 +305,7 @@ msgstr "" #: ../../library/asyncio-task.rst:338 ../../library/asyncio-task.rst:472 #: ../../library/asyncio-task.rst:645 ../../library/asyncio-task.rst:703 #: ../../library/asyncio-task.rst:729 ../../library/asyncio-task.rst:769 -#: ../../library/asyncio-task.rst:869 +#: ../../library/asyncio-task.rst:868 msgid "Example::" msgstr "" "範例:\n" @@ -395,7 +395,7 @@ msgstr "" #: ../../library/asyncio-task.rst:426 ../../library/asyncio-task.rst:521 #: ../../library/asyncio-task.rst:620 ../../library/asyncio-task.rst:794 -#: ../../library/asyncio-task.rst:849 ../../library/asyncio-task.rst:875 +#: ../../library/asyncio-task.rst:848 ../../library/asyncio-task.rst:874 msgid "Removed the *loop* parameter." msgstr "移除 *loop* 參數。" @@ -780,52 +780,40 @@ msgstr "" msgid "Constant" msgstr "常數" -#: ../../library/asyncio-task.rst:831 +#: ../../library/asyncio-task.rst:832 msgid "Description" msgstr "描述" -#: ../../library/asyncio-task.rst:833 -msgid ":const:`FIRST_COMPLETED`" -msgstr ":const:`FIRST_COMPLETED`" - -#: ../../library/asyncio-task.rst:833 +#: ../../library/asyncio-task.rst:835 msgid "The function will return when any future finishes or is cancelled." msgstr "" -#: ../../library/asyncio-task.rst:836 -msgid ":const:`FIRST_EXCEPTION`" -msgstr ":const:`FIRST_EXCEPTION`" - -#: ../../library/asyncio-task.rst:836 +#: ../../library/asyncio-task.rst:838 msgid "" -"The function will return when any future finishes by raising an exception. " +"The function will return when any future finishes by raising an exception. " "If no future raises an exception then it is equivalent to :const:" "`ALL_COMPLETED`." msgstr "" -#: ../../library/asyncio-task.rst:842 -msgid ":const:`ALL_COMPLETED`" -msgstr ":const:`ALL_COMPLETED`" - -#: ../../library/asyncio-task.rst:842 +#: ../../library/asyncio-task.rst:843 msgid "The function will return when all futures finish or are cancelled." msgstr "" -#: ../../library/asyncio-task.rst:846 +#: ../../library/asyncio-task.rst:845 msgid "" "Unlike :func:`~asyncio.wait_for`, ``wait()`` does not cancel the futures " "when a timeout occurs." msgstr "" -#: ../../library/asyncio-task.rst:852 +#: ../../library/asyncio-task.rst:851 msgid "Passing coroutine objects to ``wait()`` directly is forbidden." msgstr "" -#: ../../library/asyncio-task.rst:855 ../../library/asyncio-task.rst:882 +#: ../../library/asyncio-task.rst:854 ../../library/asyncio-task.rst:881 msgid "Added support for generators yielding tasks." msgstr "" -#: ../../library/asyncio-task.rst:861 +#: ../../library/asyncio-task.rst:860 msgid "" "Run :ref:`awaitable objects ` in the *aws* iterable " "concurrently. Return an iterator of coroutines. Each coroutine returned can " @@ -833,26 +821,26 @@ msgid "" "remaining awaitables." msgstr "" -#: ../../library/asyncio-task.rst:866 +#: ../../library/asyncio-task.rst:865 msgid "" "Raises :exc:`TimeoutError` if the timeout occurs before all Futures are done." msgstr "" -#: ../../library/asyncio-task.rst:878 +#: ../../library/asyncio-task.rst:877 msgid "" "Deprecation warning is emitted if not all awaitable objects in the *aws* " "iterable are Future-like objects and there is no running event loop." msgstr "" -#: ../../library/asyncio-task.rst:887 +#: ../../library/asyncio-task.rst:886 msgid "Running in Threads" msgstr "" -#: ../../library/asyncio-task.rst:891 +#: ../../library/asyncio-task.rst:890 msgid "Asynchronously run function *func* in a separate thread." msgstr "" -#: ../../library/asyncio-task.rst:893 +#: ../../library/asyncio-task.rst:892 msgid "" "Any \\*args and \\*\\*kwargs supplied for this function are directly passed " "to *func*. Also, the current :class:`contextvars.Context` is propagated, " @@ -860,19 +848,19 @@ msgid "" "separate thread." msgstr "" -#: ../../library/asyncio-task.rst:898 +#: ../../library/asyncio-task.rst:897 msgid "" "Return a coroutine that can be awaited to get the eventual result of *func*." msgstr "" -#: ../../library/asyncio-task.rst:900 +#: ../../library/asyncio-task.rst:899 msgid "" "This coroutine function is primarily intended to be used for executing IO-" "bound functions/methods that would otherwise block the event loop if they " "were run in the main thread. For example::" msgstr "" -#: ../../library/asyncio-task.rst:930 +#: ../../library/asyncio-task.rst:929 msgid "" "Directly calling ``blocking_io()`` in any coroutine would block the event " "loop for its duration, resulting in an additional 1 second of run time. " @@ -880,7 +868,7 @@ msgid "" "thread without blocking the event loop." msgstr "" -#: ../../library/asyncio-task.rst:937 +#: ../../library/asyncio-task.rst:936 msgid "" "Due to the :term:`GIL`, ``asyncio.to_thread()`` can typically only be used " "to make IO-bound functions non-blocking. However, for extension modules that " @@ -888,85 +876,85 @@ msgid "" "``asyncio.to_thread()`` can also be used for CPU-bound functions." msgstr "" -#: ../../library/asyncio-task.rst:946 +#: ../../library/asyncio-task.rst:945 msgid "Scheduling From Other Threads" msgstr "" -#: ../../library/asyncio-task.rst:950 +#: ../../library/asyncio-task.rst:949 msgid "Submit a coroutine to the given event loop. Thread-safe." msgstr "" -#: ../../library/asyncio-task.rst:952 +#: ../../library/asyncio-task.rst:951 msgid "" "Return a :class:`concurrent.futures.Future` to wait for the result from " "another OS thread." msgstr "" -#: ../../library/asyncio-task.rst:955 +#: ../../library/asyncio-task.rst:954 msgid "" "This function is meant to be called from a different OS thread than the one " "where the event loop is running. Example::" msgstr "" -#: ../../library/asyncio-task.rst:967 +#: ../../library/asyncio-task.rst:966 msgid "" "If an exception is raised in the coroutine, the returned Future will be " "notified. It can also be used to cancel the task in the event loop::" msgstr "" -#: ../../library/asyncio-task.rst:981 +#: ../../library/asyncio-task.rst:980 msgid "" "See the :ref:`concurrency and multithreading ` " "section of the documentation." msgstr "" -#: ../../library/asyncio-task.rst:984 +#: ../../library/asyncio-task.rst:983 msgid "" "Unlike other asyncio functions this function requires the *loop* argument to " "be passed explicitly." msgstr "" -#: ../../library/asyncio-task.rst:991 +#: ../../library/asyncio-task.rst:990 msgid "Introspection" msgstr "" -#: ../../library/asyncio-task.rst:996 +#: ../../library/asyncio-task.rst:995 msgid "" "Return the currently running :class:`Task` instance, or ``None`` if no task " "is running." msgstr "" -#: ../../library/asyncio-task.rst:999 +#: ../../library/asyncio-task.rst:998 msgid "" "If *loop* is ``None`` :func:`get_running_loop` is used to get the current " "loop." msgstr "" -#: ../../library/asyncio-task.rst:1007 +#: ../../library/asyncio-task.rst:1006 msgid "Return a set of not yet finished :class:`Task` objects run by the loop." msgstr "" -#: ../../library/asyncio-task.rst:1010 +#: ../../library/asyncio-task.rst:1009 msgid "" "If *loop* is ``None``, :func:`get_running_loop` is used for getting current " "loop." msgstr "" -#: ../../library/asyncio-task.rst:1018 +#: ../../library/asyncio-task.rst:1017 msgid "Return ``True`` if *obj* is a coroutine object." msgstr "" -#: ../../library/asyncio-task.rst:1024 +#: ../../library/asyncio-task.rst:1023 msgid "Task Object" msgstr "" -#: ../../library/asyncio-task.rst:1028 +#: ../../library/asyncio-task.rst:1027 msgid "" "A :class:`Future-like ` object that runs a Python :ref:`coroutine " "`. Not thread-safe." msgstr "" -#: ../../library/asyncio-task.rst:1031 +#: ../../library/asyncio-task.rst:1030 msgid "" "Tasks are used to run coroutines in event loops. If a coroutine awaits on a " "Future, the Task suspends the execution of the coroutine and waits for the " @@ -974,21 +962,21 @@ msgid "" "wrapped coroutine resumes." msgstr "" -#: ../../library/asyncio-task.rst:1037 +#: ../../library/asyncio-task.rst:1036 msgid "" "Event loops use cooperative scheduling: an event loop runs one Task at a " "time. While a Task awaits for the completion of a Future, the event loop " "runs other Tasks, callbacks, or performs IO operations." msgstr "" -#: ../../library/asyncio-task.rst:1042 +#: ../../library/asyncio-task.rst:1041 msgid "" "Use the high-level :func:`asyncio.create_task` function to create Tasks, or " "the low-level :meth:`loop.create_task` or :func:`ensure_future` functions. " "Manual instantiation of Tasks is discouraged." msgstr "" -#: ../../library/asyncio-task.rst:1047 +#: ../../library/asyncio-task.rst:1046 msgid "" "To cancel a running Task use the :meth:`cancel` method. Calling it will " "cause the Task to throw a :exc:`CancelledError` exception into the wrapped " @@ -996,20 +984,20 @@ msgid "" "cancellation, the Future object will be cancelled." msgstr "" -#: ../../library/asyncio-task.rst:1052 +#: ../../library/asyncio-task.rst:1051 msgid "" ":meth:`cancelled` can be used to check if the Task was cancelled. The method " "returns ``True`` if the wrapped coroutine did not suppress the :exc:" "`CancelledError` exception and was actually cancelled." msgstr "" -#: ../../library/asyncio-task.rst:1057 +#: ../../library/asyncio-task.rst:1056 msgid "" ":class:`asyncio.Task` inherits from :class:`Future` all of its APIs except :" "meth:`Future.set_result` and :meth:`Future.set_exception`." msgstr "" -#: ../../library/asyncio-task.rst:1061 +#: ../../library/asyncio-task.rst:1060 msgid "" "An optional keyword-only *context* argument allows specifying a custom :" "class:`contextvars.Context` for the *coro* to run in. If no *context* is " @@ -1017,7 +1005,7 @@ msgid "" "in the copied context." msgstr "" -#: ../../library/asyncio-task.rst:1066 +#: ../../library/asyncio-task.rst:1065 msgid "" "An optional keyword-only *eager_start* argument allows eagerly starting the " "execution of the :class:`asyncio.Task` at task creation time. If set to " @@ -1027,96 +1015,96 @@ msgid "" "eagerly and will skip scheduling to the event loop." msgstr "" -#: ../../library/asyncio-task.rst:1073 +#: ../../library/asyncio-task.rst:1072 msgid "Added support for the :mod:`contextvars` module." msgstr "" -#: ../../library/asyncio-task.rst:1079 +#: ../../library/asyncio-task.rst:1078 msgid "" "Deprecation warning is emitted if *loop* is not specified and there is no " "running event loop." msgstr "" -#: ../../library/asyncio-task.rst:1086 +#: ../../library/asyncio-task.rst:1085 msgid "Added the *eager_start* parameter." msgstr "新增 *eager_start* 參數。" -#: ../../library/asyncio-task.rst:1091 +#: ../../library/asyncio-task.rst:1090 msgid "Return ``True`` if the Task is *done*." msgstr "" -#: ../../library/asyncio-task.rst:1093 +#: ../../library/asyncio-task.rst:1092 msgid "" "A Task is *done* when the wrapped coroutine either returned a value, raised " "an exception, or the Task was cancelled." msgstr "" -#: ../../library/asyncio-task.rst:1098 +#: ../../library/asyncio-task.rst:1097 msgid "Return the result of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1100 +#: ../../library/asyncio-task.rst:1099 msgid "" "If the Task is *done*, the result of the wrapped coroutine is returned (or " "if the coroutine raised an exception, that exception is re-raised.)" msgstr "" -#: ../../library/asyncio-task.rst:1104 ../../library/asyncio-task.rst:1118 +#: ../../library/asyncio-task.rst:1103 ../../library/asyncio-task.rst:1117 msgid "" "If the Task has been *cancelled*, this method raises a :exc:`CancelledError` " "exception." msgstr "" -#: ../../library/asyncio-task.rst:1107 +#: ../../library/asyncio-task.rst:1106 msgid "" "If the Task's result isn't yet available, this method raises a :exc:" "`InvalidStateError` exception." msgstr "" -#: ../../library/asyncio-task.rst:1112 +#: ../../library/asyncio-task.rst:1111 msgid "Return the exception of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1114 +#: ../../library/asyncio-task.rst:1113 msgid "" "If the wrapped coroutine raised an exception that exception is returned. If " "the wrapped coroutine returned normally this method returns ``None``." msgstr "" -#: ../../library/asyncio-task.rst:1121 +#: ../../library/asyncio-task.rst:1120 msgid "" "If the Task isn't *done* yet, this method raises an :exc:`InvalidStateError` " "exception." msgstr "" -#: ../../library/asyncio-task.rst:1126 +#: ../../library/asyncio-task.rst:1125 msgid "Add a callback to be run when the Task is *done*." msgstr "" -#: ../../library/asyncio-task.rst:1128 ../../library/asyncio-task.rst:1137 +#: ../../library/asyncio-task.rst:1127 ../../library/asyncio-task.rst:1136 msgid "This method should only be used in low-level callback-based code." msgstr "" -#: ../../library/asyncio-task.rst:1130 +#: ../../library/asyncio-task.rst:1129 msgid "" "See the documentation of :meth:`Future.add_done_callback` for more details." msgstr "" -#: ../../library/asyncio-task.rst:1135 +#: ../../library/asyncio-task.rst:1134 msgid "Remove *callback* from the callbacks list." msgstr "" -#: ../../library/asyncio-task.rst:1139 +#: ../../library/asyncio-task.rst:1138 msgid "" "See the documentation of :meth:`Future.remove_done_callback` for more " "details." msgstr "" -#: ../../library/asyncio-task.rst:1144 +#: ../../library/asyncio-task.rst:1143 msgid "Return the list of stack frames for this Task." msgstr "" -#: ../../library/asyncio-task.rst:1146 +#: ../../library/asyncio-task.rst:1145 msgid "" "If the wrapped coroutine is not done, this returns the stack where it is " "suspended. If the coroutine has completed successfully or was cancelled, " @@ -1124,15 +1112,15 @@ msgid "" "this returns the list of traceback frames." msgstr "" -#: ../../library/asyncio-task.rst:1152 +#: ../../library/asyncio-task.rst:1151 msgid "The frames are always ordered from oldest to newest." msgstr "" -#: ../../library/asyncio-task.rst:1154 +#: ../../library/asyncio-task.rst:1153 msgid "Only one stack frame is returned for a suspended coroutine." msgstr "" -#: ../../library/asyncio-task.rst:1156 +#: ../../library/asyncio-task.rst:1155 msgid "" "The optional *limit* argument sets the maximum number of frames to return; " "by default all available frames are returned. The ordering of the returned " @@ -1141,81 +1129,81 @@ msgid "" "are returned. (This matches the behavior of the traceback module.)" msgstr "" -#: ../../library/asyncio-task.rst:1165 +#: ../../library/asyncio-task.rst:1164 msgid "Print the stack or traceback for this Task." msgstr "" -#: ../../library/asyncio-task.rst:1167 +#: ../../library/asyncio-task.rst:1166 msgid "" "This produces output similar to that of the traceback module for the frames " "retrieved by :meth:`get_stack`." msgstr "" -#: ../../library/asyncio-task.rst:1170 +#: ../../library/asyncio-task.rst:1169 msgid "The *limit* argument is passed to :meth:`get_stack` directly." msgstr "" -#: ../../library/asyncio-task.rst:1172 +#: ../../library/asyncio-task.rst:1171 msgid "" "The *file* argument is an I/O stream to which the output is written; by " "default output is written to :data:`sys.stdout`." msgstr "" -#: ../../library/asyncio-task.rst:1177 +#: ../../library/asyncio-task.rst:1176 msgid "Return the coroutine object wrapped by the :class:`Task`." msgstr "" -#: ../../library/asyncio-task.rst:1181 +#: ../../library/asyncio-task.rst:1180 msgid "" "This will return ``None`` for Tasks which have already completed eagerly. " "See the :ref:`Eager Task Factory `." msgstr "" -#: ../../library/asyncio-task.rst:1188 +#: ../../library/asyncio-task.rst:1187 msgid "Newly added eager task execution means result may be ``None``." msgstr "" -#: ../../library/asyncio-task.rst:1192 +#: ../../library/asyncio-task.rst:1191 msgid "" "Return the :class:`contextvars.Context` object associated with the task." msgstr "" -#: ../../library/asyncio-task.rst:1199 +#: ../../library/asyncio-task.rst:1198 msgid "Return the name of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1201 +#: ../../library/asyncio-task.rst:1200 msgid "" "If no name has been explicitly assigned to the Task, the default asyncio " "Task implementation generates a default name during instantiation." msgstr "" -#: ../../library/asyncio-task.rst:1209 +#: ../../library/asyncio-task.rst:1208 msgid "Set the name of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1211 +#: ../../library/asyncio-task.rst:1210 msgid "" "The *value* argument can be any object, which is then converted to a string." msgstr "" -#: ../../library/asyncio-task.rst:1214 +#: ../../library/asyncio-task.rst:1213 msgid "" "In the default Task implementation, the name will be visible in the :func:" "`repr` output of a task object." msgstr "" -#: ../../library/asyncio-task.rst:1221 +#: ../../library/asyncio-task.rst:1220 msgid "Request the Task to be cancelled." msgstr "" -#: ../../library/asyncio-task.rst:1223 +#: ../../library/asyncio-task.rst:1222 msgid "" "This arranges for a :exc:`CancelledError` exception to be thrown into the " "wrapped coroutine on the next cycle of the event loop." msgstr "" -#: ../../library/asyncio-task.rst:1226 +#: ../../library/asyncio-task.rst:1225 msgid "" "The coroutine then has a chance to clean up or even deny the request by " "suppressing the exception with a :keyword:`try` ... ... ``except " @@ -1227,46 +1215,46 @@ msgid "" "addition to catching the exception." msgstr "" -#: ../../library/asyncio-task.rst:1236 +#: ../../library/asyncio-task.rst:1235 msgid "Added the *msg* parameter." msgstr "新增 *msg* 參數。" -#: ../../library/asyncio-task.rst:1239 +#: ../../library/asyncio-task.rst:1238 msgid "The ``msg`` parameter is propagated from cancelled task to its awaiter." msgstr "" -#: ../../library/asyncio-task.rst:1244 +#: ../../library/asyncio-task.rst:1243 msgid "" "The following example illustrates how coroutines can intercept the " "cancellation request::" msgstr "" -#: ../../library/asyncio-task.rst:1283 +#: ../../library/asyncio-task.rst:1282 msgid "Return ``True`` if the Task is *cancelled*." msgstr "" -#: ../../library/asyncio-task.rst:1285 +#: ../../library/asyncio-task.rst:1284 msgid "" "The Task is *cancelled* when the cancellation was requested with :meth:" "`cancel` and the wrapped coroutine propagated the :exc:`CancelledError` " "exception thrown into it." msgstr "" -#: ../../library/asyncio-task.rst:1291 +#: ../../library/asyncio-task.rst:1290 msgid "Decrement the count of cancellation requests to this Task." msgstr "" -#: ../../library/asyncio-task.rst:1293 +#: ../../library/asyncio-task.rst:1292 msgid "Returns the remaining number of cancellation requests." msgstr "" -#: ../../library/asyncio-task.rst:1295 +#: ../../library/asyncio-task.rst:1294 msgid "" "Note that once execution of a cancelled task completed, further calls to :" "meth:`uncancel` are ineffective." msgstr "" -#: ../../library/asyncio-task.rst:1300 +#: ../../library/asyncio-task.rst:1299 msgid "" "This method is used by asyncio's internals and isn't expected to be used by " "end-user code. In particular, if a Task gets successfully uncancelled, this " @@ -1275,7 +1263,7 @@ msgid "" "respective structured block. For example::" msgstr "" -#: ../../library/asyncio-task.rst:1318 +#: ../../library/asyncio-task.rst:1317 msgid "" "While the block with ``make_request()`` and ``make_another_request()`` might " "get cancelled due to the timeout, ``unrelated_code()`` should continue " @@ -1284,20 +1272,20 @@ msgid "" "similar fashion." msgstr "" -#: ../../library/asyncio-task.rst:1324 +#: ../../library/asyncio-task.rst:1323 msgid "" "If end-user code is, for some reason, suppresing cancellation by catching :" "exc:`CancelledError`, it needs to call this method to remove the " "cancellation state." msgstr "" -#: ../../library/asyncio-task.rst:1330 +#: ../../library/asyncio-task.rst:1329 msgid "" "Return the number of pending cancellation requests to this Task, i.e., the " "number of calls to :meth:`cancel` less the number of :meth:`uncancel` calls." msgstr "" -#: ../../library/asyncio-task.rst:1334 +#: ../../library/asyncio-task.rst:1333 msgid "" "Note that if this number is greater than zero but the Task is still " "executing, :meth:`cancelled` will still return ``False``. This is because " @@ -1306,8 +1294,17 @@ msgid "" "to zero." msgstr "" -#: ../../library/asyncio-task.rst:1340 +#: ../../library/asyncio-task.rst:1339 msgid "" "This method is used by asyncio's internals and isn't expected to be used by " "end-user code. See :meth:`uncancel` for more details." msgstr "" + +#~ msgid ":const:`FIRST_COMPLETED`" +#~ msgstr ":const:`FIRST_COMPLETED`" + +#~ msgid ":const:`FIRST_EXCEPTION`" +#~ msgstr ":const:`FIRST_EXCEPTION`" + +#~ msgid ":const:`ALL_COMPLETED`" +#~ msgstr ":const:`ALL_COMPLETED`" diff --git a/library/bdb.po b/library/bdb.po index 8f69b63f97..88e6a80fd5 100644 --- a/library/bdb.po +++ b/library/bdb.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-13 13:14+0000\n" +"POT-Creation-Date: 2024-01-24 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:39+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -20,7 +20,7 @@ msgstr "" #: ../../library/bdb.rst:2 msgid ":mod:`bdb` --- Debugger framework" -msgstr "" +msgstr ":mod:`bdb` --- 偵錯器框架" #: ../../library/bdb.rst:7 msgid "**Source code:** :source:`Lib/bdb.py`" @@ -34,15 +34,15 @@ msgstr "" #: ../../library/bdb.rst:14 msgid "The following exception is defined:" -msgstr "" +msgstr "有定義以下例外:" #: ../../library/bdb.rst:18 msgid "Exception raised by the :class:`Bdb` class for quitting the debugger." -msgstr "" +msgstr "由 :class:`Bdb` 類別所引發的例外,用來退出偵錯器。" #: ../../library/bdb.rst:21 msgid "The :mod:`bdb` module also defines two classes:" -msgstr "" +msgstr ":mod:`bdb` 模組也定義了兩個類別:" #: ../../library/bdb.rst:25 msgid "" @@ -69,7 +69,7 @@ msgstr "" #: ../../library/bdb.rst:39 msgid ":class:`Breakpoint` instances have the following methods:" -msgstr "" +msgstr ":class:`Breakpoint` 實例有以下方法:" #: ../../library/bdb.rst:43 msgid "" @@ -150,7 +150,7 @@ msgstr "" #: ../../library/bdb.rst:102 msgid "True if :class:`Breakpoint` is enabled." -msgstr "" +msgstr "如 :class:`Breakpoint` 有被啟用則為 True。" #: ../../library/bdb.rst:106 msgid "Numeric index for a single instance of a :class:`Breakpoint`." @@ -191,8 +191,8 @@ msgid "" msgstr "" #: ../../library/bdb.rst:135 -msgid "The *skip* argument." -msgstr "*skip* 引數。" +msgid "Added the *skip* parameter." +msgstr "新增 *skip* 引數。" #: ../../library/bdb.rst:138 msgid "" @@ -512,15 +512,15 @@ msgstr "" #: ../../library/bdb.rst:374 msgid "The function name or ``\"\"``." -msgstr "" +msgstr "函式名稱或 ``\"\"``。" #: ../../library/bdb.rst:375 msgid "The input arguments." -msgstr "" +msgstr "輸入引數。" #: ../../library/bdb.rst:376 msgid "The return value." -msgstr "" +msgstr "回傳值。" #: ../../library/bdb.rst:377 msgid "The line of code (if it exists)." diff --git a/library/bisect.po b/library/bisect.po index c2a7f61e0f..9a3fb498b3 100644 --- a/library/bisect.po +++ b/library/bisect.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-27 00:03+0000\n" +"POT-Creation-Date: 2024-01-11 00:04+0000\n" "PO-Revision-Date: 2023-08-01 12:53+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -147,10 +147,11 @@ msgstr "此函式只有在搜索時會使用 *key* 函式,插入時不會。" #: ../../library/bisect.rst:82 ../../library/bisect.rst:102 msgid "" -"Keep in mind that the ``O(log n)`` search is dominated by the slow O(n) " -"insertion step." +"Keep in mind that the *O*\\ (log *n*) search is dominated by the slow *O*\\ " +"(*n*) insertion step." msgstr "" -"注意雖然搜索是 ``O(log n)``,但插入是 O(n),因此此函式整體時間複雜度是 O(n)。" +"注意雖然搜索是 *O*\\ (log *n*),但插入是 *O*\\ (*n*),因此此函式整體時間複雜" +"度是 *O*\\ (*n*)。" #: ../../library/bisect.rst:92 msgid "" @@ -191,11 +192,11 @@ msgstr "" #: ../../library/bisect.rst:118 msgid "" -"The *insort()* functions are ``O(n)`` because the logarithmic search step is " -"dominated by the linear time insertion step." +"The *insort()* functions are *O*\\ (*n*) because the logarithmic search step " +"is dominated by the linear time insertion step." msgstr "" -"*insort()* 函式的複雜度為 ``O(n)``,因為對數搜尋是以線性時間的插入步驟所主導 " -"(dominate)。" +"*insort()* 函式的複雜度為 *O*\\ (*n*),因為對數搜尋是以線性時間的插入步驟所主" +"導 (dominate)。" #: ../../library/bisect.rst:121 msgid "" diff --git a/library/collections.po b/library/collections.po index 352bdffef0..1c13168b73 100644 --- a/library/collections.po +++ b/library/collections.po @@ -637,22 +637,22 @@ msgid "" "Deques are a generalization of stacks and queues (the name is pronounced " "\"deck\" and is short for \"double-ended queue\"). Deques support thread-" "safe, memory efficient appends and pops from either side of the deque with " -"approximately the same O(1) performance in either direction." +"approximately the same *O*\\ (1) performance in either direction." msgstr "" "Deque(發音為 \"deck\",為 \"double-ended queue\" 的簡稱)為 stack 和 queue " "的一般化。deque 支援執行緒安全 (thread-safe),且能夠有效率地節省記憶體在頭和" -"尾加入和移除元素,兩個方向的表現都大致為 O(1) 複雜度。" +"尾加入和移除元素,兩個方向的表現都大致為 *O*\\ (1) 複雜度。" #: ../../library/collections.rst:463 msgid "" "Though :class:`list` objects support similar operations, they are optimized " -"for fast fixed-length operations and incur O(n) memory movement costs for " -"``pop(0)`` and ``insert(0, v)`` operations which change both the size and " -"position of the underlying data representation." +"for fast fixed-length operations and incur *O*\\ (*n*) memory movement costs " +"for ``pop(0)`` and ``insert(0, v)`` operations which change both the size " +"and position of the underlying data representation." msgstr "" "雖然 :class:`list` 物件也支援類似操作,但 list 優化了長度固定時的操作,而會改" "變底層資料的長度及位置的 ``pop(0)`` 和 ``insert(0, v)`` 操作,記憶體移動則為 " -"O(n) 複雜度。" +"*O*\\ (*n*) 複雜度。" #: ../../library/collections.rst:469 msgid "" @@ -785,14 +785,15 @@ msgid "" "In addition to the above, deques support iteration, pickling, ``len(d)``, " "``reversed(d)``, ``copy.copy(d)``, ``copy.deepcopy(d)``, membership testing " "with the :keyword:`in` operator, and subscript references such as ``d[0]`` " -"to access the first element. Indexed access is O(1) at both ends but slows " -"to O(n) in the middle. For fast random access, use lists instead." +"to access the first element. Indexed access is *O*\\ (1) at both ends but " +"slows to *O*\\ (*n*) in the middle. For fast random access, use lists " +"instead." msgstr "" "除了以上使用方式,deque 亦支援了疊代、pickle、``len(d)``、``reversed(d)``、" "``copy.copy(d)``、``copy.deepcopy(d)``、用 :keyword:`in` 運算子來作隸屬資格檢" "測以及像是 ``d[0]`` 的標號引用來取得第一個元素。在兩端做索引存取的複雜度為 " -"O(1) 但越靠近中間則減慢至 O(n)。若想要隨機而快速的存取,使用 list 會較為合" -"適。" +"*O*\\ (1) 但越靠近中間則減慢至 *O*\\ (*n*)。若想要隨機而快速的存取,使用 " +"list 會較為合適。" #: ../../library/collections.rst:591 msgid "" diff --git a/library/concurrent.futures.po b/library/concurrent.futures.po index d8c5ecccee..146b4780a1 100644 --- a/library/concurrent.futures.po +++ b/library/concurrent.futures.po @@ -1,13 +1,13 @@ -# Copyright (C) 2001-2023, Python Software Foundation +# Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: -# Matt Wang , 2023 +# Matt Wang , 2023-2024 msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2024-01-25 06:20+0000\n" "PO-Revision-Date: 2023-01-24 03:33+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -87,8 +87,8 @@ msgstr "" "::" #: ../../library/concurrent.futures.rst:44 -msgid "Similar to :func:`map(func, *iterables) ` except:" -msgstr "類似於 :func:`map(func, *iterables) `,除了:" +msgid "Similar to :func:`map(fn, *iterables) ` except:" +msgstr "類似於 :func:`map(fn, *iterables) `,除了:" #: ../../library/concurrent.futures.rst:46 msgid "the *iterables* are collected immediately rather than lazily;" @@ -96,9 +96,9 @@ msgstr "*iterables* 立即被收集而不是延遲 (lazily) 收集;" #: ../../library/concurrent.futures.rst:48 msgid "" -"*func* is executed asynchronously and several calls to *func* may be made " +"*fn* is executed asynchronously and several calls to *fn* may be made " "concurrently." -msgstr "*func* 是非同步執行的,並且對 *func* 的多次呼叫可以並行處理。" +msgstr "*fn* 是非同步執行的,並且對 *fn* 的多次呼叫可以並行處理。" #: ../../library/concurrent.futures.rst:51 msgid "" @@ -115,9 +115,9 @@ msgstr "" #: ../../library/concurrent.futures.rst:57 msgid "" -"If a *func* call raises an exception, then that exception will be raised " -"when its value is retrieved from the iterator." -msgstr "如果 *func* 呼叫引發例外,則當從疊代器中檢索到它的值時將引發該例外。" +"If a *fn* call raises an exception, then that exception will be raised when " +"its value is retrieved from the iterator." +msgstr "如果 *fn* 呼叫引發例外,則當從疊代器中檢索到它的值時將引發該例外。" #: ../../library/concurrent.futures.rst:60 msgid "" @@ -280,15 +280,15 @@ msgstr "" #: ../../library/concurrent.futures.rst:174 msgid "" -"The *thread_name_prefix* argument was added to allow users to control the :" +"Added the *thread_name_prefix* parameter to allow users to control the :" "class:`threading.Thread` names for worker threads created by the pool for " "easier debugging." msgstr "" -"新增了 *thread_name_prefix* 引數以允許使用者控制由池所建立的工作執行緒 " -"(worker thread) 的 :class:`threading.Thread` 名稱,以便於除錯。" +"新增 *thread_name_prefix* 參數以允許使用者控制由池所建立的工作執行緒 (worker " +"thread) 的 :class:`threading.Thread` 名稱,以便於除錯。" #: ../../library/concurrent.futures.rst:179 -#: ../../library/concurrent.futures.rst:282 +#: ../../library/concurrent.futures.rst:283 msgid "Added the *initializer* and *initargs* arguments." msgstr "新增 *initializer* 與 *initargs* 引數。" @@ -407,23 +407,23 @@ msgstr "" #: ../../library/concurrent.futures.rst:272 msgid "" -"When one of the worker processes terminates abruptly, a :exc:" -"`BrokenProcessPool` error is now raised. Previously, behaviour was " -"undefined but operations on the executor or its futures would often freeze " -"or deadlock." +"When one of the worker processes terminates abruptly, a :exc:`~concurrent." +"futures.process.BrokenProcessPool` error is now raised. Previously, " +"behaviour was undefined but operations on the executor or its futures would " +"often freeze or deadlock." msgstr "" -"當其中一個工作行程突然終止時,現在會引發 :exc:`BrokenProcessPool` 錯誤。在過" -"去,此行為是未定義的 (undefined),但對 executor 或其 future 的操作經常會發生" -"凍結或死鎖。" +"當其中一個工作行程突然終止時,現在會引發 :exc:`~concurrent.futures.process." +"BrokenProcessPool` 錯誤。在過去,此行為是未定義的 (undefined),但對 executor " +"或其 future 的操作經常會發生凍結或死鎖。" -#: ../../library/concurrent.futures.rst:278 +#: ../../library/concurrent.futures.rst:279 msgid "" "The *mp_context* argument was added to allow users to control the " "start_method for worker processes created by the pool." msgstr "" "新增了 *mp_context* 引數以允許使用者控制由池所建立的工作行程的 start_method。" -#: ../../library/concurrent.futures.rst:285 +#: ../../library/concurrent.futures.rst:286 msgid "" "The default :mod:`multiprocessing` start method (see :ref:`multiprocessing-" "start-methods`) will change away from *fork* in Python 3.14. Code that " @@ -431,15 +431,19 @@ msgid "" "explicitly specify that by passing a ``mp_context=multiprocessing." "get_context(\"fork\")`` parameter." msgstr "" +"預設的 :mod:`multiprocessing` 啟動方法(請參閱 :ref:`multiprocessing-start-" +"methods`\\ )將不再是 Python 3.14 中的 *fork*。需要 *fork* 用於其 :class:" +"`ProcessPoolExecutor` 的程式碼應透過傳遞 ``mp_context=multiprocessing." +"get_context(\"fork\")`` 參數來明確指定。" -#: ../../library/concurrent.futures.rst:292 +#: ../../library/concurrent.futures.rst:293 msgid "" "The *max_tasks_per_child* argument was added to allow users to control the " "lifetime of workers in the pool." msgstr "" "新增了 *max_tasks_per_child* 引數以允許使用者控制池中 worker 的生命週期。" -#: ../../library/concurrent.futures.rst:296 +#: ../../library/concurrent.futures.rst:297 msgid "" "On POSIX systems, if your application has multiple threads and the :mod:" "`multiprocessing` context uses the ``\"fork\"`` start method: The :func:`os." @@ -447,16 +451,20 @@ msgid "" "`DeprecationWarning`. Pass a *mp_context* configured to use a different " "start method. See the :func:`os.fork` documentation for further explanation." msgstr "" +"在 POSIX 系統上,如果你的應用程式有多個執行緒並且 :mod:`multiprocessing` 情境" +"使用了 ``\"fork\"`` 啟動方法:內部呼叫以產生 worker 的 :func:`os.fork` 函式可" +"能會引發 :exc:`DeprecationWarning`。傳遞一個 *mp_context* 以配置為使用不同的" +"啟動方法。更多說明請參閱 :func:`os.fork` 文件。" -#: ../../library/concurrent.futures.rst:307 +#: ../../library/concurrent.futures.rst:308 msgid "ProcessPoolExecutor Example" msgstr "ProcessPoolExecutor 範例" -#: ../../library/concurrent.futures.rst:345 +#: ../../library/concurrent.futures.rst:346 msgid "Future Objects" msgstr "Future 物件" -#: ../../library/concurrent.futures.rst:347 +#: ../../library/concurrent.futures.rst:348 msgid "" "The :class:`Future` class encapsulates the asynchronous execution of a " "callable. :class:`Future` instances are created by :meth:`Executor.submit`." @@ -464,7 +472,7 @@ msgstr "" ":class:`Future` 類別封裝了可呼叫物件的非同步執行。:class:`Future` 實例由 :" "meth:`Executor.submit` 建立。" -#: ../../library/concurrent.futures.rst:352 +#: ../../library/concurrent.futures.rst:353 msgid "" "Encapsulates the asynchronous execution of a callable. :class:`Future` " "instances are created by :meth:`Executor.submit` and should not be created " @@ -473,7 +481,7 @@ msgstr "" "封裝可呼叫物件的非同步執行。:class:`Future` 實例由 :meth:`Executor.submit` 建" "立,且除測試外不應直接建立。" -#: ../../library/concurrent.futures.rst:358 +#: ../../library/concurrent.futures.rst:359 msgid "" "Attempt to cancel the call. If the call is currently being executed or " "finished running and cannot be cancelled then the method will return " @@ -483,22 +491,22 @@ msgstr "" "嘗試取消呼叫。如果呼叫當前正在執行或已完成運行且無法取消,則該方法將回傳 " "``False``,否則呼叫將被取消並且該方法將回傳 ``True``。" -#: ../../library/concurrent.futures.rst:365 +#: ../../library/concurrent.futures.rst:366 msgid "Return ``True`` if the call was successfully cancelled." msgstr "如果該呼叫成功被取消,則回傳 ``True``。" -#: ../../library/concurrent.futures.rst:369 +#: ../../library/concurrent.futures.rst:370 msgid "" "Return ``True`` if the call is currently being executed and cannot be " "cancelled." msgstr "如果呼叫正在執行且無法取消,則回傳 ``True``。" -#: ../../library/concurrent.futures.rst:374 +#: ../../library/concurrent.futures.rst:375 msgid "" "Return ``True`` if the call was successfully cancelled or finished running." msgstr "如果呼叫成功被取消或結束運行,則回傳 ``True``。" -#: ../../library/concurrent.futures.rst:379 +#: ../../library/concurrent.futures.rst:380 msgid "" "Return the value returned by the call. If the call hasn't yet completed then " "this method will wait up to *timeout* seconds. If the call hasn't completed " @@ -510,19 +518,19 @@ msgstr "" "叫在 *timeout* 秒內未完成,則會引發 :exc:`TimeoutError`。*timeout* 可以是整數" "或浮點數。如果未指定 *timeout* 或為 ``None``,則等待時間就不會有限制。" -#: ../../library/concurrent.futures.rst:386 -#: ../../library/concurrent.futures.rst:400 +#: ../../library/concurrent.futures.rst:387 +#: ../../library/concurrent.futures.rst:401 msgid "" "If the future is cancelled before completing then :exc:`.CancelledError` " "will be raised." msgstr "如果 future 在完成之前被取消,那麼 :exc:`.CancelledError` 將被引發。" -#: ../../library/concurrent.futures.rst:389 +#: ../../library/concurrent.futures.rst:390 msgid "" "If the call raised an exception, this method will raise the same exception." msgstr "如果該呼叫引發了例外,此方法將引發相同的例外。" -#: ../../library/concurrent.futures.rst:393 +#: ../../library/concurrent.futures.rst:394 msgid "" "Return the exception raised by the call. If the call hasn't yet completed " "then this method will wait up to *timeout* seconds. If the call hasn't " @@ -534,11 +542,11 @@ msgstr "" "呼叫在 *timeout* 秒內未完成,則會引發 :exc:`TimeoutError`。 *timeout* 可以是" "整數或浮點數。如果未指定 *timeout* 或為 ``None``,則等待時間就不會有限制。" -#: ../../library/concurrent.futures.rst:403 +#: ../../library/concurrent.futures.rst:404 msgid "If the call completed without raising, ``None`` is returned." msgstr "如果呼叫在沒有引發的情況下完成,則回傳 ``None``。" -#: ../../library/concurrent.futures.rst:407 +#: ../../library/concurrent.futures.rst:408 msgid "" "Attaches the callable *fn* to the future. *fn* will be called, with the " "future as its only argument, when the future is cancelled or finishes " @@ -547,7 +555,7 @@ msgstr "" "將可呼叫的 *fn* 附加到 future 上。當 future 被取消或完成運行時,*fn* 將被以 " "future 作為其唯一引數來呼叫。" -#: ../../library/concurrent.futures.rst:411 +#: ../../library/concurrent.futures.rst:412 msgid "" "Added callables are called in the order that they were added and are always " "called in a thread belonging to the process that added them. If the " @@ -559,19 +567,19 @@ msgstr "" "如果可呼叫物件引發 :exc:`Exception` 子類別,它將被記錄 (log) 並忽略。如果可呼" "叫物件引發 :exc:`BaseException` 子類別,該行為未定義。" -#: ../../library/concurrent.futures.rst:417 +#: ../../library/concurrent.futures.rst:418 msgid "" "If the future has already completed or been cancelled, *fn* will be called " "immediately." msgstr "如果 future 已經完成或被取消,*fn* 將立即被呼叫。" -#: ../../library/concurrent.futures.rst:420 +#: ../../library/concurrent.futures.rst:421 msgid "" "The following :class:`Future` methods are meant for use in unit tests and :" "class:`Executor` implementations." msgstr "以下 :class:`Future` 方法旨在用於單元測試和 :class:`Executor` 實作。" -#: ../../library/concurrent.futures.rst:425 +#: ../../library/concurrent.futures.rst:426 msgid "" "This method should only be called by :class:`Executor` implementations " "before executing the work associated with the :class:`Future` and by unit " @@ -580,7 +588,7 @@ msgstr "" "此方法只能在與 :class:`Future` 關聯的工作被執行之前於 :class:`Executor` 實作" "中呼叫,或者在單元測試中呼叫。" -#: ../../library/concurrent.futures.rst:429 +#: ../../library/concurrent.futures.rst:430 msgid "" "If the method returns ``False`` then the :class:`Future` was cancelled, i." "e. :meth:`Future.cancel` was called and returned ``True``. Any threads " @@ -591,7 +599,7 @@ msgstr "" "cancel` 被呼叫並回傳 ``True``。任何等待 :class:`Future` 完成的執行緒(即透" "過 :func:`as_completed` 或 :func:`wait`)將被喚醒。" -#: ../../library/concurrent.futures.rst:434 +#: ../../library/concurrent.futures.rst:435 msgid "" "If the method returns ``True`` then the :class:`Future` was not cancelled " "and has been put in the running state, i.e. calls to :meth:`Future.running` " @@ -600,7 +608,7 @@ msgstr "" "如果該方法回傳 ``True`` 則代表 :class:`Future` 未被取消並已進入運行狀態,意即" "呼叫 :meth:`Future.running` 將回傳 ``True``。" -#: ../../library/concurrent.futures.rst:438 +#: ../../library/concurrent.futures.rst:439 msgid "" "This method can only be called once and cannot be called after :meth:`Future." "set_result` or :meth:`Future.set_exception` have been called." @@ -608,20 +616,20 @@ msgstr "" "此方法只能呼叫一次,且不能在呼叫 :meth:`Future.set_result` 或 :meth:`Future." "set_exception` 之後呼叫。" -#: ../../library/concurrent.futures.rst:444 +#: ../../library/concurrent.futures.rst:445 msgid "" "Sets the result of the work associated with the :class:`Future` to *result*." msgstr "將與 :class:`Future` 關聯的工作結果設定為 *result*。" -#: ../../library/concurrent.futures.rst:447 -#: ../../library/concurrent.futures.rst:460 +#: ../../library/concurrent.futures.rst:448 +#: ../../library/concurrent.futures.rst:461 msgid "" "This method should only be used by :class:`Executor` implementations and " "unit tests." msgstr "此方法只能在 :class:`Executor` 實作中和單元測試中使用。" -#: ../../library/concurrent.futures.rst:450 -#: ../../library/concurrent.futures.rst:463 +#: ../../library/concurrent.futures.rst:451 +#: ../../library/concurrent.futures.rst:464 msgid "" "This method raises :exc:`concurrent.futures.InvalidStateError` if the :class:" "`Future` is already done." @@ -629,18 +637,18 @@ msgstr "" "如果 :class:`Future` 已經完成,此方法會引發 :exc:`concurrent.futures." "InvalidStateError`。" -#: ../../library/concurrent.futures.rst:457 +#: ../../library/concurrent.futures.rst:458 msgid "" "Sets the result of the work associated with the :class:`Future` to the :" "class:`Exception` *exception*." msgstr "" "將與 :class:`Future` 關聯的工作結果設定為 :class:`Exception` *exception*。" -#: ../../library/concurrent.futures.rst:469 +#: ../../library/concurrent.futures.rst:470 msgid "Module Functions" msgstr "模組函式" -#: ../../library/concurrent.futures.rst:473 +#: ../../library/concurrent.futures.rst:474 msgid "" "Wait for the :class:`Future` instances (possibly created by different :class:" "`Executor` instances) given by *fs* to complete. Duplicate futures given to " @@ -656,7 +664,7 @@ msgstr "" "完成的 future(已完成或被取消的 future)。第二組名為 ``not_done``,包含未完成" "的 future(未定或運行中的 future)。" -#: ../../library/concurrent.futures.rst:481 +#: ../../library/concurrent.futures.rst:482 msgid "" "*timeout* can be used to control the maximum number of seconds to wait " "before returning. *timeout* can be an int or float. If *timeout* is not " @@ -665,46 +673,34 @@ msgstr "" "*timeout* 可用於控制回傳前等待的最大秒數。*timeout* 可以是整數或浮點數。如果" "未指定 *timeout* 或為 ``None``,則等待時間就沒有限制。" -#: ../../library/concurrent.futures.rst:485 +#: ../../library/concurrent.futures.rst:486 msgid "" "*return_when* indicates when this function should return. It must be one of " "the following constants:" msgstr "*return_when* 表示此函式應回傳的時間。它必須是以下常數之一:" -#: ../../library/concurrent.futures.rst:491 +#: ../../library/concurrent.futures.rst:492 msgid "Constant" msgstr "常數" -#: ../../library/concurrent.futures.rst:491 +#: ../../library/concurrent.futures.rst:493 msgid "Description" msgstr "描述" -#: ../../library/concurrent.futures.rst:493 -msgid ":const:`FIRST_COMPLETED`" -msgstr ":const:`FIRST_COMPLETED`" - -#: ../../library/concurrent.futures.rst:493 +#: ../../library/concurrent.futures.rst:496 msgid "The function will return when any future finishes or is cancelled." msgstr "當任何 future 完成或被取消時,該函式就會回傳。" -#: ../../library/concurrent.futures.rst:496 -msgid ":const:`FIRST_EXCEPTION`" -msgstr ":const:`FIRST_EXCEPTION`" - -#: ../../library/concurrent.futures.rst:496 +#: ../../library/concurrent.futures.rst:499 msgid "" -"The function will return when any future finishes by raising an exception. " +"The function will return when any future finishes by raising an exception. " "If no future raises an exception then it is equivalent to :const:" "`ALL_COMPLETED`." msgstr "" "該函式會在任何 future 透過引發例外而完結時回傳。如果 future 沒有引發例外,那" "麼它等同於 :const:`ALL_COMPLETED`。" -#: ../../library/concurrent.futures.rst:502 -msgid ":const:`ALL_COMPLETED`" -msgstr ":const:`ALL_COMPLETED`" - -#: ../../library/concurrent.futures.rst:502 +#: ../../library/concurrent.futures.rst:504 msgid "The function will return when all futures finish or are cancelled." msgstr "當所有 future 都完成或被取消時,該函式才會回傳。" @@ -775,19 +771,20 @@ msgstr "當前狀態下不允許的 future 操作被執行時而引發。" #: ../../library/concurrent.futures.rst:564 msgid "" "Derived from :exc:`~concurrent.futures.BrokenExecutor`, this exception class " -"is raised when one of the workers of a :class:`ThreadPoolExecutor` has " -"failed initializing." +"is raised when one of the workers of a :class:`~concurrent.futures." +"ThreadPoolExecutor` has failed initializing." msgstr "" -"衍生自 :exc:`~concurrent.futures.BrokenExecutor`,當 :class:" -"`ThreadPoolExecutor` 的其中一個 worker 初始化失敗時會引發此例外類別。" +"衍生自 :exc:`~concurrent.futures.BrokenExecutor`,當 :class:`~concurrent." +"futures.ThreadPoolExecutor` 的其中一個 worker 初始化失敗時會引發此例外類別。" -#: ../../library/concurrent.futures.rst:574 +#: ../../library/concurrent.futures.rst:575 msgid "" "Derived from :exc:`~concurrent.futures.BrokenExecutor` (formerly :exc:" "`RuntimeError`), this exception class is raised when one of the workers of " -"a :class:`ProcessPoolExecutor` has terminated in a non-clean fashion (for " -"example, if it was killed from the outside)." +"a :class:`~concurrent.futures.ProcessPoolExecutor` has terminated in a non-" +"clean fashion (for example, if it was killed from the outside)." msgstr "" "衍生自 :exc:`~concurrent.futures.BrokenExecutor`\\(以前為 :exc:" -"`RuntimeError`),當 :class:`ProcessPoolExecutor` 的其中一個 worker 以不乾淨" -"的方式終止時將引發此例外類別(例如它是從外面被 kill 掉的)。" +"`RuntimeError`),當 :class:`~concurrent.futures.ProcessPoolExecutor` 的其中" +"一個 worker 以不乾淨的方式終止時將引發此例外類別(例如它是從外面被 kill 掉" +"的)。" diff --git a/library/configparser.po b/library/configparser.po index 66bb23ab04..01356ffc83 100644 --- a/library/configparser.po +++ b/library/configparser.po @@ -1,5 +1,4 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -7,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-13 13:14+0000\n" +"POT-Creation-Date: 2024-01-24 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:41+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -20,7 +19,7 @@ msgstr "" #: ../../library/configparser.rst:2 msgid ":mod:`configparser` --- Configuration file parser" -msgstr "" +msgstr ":mod:`configparser` --- 設定檔剖析器" #: ../../library/configparser.rst:14 msgid "**Source code:** :source:`Lib/configparser.py`" @@ -158,8 +157,8 @@ msgstr "" #: ../../library/configparser.rst:211 msgid "" -"As with a dictionary, you can use a section's :meth:`get` method to provide " -"fallback values:" +"As with a dictionary, you can use a section's :meth:`~ConfigParser.get` " +"method to provide fallback values:" msgstr "" #: ../../library/configparser.rst:224 @@ -173,10 +172,10 @@ msgstr "" #: ../../library/configparser.rst:235 msgid "" -"One more thing to be aware of is that the parser-level :meth:`get` method " -"provides a custom, more complex interface, maintained for backwards " -"compatibility. When using this method, a fallback value can be provided via " -"the ``fallback`` keyword-only argument:" +"One more thing to be aware of is that the parser-level :meth:`~ConfigParser." +"get` method provides a custom, more complex interface, maintained for " +"backwards compatibility. When using this method, a fallback value can be " +"provided via the ``fallback`` keyword-only argument:" msgstr "" #: ../../library/configparser.rst:246 @@ -205,8 +204,8 @@ msgstr "" #: ../../library/configparser.rst:274 msgid "" -"By default, a valid section name can be any string that does not contain '\\" -"\\n' or ']'. To change this, see :attr:`ConfigParser.SECTCRE`." +"By default, a valid section name can be any string that does not contain '\\" +"\\n'. To change this, see :attr:`ConfigParser.SECTCRE`." msgstr "" #: ../../library/configparser.rst:277 @@ -380,7 +379,7 @@ msgstr "" #: ../../library/configparser.rst:483 msgid "" "The most common way to change the way a specific config parser works is to " -"use the :meth:`__init__` options:" +"use the :meth:`!__init__` options:" msgstr "" #: ../../library/configparser.rst:486 @@ -398,7 +397,7 @@ msgstr "" #: ../../library/configparser.rst:493 msgid "" "Hint: if you want to specify default values for a specific section, use :" -"meth:`read_dict` before you read the actual file." +"meth:`~ConfigParser.read_dict` before you read the actual file." msgstr "" #: ../../library/configparser.rst:496 @@ -496,9 +495,9 @@ msgstr "" #: ../../library/configparser.rst:637 msgid "" "When set to ``True``, the parser will not allow for any section or option " -"duplicates while reading from a single source (using :meth:`read_file`, :" -"meth:`read_string` or :meth:`read_dict`). It is recommended to use strict " -"parsers in new applications." +"duplicates while reading from a single source (using :meth:`~ConfigParser." +"read_file`, :meth:`~ConfigParser.read_string` or :meth:`~ConfigParser." +"read_dict`). It is recommended to use strict parsers in new applications." msgstr "" #: ../../library/configparser.rst:642 @@ -576,7 +575,7 @@ msgid "" "be desirable, users may define them in a subclass or pass a dictionary where " "each key is a name of the converter and each value is a callable " "implementing said conversion. For instance, passing ``{'decimal': decimal." -"Decimal}`` would add :meth:`getdecimal` on both the parser object and all " +"Decimal}`` would add :meth:`!getdecimal` on both the parser object and all " "section proxies. In other words, it will be possible to write both " "``parser_instance.getdecimal('section', 'key', fallback=0)`` and " "``parser_instance['section'].getdecimal('key', 0)``." @@ -838,8 +837,8 @@ msgstr "" #: ../../library/configparser.rst:1048 msgid "" -"The *encoding* parameter. Previously, all files were read using the default " -"encoding for :func:`open`." +"Added the *encoding* parameter. Previously, all files were read using the " +"default encoding for :func:`open`." msgstr "" #: ../../library/configparser.rst:1052 @@ -859,13 +858,13 @@ msgstr "" #: ../../library/configparser.rst:1064 msgid "" "Optional argument *source* specifies the name of the file being read. If " -"not given and *f* has a :attr:`name` attribute, that is used for *source*; " +"not given and *f* has a :attr:`!name` attribute, that is used for *source*; " "the default is ``''``." msgstr "" #: ../../library/configparser.rst:1068 -msgid "Replaces :meth:`readfp`." -msgstr "" +msgid "Replaces :meth:`!readfp`." +msgstr "取代 :meth:`!readfp`。" #: ../../library/configparser.rst:1073 msgid "Parse configuration data from a string." @@ -1027,9 +1026,9 @@ msgstr "" #: ../../library/configparser.rst:1217 msgid "" -"The maximum depth for recursive interpolation for :meth:`get` when the *raw* " -"parameter is false. This is relevant only when the default *interpolation* " -"is used." +"The maximum depth for recursive interpolation for :meth:`~configparser." +"ConfigParser.get` when the *raw* parameter is false. This is relevant only " +"when the default *interpolation* is used." msgstr "" #: ../../library/configparser.rst:1225 @@ -1096,15 +1095,15 @@ msgstr "" #: ../../library/configparser.rst:1290 msgid "" -"Exception raised if :meth:`add_section` is called with the name of a section " -"that is already present or in strict parsers when a section if found more " -"than once in a single input file, string or dictionary." +"Exception raised if :meth:`~ConfigParser.add_section` is called with the " +"name of a section that is already present or in strict parsers when a " +"section if found more than once in a single input file, string or dictionary." msgstr "" #: ../../library/configparser.rst:1294 msgid "" -"Optional ``source`` and ``lineno`` attributes and arguments to :meth:" -"`__init__` were added." +"Added the optional *source* and *lineno* attributes and parameters to :meth:" +"`!__init__`." msgstr "" #: ../../library/configparser.rst:1301 @@ -1158,7 +1157,7 @@ msgstr "" #: ../../library/configparser.rst:1348 msgid "" -"The ``filename`` attribute and :meth:`__init__` constructor argument were " +"The ``filename`` attribute and :meth:`!__init__` constructor argument were " "removed. They have been available using the name ``source`` since 3.2." msgstr "" diff --git a/library/contextlib.po b/library/contextlib.po index 5902adb1f1..5a7668df6a 100644 --- a/library/contextlib.po +++ b/library/contextlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-08 16:59+0000\n" +"POT-Creation-Date: 2024-01-25 06:20+0000\n" "PO-Revision-Date: 2018-05-23 14:41+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -182,20 +182,29 @@ msgid "" "``page.close()`` will be called when the :keyword:`with` block is exited." msgstr "" -#: ../../library/contextlib.rst:188 +#: ../../library/contextlib.rst:187 +msgid "" +"Most types managing resources support the :term:`context manager` protocol, " +"which closes *thing* on leaving the :keyword:`with` statement. As such, :" +"func:`!closing` is most useful for third party types that don't support " +"context managers. This example is purely for illustration purposes, as :func:" +"`~urllib.request.urlopen` would normally be used in a context manager." +msgstr "" + +#: ../../library/contextlib.rst:196 msgid "" "Return an async context manager that calls the ``aclose()`` method of " "*thing* upon completion of the block. This is basically equivalent to::" msgstr "" -#: ../../library/contextlib.rst:200 +#: ../../library/contextlib.rst:208 msgid "" "Significantly, ``aclosing()`` supports deterministic cleanup of async " "generators when they happen to exit early by :keyword:`break` or an " "exception. For example::" msgstr "" -#: ../../library/contextlib.rst:211 +#: ../../library/contextlib.rst:219 msgid "" "This pattern ensures that the generator's async exit code is executed in the " "same context as its iterations (so that exceptions and context variables " @@ -203,31 +212,31 @@ msgid "" "task it depends on)." msgstr "" -#: ../../library/contextlib.rst:223 +#: ../../library/contextlib.rst:231 msgid "" "Return a context manager that returns *enter_result* from ``__enter__``, but " "otherwise does nothing. It is intended to be used as a stand-in for an " "optional context manager, for example::" msgstr "" -#: ../../library/contextlib.rst:237 +#: ../../library/contextlib.rst:245 msgid "An example using *enter_result*::" msgstr "" "一個使用 *enter_result* 的範例:\n" "\n" "::" -#: ../../library/contextlib.rst:250 +#: ../../library/contextlib.rst:258 msgid "" "It can also be used as a stand-in for :ref:`asynchronous context managers " "`::" msgstr "" -#: ../../library/contextlib.rst:266 +#: ../../library/contextlib.rst:274 msgid ":term:`asynchronous context manager` support was added." msgstr "" -#: ../../library/contextlib.rst:273 +#: ../../library/contextlib.rst:281 msgid "" "Return a context manager that suppresses any of the specified exceptions if " "they occur in the body of a :keyword:`!with` statement and then resumes " @@ -235,7 +244,7 @@ msgid "" "statement." msgstr "" -#: ../../library/contextlib.rst:278 +#: ../../library/contextlib.rst:286 msgid "" "As with any other mechanism that completely suppresses exceptions, this " "context manager should be used only to cover very specific errors where " @@ -243,23 +252,23 @@ msgid "" "do." msgstr "" -#: ../../library/contextlib.rst:283 +#: ../../library/contextlib.rst:291 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/contextlib.rst:293 +#: ../../library/contextlib.rst:301 msgid "This code is equivalent to::" msgstr "" -#: ../../library/contextlib.rst:305 ../../library/contextlib.rst:352 -#: ../../library/contextlib.rst:362 ../../library/contextlib.rst:379 +#: ../../library/contextlib.rst:313 ../../library/contextlib.rst:360 +#: ../../library/contextlib.rst:370 ../../library/contextlib.rst:387 msgid "This context manager is :ref:`reentrant `." msgstr "" -#: ../../library/contextlib.rst:307 +#: ../../library/contextlib.rst:315 msgid "" "If the code within the :keyword:`!with` block raises a :exc:" "`BaseExceptionGroup`, suppressed exceptions are removed from the group. If " @@ -267,25 +276,25 @@ msgid "" "re-raised." msgstr "" -#: ../../library/contextlib.rst:313 +#: ../../library/contextlib.rst:321 msgid "" "``suppress`` now supports suppressing exceptions raised as part of an :exc:" "`BaseExceptionGroup`." msgstr "" -#: ../../library/contextlib.rst:319 +#: ../../library/contextlib.rst:327 msgid "" "Context manager for temporarily redirecting :data:`sys.stdout` to another " "file or file-like object." msgstr "" -#: ../../library/contextlib.rst:322 +#: ../../library/contextlib.rst:330 msgid "" "This tool adds flexibility to existing functions or classes whose output is " "hardwired to stdout." msgstr "" -#: ../../library/contextlib.rst:325 +#: ../../library/contextlib.rst:333 msgid "" "For example, the output of :func:`help` normally is sent to *sys.stdout*. " "You can capture that output in a string by redirecting the output to an :" @@ -294,17 +303,17 @@ msgid "" "`with` statement::" msgstr "" -#: ../../library/contextlib.rst:335 +#: ../../library/contextlib.rst:343 msgid "" "To send the output of :func:`help` to a file on disk, redirect the output to " "a regular file::" msgstr "" -#: ../../library/contextlib.rst:342 +#: ../../library/contextlib.rst:350 msgid "To send the output of :func:`help` to *sys.stderr*::" msgstr "" -#: ../../library/contextlib.rst:347 +#: ../../library/contextlib.rst:355 msgid "" "Note that the global side effect on :data:`sys.stdout` means that this " "context manager is not suitable for use in library code and most threaded " @@ -312,13 +321,13 @@ msgid "" "it is still a useful approach for many utility scripts." msgstr "" -#: ../../library/contextlib.rst:359 +#: ../../library/contextlib.rst:367 msgid "" "Similar to :func:`~contextlib.redirect_stdout` but redirecting :data:`sys." "stderr` to another file or file-like object." msgstr "" -#: ../../library/contextlib.rst:369 +#: ../../library/contextlib.rst:377 msgid "" "Non parallel-safe context manager to change the current working directory. " "As this changes a global state, the working directory, it is not suitable " @@ -328,63 +337,63 @@ msgid "" "when this context manager is active." msgstr "" -#: ../../library/contextlib.rst:376 +#: ../../library/contextlib.rst:384 msgid "" "This is a simple wrapper around :func:`~os.chdir`, it changes the current " "working directory upon entering and restores the old one on exit." msgstr "" -#: ../../library/contextlib.rst:386 +#: ../../library/contextlib.rst:394 msgid "" "A base class that enables a context manager to also be used as a decorator." msgstr "" -#: ../../library/contextlib.rst:388 +#: ../../library/contextlib.rst:396 msgid "" "Context managers inheriting from ``ContextDecorator`` have to implement " "``__enter__`` and ``__exit__`` as normal. ``__exit__`` retains its optional " "exception handling even when used as a decorator." msgstr "" -#: ../../library/contextlib.rst:392 +#: ../../library/contextlib.rst:400 msgid "" "``ContextDecorator`` is used by :func:`contextmanager`, so you get this " "functionality automatically." msgstr "" -#: ../../library/contextlib.rst:395 +#: ../../library/contextlib.rst:403 msgid "Example of ``ContextDecorator``::" msgstr "" "``ContextDecorator`` 範例:\n" "\n" "::" -#: ../../library/contextlib.rst:408 ../../library/contextlib.rst:480 +#: ../../library/contextlib.rst:416 ../../library/contextlib.rst:488 msgid "The class can then be used like this::" msgstr "" -#: ../../library/contextlib.rst:426 +#: ../../library/contextlib.rst:434 msgid "" "This change is just syntactic sugar for any construct of the following form::" msgstr "" -#: ../../library/contextlib.rst:432 +#: ../../library/contextlib.rst:440 msgid "``ContextDecorator`` lets you instead write::" msgstr "" -#: ../../library/contextlib.rst:438 +#: ../../library/contextlib.rst:446 msgid "" "It makes it clear that the ``cm`` applies to the whole function, rather than " "just a piece of it (and saving an indentation level is nice, too)." msgstr "" -#: ../../library/contextlib.rst:441 +#: ../../library/contextlib.rst:449 msgid "" "Existing context managers that already have a base class can be extended by " "using ``ContextDecorator`` as a mixin class::" msgstr "" -#: ../../library/contextlib.rst:454 +#: ../../library/contextlib.rst:462 msgid "" "As the decorated function must be able to be called multiple times, the " "underlying context manager must support use in multiple :keyword:`with` " @@ -392,38 +401,38 @@ msgid "" "explicit :keyword:`!with` statement inside the function should be used." msgstr "" -#: ../../library/contextlib.rst:464 +#: ../../library/contextlib.rst:472 msgid "" "Similar to :class:`ContextDecorator` but only for asynchronous functions." msgstr "" -#: ../../library/contextlib.rst:466 +#: ../../library/contextlib.rst:474 msgid "Example of ``AsyncContextDecorator``::" msgstr "" "``AsyncContextDecorator`` 範例:\n" "\n" "::" -#: ../../library/contextlib.rst:505 +#: ../../library/contextlib.rst:513 msgid "" "A context manager that is designed to make it easy to programmatically " "combine other context managers and cleanup functions, especially those that " "are optional or otherwise driven by input data." msgstr "" -#: ../../library/contextlib.rst:509 +#: ../../library/contextlib.rst:517 msgid "" "For example, a set of files may easily be handled in a single with statement " "as follows::" msgstr "" -#: ../../library/contextlib.rst:518 +#: ../../library/contextlib.rst:526 msgid "" "The :meth:`~object.__enter__` method returns the :class:`ExitStack` " "instance, and performs no additional operations." msgstr "" -#: ../../library/contextlib.rst:521 +#: ../../library/contextlib.rst:529 msgid "" "Each instance maintains a stack of registered callbacks that are called in " "reverse order when the instance is closed (either explicitly or implicitly " @@ -431,14 +440,14 @@ msgid "" "invoked implicitly when the context stack instance is garbage collected." msgstr "" -#: ../../library/contextlib.rst:526 +#: ../../library/contextlib.rst:534 msgid "" "This stack model is used so that context managers that acquire their " "resources in their ``__init__`` method (such as file objects) can be handled " "correctly." msgstr "" -#: ../../library/contextlib.rst:530 +#: ../../library/contextlib.rst:538 msgid "" "Since registered callbacks are invoked in the reverse order of registration, " "this ends up behaving as if multiple nested :keyword:`with` statements had " @@ -448,7 +457,7 @@ msgid "" "updated state." msgstr "" -#: ../../library/contextlib.rst:537 +#: ../../library/contextlib.rst:545 msgid "" "This is a relatively low level API that takes care of the details of " "correctly unwinding the stack of exit callbacks. It provides a suitable " @@ -456,76 +465,76 @@ msgid "" "in application specific ways." msgstr "" -#: ../../library/contextlib.rst:546 +#: ../../library/contextlib.rst:554 msgid "" "Enters a new context manager and adds its :meth:`~object.__exit__` method to " "the callback stack. The return value is the result of the context manager's " "own :meth:`~object.__enter__` method." msgstr "" -#: ../../library/contextlib.rst:550 +#: ../../library/contextlib.rst:558 msgid "" "These context managers may suppress exceptions just as they normally would " "if used directly as part of a :keyword:`with` statement." msgstr "" -#: ../../library/contextlib.rst:553 +#: ../../library/contextlib.rst:561 msgid "" "Raises :exc:`TypeError` instead of :exc:`AttributeError` if *cm* is not a " "context manager." msgstr "" -#: ../../library/contextlib.rst:559 +#: ../../library/contextlib.rst:567 msgid "" "Adds a context manager's :meth:`~object.__exit__` method to the callback " "stack." msgstr "" -#: ../../library/contextlib.rst:561 +#: ../../library/contextlib.rst:569 msgid "" "As ``__enter__`` is *not* invoked, this method can be used to cover part of " "an :meth:`~object.__enter__` implementation with a context manager's own :" "meth:`~object.__exit__` method." msgstr "" -#: ../../library/contextlib.rst:565 +#: ../../library/contextlib.rst:573 msgid "" "If passed an object that is not a context manager, this method assumes it is " "a callback with the same signature as a context manager's :meth:`~object." "__exit__` method and adds it directly to the callback stack." msgstr "" -#: ../../library/contextlib.rst:569 +#: ../../library/contextlib.rst:577 msgid "" "By returning true values, these callbacks can suppress exceptions the same " "way context manager :meth:`~object.__exit__` methods can." msgstr "" -#: ../../library/contextlib.rst:572 +#: ../../library/contextlib.rst:580 msgid "" "The passed in object is returned from the function, allowing this method to " "be used as a function decorator." msgstr "" -#: ../../library/contextlib.rst:577 +#: ../../library/contextlib.rst:585 msgid "" "Accepts an arbitrary callback function and arguments and adds it to the " "callback stack." msgstr "" -#: ../../library/contextlib.rst:580 +#: ../../library/contextlib.rst:588 msgid "" "Unlike the other methods, callbacks added this way cannot suppress " "exceptions (as they are never passed the exception details)." msgstr "" -#: ../../library/contextlib.rst:583 +#: ../../library/contextlib.rst:591 msgid "" "The passed in callback is returned from the function, allowing this method " "to be used as a function decorator." msgstr "" -#: ../../library/contextlib.rst:588 +#: ../../library/contextlib.rst:596 msgid "" "Transfers the callback stack to a fresh :class:`ExitStack` instance and " "returns it. No callbacks are invoked by this operation - instead, they will " @@ -533,77 +542,77 @@ msgid "" "at the end of a :keyword:`with` statement)." msgstr "" -#: ../../library/contextlib.rst:593 +#: ../../library/contextlib.rst:601 msgid "" "For example, a group of files can be opened as an \"all or nothing\" " "operation as follows::" msgstr "" -#: ../../library/contextlib.rst:607 +#: ../../library/contextlib.rst:615 msgid "" "Immediately unwinds the callback stack, invoking callbacks in the reverse " "order of registration. For any context managers and exit callbacks " "registered, the arguments passed in will indicate that no exception occurred." msgstr "" -#: ../../library/contextlib.rst:614 +#: ../../library/contextlib.rst:622 msgid "" "An :ref:`asynchronous context manager `, similar to :" "class:`ExitStack`, that supports combining both synchronous and asynchronous " "context managers, as well as having coroutines for cleanup logic." msgstr "" -#: ../../library/contextlib.rst:619 +#: ../../library/contextlib.rst:627 msgid "" "The :meth:`~ExitStack.close` method is not implemented; :meth:`aclose` must " "be used instead." msgstr "" -#: ../../library/contextlib.rst:624 +#: ../../library/contextlib.rst:632 msgid "" "Similar to :meth:`ExitStack.enter_context` but expects an asynchronous " "context manager." msgstr "" -#: ../../library/contextlib.rst:627 +#: ../../library/contextlib.rst:635 msgid "" "Raises :exc:`TypeError` instead of :exc:`AttributeError` if *cm* is not an " "asynchronous context manager." msgstr "" -#: ../../library/contextlib.rst:633 +#: ../../library/contextlib.rst:641 msgid "" "Similar to :meth:`ExitStack.push` but expects either an asynchronous context " "manager or a coroutine function." msgstr "" -#: ../../library/contextlib.rst:638 +#: ../../library/contextlib.rst:646 msgid "Similar to :meth:`ExitStack.callback` but expects a coroutine function." msgstr "" -#: ../../library/contextlib.rst:642 +#: ../../library/contextlib.rst:650 msgid "Similar to :meth:`ExitStack.close` but properly handles awaitables." msgstr "" -#: ../../library/contextlib.rst:644 +#: ../../library/contextlib.rst:652 msgid "Continuing the example for :func:`asynccontextmanager`::" msgstr "" -#: ../../library/contextlib.rst:656 +#: ../../library/contextlib.rst:664 msgid "Examples and Recipes" msgstr "" -#: ../../library/contextlib.rst:658 +#: ../../library/contextlib.rst:666 msgid "" "This section describes some examples and recipes for making effective use of " "the tools provided by :mod:`contextlib`." msgstr "" -#: ../../library/contextlib.rst:663 +#: ../../library/contextlib.rst:671 msgid "Supporting a variable number of context managers" msgstr "" -#: ../../library/contextlib.rst:665 +#: ../../library/contextlib.rst:673 msgid "" "The primary use case for :class:`ExitStack` is the one given in the class " "documentation: supporting a variable number of context managers and other " @@ -613,18 +622,18 @@ msgid "" "of the context managers being optional::" msgstr "" -#: ../../library/contextlib.rst:680 +#: ../../library/contextlib.rst:688 msgid "" "As shown, :class:`ExitStack` also makes it quite easy to use :keyword:`with` " "statements to manage arbitrary resources that don't natively support the " "context management protocol." msgstr "" -#: ../../library/contextlib.rst:686 +#: ../../library/contextlib.rst:694 msgid "Catching exceptions from ``__enter__`` methods" msgstr "" -#: ../../library/contextlib.rst:688 +#: ../../library/contextlib.rst:696 msgid "" "It is occasionally desirable to catch exceptions from an ``__enter__`` " "method implementation, *without* inadvertently catching exceptions from the :" @@ -633,7 +642,7 @@ msgid "" "be separated slightly in order to allow this::" msgstr "" -#: ../../library/contextlib.rst:703 +#: ../../library/contextlib.rst:711 msgid "" "Actually needing to do this is likely to indicate that the underlying API " "should be providing a direct resource management interface for use with :" @@ -644,29 +653,29 @@ msgid "" "`with` statement." msgstr "" -#: ../../library/contextlib.rst:713 +#: ../../library/contextlib.rst:721 msgid "Cleaning up in an ``__enter__`` implementation" msgstr "" -#: ../../library/contextlib.rst:715 +#: ../../library/contextlib.rst:723 msgid "" "As noted in the documentation of :meth:`ExitStack.push`, this method can be " "useful in cleaning up an already allocated resource if later steps in the :" "meth:`~object.__enter__` implementation fail." msgstr "" -#: ../../library/contextlib.rst:719 +#: ../../library/contextlib.rst:727 msgid "" "Here's an example of doing this for a context manager that accepts resource " "acquisition and release functions, along with an optional validation " "function, and maps them to the context management protocol::" msgstr "" -#: ../../library/contextlib.rst:759 +#: ../../library/contextlib.rst:767 msgid "Replacing any use of ``try-finally`` and flag variables" msgstr "" -#: ../../library/contextlib.rst:761 +#: ../../library/contextlib.rst:769 msgid "" "A pattern you will sometimes see is a ``try-finally`` statement with a flag " "variable to indicate whether or not the body of the ``finally`` clause " @@ -674,57 +683,57 @@ msgid "" "by using an ``except`` clause instead), it looks something like this::" msgstr "" -#: ../../library/contextlib.rst:775 +#: ../../library/contextlib.rst:783 msgid "" "As with any ``try`` statement based code, this can cause problems for " "development and review, because the setup code and the cleanup code can end " "up being separated by arbitrarily long sections of code." msgstr "" -#: ../../library/contextlib.rst:779 +#: ../../library/contextlib.rst:787 msgid "" ":class:`ExitStack` makes it possible to instead register a callback for " "execution at the end of a ``with`` statement, and then later decide to skip " "executing that callback::" msgstr "" -#: ../../library/contextlib.rst:791 +#: ../../library/contextlib.rst:799 msgid "" "This allows the intended cleanup up behaviour to be made explicit up front, " "rather than requiring a separate flag variable." msgstr "" -#: ../../library/contextlib.rst:794 +#: ../../library/contextlib.rst:802 msgid "" "If a particular application uses this pattern a lot, it can be simplified " "even further by means of a small helper class::" msgstr "" -#: ../../library/contextlib.rst:812 +#: ../../library/contextlib.rst:820 msgid "" "If the resource cleanup isn't already neatly bundled into a standalone " "function, then it is still possible to use the decorator form of :meth:" "`ExitStack.callback` to declare the resource cleanup in advance::" msgstr "" -#: ../../library/contextlib.rst:827 +#: ../../library/contextlib.rst:835 msgid "" "Due to the way the decorator protocol works, a callback function declared " "this way cannot take any parameters. Instead, any resources to be released " "must be accessed as closure variables." msgstr "" -#: ../../library/contextlib.rst:833 +#: ../../library/contextlib.rst:841 msgid "Using a context manager as a function decorator" msgstr "" -#: ../../library/contextlib.rst:835 +#: ../../library/contextlib.rst:843 msgid "" ":class:`ContextDecorator` makes it possible to use a context manager in both " "an ordinary ``with`` statement and also as a function decorator." msgstr "" -#: ../../library/contextlib.rst:838 +#: ../../library/contextlib.rst:846 msgid "" "For example, it is sometimes useful to wrap functions or groups of " "statements with a logger that can track the time of entry and time of exit. " @@ -733,15 +742,15 @@ msgid "" "in a single definition::" msgstr "" -#: ../../library/contextlib.rst:859 +#: ../../library/contextlib.rst:867 msgid "Instances of this class can be used as both a context manager::" msgstr "" -#: ../../library/contextlib.rst:865 +#: ../../library/contextlib.rst:873 msgid "And also as a function decorator::" msgstr "" -#: ../../library/contextlib.rst:872 +#: ../../library/contextlib.rst:880 msgid "" "Note that there is one additional limitation when using context managers as " "function decorators: there's no way to access the return value of :meth:" @@ -749,21 +758,21 @@ msgid "" "use an explicit ``with`` statement." msgstr "" -#: ../../library/contextlib.rst:880 +#: ../../library/contextlib.rst:888 msgid ":pep:`343` - The \"with\" statement" msgstr ":pep:`343` - \"with\" 陳述式" -#: ../../library/contextlib.rst:880 +#: ../../library/contextlib.rst:888 msgid "" "The specification, background, and examples for the Python :keyword:`with` " "statement." msgstr "" -#: ../../library/contextlib.rst:886 +#: ../../library/contextlib.rst:894 msgid "Single use, reusable and reentrant context managers" msgstr "" -#: ../../library/contextlib.rst:888 +#: ../../library/contextlib.rst:896 msgid "" "Most context managers are written in a way that means they can only be used " "effectively in a :keyword:`with` statement once. These single use context " @@ -771,32 +780,32 @@ msgid "" "them a second time will trigger an exception or otherwise not work correctly." msgstr "" -#: ../../library/contextlib.rst:894 +#: ../../library/contextlib.rst:902 msgid "" "This common limitation means that it is generally advisable to create " "context managers directly in the header of the :keyword:`with` statement " "where they are used (as shown in all of the usage examples above)." msgstr "" -#: ../../library/contextlib.rst:898 +#: ../../library/contextlib.rst:906 msgid "" "Files are an example of effectively single use context managers, since the " "first :keyword:`with` statement will close the file, preventing any further " "IO operations using that file object." msgstr "" -#: ../../library/contextlib.rst:902 +#: ../../library/contextlib.rst:910 msgid "" "Context managers created using :func:`contextmanager` are also single use " "context managers, and will complain about the underlying generator failing " "to yield if an attempt is made to use them a second time::" msgstr "" -#: ../../library/contextlib.rst:930 +#: ../../library/contextlib.rst:938 msgid "Reentrant context managers" msgstr "" -#: ../../library/contextlib.rst:932 +#: ../../library/contextlib.rst:940 msgid "" "More sophisticated context managers may be \"reentrant\". These context " "managers can not only be used in multiple :keyword:`with` statements, but " @@ -804,21 +813,21 @@ msgid "" "the same context manager." msgstr "" -#: ../../library/contextlib.rst:937 +#: ../../library/contextlib.rst:945 msgid "" ":class:`threading.RLock` is an example of a reentrant context manager, as " "are :func:`suppress`, :func:`redirect_stdout`, and :func:`chdir`. Here's a " "very simple example of reentrant use::" msgstr "" -#: ../../library/contextlib.rst:956 +#: ../../library/contextlib.rst:964 msgid "" "Real world examples of reentrancy are more likely to involve multiple " "functions calling each other and hence be far more complicated than this " "example." msgstr "" -#: ../../library/contextlib.rst:960 +#: ../../library/contextlib.rst:968 msgid "" "Note also that being reentrant is *not* the same thing as being thread " "safe. :func:`redirect_stdout`, for example, is definitely not thread safe, " @@ -826,11 +835,11 @@ msgid "" "stdout` to a different stream." msgstr "" -#: ../../library/contextlib.rst:969 +#: ../../library/contextlib.rst:977 msgid "Reusable context managers" msgstr "" -#: ../../library/contextlib.rst:971 +#: ../../library/contextlib.rst:979 msgid "" "Distinct from both single use and reentrant context managers are " "\"reusable\" context managers (or, to be completely explicit, \"reusable, " @@ -840,21 +849,21 @@ msgid "" "manager instance has already been used in a containing with statement." msgstr "" -#: ../../library/contextlib.rst:978 +#: ../../library/contextlib.rst:986 msgid "" ":class:`threading.Lock` is an example of a reusable, but not reentrant, " "context manager (for a reentrant lock, it is necessary to use :class:" "`threading.RLock` instead)." msgstr "" -#: ../../library/contextlib.rst:982 +#: ../../library/contextlib.rst:990 msgid "" "Another example of a reusable, but not reentrant, context manager is :class:" "`ExitStack`, as it invokes *all* currently registered callbacks when leaving " "any with statement, regardless of where those callbacks were added::" msgstr "" -#: ../../library/contextlib.rst:1013 +#: ../../library/contextlib.rst:1021 msgid "" "As the output from the example shows, reusing a single stack object across " "multiple with statements works correctly, but attempting to nest them will " @@ -862,7 +871,7 @@ msgid "" "which is unlikely to be desirable behaviour." msgstr "" -#: ../../library/contextlib.rst:1018 +#: ../../library/contextlib.rst:1026 msgid "" "Using separate :class:`ExitStack` instances instead of reusing a single " "instance avoids that problem::" diff --git a/library/contextvars.po b/library/contextvars.po index d3ec497566..715180773f 100644 --- a/library/contextvars.po +++ b/library/contextvars.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-21 00:15+0000\n" +"POT-Creation-Date: 2024-01-11 00:04+0000\n" "PO-Revision-Date: 2018-07-15 18:56+0800\n" "Last-Translator: \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -165,8 +165,9 @@ msgstr "" #: ../../library/contextvars.rst:134 msgid "" -"The function has an O(1) complexity, i.e. works equally fast for contexts " -"with a few context variables and for contexts that have a lot of them." +"The function has an *O*\\ (1) complexity, i.e. works equally fast for " +"contexts with a few context variables and for contexts that have a lot of " +"them." msgstr "" #: ../../library/contextvars.rst:141 diff --git a/library/datetime.po b/library/datetime.po index 5388a1b332..d3562c071b 100644 --- a/library/datetime.po +++ b/library/datetime.po @@ -1,5 +1,4 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -7,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-23 16:09+0000\n" +"POT-Creation-Date: 2024-01-24 00:03+0000\n" "PO-Revision-Date: 2023-08-07 10:20+0800\n" "Last-Translator: Griiid \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -72,11 +71,11 @@ msgstr "" #: ../../library/datetime.rst:38 msgid "Third-party library with expanded time zone and parsing support." -msgstr "" +msgstr "帶有時區與剖析擴充支援的第三方函式庫。" #: ../../library/datetime.rst:42 msgid "Package `DateType `_" -msgstr "" +msgstr "`DateType `_ 套件" #: ../../library/datetime.rst:41 msgid "" @@ -1114,8 +1113,8 @@ msgstr "" #: ../../library/datetime.rst:859 ../../library/datetime.rst:1255 #: ../../library/datetime.rst:1833 -msgid "Added the ``fold`` argument." -msgstr "新增 ``fold`` 引數。" +msgid "Added the *fold* parameter." +msgstr "新增 *fold* 參數。" #: ../../library/datetime.rst:866 msgid "Return the current local datetime, with :attr:`.tzinfo` ``None``." @@ -1835,8 +1834,8 @@ msgid ":exc:`ValueError` will be raised on an invalid *timespec* argument::" msgstr "" #: ../../library/datetime.rst:1499 ../../library/datetime.rst:1877 -msgid "Added the *timespec* argument." -msgstr "新增 *timespec* 引數。" +msgid "Added the *timespec* parameter." +msgstr "新增 *timespec* 參數。" #: ../../library/datetime.rst:1505 msgid "" @@ -2456,7 +2455,7 @@ msgstr "" #: ../../library/datetime.rst:2291 msgid "Always returns ``None``." -msgstr "" +msgstr "總是回傳 ``None``。" #: ../../library/datetime.rst:2295 msgid "" @@ -3018,7 +3017,7 @@ msgstr "新增 ``%G``\\ 、\\ ``%u`` 與 ``%V``\\ 。" #: ../../library/datetime.rst:2493 msgid "``%:z`` was added." -msgstr "" +msgstr "新增 ``%:z``。" #: ../../library/datetime.rst:2497 msgid "Technical Detail" diff --git a/library/dbm.po b/library/dbm.po index 63f1f9cda2..d1eed34764 100644 --- a/library/dbm.po +++ b/library/dbm.po @@ -1,5 +1,4 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -8,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-23 16:09+0000\n" +"POT-Creation-Date: 2024-01-27 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:42+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -21,7 +20,7 @@ msgstr "" #: ../../library/dbm.rst:2 msgid ":mod:`dbm` --- Interfaces to Unix \"databases\"" -msgstr "" +msgstr ":mod:`dbm` --- Unix \"databases\" 的介面" #: ../../library/dbm.rst:7 msgid "**Source code:** :source:`Lib/dbm/__init__.py`" @@ -51,349 +50,400 @@ msgid "" msgstr "" #: ../../library/dbm.rst:31 -msgid "" -"Returns one of the following values: ``None`` if the file can't be opened " -"because it's unreadable or doesn't exist; the empty string (``''``) if the " -"file's format can't be guessed; or a string containing the required module " -"name, such as ``'dbm.ndbm'`` or ``'dbm.gnu'``." -msgstr "" +msgid "Return one of the following values:" +msgstr "回傳以下其中一個值:" -#: ../../library/dbm.rst:36 ../../library/dbm.rst:210 ../../library/dbm.rst:316 -#: ../../library/dbm.rst:400 -msgid "Accepts :term:`path-like object` for filename." +#: ../../library/dbm.rst:33 +msgid "" +"``None`` if the file can't be opened because it's unreadable or doesn't exist" msgstr "" -#: ../../library/dbm.rst:41 -msgid "Open the database file *file* and return a corresponding object." +#: ../../library/dbm.rst:34 +msgid "the empty string (``''``) if the file's format can't be guessed" msgstr "" -#: ../../library/dbm.rst:43 +#: ../../library/dbm.rst:35 msgid "" -"If the database file already exists, the :func:`whichdb` function is used to " -"determine its type and the appropriate module is used; if it does not exist, " -"the first module listed above that can be imported is used." +"a string containing the required module name, such as ``'dbm.ndbm'`` or " +"``'dbm.gnu'``" msgstr "" -#: ../../library/dbm.rst:47 ../../library/dbm.rst:166 ../../library/dbm.rst:364 -msgid "The optional *flag* argument can be:" +#: ../../library/dbm.rst:37 ../../library/dbm.rst:397 +msgid "*filename* accepts a :term:`path-like object`." msgstr "" -#: ../../library/dbm.rst:50 ../../library/dbm.rst:169 ../../library/dbm.rst:188 -#: ../../library/dbm.rst:294 ../../library/dbm.rst:367 -msgid "Value" +#: ../../library/dbm.rst:61 +msgid "Open a database and return the corresponding database object." msgstr "" -#: ../../library/dbm.rst:50 ../../library/dbm.rst:169 ../../library/dbm.rst:188 -#: ../../library/dbm.rst:294 ../../library/dbm.rst:367 -msgid "Meaning" +#: ../../library/dbm.rst:0 +msgid "Parameters" msgstr "" -#: ../../library/dbm.rst:52 ../../library/dbm.rst:171 ../../library/dbm.rst:296 -#: ../../library/dbm.rst:369 -msgid "``'r'``" -msgstr "``'r'``" +#: ../../library/dbm.rst:63 +msgid "" +"The database file to open. If the database file already exists, the :func:" +"`whichdb` function is used to determine its type and the appropriate module " +"is used; if it does not exist, the first submodule listed above that can be " +"imported is used." +msgstr "" -#: ../../library/dbm.rst:52 ../../library/dbm.rst:171 ../../library/dbm.rst:296 -#: ../../library/dbm.rst:369 -msgid "Open existing database for reading only (default)" +#: ../../library/dbm.rst:64 +msgid "The database file to open." msgstr "" -#: ../../library/dbm.rst:55 ../../library/dbm.rst:174 ../../library/dbm.rst:299 -#: ../../library/dbm.rst:372 -msgid "``'w'``" -msgstr "``'w'``" +#: ../../library/dbm.rst:66 +msgid "" +"If the database file already exists, the :func:`whichdb` function is used to " +"determine its type and the appropriate module is used; if it does not exist, " +"the first submodule listed above that can be imported is used." +msgstr "" -#: ../../library/dbm.rst:55 ../../library/dbm.rst:174 ../../library/dbm.rst:299 -#: ../../library/dbm.rst:372 -msgid "Open existing database for reading and writing" +#: ../../library/dbm.rst:71 +msgid "" +"* ``'r'`` (default), |flag_r| * ``'w'``, |flag_w| * ``'c'``, |flag_c| * " +"``'n'``, |flag_n|" msgstr "" +"* ``'r'`` (default), |flag_r| * ``'w'``, |flag_w| * ``'c'``, |flag_c| * " +"``'n'``, |flag_n|" -#: ../../library/dbm.rst:58 ../../library/dbm.rst:177 ../../library/dbm.rst:302 -#: ../../library/dbm.rst:375 -msgid "``'c'``" -msgstr "``'c'``" +#: ../../library/dbm.rst:72 +msgid "``'r'`` (default), |flag_r|" +msgstr "``'r'`` (default), |flag_r|" -#: ../../library/dbm.rst:58 ../../library/dbm.rst:177 ../../library/dbm.rst:302 -#: ../../library/dbm.rst:375 -msgid "Open database for reading and writing, creating it if it doesn't exist" -msgstr "" +#: ../../library/dbm.rst:73 +msgid "``'w'``, |flag_w|" +msgstr "``'w'``, |flag_w|" -#: ../../library/dbm.rst:61 ../../library/dbm.rst:180 ../../library/dbm.rst:305 -#: ../../library/dbm.rst:378 -msgid "``'n'``" -msgstr "``'n'``" +#: ../../library/dbm.rst:74 +msgid "``'c'``, |flag_c|" +msgstr "``'c'``, |flag_c|" -#: ../../library/dbm.rst:61 ../../library/dbm.rst:180 ../../library/dbm.rst:305 -#: ../../library/dbm.rst:378 -msgid "Always create a new, empty database, open for reading and writing" -msgstr "" +#: ../../library/dbm.rst:75 +msgid "``'n'``, |flag_n|" +msgstr "``'n'``, |flag_n|" -#: ../../library/dbm.rst:65 ../../library/dbm.rst:309 ../../library/dbm.rst:382 +#: ../../library/dbm.rst:77 msgid "" -"The optional *mode* argument is the Unix mode of the file, used only when " -"the database has to be created. It defaults to octal ``0o666`` (and will be " -"modified by the prevailing umask)." +"The Unix file access mode of the file (default: octal ``0o666``), used only " +"when the database has to be created." msgstr "" -#: ../../library/dbm.rst:70 -msgid "" -"The object returned by :func:`.open` supports the same basic functionality " -"as dictionaries; keys and their corresponding values can be stored, " -"retrieved, and deleted, and the :keyword:`in` operator and the :meth:`keys` " -"method are available, as well as :meth:`get` and :meth:`setdefault`." +#: ../../library/dbm.rst:81 +msgid "*file* accepts a :term:`path-like object`." msgstr "" -#: ../../library/dbm.rst:75 +#: ../../library/dbm.rst:84 msgid "" -":meth:`get` and :meth:`setdefault` are now available in all database modules." +"The object returned by :func:`~dbm.open` supports the same basic " +"functionality as a :class:`dict`; keys and their corresponding values can be " +"stored, retrieved, and deleted, and the :keyword:`in` operator and the :meth:" +"`!keys` method are available, as well as :meth:`!get` and :meth:`!" +"setdefault` methods." msgstr "" -#: ../../library/dbm.rst:78 +#: ../../library/dbm.rst:89 msgid "" -"Deleting a key from a read-only database raises database module specific " -"error instead of :exc:`KeyError`." +"Key and values are always stored as :class:`bytes`. This means that when " +"strings are used they are implicitly converted to the default encoding " +"before being stored." msgstr "" -#: ../../library/dbm.rst:82 -msgid "Accepts :term:`path-like object` for file." +#: ../../library/dbm.rst:93 +msgid "" +"These objects also support being used in a :keyword:`with` statement, which " +"will automatically close them when done." msgstr "" -#: ../../library/dbm.rst:85 +#: ../../library/dbm.rst:96 msgid "" -"Key and values are always stored as bytes. This means that when strings are " -"used they are implicitly converted to the default encoding before being " -"stored." +":meth:`!get` and :meth:`!setdefault` methods are now available for all :mod:" +"`dbm` backends." msgstr "" -#: ../../library/dbm.rst:89 +#: ../../library/dbm.rst:100 msgid "" -"These objects also support being used in a :keyword:`with` statement, which " -"will automatically close them when done." +"Added native support for the context management protocol to the objects " +"returned by :func:`~dbm.open`." msgstr "" -#: ../../library/dbm.rst:92 +#: ../../library/dbm.rst:104 msgid "" -"Added native support for the context management protocol to the objects " -"returned by :func:`.open`." +"Deleting a key from a read-only database raises a database module specific " +"exception instead of :exc:`KeyError`." msgstr "" -#: ../../library/dbm.rst:96 +#: ../../library/dbm.rst:108 msgid "" "The following example records some hostnames and a corresponding title, and " "then prints out the contents of the database::" msgstr "" -#: ../../library/dbm.rst:126 +#: ../../library/dbm.rst:138 msgid "Module :mod:`shelve`" msgstr ":mod:`shelve` 模組" -#: ../../library/dbm.rst:127 +#: ../../library/dbm.rst:139 msgid "Persistence module which stores non-string data." msgstr "" -#: ../../library/dbm.rst:130 +#: ../../library/dbm.rst:142 msgid "The individual submodules are described in the following sections." msgstr "" -#: ../../library/dbm.rst:134 -msgid ":mod:`dbm.gnu` --- GNU's reinterpretation of dbm" -msgstr "" +#: ../../library/dbm.rst:146 +msgid ":mod:`dbm.gnu` --- GNU database manager" +msgstr ":mod:`dbm.gnu` --- GNU 資料庫管理器" -#: ../../library/dbm.rst:140 +#: ../../library/dbm.rst:152 msgid "**Source code:** :source:`Lib/dbm/gnu.py`" msgstr "**原始碼:**\\ :source:`Lib/dbm/gnu.py`" -#: ../../library/dbm.rst:144 +#: ../../library/dbm.rst:156 msgid "" -"This module is quite similar to the :mod:`dbm` module, but uses the GNU " -"library ``gdbm`` instead to provide some additional functionality. Please " -"note that the file formats created by :mod:`dbm.gnu` and :mod:`dbm.ndbm` are " -"incompatible." +"The :mod:`dbm.gnu` module provides an interface to the :abbr:`GDBM (GNU " +"dbm)` library, similar to the :mod:`dbm.ndbm` module, but with additional " +"functionality like crash tolerance." msgstr "" -#: ../../library/dbm.rst:148 +#: ../../library/dbm.rst:160 msgid "" -"The :mod:`dbm.gnu` module provides an interface to the GNU DBM library. " -"``dbm.gnu.gdbm`` objects behave like mappings (dictionaries), except that " -"keys and values are always converted to bytes before storing. Printing a " -"``gdbm`` object doesn't print the keys and values, and the :meth:`items` " -"and :meth:`values` methods are not supported." +":class:`!gdbm` objects behave similar to :term:`mappings `, except " +"that keys and values are always converted to :class:`bytes` before storing, " +"and the :meth:`!items` and :meth:`!values` methods are not supported." msgstr "" -#: ../../library/dbm.rst:157 +#: ../../library/dbm.rst:164 ../../library/dbm.rst:272 +msgid "|incompat_note|" +msgstr "|incompat_note|" + +#: ../../library/dbm.rst:168 msgid "" "Raised on :mod:`dbm.gnu`-specific errors, such as I/O errors. :exc:" "`KeyError` is raised for general mapping errors like specifying an incorrect " "key." msgstr "" -#: ../../library/dbm.rst:163 +#: ../../library/dbm.rst:174 msgid "" -"Open a ``gdbm`` database and return a :class:`gdbm` object. The *filename* " +"Open a GDBM database and return a :class:`!gdbm` object. The *filename* " "argument is the name of the database file." msgstr "" -#: ../../library/dbm.rst:184 +#: ../../library/dbm.rst:177 +msgid "The optional *flag* argument can be:" +msgstr "" + +#: ../../library/dbm.rst:1 ../../library/dbm.rst:191 +msgid "Value" +msgstr "" + +#: ../../library/dbm.rst:1 ../../library/dbm.rst:191 +msgid "Meaning" +msgstr "" + +#: ../../library/dbm.rst:1 +msgid "``'r'`` (default)" +msgstr "" + +#: ../../library/dbm.rst:1 +msgid "|flag_r|" +msgstr "|flag_r|" + +#: ../../library/dbm.rst:1 +msgid "``'w'``" +msgstr "``'w'``" + +#: ../../library/dbm.rst:1 +msgid "|flag_w|" +msgstr "|flag_w|" + +#: ../../library/dbm.rst:1 +msgid "``'c'``" +msgstr "``'c'``" + +#: ../../library/dbm.rst:1 +msgid "|flag_c|" +msgstr "|flag_c|" + +#: ../../library/dbm.rst:1 +msgid "``'n'``" +msgstr "``'n'``" + +#: ../../library/dbm.rst:1 +msgid "|flag_n|" +msgstr "|flag_n|" + +#: ../../library/dbm.rst:187 msgid "" "The following additional characters may be appended to the flag to control " "how the database is opened:" msgstr "" -#: ../../library/dbm.rst:190 +#: ../../library/dbm.rst:193 msgid "``'f'``" msgstr "``'f'``" -#: ../../library/dbm.rst:190 +#: ../../library/dbm.rst:193 msgid "" "Open the database in fast mode. Writes to the database will not be " "synchronized." msgstr "" -#: ../../library/dbm.rst:193 +#: ../../library/dbm.rst:196 msgid "``'s'``" msgstr "``'s'``" -#: ../../library/dbm.rst:193 +#: ../../library/dbm.rst:196 msgid "" "Synchronized mode. This will cause changes to the database to be immediately " "written to the file." msgstr "" -#: ../../library/dbm.rst:197 +#: ../../library/dbm.rst:200 msgid "``'u'``" msgstr "``'u'``" -#: ../../library/dbm.rst:197 +#: ../../library/dbm.rst:200 msgid "Do not lock database." msgstr "不要鎖住資料庫" -#: ../../library/dbm.rst:200 +#: ../../library/dbm.rst:203 msgid "" -"Not all flags are valid for all versions of ``gdbm``. The module constant :" +"Not all flags are valid for all versions of GDBM. The module constant :" "const:`open_flags` is a string of supported flag characters. The exception :" "exc:`error` is raised if an invalid flag is specified." msgstr "" -#: ../../library/dbm.rst:204 +#: ../../library/dbm.rst:207 msgid "" "The optional *mode* argument is the Unix mode of the file, used only when " "the database has to be created. It defaults to octal ``0o666``." msgstr "" -#: ../../library/dbm.rst:207 +#: ../../library/dbm.rst:210 msgid "" -"In addition to the dictionary-like methods, ``gdbm`` objects have the " +"In addition to the dictionary-like methods, :class:`gdbm` objects have the " "following methods:" msgstr "" -#: ../../library/dbm.rst:215 +#: ../../library/dbm.rst:213 ../../library/dbm.rst:315 +msgid "Accepts :term:`path-like object` for filename." +msgstr "" + +#: ../../library/dbm.rst:218 msgid "" "It's possible to loop over every key in the database using this method and " -"the :meth:`nextkey` method. The traversal is ordered by ``gdbm``'s internal " +"the :meth:`nextkey` method. The traversal is ordered by GDBM's internal " "hash values, and won't be sorted by the key values. This method returns the " "starting key." msgstr "" -#: ../../library/dbm.rst:222 +#: ../../library/dbm.rst:225 msgid "" "Returns the key that follows *key* in the traversal. The following code " "prints every key in the database ``db``, without having to create a list in " "memory that contains them all::" msgstr "" -#: ../../library/dbm.rst:233 +#: ../../library/dbm.rst:236 msgid "" "If you have carried out a lot of deletions and would like to shrink the " -"space used by the ``gdbm`` file, this routine will reorganize the database. " -"``gdbm`` objects will not shorten the length of a database file except by " -"using this reorganization; otherwise, deleted file space will be kept and " +"space used by the GDBM file, this routine will reorganize the database. :" +"class:`!gdbm` objects will not shorten the length of a database file except " +"by using this reorganization; otherwise, deleted file space will be kept and " "reused as new (key, value) pairs are added." msgstr "" -#: ../../library/dbm.rst:241 +#: ../../library/dbm.rst:244 msgid "" "When the database has been opened in fast mode, this method forces any " "unwritten data to be written to the disk." msgstr "" -#: ../../library/dbm.rst:246 -msgid "Close the ``gdbm`` database." -msgstr "" - #: ../../library/dbm.rst:249 -msgid ":mod:`dbm.ndbm` --- Interface based on ndbm" -msgstr "" +msgid "Close the GDBM database." +msgstr "關閉 GDBM 資料庫。" + +#: ../../library/dbm.rst:253 +msgid ":mod:`dbm.ndbm` --- New Database Manager" +msgstr ":mod:`dbm.ndbm` --- 新資料庫管理器" -#: ../../library/dbm.rst:255 +#: ../../library/dbm.rst:259 msgid "**Source code:** :source:`Lib/dbm/ndbm.py`" msgstr "**原始碼:**\\ :source:`Lib/dbm/ndbm.py`" -#: ../../library/dbm.rst:259 +#: ../../library/dbm.rst:263 msgid "" -"The :mod:`dbm.ndbm` module provides an interface to the Unix \"(n)dbm\" " -"library. Dbm objects behave like mappings (dictionaries), except that keys " -"and values are always stored as bytes. Printing a ``dbm`` object doesn't " -"print the keys and values, and the :meth:`items` and :meth:`values` methods " -"are not supported." +"The :mod:`dbm.ndbm` module provides an interface to the :abbr:`NDBM (New " +"Database Manager)` library. :class:`!ndbm` objects behave similar to :term:" +"`mappings `, except that keys and values are always stored as :" +"class:`bytes`, and the :meth:`!items` and :meth:`!values` methods are not " +"supported." msgstr "" -#: ../../library/dbm.rst:264 +#: ../../library/dbm.rst:269 msgid "" -"This module can be used with the \"classic\" ndbm interface or the GNU GDBM " -"compatibility interface. On Unix, the :program:`configure` script will " -"attempt to locate the appropriate header file to simplify building this " -"module." +"This module can be used with the \"classic\" NDBM interface or the :abbr:" +"`GDBM (GNU dbm)` compatibility interface." msgstr "" -#: ../../library/dbm.rst:270 +#: ../../library/dbm.rst:276 msgid "" -"The ndbm library shipped as part of macOS has an undocumented limitation on " +"The NDBM library shipped as part of macOS has an undocumented limitation on " "the size of values, which can result in corrupted database files when " "storing values larger than this limit. Reading such corrupted files can " "result in a hard crash (segmentation fault)." msgstr "" -#: ../../library/dbm.rst:277 +#: ../../library/dbm.rst:283 msgid "" "Raised on :mod:`dbm.ndbm`-specific errors, such as I/O errors. :exc:" "`KeyError` is raised for general mapping errors like specifying an incorrect " "key." msgstr "" -#: ../../library/dbm.rst:283 -msgid "Name of the ``ndbm`` implementation library used." +#: ../../library/dbm.rst:289 +msgid "Name of the NDBM implementation library used." msgstr "" -#: ../../library/dbm.rst:288 +#: ../../library/dbm.rst:294 msgid "" -"Open a dbm database and return a ``ndbm`` object. The *filename* argument " -"is the name of the database file (without the :file:`.dir` or :file:`.pag` " -"extensions)." +"Open an NDBM database and return an :class:`!ndbm` object. The *filename* " +"argument is the name of the database file (without the :file:`.dir` or :file:" +"`.pag` extensions)." msgstr "" -#: ../../library/dbm.rst:291 +#: ../../library/dbm.rst:298 msgid "The optional *flag* argument must be one of these values:" msgstr "" -#: ../../library/dbm.rst:313 +#: ../../library/dbm.rst:308 msgid "" -"In addition to the dictionary-like methods, ``ndbm`` objects provide the " -"following method:" +"The optional *mode* argument is the Unix mode of the file, used only when " +"the database has to be created. It defaults to octal ``0o666`` (and will be " +"modified by the prevailing umask)." msgstr "" -#: ../../library/dbm.rst:321 -msgid "Close the ``ndbm`` database." +#: ../../library/dbm.rst:312 +msgid "" +"In addition to the dictionary-like methods, :class:`!ndbm` objects provide " +"the following method:" msgstr "" -#: ../../library/dbm.rst:325 +#: ../../library/dbm.rst:320 +msgid "Close the NDBM database." +msgstr "關閉 NDBM 資料庫。" + +#: ../../library/dbm.rst:324 msgid ":mod:`dbm.dumb` --- Portable DBM implementation" -msgstr "" +msgstr ":mod:`dbm.dumb` --- 可攜式 DBM 實作" -#: ../../library/dbm.rst:330 +#: ../../library/dbm.rst:329 msgid "**Source code:** :source:`Lib/dbm/dumb.py`" msgstr "**原始碼:**\\ :source:`Lib/dbm/dumb.py`" -#: ../../library/dbm.rst:336 +#: ../../library/dbm.rst:335 msgid "" "The :mod:`dbm.dumb` module is intended as a last resort fallback for the :" "mod:`dbm` module when a more robust module is not available. The :mod:`dbm." @@ -401,17 +451,18 @@ msgid "" "the other database modules." msgstr "" -#: ../../library/dbm.rst:343 +#: ../../library/dbm.rst:342 msgid "" -"The :mod:`dbm.dumb` module provides a persistent dictionary-like interface " -"which is written entirely in Python. Unlike other modules such as :mod:`dbm." -"gnu` no external library is required. As with other persistent mappings, " -"the keys and values are always stored as bytes." +"The :mod:`dbm.dumb` module provides a persistent :class:`dict`-like " +"interface which is written entirely in Python. Unlike other :mod:`dbm` " +"backends, such as :mod:`dbm.gnu`, no external library is required. As with " +"other :mod:`dbm` backends, the keys and values are always stored as :class:" +"`bytes`." msgstr "" -#: ../../library/dbm.rst:348 -msgid "The module defines the following:" -msgstr "" +#: ../../library/dbm.rst:349 +msgid "The :mod:`!dbm.dumb` module defines the following:" +msgstr ":mod:`!dbm.dumb` 模組定義了以下項目:" #: ../../library/dbm.rst:353 msgid "" @@ -422,48 +473,85 @@ msgstr "" #: ../../library/dbm.rst:359 msgid "" -"Open a ``dumbdbm`` database and return a dumbdbm object. The *filename* " -"argument is the basename of the database file (without any specific " -"extensions). When a dumbdbm database is created, files with :file:`.dat` " -"and :file:`.dir` extensions are created." +"Open a :mod:`!dbm.dumb` database. The returned database object behaves " +"similar to a :term:`mapping`, in addition to providing :meth:`~dumbdbm.sync` " +"and :meth:`~dumbdbm.close` methods." msgstr "" -#: ../../library/dbm.rst:387 +#: ../../library/dbm.rst:364 +msgid "" +"The basename of the database file (without extensions). A new database " +"creates the following files: - :file:`{filename}.dat` - :file:`{filename}." +"dir`" +msgstr "" + +#: ../../library/dbm.rst:365 +msgid "" +"The basename of the database file (without extensions). A new database " +"creates the following files:" +msgstr "" + +#: ../../library/dbm.rst:368 +msgid ":file:`{filename}.dat`" +msgstr ":file:`{filename}.dat`" + +#: ../../library/dbm.rst:369 +msgid ":file:`{filename}.dir`" +msgstr ":file:`{filename}.dir`" + +#: ../../library/dbm.rst:372 +msgid "" +".. csv-table:: :header: \"Value\", \"Meaning\" ``'r'``, |flag_r| " +"``'w'``, |flag_w| ``'c'`` (default), |flag_c| ``'n'``, |flag_n|" +msgstr "" + +#: ../../library/dbm.rst:1 +msgid "``'r'``" +msgstr "``'r'``" + +#: ../../library/dbm.rst:1 +msgid "``'c'`` (default)" +msgstr "``'c'``\\ (預設)" + +#: ../../library/dbm.rst:381 +msgid "" +"The Unix file access mode of the file (default: ``0o666``), used only when " +"the database has to be created." +msgstr "" + +#: ../../library/dbm.rst:386 msgid "" "It is possible to crash the Python interpreter when loading a database with " "a sufficiently large/complex entry due to stack depth limitations in " "Python's AST compiler." msgstr "" -#: ../../library/dbm.rst:391 -msgid "" -":func:`.open` always creates a new database when the flag has the value " -"``'n'``." +#: ../../library/dbm.rst:390 +msgid ":func:`open` always creates a new database when *flag* is ``'n'``." msgstr "" -#: ../../library/dbm.rst:395 +#: ../../library/dbm.rst:393 msgid "" -"A database opened with flags ``'r'`` is now read-only. Opening with flags " -"``'r'`` and ``'w'`` no longer creates a database if it does not exist." +"A database opened read-only if *flag* is ``'r'``. A database is not created " +"if it does not exist if *flag* is ``'r'`` or ``'w'``." msgstr "" -#: ../../library/dbm.rst:403 +#: ../../library/dbm.rst:400 msgid "" "In addition to the methods provided by the :class:`collections.abc." -"MutableMapping` class, :class:`dumbdbm` objects provide the following " -"methods:" +"MutableMapping` class, the following methods are provided:" msgstr "" -#: ../../library/dbm.rst:409 +#: ../../library/dbm.rst:406 msgid "" "Synchronize the on-disk directory and data files. This method is called by " "the :meth:`Shelve.sync` method." msgstr "" -#: ../../library/dbm.rst:414 -msgid "Close the ``dumbdbm`` database." -msgstr "" +#: ../../library/dbm.rst:411 +msgid "Close the database." +msgstr "關閉資料庫。" -#: ../../library/dbm.rst:332 +#: ../../library/dbm.rst:331 msgid "databases" msgstr "databases(資料庫)" diff --git a/library/difflib.po b/library/difflib.po index 3fd67c4ee7..9b4da5dfec 100644 --- a/library/difflib.po +++ b/library/difflib.po @@ -1,5 +1,4 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -7,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-11-04 00:03+0000\n" +"POT-Creation-Date: 2024-01-24 00:03+0000\n" "PO-Revision-Date: 2016-11-19 00:29+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -73,8 +72,8 @@ msgid "" msgstr "" #: ../../library/difflib.rst:55 ../../library/difflib.rst:386 -msgid "The *autojunk* parameter." -msgstr "*autojunk* 參數。" +msgid "Added the *autojunk* parameter." +msgstr "新增 *autojunk* 參數。" #: ../../library/difflib.rst:61 msgid "" diff --git a/library/dis.po b/library/dis.po index b3fb5b05c3..624c20d7c0 100644 --- a/library/dis.po +++ b/library/dis.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-07 00:03+0000\n" +"POT-Creation-Date: 2024-01-03 20:44+0000\n" "PO-Revision-Date: 2018-07-27 16:55+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -367,33 +367,34 @@ msgstr "" #: ../../library/dis.rst:319 msgid "" -"This generator function uses the ``co_lines`` method of the code object " -"*code* to find the offsets which are starts of lines in the source code. " -"They are generated as ``(offset, lineno)`` pairs." +"This generator function uses the :meth:`~codeobject.co_lines` method of the :" +"ref:`code object ` *code* to find the offsets which are starts " +"of lines in the source code. They are generated as ``(offset, lineno)`` " +"pairs." msgstr "" -#: ../../library/dis.rst:323 +#: ../../library/dis.rst:324 msgid "Line numbers can be decreasing. Before, they were always increasing." msgstr "" -#: ../../library/dis.rst:326 +#: ../../library/dis.rst:327 msgid "" -"The :pep:`626` ``co_lines`` method is used instead of the :attr:`~codeobject." -"co_firstlineno` and :attr:`~codeobject.co_lnotab` attributes of the code " -"object." +"The :pep:`626` :meth:`~codeobject.co_lines` method is used instead of the :" +"attr:`~codeobject.co_firstlineno` and :attr:`~codeobject.co_lnotab` " +"attributes of the :ref:`code object `." msgstr "" -#: ../../library/dis.rst:334 +#: ../../library/dis.rst:335 msgid "" "Detect all offsets in the raw compiled bytecode string *code* which are jump " "targets, and return a list of these offsets." msgstr "" -#: ../../library/dis.rst:340 +#: ../../library/dis.rst:341 msgid "Compute the stack effect of *opcode* with argument *oparg*." msgstr "" -#: ../../library/dis.rst:342 +#: ../../library/dis.rst:343 msgid "" "If the code has a jump target and *jump* is ``True``, :func:`~stack_effect` " "will return the stack effect of jumping. If *jump* is ``False``, it will " @@ -401,122 +402,122 @@ msgid "" "it will return the maximal stack effect of both cases." msgstr "" -#: ../../library/dis.rst:349 +#: ../../library/dis.rst:350 msgid "Added *jump* parameter." msgstr "新增 *jump* 參數。" -#: ../../library/dis.rst:356 +#: ../../library/dis.rst:357 msgid "Python Bytecode Instructions" msgstr "" -#: ../../library/dis.rst:358 +#: ../../library/dis.rst:359 msgid "" "The :func:`get_instructions` function and :class:`Bytecode` class provide " "details of bytecode instructions as :class:`Instruction` instances:" msgstr "" -#: ../../library/dis.rst:363 +#: ../../library/dis.rst:364 msgid "Details for a bytecode operation" msgstr "" -#: ../../library/dis.rst:367 +#: ../../library/dis.rst:368 msgid "" "numeric code for operation, corresponding to the opcode values listed below " "and the bytecode values in the :ref:`opcode_collections`." msgstr "" -#: ../../library/dis.rst:373 +#: ../../library/dis.rst:374 msgid "human readable name for operation" msgstr "" -#: ../../library/dis.rst:378 +#: ../../library/dis.rst:379 msgid "numeric argument to operation (if any), otherwise ``None``" msgstr "" -#: ../../library/dis.rst:383 +#: ../../library/dis.rst:384 msgid "resolved arg value (if any), otherwise ``None``" msgstr "" -#: ../../library/dis.rst:388 +#: ../../library/dis.rst:389 msgid "" "human readable description of operation argument (if any), otherwise an " "empty string." msgstr "" -#: ../../library/dis.rst:394 +#: ../../library/dis.rst:395 msgid "start index of operation within bytecode sequence" msgstr "" -#: ../../library/dis.rst:399 +#: ../../library/dis.rst:400 msgid "line started by this opcode (if any), otherwise ``None``" msgstr "" -#: ../../library/dis.rst:404 +#: ../../library/dis.rst:405 msgid "``True`` if other code jumps to here, otherwise ``False``" msgstr "" -#: ../../library/dis.rst:409 +#: ../../library/dis.rst:410 msgid "" ":class:`dis.Positions` object holding the start and end locations that are " "covered by this instruction." msgstr "" -#: ../../library/dis.rst:416 +#: ../../library/dis.rst:417 msgid "Field ``positions`` is added." msgstr "" -#: ../../library/dis.rst:421 +#: ../../library/dis.rst:422 msgid "" "In case the information is not available, some fields might be ``None``." msgstr "" -#: ../../library/dis.rst:431 +#: ../../library/dis.rst:432 msgid "" "The Python compiler currently generates the following bytecode instructions." msgstr "" -#: ../../library/dis.rst:434 +#: ../../library/dis.rst:435 msgid "**General instructions**" msgstr "" -#: ../../library/dis.rst:436 +#: ../../library/dis.rst:437 msgid "" "In the following, We will refer to the interpreter stack as ``STACK`` and " "describe operations on it as if it was a Python list. The top of the stack " "corresponds to ``STACK[-1]`` in this language." msgstr "" -#: ../../library/dis.rst:442 +#: ../../library/dis.rst:443 msgid "" "Do nothing code. Used as a placeholder by the bytecode optimizer, and to " "generate line tracing events." msgstr "" -#: ../../library/dis.rst:448 +#: ../../library/dis.rst:449 msgid "Removes the top-of-stack item::" msgstr "" -#: ../../library/dis.rst:455 +#: ../../library/dis.rst:456 msgid "" "Removes the top two values from the stack. Equivalent to ``POP_TOP``; " "``POP_TOP``. Used to clean up at the end of loops, hence the name." msgstr "" -#: ../../library/dis.rst:464 +#: ../../library/dis.rst:465 msgid "Implements ``del STACK[-2]``. Used to clean up when a generator exits." msgstr "" -#: ../../library/dis.rst:472 +#: ../../library/dis.rst:473 msgid "" "Push the i-th item to the top of the stack without removing it from its " "original location::" msgstr "" -#: ../../library/dis.rst:483 +#: ../../library/dis.rst:484 msgid "Swap the top of the stack with the i-th element::" msgstr "" -#: ../../library/dis.rst:492 +#: ../../library/dis.rst:493 msgid "" "Rather than being an actual instruction, this opcode is used to mark extra " "space for the interpreter to cache useful data directly in the bytecode " @@ -524,91 +525,91 @@ msgid "" "viewed with ``show_caches=True``." msgstr "" -#: ../../library/dis.rst:497 +#: ../../library/dis.rst:498 msgid "" "Logically, this space is part of the preceding instruction. Many opcodes " "expect to be followed by an exact number of caches, and will instruct the " "interpreter to skip over them at runtime." msgstr "" -#: ../../library/dis.rst:501 +#: ../../library/dis.rst:502 msgid "" "Populated caches can look like arbitrary instructions, so great care should " "be taken when reading or modifying raw, adaptive bytecode containing " "quickened data." msgstr "" -#: ../../library/dis.rst:508 +#: ../../library/dis.rst:509 msgid "**Unary operations**" msgstr "" -#: ../../library/dis.rst:510 +#: ../../library/dis.rst:511 msgid "" "Unary operations take the top of the stack, apply the operation, and push " "the result back on the stack." msgstr "" -#: ../../library/dis.rst:516 +#: ../../library/dis.rst:517 msgid "Implements ``STACK[-1] = -STACK[-1]``." msgstr "" -#: ../../library/dis.rst:521 +#: ../../library/dis.rst:522 msgid "Implements ``STACK[-1] = not STACK[-1]``." msgstr "" -#: ../../library/dis.rst:526 +#: ../../library/dis.rst:527 msgid "Implements ``STACK[-1] = ~STACK[-1]``." msgstr "" -#: ../../library/dis.rst:531 +#: ../../library/dis.rst:532 msgid "Implements ``STACK[-1] = iter(STACK[-1])``." msgstr "" -#: ../../library/dis.rst:536 +#: ../../library/dis.rst:537 msgid "" "If ``STACK[-1]`` is a :term:`generator iterator` or :term:`coroutine` object " "it is left as is. Otherwise, implements ``STACK[-1] = iter(STACK[-1])``." msgstr "" -#: ../../library/dis.rst:542 +#: ../../library/dis.rst:543 msgid "**Binary and in-place operations**" msgstr "" -#: ../../library/dis.rst:544 +#: ../../library/dis.rst:545 msgid "" "Binary operations remove the top two items from the stack (``STACK[-1]`` and " "``STACK[-2]``). They perform the operation, then put the result back on the " "stack." msgstr "" -#: ../../library/dis.rst:547 +#: ../../library/dis.rst:548 msgid "" "In-place operations are like binary operations, but the operation is done in-" "place when ``STACK[-2]`` supports it, and the resulting ``STACK[-1]`` may be " "(but does not have to be) the original ``STACK[-2]``." msgstr "" -#: ../../library/dis.rst:554 +#: ../../library/dis.rst:555 msgid "" "Implements the binary and in-place operators (depending on the value of " "*op*)::" msgstr "" -#: ../../library/dis.rst:566 ../../library/dis.rst:575 -#: ../../library/dis.rst:585 ../../library/dis.rst:593 -#: ../../library/dis.rst:605 ../../library/dis.rst:693 -#: ../../library/dis.rst:703 ../../library/dis.rst:713 -#: ../../library/dis.rst:933 ../../library/dis.rst:944 -#: ../../library/dis.rst:1044 ../../library/dis.rst:1056 -#: ../../library/dis.rst:1068 +#: ../../library/dis.rst:567 ../../library/dis.rst:576 +#: ../../library/dis.rst:586 ../../library/dis.rst:594 +#: ../../library/dis.rst:606 ../../library/dis.rst:694 +#: ../../library/dis.rst:704 ../../library/dis.rst:714 +#: ../../library/dis.rst:934 ../../library/dis.rst:945 +#: ../../library/dis.rst:1045 ../../library/dis.rst:1057 +#: ../../library/dis.rst:1069 msgid "Implements::" msgstr "" -#: ../../library/dis.rst:616 +#: ../../library/dis.rst:617 msgid "**Coroutine opcodes**" msgstr "" -#: ../../library/dis.rst:620 +#: ../../library/dis.rst:621 msgid "" "Implements ``STACK[-1] = get_awaitable(STACK[-1])``, where " "``get_awaitable(o)`` returns ``o`` if ``o`` is a coroutine object or a " @@ -616,39 +617,39 @@ msgid "" "resolves ``o.__await__``." msgstr "" -#: ../../library/dis.rst:625 +#: ../../library/dis.rst:626 msgid "" "If the ``where`` operand is nonzero, it indicates where the instruction " "occurs:" msgstr "" -#: ../../library/dis.rst:628 +#: ../../library/dis.rst:629 msgid "``1``: After a call to ``__aenter__``" msgstr "" -#: ../../library/dis.rst:629 +#: ../../library/dis.rst:630 msgid "``2``: After a call to ``__aexit__``" msgstr "" -#: ../../library/dis.rst:633 +#: ../../library/dis.rst:634 msgid "Previously, this instruction did not have an oparg." msgstr "" -#: ../../library/dis.rst:639 +#: ../../library/dis.rst:640 msgid "Implements ``STACK[-1] = STACK[-1].__aiter__()``." msgstr "" -#: ../../library/dis.rst:642 +#: ../../library/dis.rst:643 msgid "Returning awaitable objects from ``__aiter__`` is no longer supported." msgstr "" -#: ../../library/dis.rst:649 +#: ../../library/dis.rst:650 msgid "" "Implement ``STACK.append(get_awaitable(STACK[-1].__anext__()))`` to the " "stack. See ``GET_AWAITABLE`` for details about ``get_awaitable``." msgstr "" -#: ../../library/dis.rst:657 +#: ../../library/dis.rst:658 msgid "" "Terminates an :keyword:`async for` loop. Handles an exception raised when " "awaiting a next item. The stack contains the async iterable in ``STACK[-2]`` " @@ -656,13 +657,13 @@ msgid "" "is not :exc:`StopAsyncIteration`, it is re-raised." msgstr "" -#: ../../library/dis.rst:664 ../../library/dis.rst:769 -#: ../../library/dis.rst:780 +#: ../../library/dis.rst:665 ../../library/dis.rst:770 +#: ../../library/dis.rst:781 msgid "" "Exception representation on the stack now consist of one, not three, items." msgstr "" -#: ../../library/dis.rst:670 +#: ../../library/dis.rst:671 msgid "" "Handles an exception raised during a :meth:`~generator.throw` or :meth:" "`~generator.close` call through the current frame. If ``STACK[-1]`` is an " @@ -670,35 +671,35 @@ msgid "" "its ``value`` member. Otherwise, re-raise ``STACK[-1]``." msgstr "" -#: ../../library/dis.rst:680 +#: ../../library/dis.rst:681 msgid "" "Resolves ``__aenter__`` and ``__aexit__`` from ``STACK[-1]``. Pushes " "``__aexit__`` and result of ``__aenter__()`` to the stack::" msgstr "" -#: ../../library/dis.rst:689 +#: ../../library/dis.rst:690 msgid "**Miscellaneous opcodes**" msgstr "" -#: ../../library/dis.rst:698 +#: ../../library/dis.rst:699 msgid "Used to implement set comprehensions." msgstr "" -#: ../../library/dis.rst:708 +#: ../../library/dis.rst:709 msgid "Used to implement list comprehensions." msgstr "" -#: ../../library/dis.rst:719 +#: ../../library/dis.rst:720 msgid "Used to implement dict comprehensions." msgstr "" -#: ../../library/dis.rst:722 +#: ../../library/dis.rst:723 msgid "" "Map value is ``STACK[-1]`` and map key is ``STACK[-2]``. Before, those were " "reversed." msgstr "" -#: ../../library/dis.rst:726 +#: ../../library/dis.rst:727 msgid "" "For all of the :opcode:`SET_ADD`, :opcode:`LIST_APPEND` and :opcode:" "`MAP_ADD` instructions, while the added value or key/value pair is popped " @@ -706,29 +707,29 @@ msgid "" "further iterations of the loop." msgstr "" -#: ../../library/dis.rst:734 +#: ../../library/dis.rst:735 msgid "Returns with ``STACK[-1]`` to the caller of the function." msgstr "" -#: ../../library/dis.rst:739 +#: ../../library/dis.rst:740 msgid "Returns with ``co_consts[consti]`` to the caller of the function." msgstr "" -#: ../../library/dis.rst:746 +#: ../../library/dis.rst:747 msgid "Yields ``STACK.pop()`` from a :term:`generator`." msgstr "" -#: ../../library/dis.rst:748 +#: ../../library/dis.rst:749 msgid "oparg set to be the stack depth." msgstr "" -#: ../../library/dis.rst:751 +#: ../../library/dis.rst:752 msgid "" "oparg set to be the exception block depth, for efficient closing of " "generators." msgstr "" -#: ../../library/dis.rst:757 +#: ../../library/dis.rst:758 msgid "" "Checks whether ``__annotations__`` is defined in ``locals()``, if not it is " "set up to an empty ``dict``. This opcode is only emitted if a class or " @@ -736,39 +737,39 @@ msgid "" "statically." msgstr "" -#: ../../library/dis.rst:767 +#: ../../library/dis.rst:768 msgid "" "Pops a value from the stack, which is used to restore the exception state." msgstr "" -#: ../../library/dis.rst:774 +#: ../../library/dis.rst:775 msgid "" "Re-raises the exception currently on top of the stack. If oparg is non-zero, " "pops an additional value from the stack which is used to set :attr:`~frame." "f_lasti` of the current frame." msgstr "" -#: ../../library/dis.rst:785 +#: ../../library/dis.rst:786 msgid "" "Pops a value from the stack. Pushes the current exception to the top of the " "stack. Pushes the value originally popped back to the stack. Used in " "exception handlers." msgstr "" -#: ../../library/dis.rst:793 +#: ../../library/dis.rst:794 msgid "" "Performs exception matching for ``except``. Tests whether the ``STACK[-2]`` " "is an exception matching ``STACK[-1]``. Pops ``STACK[-1]`` and pushes the " "boolean result of the test." msgstr "" -#: ../../library/dis.rst:801 +#: ../../library/dis.rst:802 msgid "" "Performs exception matching for ``except*``. Applies ``split(STACK[-1])`` on " "the exception group representing ``STACK[-2]``." msgstr "" -#: ../../library/dis.rst:804 +#: ../../library/dis.rst:805 msgid "" "In case of a match, pops two items from the stack and pushes the non-" "matching subgroup (``None`` in case of full match) followed by the matching " @@ -776,7 +777,7 @@ msgid "" "``None``." msgstr "" -#: ../../library/dis.rst:813 +#: ../../library/dis.rst:814 msgid "" "Calls the function in position 4 on the stack with arguments (type, val, tb) " "representing the exception at the top of the stack. Used to implement the " @@ -784,25 +785,25 @@ msgid "" "occurred in a :keyword:`with` statement." msgstr "" -#: ../../library/dis.rst:820 +#: ../../library/dis.rst:821 msgid "" "The ``__exit__`` function is in position 4 of the stack rather than 7. " "Exception representation on the stack now consist of one, not three, items." msgstr "" -#: ../../library/dis.rst:827 +#: ../../library/dis.rst:828 msgid "" "Pushes :exc:`AssertionError` onto the stack. Used by the :keyword:`assert` " "statement." msgstr "" -#: ../../library/dis.rst:835 +#: ../../library/dis.rst:836 msgid "" "Pushes :func:`!builtins.__build_class__` onto the stack. It is later called " "to construct a class." msgstr "" -#: ../../library/dis.rst:841 +#: ../../library/dis.rst:842 msgid "" "This opcode performs several operations before a with block starts. First, " "it loads :meth:`~object.__exit__` from the context manager and pushes it " @@ -811,11 +812,11 @@ msgid "" "``__enter__()`` method is pushed onto the stack." msgstr "" -#: ../../library/dis.rst:852 +#: ../../library/dis.rst:853 msgid "Perform ``STACK.append(len(STACK[-1]))``." msgstr "" -#: ../../library/dis.rst:859 +#: ../../library/dis.rst:860 msgid "" "If ``STACK[-1]`` is an instance of :class:`collections.abc.Mapping` (or, " "more technically: if it has the :c:macro:`Py_TPFLAGS_MAPPING` flag set in " @@ -823,7 +824,7 @@ msgid "" "Otherwise, push ``False``." msgstr "" -#: ../../library/dis.rst:869 +#: ../../library/dis.rst:870 msgid "" "If ``STACK[-1]`` is an instance of :class:`collections.abc.Sequence` and is " "*not* an instance of :class:`str`/:class:`bytes`/:class:`bytearray` (or, " @@ -832,20 +833,20 @@ msgid "" "Otherwise, push ``False``." msgstr "" -#: ../../library/dis.rst:879 +#: ../../library/dis.rst:880 msgid "" "``STACK[-1]`` is a tuple of mapping keys, and ``STACK[-2]`` is the match " "subject. If ``STACK[-2]`` contains all of the keys in ``STACK[-1]``, push a :" "class:`tuple` containing the corresponding values. Otherwise, push ``None``." msgstr "" -#: ../../library/dis.rst:885 ../../library/dis.rst:1512 +#: ../../library/dis.rst:886 ../../library/dis.rst:1513 msgid "" "Previously, this instruction also pushed a boolean value indicating success " "(``True``) or failure (``False``)." msgstr "" -#: ../../library/dis.rst:892 +#: ../../library/dis.rst:893 msgid "" "Implements ``name = STACK.pop()``. *namei* is the index of *name* in the " "attribute :attr:`~codeobject.co_names` of the :ref:`code object `." msgstr "" -#: ../../library/dis.rst:905 +#: ../../library/dis.rst:906 msgid "" "Unpacks ``STACK[-1]`` into *count* individual values, which are put onto the " "stack right-to-left. Require there to be exactly *count* values.::" msgstr "" -#: ../../library/dis.rst:914 +#: ../../library/dis.rst:915 msgid "" "Implements assignment with a starred target: Unpacks an iterable in " "``STACK[-1]`` into individual values, where the total number of values can " @@ -873,11 +874,11 @@ msgid "" "will be a list of all leftover items." msgstr "" -#: ../../library/dis.rst:919 +#: ../../library/dis.rst:920 msgid "The number of values before and after the list value is limited to 255." msgstr "" -#: ../../library/dis.rst:921 +#: ../../library/dis.rst:922 msgid "" "The number of values before the list value is encoded in the argument of the " "opcode. The number of values after the list if any is encoded using an " @@ -886,50 +887,50 @@ msgid "" "list value, the high byte of *counts* the number of values after it." msgstr "" -#: ../../library/dis.rst:927 +#: ../../library/dis.rst:928 msgid "" "The extracted values are put onto the stack right-to-left, i.e. ``a, *b, c = " "d`` will be stored after execution as ``STACK.extend((a, b, c))``." msgstr "" -#: ../../library/dis.rst:939 +#: ../../library/dis.rst:940 msgid "" "where *namei* is the index of name in :attr:`~codeobject.co_names` of the :" "ref:`code object `." msgstr "" -#: ../../library/dis.rst:949 +#: ../../library/dis.rst:950 msgid "" "where *namei* is the index of name into :attr:`~codeobject.co_names` of the :" "ref:`code object `." msgstr "" -#: ../../library/dis.rst:955 +#: ../../library/dis.rst:956 msgid "Works as :opcode:`STORE_NAME`, but stores the name as a global." msgstr "" -#: ../../library/dis.rst:960 +#: ../../library/dis.rst:961 msgid "Works as :opcode:`DELETE_NAME`, but deletes a global name." msgstr "" -#: ../../library/dis.rst:965 +#: ../../library/dis.rst:966 msgid "Pushes ``co_consts[consti]`` onto the stack." msgstr "" -#: ../../library/dis.rst:970 +#: ../../library/dis.rst:971 msgid "" "Pushes the value associated with ``co_names[namei]`` onto the stack. The " "name is looked up within the locals, then the globals, then the builtins." msgstr "" -#: ../../library/dis.rst:976 +#: ../../library/dis.rst:977 msgid "" "Pushes a reference to the locals dictionary onto the stack. This is used to " "prepare namespace dictionaries for :opcode:`LOAD_FROM_DICT_OR_DEREF` and :" "opcode:`LOAD_FROM_DICT_OR_GLOBALS`." msgstr "" -#: ../../library/dis.rst:985 +#: ../../library/dis.rst:986 msgid "" "Pops a mapping off the stack and looks up the value for ``co_names[namei]``. " "If the name is not found there, looks it up in the globals and then the " @@ -938,69 +939,69 @@ msgid "" "bodies." msgstr "" -#: ../../library/dis.rst:996 +#: ../../library/dis.rst:997 msgid "" "Creates a tuple consuming *count* items from the stack, and pushes the " "resulting tuple onto the stack.::" msgstr "" -#: ../../library/dis.rst:1006 +#: ../../library/dis.rst:1007 msgid "Works as :opcode:`BUILD_TUPLE`, but creates a list." msgstr "" -#: ../../library/dis.rst:1011 +#: ../../library/dis.rst:1012 msgid "Works as :opcode:`BUILD_TUPLE`, but creates a set." msgstr "" -#: ../../library/dis.rst:1016 +#: ../../library/dis.rst:1017 msgid "" "Pushes a new dictionary object onto the stack. Pops ``2 * count`` items so " "that the dictionary holds *count* entries: ``{..., STACK[-4]: STACK[-3], " "STACK[-2]: STACK[-1]}``." msgstr "" -#: ../../library/dis.rst:1020 +#: ../../library/dis.rst:1021 msgid "" "The dictionary is created from stack items instead of creating an empty " "dictionary pre-sized to hold *count* items." msgstr "" -#: ../../library/dis.rst:1027 +#: ../../library/dis.rst:1028 msgid "" "The version of :opcode:`BUILD_MAP` specialized for constant keys. Pops the " "top element on the stack which contains a tuple of keys, then starting from " "``STACK[-2]``, pops *count* values to form values in the built dictionary." msgstr "" -#: ../../library/dis.rst:1036 +#: ../../library/dis.rst:1037 msgid "" "Concatenates *count* strings from the stack and pushes the resulting string " "onto the stack." msgstr "" -#: ../../library/dis.rst:1049 +#: ../../library/dis.rst:1050 msgid "Used to build lists." msgstr "" -#: ../../library/dis.rst:1061 +#: ../../library/dis.rst:1062 msgid "Used to build sets." msgstr "" -#: ../../library/dis.rst:1073 +#: ../../library/dis.rst:1074 msgid "Used to build dicts." msgstr "" -#: ../../library/dis.rst:1080 +#: ../../library/dis.rst:1081 msgid "Like :opcode:`DICT_UPDATE` but raises an exception for duplicate keys." msgstr "" -#: ../../library/dis.rst:1087 +#: ../../library/dis.rst:1088 msgid "" "If the low bit of ``namei`` is not set, this replaces ``STACK[-1]`` with " "``getattr(STACK[-1], co_names[namei>>1])``." msgstr "" -#: ../../library/dis.rst:1090 +#: ../../library/dis.rst:1091 msgid "" "If the low bit of ``namei`` is set, this will attempt to load a method named " "``co_names[namei>>1]`` from the ``STACK[-1]`` object. ``STACK[-1]`` is " @@ -1011,60 +1012,60 @@ msgid "" "the object returned by the attribute lookup are pushed." msgstr "" -#: ../../library/dis.rst:1098 +#: ../../library/dis.rst:1099 msgid "" "If the low bit of ``namei`` is set, then a ``NULL`` or ``self`` is pushed to " "the stack before the attribute or unbound method respectively." msgstr "" -#: ../../library/dis.rst:1105 +#: ../../library/dis.rst:1106 msgid "" "This opcode implements :func:`super`, both in its zero-argument and two-" "argument forms (e.g. ``super().method()``, ``super().attr`` and ``super(cls, " "self).method()``, ``super(cls, self).attr``)." msgstr "" -#: ../../library/dis.rst:1109 +#: ../../library/dis.rst:1110 msgid "" "It pops three values from the stack (from top of stack down): - ``self``: " "the first argument to the current method - ``cls``: the class within which " "the current method was defined - the global ``super``" msgstr "" -#: ../../library/dis.rst:1114 +#: ../../library/dis.rst:1115 msgid "" "With respect to its argument, it works similarly to :opcode:`LOAD_ATTR`, " "except that ``namei`` is shifted left by 2 bits instead of 1." msgstr "" -#: ../../library/dis.rst:1117 +#: ../../library/dis.rst:1118 msgid "" "The low bit of ``namei`` signals to attempt a method load, as with :opcode:" "`LOAD_ATTR`, which results in pushing ``None`` and the loaded method. When " "it is unset a single value is pushed to the stack." msgstr "" -#: ../../library/dis.rst:1121 +#: ../../library/dis.rst:1122 msgid "" "The second-low bit of ``namei``, if set, means that this was a two-argument " "call to :func:`super` (unset means zero-argument)." msgstr "" -#: ../../library/dis.rst:1129 +#: ../../library/dis.rst:1130 msgid "" "Performs a Boolean operation. The operation name can be found in " "``cmp_op[opname]``." msgstr "" -#: ../../library/dis.rst:1135 +#: ../../library/dis.rst:1136 msgid "Performs ``is`` comparison, or ``is not`` if ``invert`` is 1." msgstr "" -#: ../../library/dis.rst:1142 +#: ../../library/dis.rst:1143 msgid "Performs ``in`` comparison, or ``not in`` if ``invert`` is 1." msgstr "" -#: ../../library/dis.rst:1149 +#: ../../library/dis.rst:1150 msgid "" "Imports the module ``co_names[namei]``. ``STACK[-1]`` and ``STACK[-2]`` are " "popped and provide the *fromlist* and *level* arguments of :func:" @@ -1073,68 +1074,68 @@ msgid "" "opcode:`STORE_FAST` instruction modifies the namespace." msgstr "" -#: ../../library/dis.rst:1157 +#: ../../library/dis.rst:1158 msgid "" "Loads the attribute ``co_names[namei]`` from the module found in " "``STACK[-1]``. The resulting object is pushed onto the stack, to be " "subsequently stored by a :opcode:`STORE_FAST` instruction." msgstr "" -#: ../../library/dis.rst:1164 +#: ../../library/dis.rst:1165 msgid "Increments bytecode counter by *delta*." msgstr "" -#: ../../library/dis.rst:1169 +#: ../../library/dis.rst:1170 msgid "Decrements bytecode counter by *delta*. Checks for interrupts." msgstr "" -#: ../../library/dis.rst:1176 +#: ../../library/dis.rst:1177 msgid "Decrements bytecode counter by *delta*. Does not check for interrupts." msgstr "" -#: ../../library/dis.rst:1183 +#: ../../library/dis.rst:1184 msgid "" "If ``STACK[-1]`` is true, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1186 ../../library/dis.rst:1199 +#: ../../library/dis.rst:1187 ../../library/dis.rst:1200 msgid "" "The oparg is now a relative delta rather than an absolute target. This " "opcode is a pseudo-instruction, replaced in final bytecode by the directed " "versions (forward/backward)." msgstr "" -#: ../../library/dis.rst:1191 ../../library/dis.rst:1204 -#: ../../library/dis.rst:1217 ../../library/dis.rst:1231 +#: ../../library/dis.rst:1192 ../../library/dis.rst:1205 +#: ../../library/dis.rst:1218 ../../library/dis.rst:1232 msgid "This is no longer a pseudo-instruction." msgstr "" -#: ../../library/dis.rst:1196 +#: ../../library/dis.rst:1197 msgid "" "If ``STACK[-1]`` is false, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1209 +#: ../../library/dis.rst:1210 msgid "" "If ``STACK[-1]`` is not ``None``, increments the bytecode counter by " "*delta*. ``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1212 ../../library/dis.rst:1226 +#: ../../library/dis.rst:1213 ../../library/dis.rst:1227 msgid "" "This opcode is a pseudo-instruction, replaced in final bytecode by the " "directed versions (forward/backward)." msgstr "" -#: ../../library/dis.rst:1223 +#: ../../library/dis.rst:1224 msgid "" "If ``STACK[-1]`` is ``None``, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1236 +#: ../../library/dis.rst:1237 msgid "" "``STACK[-1]`` is an :term:`iterator`. Call its :meth:`~iterator.__next__` " "method. If this yields a new value, push it on the stack (leaving the " @@ -1142,88 +1143,88 @@ msgid "" "code counter is incremented by *delta*." msgstr "" -#: ../../library/dis.rst:1241 +#: ../../library/dis.rst:1242 msgid "Up until 3.11 the iterator was popped when it was exhausted." msgstr "" -#: ../../library/dis.rst:1246 +#: ../../library/dis.rst:1247 msgid "Loads the global named ``co_names[namei>>1]`` onto the stack." msgstr "" -#: ../../library/dis.rst:1248 +#: ../../library/dis.rst:1249 msgid "" "If the low bit of ``namei`` is set, then a ``NULL`` is pushed to the stack " "before the global variable." msgstr "" -#: ../../library/dis.rst:1254 +#: ../../library/dis.rst:1255 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack." msgstr "" -#: ../../library/dis.rst:1256 +#: ../../library/dis.rst:1257 msgid "" "This opcode is now only used in situations where the local variable is " "guaranteed to be initialized. It cannot raise :exc:`UnboundLocalError`." msgstr "" -#: ../../library/dis.rst:1262 +#: ../../library/dis.rst:1263 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack, " "raising an :exc:`UnboundLocalError` if the local variable has not been " "initialized." msgstr "" -#: ../../library/dis.rst:1270 +#: ../../library/dis.rst:1271 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack (or " "pushes ``NULL`` onto the stack if the local variable has not been " "initialized) and sets ``co_varnames[var_num]`` to ``NULL``." msgstr "" -#: ../../library/dis.rst:1278 +#: ../../library/dis.rst:1279 msgid "Stores ``STACK.pop()`` into the local ``co_varnames[var_num]``." msgstr "" -#: ../../library/dis.rst:1283 +#: ../../library/dis.rst:1284 msgid "Deletes local ``co_varnames[var_num]``." msgstr "" -#: ../../library/dis.rst:1288 +#: ../../library/dis.rst:1289 msgid "" "Creates a new cell in slot ``i``. If that slot is nonempty then that value " "is stored into the new cell." msgstr "" -#: ../../library/dis.rst:1296 +#: ../../library/dis.rst:1297 msgid "" "Pushes a reference to the cell contained in slot ``i`` of the \"fast " "locals\" storage. The name of the variable is ``co_fastlocalnames[i]``." msgstr "" -#: ../../library/dis.rst:1299 +#: ../../library/dis.rst:1300 msgid "" "Note that ``LOAD_CLOSURE`` is effectively an alias for ``LOAD_FAST``. It " "exists to keep bytecode a little more readable." msgstr "" -#: ../../library/dis.rst:1302 +#: ../../library/dis.rst:1303 msgid "``i`` is no longer offset by the length of ``co_varnames``." msgstr "" -#: ../../library/dis.rst:1308 +#: ../../library/dis.rst:1309 msgid "" "Loads the cell contained in slot ``i`` of the \"fast locals\" storage. " "Pushes a reference to the object the cell contains on the stack." msgstr "" -#: ../../library/dis.rst:1311 ../../library/dis.rst:1333 -#: ../../library/dis.rst:1344 +#: ../../library/dis.rst:1312 ../../library/dis.rst:1334 +#: ../../library/dis.rst:1345 msgid "" "``i`` is no longer offset by the length of :attr:`~codeobject.co_varnames`." msgstr "" -#: ../../library/dis.rst:1317 +#: ../../library/dis.rst:1318 msgid "" "Pops a mapping off the stack and looks up the name associated with slot " "``i`` of the \"fast locals\" storage in this mapping. If the name is not " @@ -1233,94 +1234,94 @@ msgid "" "scopes ` within class bodies." msgstr "" -#: ../../library/dis.rst:1330 +#: ../../library/dis.rst:1331 msgid "" "Stores ``STACK.pop()`` into the cell contained in slot ``i`` of the \"fast " "locals\" storage." msgstr "" -#: ../../library/dis.rst:1339 +#: ../../library/dis.rst:1340 msgid "" "Empties the cell contained in slot ``i`` of the \"fast locals\" storage. " "Used by the :keyword:`del` statement." msgstr "" -#: ../../library/dis.rst:1350 +#: ../../library/dis.rst:1351 msgid "" "Copies the ``n`` free variables from the closure into the frame. Removes the " "need for special code on the caller's side when calling closures." msgstr "" -#: ../../library/dis.rst:1359 +#: ../../library/dis.rst:1360 msgid "" "Raises an exception using one of the 3 forms of the ``raise`` statement, " "depending on the value of *argc*:" msgstr "" -#: ../../library/dis.rst:1362 +#: ../../library/dis.rst:1363 msgid "0: ``raise`` (re-raise previous exception)" msgstr "" -#: ../../library/dis.rst:1363 +#: ../../library/dis.rst:1364 msgid "" "1: ``raise STACK[-1]`` (raise exception instance or type at ``STACK[-1]``)" msgstr "" -#: ../../library/dis.rst:1364 +#: ../../library/dis.rst:1365 msgid "" "2: ``raise STACK[-2] from STACK[-1]`` (raise exception instance or type at " "``STACK[-2]`` with ``__cause__`` set to ``STACK[-1]``)" msgstr "" -#: ../../library/dis.rst:1370 +#: ../../library/dis.rst:1371 msgid "" "Calls a callable object with the number of arguments specified by ``argc``, " "including the named arguments specified by the preceding :opcode:`KW_NAMES`, " "if any. On the stack are (in ascending order), either:" msgstr "" -#: ../../library/dis.rst:1375 +#: ../../library/dis.rst:1376 msgid "NULL" msgstr "" -#: ../../library/dis.rst:1376 ../../library/dis.rst:1382 +#: ../../library/dis.rst:1377 ../../library/dis.rst:1383 msgid "The callable" msgstr "" -#: ../../library/dis.rst:1377 +#: ../../library/dis.rst:1378 msgid "The positional arguments" msgstr "" -#: ../../library/dis.rst:1378 ../../library/dis.rst:1385 +#: ../../library/dis.rst:1379 ../../library/dis.rst:1386 msgid "The named arguments" msgstr "" -#: ../../library/dis.rst:1380 +#: ../../library/dis.rst:1381 msgid "or:" msgstr "或:" -#: ../../library/dis.rst:1383 +#: ../../library/dis.rst:1384 msgid "``self``" msgstr "``self``" -#: ../../library/dis.rst:1384 +#: ../../library/dis.rst:1385 msgid "The remaining positional arguments" msgstr "" -#: ../../library/dis.rst:1387 +#: ../../library/dis.rst:1388 msgid "" "``argc`` is the total of the positional and named arguments, excluding " "``self`` when a ``NULL`` is not present." msgstr "" -#: ../../library/dis.rst:1390 +#: ../../library/dis.rst:1391 msgid "" "``CALL`` pops all arguments and the callable object off the stack, calls the " "callable object with those arguments, and pushes the return value returned " "by the callable object." msgstr "" -#: ../../library/dis.rst:1399 +#: ../../library/dis.rst:1400 msgid "" "Calls a callable object with variable set of positional and keyword " "arguments. If the lowest bit of *flags* is set, the top of the stack " @@ -1332,70 +1333,70 @@ msgid "" "arguments, and pushes the return value returned by the callable object." msgstr "" -#: ../../library/dis.rst:1414 +#: ../../library/dis.rst:1415 msgid "" "Pushes a ``NULL`` to the stack. Used in the call sequence to match the " "``NULL`` pushed by :opcode:`LOAD_METHOD` for non-method calls." msgstr "" -#: ../../library/dis.rst:1423 +#: ../../library/dis.rst:1424 msgid "" "Prefixes :opcode:`CALL`. Stores a reference to ``co_consts[consti]`` into an " "internal variable for use by :opcode:`CALL`. ``co_consts[consti]`` must be a " "tuple of strings." msgstr "" -#: ../../library/dis.rst:1432 +#: ../../library/dis.rst:1433 msgid "" "Pushes a new function object on the stack. From bottom to top, the consumed " "stack must consist of values if the argument carries a specified flag value" msgstr "" -#: ../../library/dis.rst:1435 +#: ../../library/dis.rst:1436 msgid "" "``0x01`` a tuple of default values for positional-only and positional-or-" "keyword parameters in positional order" msgstr "" -#: ../../library/dis.rst:1437 +#: ../../library/dis.rst:1438 msgid "``0x02`` a dictionary of keyword-only parameters' default values" msgstr "" -#: ../../library/dis.rst:1438 +#: ../../library/dis.rst:1439 msgid "``0x04`` a tuple of strings containing parameters' annotations" msgstr "" -#: ../../library/dis.rst:1439 +#: ../../library/dis.rst:1440 msgid "``0x08`` a tuple containing cells for free variables, making a closure" msgstr "" -#: ../../library/dis.rst:1440 +#: ../../library/dis.rst:1441 msgid "the code associated with the function (at ``STACK[-1]``)" msgstr "" -#: ../../library/dis.rst:1442 +#: ../../library/dis.rst:1443 msgid "Flag value ``0x04`` is a tuple of strings instead of dictionary" msgstr "" -#: ../../library/dis.rst:1445 +#: ../../library/dis.rst:1446 msgid "Qualified name at ``STACK[-1]`` was removed." msgstr "" -#: ../../library/dis.rst:1453 +#: ../../library/dis.rst:1454 msgid "" "Pushes a slice object on the stack. *argc* must be 2 or 3. If it is 2, " "implements::" msgstr "" -#: ../../library/dis.rst:1459 +#: ../../library/dis.rst:1460 msgid "if it is 3, implements::" msgstr "" -#: ../../library/dis.rst:1466 +#: ../../library/dis.rst:1467 msgid "See the :func:`slice` built-in function for more information." msgstr "" -#: ../../library/dis.rst:1471 +#: ../../library/dis.rst:1472 msgid "" "Prefixes any opcode which has an argument too big to fit into the default " "one byte. *ext* holds an additional byte which act as higher bits in the " @@ -1403,54 +1404,54 @@ msgid "" "allowed, forming an argument from two-byte to four-byte." msgstr "" -#: ../../library/dis.rst:1479 +#: ../../library/dis.rst:1480 msgid "" "Used for implementing formatted literal strings (f-strings). Pops an " "optional *fmt_spec* from the stack, then a required *value*. *flags* is " "interpreted as follows:" msgstr "" -#: ../../library/dis.rst:1483 +#: ../../library/dis.rst:1484 msgid "``(flags & 0x03) == 0x00``: *value* is formatted as-is." msgstr "" -#: ../../library/dis.rst:1484 +#: ../../library/dis.rst:1485 msgid "" "``(flags & 0x03) == 0x01``: call :func:`str` on *value* before formatting it." msgstr "" -#: ../../library/dis.rst:1486 +#: ../../library/dis.rst:1487 msgid "" "``(flags & 0x03) == 0x02``: call :func:`repr` on *value* before formatting " "it." msgstr "" -#: ../../library/dis.rst:1488 +#: ../../library/dis.rst:1489 msgid "" "``(flags & 0x03) == 0x03``: call :func:`ascii` on *value* before formatting " "it." msgstr "" -#: ../../library/dis.rst:1490 +#: ../../library/dis.rst:1491 msgid "" "``(flags & 0x04) == 0x04``: pop *fmt_spec* from the stack and use it, else " "use an empty *fmt_spec*." msgstr "" -#: ../../library/dis.rst:1493 +#: ../../library/dis.rst:1494 msgid "" "Formatting is performed using :c:func:`PyObject_Format`. The result is " "pushed on the stack." msgstr "" -#: ../../library/dis.rst:1501 +#: ../../library/dis.rst:1502 msgid "" "``STACK[-1]`` is a tuple of keyword attribute names, ``STACK[-2]`` is the " "class being matched against, and ``STACK[-3]`` is the match subject. " "*count* is the number of positional sub-patterns." msgstr "" -#: ../../library/dis.rst:1505 +#: ../../library/dis.rst:1506 msgid "" "Pop ``STACK[-1]``, ``STACK[-2]``, and ``STACK[-3]``. If ``STACK[-3]`` is an " "instance of ``STACK[-2]`` and has the positional and keyword attributes " @@ -1458,257 +1459,257 @@ msgid "" "Otherwise, push ``None``." msgstr "" -#: ../../library/dis.rst:1519 +#: ../../library/dis.rst:1520 msgid "A no-op. Performs internal tracing, debugging and optimization checks." msgstr "" -#: ../../library/dis.rst:1521 +#: ../../library/dis.rst:1522 msgid "The ``where`` operand marks where the ``RESUME`` occurs:" msgstr "" -#: ../../library/dis.rst:1523 +#: ../../library/dis.rst:1524 msgid "" "``0`` The start of a function, which is neither a generator, coroutine nor " "an async generator" msgstr "" -#: ../../library/dis.rst:1525 +#: ../../library/dis.rst:1526 msgid "``1`` After a ``yield`` expression" msgstr "" -#: ../../library/dis.rst:1526 +#: ../../library/dis.rst:1527 msgid "``2`` After a ``yield from`` expression" msgstr "" -#: ../../library/dis.rst:1527 +#: ../../library/dis.rst:1528 msgid "``3`` After an ``await`` expression" msgstr "" -#: ../../library/dis.rst:1534 +#: ../../library/dis.rst:1535 msgid "" "Create a generator, coroutine, or async generator from the current frame. " "Used as first opcode of in code object for the above mentioned callables. " "Clear the current frame and return the newly created generator." msgstr "" -#: ../../library/dis.rst:1543 +#: ../../library/dis.rst:1544 msgid "" "Equivalent to ``STACK[-1] = STACK[-2].send(STACK[-1])``. Used in ``yield " "from`` and ``await`` statements." msgstr "" -#: ../../library/dis.rst:1546 +#: ../../library/dis.rst:1547 msgid "" "If the call raises :exc:`StopIteration`, pop the top value from the stack, " "push the exception's ``value`` attribute, and increment the bytecode counter " "by *delta*." msgstr "" -#: ../../library/dis.rst:1555 +#: ../../library/dis.rst:1556 msgid "" "This is not really an opcode. It identifies the dividing line between " "opcodes in the range [0,255] which don't use their argument and those that " "do (``< HAVE_ARGUMENT`` and ``>= HAVE_ARGUMENT``, respectively)." msgstr "" -#: ../../library/dis.rst:1559 +#: ../../library/dis.rst:1560 msgid "" "If your application uses pseudo instructions, use the :data:`hasarg` " "collection instead." msgstr "" -#: ../../library/dis.rst:1562 +#: ../../library/dis.rst:1563 msgid "" "Now every instruction has an argument, but opcodes ``< HAVE_ARGUMENT`` " "ignore it. Before, only opcodes ``>= HAVE_ARGUMENT`` had an argument." msgstr "" -#: ../../library/dis.rst:1566 +#: ../../library/dis.rst:1567 msgid "" "Pseudo instructions were added to the :mod:`dis` module, and for them it is " "not true that comparison with ``HAVE_ARGUMENT`` indicates whether they use " "their arg." msgstr "" -#: ../../library/dis.rst:1574 +#: ../../library/dis.rst:1575 msgid "" "Calls an intrinsic function with one argument. Passes ``STACK[-1]`` as the " "argument and sets ``STACK[-1]`` to the result. Used to implement " "functionality that is not performance critical." msgstr "" -#: ../../library/dis.rst:1578 ../../library/dis.rst:1632 +#: ../../library/dis.rst:1579 ../../library/dis.rst:1633 msgid "The operand determines which intrinsic function is called:" msgstr "" -#: ../../library/dis.rst:1581 ../../library/dis.rst:1635 +#: ../../library/dis.rst:1582 ../../library/dis.rst:1636 msgid "Operand" msgstr "" -#: ../../library/dis.rst:1581 ../../library/dis.rst:1635 +#: ../../library/dis.rst:1582 ../../library/dis.rst:1636 msgid "Description" msgstr "" -#: ../../library/dis.rst:1583 +#: ../../library/dis.rst:1584 msgid "``INTRINSIC_1_INVALID``" msgstr "``INTRINSIC_1_INVALID``" -#: ../../library/dis.rst:1583 ../../library/dis.rst:1637 +#: ../../library/dis.rst:1584 ../../library/dis.rst:1638 msgid "Not valid" msgstr "" -#: ../../library/dis.rst:1585 +#: ../../library/dis.rst:1586 msgid "``INTRINSIC_PRINT``" msgstr "``INTRINSIC_PRINT``" -#: ../../library/dis.rst:1585 +#: ../../library/dis.rst:1586 msgid "Prints the argument to standard out. Used in the REPL." msgstr "" -#: ../../library/dis.rst:1588 +#: ../../library/dis.rst:1589 msgid "``INTRINSIC_IMPORT_STAR``" msgstr "``INTRINSIC_IMPORT_STAR``" -#: ../../library/dis.rst:1588 +#: ../../library/dis.rst:1589 msgid "Performs ``import *`` for the named module." msgstr "" -#: ../../library/dis.rst:1591 +#: ../../library/dis.rst:1592 msgid "``INTRINSIC_STOPITERATION_ERROR``" msgstr "``INTRINSIC_STOPITERATION_ERROR``" -#: ../../library/dis.rst:1591 +#: ../../library/dis.rst:1592 msgid "Extracts the return value from a ``StopIteration`` exception." msgstr "" -#: ../../library/dis.rst:1594 +#: ../../library/dis.rst:1595 msgid "``INTRINSIC_ASYNC_GEN_WRAP``" msgstr "``INTRINSIC_ASYNC_GEN_WRAP``" -#: ../../library/dis.rst:1594 +#: ../../library/dis.rst:1595 msgid "Wraps an aync generator value" msgstr "" -#: ../../library/dis.rst:1596 +#: ../../library/dis.rst:1597 msgid "``INTRINSIC_UNARY_POSITIVE``" msgstr "``INTRINSIC_UNARY_POSITIVE``" -#: ../../library/dis.rst:1596 +#: ../../library/dis.rst:1597 msgid "Performs the unary ``+`` operation" msgstr "" -#: ../../library/dis.rst:1599 +#: ../../library/dis.rst:1600 msgid "``INTRINSIC_LIST_TO_TUPLE``" msgstr "``INTRINSIC_LIST_TO_TUPLE``" -#: ../../library/dis.rst:1599 +#: ../../library/dis.rst:1600 msgid "Converts a list to a tuple" msgstr "" -#: ../../library/dis.rst:1601 +#: ../../library/dis.rst:1602 msgid "``INTRINSIC_TYPEVAR``" msgstr "``INTRINSIC_TYPEVAR``" -#: ../../library/dis.rst:1601 +#: ../../library/dis.rst:1602 msgid "Creates a :class:`typing.TypeVar`" msgstr "" -#: ../../library/dis.rst:1603 +#: ../../library/dis.rst:1604 msgid "``INTRINSIC_PARAMSPEC``" msgstr "``INTRINSIC_PARAMSPEC``" -#: ../../library/dis.rst:1603 +#: ../../library/dis.rst:1604 msgid "Creates a :class:`typing.ParamSpec`" msgstr "" -#: ../../library/dis.rst:1606 +#: ../../library/dis.rst:1607 msgid "``INTRINSIC_TYPEVARTUPLE``" msgstr "``INTRINSIC_TYPEVARTUPLE``" -#: ../../library/dis.rst:1606 +#: ../../library/dis.rst:1607 msgid "Creates a :class:`typing.TypeVarTuple`" msgstr "" -#: ../../library/dis.rst:1609 +#: ../../library/dis.rst:1610 msgid "``INTRINSIC_SUBSCRIPT_GENERIC``" msgstr "``INTRINSIC_SUBSCRIPT_GENERIC``" -#: ../../library/dis.rst:1609 +#: ../../library/dis.rst:1610 msgid "Returns :class:`typing.Generic` subscripted with the argument" msgstr "" -#: ../../library/dis.rst:1612 +#: ../../library/dis.rst:1613 msgid "``INTRINSIC_TYPEALIAS``" msgstr "``INTRINSIC_TYPEALIAS``" -#: ../../library/dis.rst:1612 +#: ../../library/dis.rst:1613 msgid "" "Creates a :class:`typing.TypeAliasType`; used in the :keyword:`type` " "statement. The argument is a tuple of the type alias's name, type " "parameters, and value." msgstr "" -#: ../../library/dis.rst:1624 +#: ../../library/dis.rst:1625 msgid "" "Calls an intrinsic function with two arguments. Used to implement " "functionality that is not performance critical::" msgstr "" -#: ../../library/dis.rst:1637 +#: ../../library/dis.rst:1638 msgid "``INTRINSIC_2_INVALID``" msgstr "``INTRINSIC_2_INVALID``" -#: ../../library/dis.rst:1639 +#: ../../library/dis.rst:1640 msgid "``INTRINSIC_PREP_RERAISE_STAR``" msgstr "``INTRINSIC_PREP_RERAISE_STAR``" -#: ../../library/dis.rst:1639 +#: ../../library/dis.rst:1640 msgid "Calculates the :exc:`ExceptionGroup` to raise from a ``try-except*``." msgstr "" -#: ../../library/dis.rst:1643 +#: ../../library/dis.rst:1644 msgid "``INTRINSIC_TYPEVAR_WITH_BOUND``" msgstr "``INTRINSIC_TYPEVAR_WITH_BOUND``" -#: ../../library/dis.rst:1643 +#: ../../library/dis.rst:1644 msgid "Creates a :class:`typing.TypeVar` with a bound." msgstr "" -#: ../../library/dis.rst:1646 +#: ../../library/dis.rst:1647 msgid "``INTRINSIC_TYPEVAR_WITH_CONSTRAINTS``" msgstr "``INTRINSIC_TYPEVAR_WITH_CONSTRAINTS``" -#: ../../library/dis.rst:1646 +#: ../../library/dis.rst:1647 msgid "Creates a :class:`typing.TypeVar` with constraints." msgstr "" -#: ../../library/dis.rst:1650 +#: ../../library/dis.rst:1651 msgid "``INTRINSIC_SET_FUNCTION_TYPE_PARAMS``" msgstr "``INTRINSIC_SET_FUNCTION_TYPE_PARAMS``" -#: ../../library/dis.rst:1650 +#: ../../library/dis.rst:1651 msgid "Sets the ``__type_params__`` attribute of a function." msgstr "" -#: ../../library/dis.rst:1657 +#: ../../library/dis.rst:1658 msgid "**Pseudo-instructions**" msgstr "" -#: ../../library/dis.rst:1659 +#: ../../library/dis.rst:1660 msgid "" "These opcodes do not appear in Python bytecode. They are used by the " "compiler but are replaced by real opcodes or removed before bytecode is " "generated." msgstr "" -#: ../../library/dis.rst:1664 +#: ../../library/dis.rst:1665 msgid "" "Set up an exception handler for the following code block. If an exception " "occurs, the value stack level is restored to its current state and control " "is transferred to the exception handler at ``target``." msgstr "" -#: ../../library/dis.rst:1671 +#: ../../library/dis.rst:1672 msgid "" "Like ``SETUP_FINALLY``, but in case of an exception also pushes the last " "instruction (``lasti``) to the stack so that ``RERAISE`` can restore it. If " @@ -1717,76 +1718,76 @@ msgid "" "exception handler at ``target``." msgstr "" -#: ../../library/dis.rst:1680 +#: ../../library/dis.rst:1681 msgid "" "Like ``SETUP_CLEANUP``, but in case of an exception one more item is popped " "from the stack before control is transferred to the exception handler at " "``target``." msgstr "" -#: ../../library/dis.rst:1684 +#: ../../library/dis.rst:1685 msgid "" "This variant is used in :keyword:`with` and :keyword:`async with` " "constructs, which push the return value of the context manager's :meth:" "`~object.__enter__` or :meth:`~object.__aenter__` to the stack." msgstr "" -#: ../../library/dis.rst:1691 +#: ../../library/dis.rst:1692 msgid "" "Marks the end of the code block associated with the last ``SETUP_FINALLY``, " "``SETUP_CLEANUP`` or ``SETUP_WITH``." msgstr "" -#: ../../library/dis.rst:1697 +#: ../../library/dis.rst:1698 msgid "" "Undirected relative jump instructions which are replaced by their directed " "(forward/backward) counterparts by the assembler." msgstr "" -#: ../../library/dis.rst:1702 +#: ../../library/dis.rst:1703 msgid "" "Optimized unbound method lookup. Emitted as a ``LOAD_ATTR`` opcode with a " "flag set in the arg." msgstr "" -#: ../../library/dis.rst:1709 +#: ../../library/dis.rst:1710 msgid "Opcode collections" msgstr "" -#: ../../library/dis.rst:1711 +#: ../../library/dis.rst:1712 msgid "" "These collections are provided for automatic introspection of bytecode " "instructions:" msgstr "" -#: ../../library/dis.rst:1714 +#: ../../library/dis.rst:1715 msgid "" "The collections now contain pseudo instructions and instrumented " "instructions as well. These are opcodes with values ``>= MIN_PSEUDO_OPCODE`` " "and ``>= MIN_INSTRUMENTED_OPCODE``." msgstr "" -#: ../../library/dis.rst:1721 +#: ../../library/dis.rst:1722 msgid "Sequence of operation names, indexable using the bytecode." msgstr "" -#: ../../library/dis.rst:1726 +#: ../../library/dis.rst:1727 msgid "Dictionary mapping operation names to bytecodes." msgstr "" -#: ../../library/dis.rst:1731 +#: ../../library/dis.rst:1732 msgid "Sequence of all compare operation names." msgstr "" -#: ../../library/dis.rst:1736 +#: ../../library/dis.rst:1737 msgid "Sequence of bytecodes that use their argument." msgstr "" -#: ../../library/dis.rst:1743 +#: ../../library/dis.rst:1744 msgid "Sequence of bytecodes that access a constant." msgstr "" -#: ../../library/dis.rst:1748 +#: ../../library/dis.rst:1749 msgid "" "Sequence of bytecodes that access a free variable. 'free' in this context " "refers to names in the current scope that are referenced by inner scopes or " @@ -1794,34 +1795,34 @@ msgid "" "include references to global or builtin scopes." msgstr "" -#: ../../library/dis.rst:1756 +#: ../../library/dis.rst:1757 msgid "Sequence of bytecodes that access an attribute by name." msgstr "" -#: ../../library/dis.rst:1761 +#: ../../library/dis.rst:1762 msgid "Sequence of bytecodes that have a relative jump target." msgstr "" -#: ../../library/dis.rst:1766 +#: ../../library/dis.rst:1767 msgid "Sequence of bytecodes that have an absolute jump target." msgstr "" -#: ../../library/dis.rst:1771 +#: ../../library/dis.rst:1772 msgid "Sequence of bytecodes that access a local variable." msgstr "" -#: ../../library/dis.rst:1776 +#: ../../library/dis.rst:1777 msgid "Sequence of bytecodes of Boolean operations." msgstr "" -#: ../../library/dis.rst:1780 +#: ../../library/dis.rst:1781 msgid "Sequence of bytecodes that set an exception handler." msgstr "" -#: ../../library/dis.rst:1451 +#: ../../library/dis.rst:1452 msgid "built-in function" msgstr "built-in function(內建函式)" -#: ../../library/dis.rst:1451 +#: ../../library/dis.rst:1452 msgid "slice" msgstr "slice(切片)" diff --git a/library/doctest.po b/library/doctest.po index bbe4175c43..648cb21b6b 100644 --- a/library/doctest.po +++ b/library/doctest.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-15 00:03+0000\n" +"POT-Creation-Date: 2024-01-19 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:43+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -80,7 +80,7 @@ msgid "" "`doctest`! Jump in. The following sections provide full details. Note that " "there are many examples of doctests in the standard Python test suite and " "libraries. Especially useful examples can be found in the standard test " -"file :file:`Lib/test/test_doctest.py`." +"file :file:`Lib/test/test_doctest/test_doctest.py`." msgstr "" #: ../../library/doctest.rst:143 @@ -243,9 +243,9 @@ msgid "" "In addition, there are cases when you want tests to be part of a module but " "not part of the help text, which requires that the tests not be included in " "the docstring. Doctest looks for a module-level variable called ``__test__`` " -"and uses it to locate other tests. If ``M.__test__`` exists and is truthy, " -"it must be a dict, and each entry maps a (string) name to a function object, " -"class object, or string. Function and class object docstrings found from ``M." +"and uses it to locate other tests. If ``M.__test__`` exists, it must be a " +"dict, and each entry maps a (string) name to a function object, class " +"object, or string. Function and class object docstrings found from ``M." "__test__`` are searched, and strings are treated as if they were " "docstrings. In output, a key ``K`` in ``M.__test__`` appears with name ``M." "__test__.K``." @@ -930,10 +930,10 @@ msgstr "" #: ../../library/doctest.rst:947 msgid "" -"Also test examples reachable from dict ``m.__test__``, if it exists and is " -"not ``None``. ``m.__test__`` maps names (strings) to functions, classes and " -"strings; function and class docstrings are searched for examples; strings " -"are searched directly, as if they were docstrings." +"Also test examples reachable from dict ``m.__test__``, if it exists. ``m." +"__test__`` maps names (strings) to functions, classes and strings; function " +"and class docstrings are searched for examples; strings are searched " +"directly, as if they were docstrings." msgstr "" #: ../../library/doctest.rst:952 diff --git a/library/email.message.po b/library/email.message.po index 5809709c83..2f00422d16 100644 --- a/library/email.message.po +++ b/library/email.message.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-20 00:03+0000\n" +"POT-Creation-Date: 2024-01-19 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:44+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -69,10 +69,9 @@ msgid "" "The :class:`EmailMessage` dictionary-like interface is indexed by the header " "names, which must be ASCII values. The values of the dictionary are strings " "with some extra methods. Headers are stored and returned in case-preserving " -"form, but field names are matched case-insensitively. Unlike a real dict, " -"there is an ordering to the keys, and there can be duplicate keys. " -"Additional methods are provided for working with headers that have duplicate " -"keys." +"form, but field names are matched case-insensitively. The keys are ordered, " +"but unlike a real dict, there can be duplicates. Addtional methods are " +"provided for working with headers that have duplicate keys." msgstr "" #: ../../library/email.message.rst:47 diff --git a/library/email.policy.po b/library/email.policy.po index b70332a7cb..355e221a75 100644 --- a/library/email.policy.po +++ b/library/email.policy.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2024-01-24 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:01+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -240,57 +240,53 @@ msgid "" "being serialized by a generator. Default: :const:`False`." msgstr "" -#: ../../library/email.policy.rst:221 -msgid "The *mangle_from_* parameter." -msgstr "*mangle_from_* 參數。" - -#: ../../library/email.policy.rst:227 +#: ../../library/email.policy.rst:226 msgid "" "A factory function for constructing a new empty message object. Used by the " "parser when building messages. Defaults to ``None``, in which case :class:" "`~email.message.Message` is used." msgstr "" -#: ../../library/email.policy.rst:233 +#: ../../library/email.policy.rst:232 msgid "" "The following :class:`Policy` method is intended to be called by code using " "the email library to create policy instances with custom settings:" msgstr "" -#: ../../library/email.policy.rst:239 +#: ../../library/email.policy.rst:238 msgid "" "Return a new :class:`Policy` instance whose attributes have the same values " "as the current instance, except where those attributes are given new values " "by the keyword arguments." msgstr "" -#: ../../library/email.policy.rst:244 +#: ../../library/email.policy.rst:243 msgid "" "The remaining :class:`Policy` methods are called by the email package code, " "and are not intended to be called by an application using the email package. " "A custom policy must implement all of these methods." msgstr "" -#: ../../library/email.policy.rst:251 +#: ../../library/email.policy.rst:250 msgid "" "Handle a *defect* found on *obj*. When the email package calls this method, " "*defect* will always be a subclass of :class:`~email.errors.Defect`." msgstr "" -#: ../../library/email.policy.rst:255 +#: ../../library/email.policy.rst:254 msgid "" "The default implementation checks the :attr:`raise_on_defect` flag. If it " "is ``True``, *defect* is raised as an exception. If it is ``False`` (the " "default), *obj* and *defect* are passed to :meth:`register_defect`." msgstr "" -#: ../../library/email.policy.rst:262 +#: ../../library/email.policy.rst:261 msgid "" "Register a *defect* on *obj*. In the email package, *defect* will always be " "a subclass of :class:`~email.errors.Defect`." msgstr "" -#: ../../library/email.policy.rst:265 +#: ../../library/email.policy.rst:264 msgid "" "The default implementation calls the ``append`` method of the ``defects`` " "attribute of *obj*. When the email package calls :attr:`handle_defect`, " @@ -300,11 +296,11 @@ msgid "" "defects in parsed messages will raise unexpected errors." msgstr "" -#: ../../library/email.policy.rst:275 +#: ../../library/email.policy.rst:274 msgid "Return the maximum allowed number of headers named *name*." msgstr "" -#: ../../library/email.policy.rst:277 +#: ../../library/email.policy.rst:276 msgid "" "Called when a header is added to an :class:`~email.message.EmailMessage` or :" "class:`~email.message.Message` object. If the returned value is not ``0`` " @@ -312,7 +308,7 @@ msgid "" "greater than or equal to the value returned, a :exc:`ValueError` is raised." msgstr "" -#: ../../library/email.policy.rst:283 +#: ../../library/email.policy.rst:282 msgid "" "Because the default behavior of ``Message.__setitem__`` is to append the " "value to the list of headers, it is easy to create duplicate headers without " @@ -322,11 +318,11 @@ msgid "" "faithfully produce as many headers as exist in the message being parsed.)" msgstr "" -#: ../../library/email.policy.rst:291 +#: ../../library/email.policy.rst:290 msgid "The default implementation returns ``None`` for all header names." msgstr "" -#: ../../library/email.policy.rst:296 +#: ../../library/email.policy.rst:295 msgid "" "The email package calls this method with a list of strings, each string " "ending with the line separation characters found in the source being " @@ -336,7 +332,7 @@ msgid "" "the parsed header." msgstr "" -#: ../../library/email.policy.rst:303 +#: ../../library/email.policy.rst:302 msgid "" "If an implementation wishes to retain compatibility with the existing email " "package policies, *name* should be the case preserved name (all characters " @@ -345,16 +341,16 @@ msgid "" "stripped of leading whitespace." msgstr "" -#: ../../library/email.policy.rst:309 +#: ../../library/email.policy.rst:308 msgid "*sourcelines* may contain surrogateescaped binary data." msgstr "" -#: ../../library/email.policy.rst:311 ../../library/email.policy.rst:327 -#: ../../library/email.policy.rst:343 +#: ../../library/email.policy.rst:310 ../../library/email.policy.rst:326 +#: ../../library/email.policy.rst:342 msgid "There is no default implementation" msgstr "" -#: ../../library/email.policy.rst:316 +#: ../../library/email.policy.rst:315 msgid "" "The email package calls this method with the name and value provided by the " "application program when the application program is modifying a ``Message`` " @@ -363,14 +359,14 @@ msgid "" "``Message`` to represent the header." msgstr "" -#: ../../library/email.policy.rst:322 +#: ../../library/email.policy.rst:321 msgid "" "If an implementation wishes to retain compatibility with the existing email " "package policies, the *name* and *value* should be strings or string " "subclasses that do not change the content of the passed in arguments." msgstr "" -#: ../../library/email.policy.rst:332 +#: ../../library/email.policy.rst:331 msgid "" "The email package calls this method with the *name* and *value* currently " "stored in the ``Message`` when that header is requested by the application " @@ -381,13 +377,13 @@ msgid "" "returned to the application." msgstr "" -#: ../../library/email.policy.rst:340 +#: ../../library/email.policy.rst:339 msgid "" "*value* may contain surrogateescaped binary data. There should be no " "surrogateescaped binary data in the value returned by the method." msgstr "" -#: ../../library/email.policy.rst:348 +#: ../../library/email.policy.rst:347 msgid "" "The email package calls this method with the *name* and *value* currently " "stored in the ``Message`` for a given header. The method should return a " @@ -397,32 +393,32 @@ msgid "" "discussion of the rules for folding email headers." msgstr "" -#: ../../library/email.policy.rst:355 +#: ../../library/email.policy.rst:354 msgid "" "*value* may contain surrogateescaped binary data. There should be no " "surrogateescaped binary data in the string returned by the method." msgstr "" -#: ../../library/email.policy.rst:361 +#: ../../library/email.policy.rst:360 msgid "" "The same as :meth:`fold`, except that the returned value should be a bytes " "object rather than a string." msgstr "" -#: ../../library/email.policy.rst:364 +#: ../../library/email.policy.rst:363 msgid "" "*value* may contain surrogateescaped binary data. These could be converted " "back into binary data in the returned bytes object." msgstr "" -#: ../../library/email.policy.rst:371 +#: ../../library/email.policy.rst:370 msgid "" "This concrete :class:`Policy` provides behavior that is intended to be fully " "compliant with the current email RFCs. These include (but are not limited " "to) :rfc:`5322`, :rfc:`2047`, and the current MIME RFCs." msgstr "" -#: ../../library/email.policy.rst:375 +#: ../../library/email.policy.rst:374 msgid "" "This policy adds new header parsing and folding algorithms. Instead of " "simple strings, headers are ``str`` subclasses with attributes that depend " @@ -430,23 +426,23 @@ msgid "" "implement :rfc:`2047` and :rfc:`5322`." msgstr "" -#: ../../library/email.policy.rst:380 +#: ../../library/email.policy.rst:379 msgid "" "The default value for the :attr:`~email.policy.Policy.message_factory` " "attribute is :class:`~email.message.EmailMessage`." msgstr "" -#: ../../library/email.policy.rst:383 +#: ../../library/email.policy.rst:382 msgid "" "In addition to the settable attributes listed above that apply to all " "policies, this policy adds the following additional attributes:" msgstr "" -#: ../../library/email.policy.rst:386 +#: ../../library/email.policy.rst:385 msgid "[1]_" msgstr "" -#: ../../library/email.policy.rst:391 +#: ../../library/email.policy.rst:390 msgid "" "If ``False``, follow :rfc:`5322`, supporting non-ASCII characters in headers " "by encoding them as \"encoded words\". If ``True``, follow :rfc:`6532` and " @@ -454,7 +450,7 @@ msgid "" "passed to SMTP servers that support the ``SMTPUTF8`` extension (:rfc:`6531`)." msgstr "" -#: ../../library/email.policy.rst:400 +#: ../../library/email.policy.rst:399 msgid "" "If the value for a header in the ``Message`` object originated from a :mod:" "`~email.parser` (as opposed to being set by a program), this attribute " @@ -462,37 +458,37 @@ msgid "" "transforming the message back into serialized form. The possible values are:" msgstr "" -#: ../../library/email.policy.rst:407 +#: ../../library/email.policy.rst:406 msgid "``none``" msgstr "``none``" -#: ../../library/email.policy.rst:407 +#: ../../library/email.policy.rst:406 msgid "all source values use original folding" msgstr "" -#: ../../library/email.policy.rst:409 +#: ../../library/email.policy.rst:408 msgid "``long``" msgstr "``long``" -#: ../../library/email.policy.rst:409 +#: ../../library/email.policy.rst:408 msgid "" "source values that have any line that is longer than ``max_line_length`` " "will be refolded" msgstr "" -#: ../../library/email.policy.rst:412 +#: ../../library/email.policy.rst:411 msgid "``all``" msgstr "``all``" -#: ../../library/email.policy.rst:412 +#: ../../library/email.policy.rst:411 msgid "all values are refolded." msgstr "" -#: ../../library/email.policy.rst:415 +#: ../../library/email.policy.rst:414 msgid "The default is ``long``." msgstr "預設為 ``long``\\ 。" -#: ../../library/email.policy.rst:420 +#: ../../library/email.policy.rst:419 msgid "" "A callable that takes two arguments, ``name`` and ``value``, where ``name`` " "is a header field name and ``value`` is an unfolded header field value, and " @@ -503,7 +499,7 @@ msgid "" "custom parsing will be added in the future." msgstr "" -#: ../../library/email.policy.rst:431 +#: ../../library/email.policy.rst:430 msgid "" "An object with at least two methods: get_content and set_content. When the :" "meth:`~email.message.EmailMessage.get_content` or :meth:`~email.message." @@ -514,20 +510,20 @@ msgid "" "``content_manager`` is set to :data:`~email.contentmanager.raw_data_manager`." msgstr "" -#: ../../library/email.policy.rst:443 ../../library/email.policy.rst:601 +#: ../../library/email.policy.rst:442 ../../library/email.policy.rst:600 msgid "" "The class provides the following concrete implementations of the abstract " "methods of :class:`Policy`:" msgstr "" -#: ../../library/email.policy.rst:449 +#: ../../library/email.policy.rst:448 msgid "" "Returns the value of the :attr:`~email.headerregistry.BaseHeader.max_count` " "attribute of the specialized class used to represent the header with the " "given name." msgstr "" -#: ../../library/email.policy.rst:457 ../../library/email.policy.rst:607 +#: ../../library/email.policy.rst:456 ../../library/email.policy.rst:606 msgid "" "The name is parsed as everything up to the '``:``' and returned unmodified. " "The value is determined by stripping leading whitespace off the remainder of " @@ -535,7 +531,7 @@ msgid "" "trailing carriage return or linefeed characters." msgstr "" -#: ../../library/email.policy.rst:465 +#: ../../library/email.policy.rst:464 msgid "" "The name is returned unchanged. If the input value has a ``name`` attribute " "and it matches *name* ignoring case, the value is returned unchanged. " @@ -544,7 +540,7 @@ msgid "" "``ValueError`` is raised if the input value contains CR or LF characters." msgstr "" -#: ../../library/email.policy.rst:475 +#: ../../library/email.policy.rst:474 msgid "" "If the value has a ``name`` attribute, it is returned to unmodified. " "Otherwise the *name*, and the *value* with any CR or LF characters removed, " @@ -553,7 +549,7 @@ msgid "" "character glyph." msgstr "" -#: ../../library/email.policy.rst:484 +#: ../../library/email.policy.rst:483 msgid "" "Header folding is controlled by the :attr:`refold_source` policy setting. A " "value is considered to be a 'source value' if and only if it does not have a " @@ -565,7 +561,7 @@ msgid "" "current policy." msgstr "" -#: ../../library/email.policy.rst:493 +#: ../../library/email.policy.rst:492 msgid "" "Source values are split into lines using :meth:`~str.splitlines`. If the " "value is not to be refolded, the lines are rejoined using the ``linesep`` " @@ -575,13 +571,13 @@ msgid "" "using the ``unknown-8bit`` charset." msgstr "" -#: ../../library/email.policy.rst:503 +#: ../../library/email.policy.rst:502 msgid "" "The same as :meth:`fold` if :attr:`~Policy.cte_type` is ``7bit``, except " "that the returned value is bytes." msgstr "" -#: ../../library/email.policy.rst:506 +#: ../../library/email.policy.rst:505 msgid "" "If :attr:`~Policy.cte_type` is ``8bit``, non-ASCII binary data is converted " "back into bytes. Headers with binary data are not refolded, regardless of " @@ -589,7 +585,7 @@ msgid "" "binary data consists of single byte characters or multibyte characters." msgstr "" -#: ../../library/email.policy.rst:513 +#: ../../library/email.policy.rst:512 msgid "" "The following instances of :class:`EmailPolicy` provide defaults suitable " "for specific application domains. Note that in the future the behavior of " @@ -597,20 +593,20 @@ msgid "" "conform even more closely to the RFCs relevant to their domains." msgstr "" -#: ../../library/email.policy.rst:521 +#: ../../library/email.policy.rst:520 msgid "" "An instance of ``EmailPolicy`` with all defaults unchanged. This policy " "uses the standard Python ``\\n`` line endings rather than the RFC-correct " "``\\r\\n``." msgstr "" -#: ../../library/email.policy.rst:528 +#: ../../library/email.policy.rst:527 msgid "" "Suitable for serializing messages in conformance with the email RFCs. Like " "``default``, but with ``linesep`` set to ``\\r\\n``, which is RFC compliant." msgstr "" -#: ../../library/email.policy.rst:535 +#: ../../library/email.policy.rst:534 msgid "" "The same as ``SMTP`` except that :attr:`~EmailPolicy.utf8` is ``True``. " "Useful for serializing messages to a message store without using encoded " @@ -619,46 +615,46 @@ msgid "" "SMTP.send_message` method handles this automatically)." msgstr "" -#: ../../library/email.policy.rst:544 +#: ../../library/email.policy.rst:543 msgid "" "Suitable for serializing headers with for use in HTTP traffic. Like " "``SMTP`` except that ``max_line_length`` is set to ``None`` (unlimited)." msgstr "" -#: ../../library/email.policy.rst:550 +#: ../../library/email.policy.rst:549 msgid "" "Convenience instance. The same as ``default`` except that " "``raise_on_defect`` is set to ``True``. This allows any policy to be made " "strict by writing::" msgstr "" -#: ../../library/email.policy.rst:557 +#: ../../library/email.policy.rst:556 msgid "" "With all of these :class:`EmailPolicies <.EmailPolicy>`, the effective API " "of the email package is changed from the Python 3.2 API in the following " "ways:" msgstr "" -#: ../../library/email.policy.rst:560 +#: ../../library/email.policy.rst:559 msgid "" "Setting a header on a :class:`~email.message.Message` results in that header " "being parsed and a header object created." msgstr "" -#: ../../library/email.policy.rst:563 +#: ../../library/email.policy.rst:562 msgid "" "Fetching a header value from a :class:`~email.message.Message` results in " "that header being parsed and a header object created and returned." msgstr "" -#: ../../library/email.policy.rst:567 +#: ../../library/email.policy.rst:566 msgid "" "Any header object, or any header that is refolded due to the policy " "settings, is folded using an algorithm that fully implements the RFC folding " "algorithms, including knowing where encoded words are required and allowed." msgstr "" -#: ../../library/email.policy.rst:572 +#: ../../library/email.policy.rst:571 msgid "" "From the application view, this means that any header obtained through the :" "class:`~email.message.EmailMessage` is a header object with extra " @@ -668,13 +664,13 @@ msgid "" "the unicode string into the correct RFC encoded form." msgstr "" -#: ../../library/email.policy.rst:579 +#: ../../library/email.policy.rst:578 msgid "" "The header objects and their attributes are described in :mod:`~email." "headerregistry`." msgstr "" -#: ../../library/email.policy.rst:586 +#: ../../library/email.policy.rst:585 msgid "" "This concrete :class:`Policy` is the backward compatibility policy. It " "replicates the behavior of the email package in Python 3.2. The :mod:" @@ -683,28 +679,28 @@ msgid "" "of the email package is to maintain compatibility with Python 3.2." msgstr "" -#: ../../library/email.policy.rst:592 +#: ../../library/email.policy.rst:591 msgid "" "The following attributes have values that are different from the :class:" "`Policy` default:" msgstr "" -#: ../../library/email.policy.rst:598 +#: ../../library/email.policy.rst:597 msgid "The default is ``True``." msgstr "" -#: ../../library/email.policy.rst:615 +#: ../../library/email.policy.rst:614 msgid "The name and value are returned unmodified." msgstr "" -#: ../../library/email.policy.rst:620 +#: ../../library/email.policy.rst:619 msgid "" "If the value contains binary data, it is converted into a :class:`~email." "header.Header` object using the ``unknown-8bit`` charset. Otherwise it is " "returned unmodified." msgstr "" -#: ../../library/email.policy.rst:627 +#: ../../library/email.policy.rst:626 msgid "" "Headers are folded using the :class:`~email.header.Header` folding " "algorithm, which preserves existing line breaks in the value, and wraps each " @@ -712,7 +708,7 @@ msgid "" "encoded using the ``unknown-8bit`` charset." msgstr "" -#: ../../library/email.policy.rst:635 +#: ../../library/email.policy.rst:634 msgid "" "Headers are folded using the :class:`~email.header.Header` folding " "algorithm, which preserves existing line breaks in the value, and wraps each " @@ -722,18 +718,21 @@ msgid "" "and any (RFC invalid) binary data it may contain." msgstr "" -#: ../../library/email.policy.rst:645 +#: ../../library/email.policy.rst:644 msgid "" "An instance of :class:`Compat32`, providing backward compatibility with the " "behavior of the email package in Python 3.2." msgstr "" -#: ../../library/email.policy.rst:650 +#: ../../library/email.policy.rst:649 msgid "Footnotes" msgstr "註解" -#: ../../library/email.policy.rst:651 +#: ../../library/email.policy.rst:650 msgid "" "Originally added in 3.3 as a :term:`provisional feature `." msgstr "" + +#~ msgid "The *mangle_from_* parameter." +#~ msgstr "*mangle_from_* 參數。" diff --git a/library/enum.po b/library/enum.po index 44112272ff..e963f76171 100644 --- a/library/enum.po +++ b/library/enum.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-25 00:03+0000\n" +"POT-Creation-Date: 2024-01-19 00:03+0000\n" "PO-Revision-Date: 2023-09-11 14:08+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -978,13 +978,10 @@ msgstr "``FIRST = auto()`` 可以運作(auto() 會被取代成 ``1``)" #: ../../library/enum.rst:822 msgid "" "``SECOND = auto(), -2`` will work (auto is replaced with ``2``, so ``2, -2`` " -"is" +"is used to create the ``SECOND`` enum member;" msgstr "" -"``SECOND = auto(), -2`` 可以運作(auto 會被取代成 ``2``, 因此 ``2, -2`` 會" - -#: ../../library/enum.rst:823 -msgid "used to create the ``SECOND`` enum member;" -msgstr "被用來建立列舉成員 ``SECOND``;" +"``SECOND = auto(), -2`` 可以運作(auto 會被取代成 ``2``, 因此 ``2, -2`` 會被" +"用來建立列舉成員 ``SECOND``;" #: ../../library/enum.rst:824 msgid "" @@ -1113,18 +1110,3 @@ msgstr "" #: ../../library/enum.rst:928 msgid "or you can reassign the appropriate :meth:`str`, etc., in your enum::" msgstr "或者你也可以在你的列舉重新給定合適的 :meth:`str`: ::" - -#~ msgid "The *start* parameter was added." -#~ msgstr "新增 *start* 參數。" - -#~ msgid "OrderedEnum" -#~ msgstr "OrderedEnum" - -#~ msgid "DuplicateFreeEnum" -#~ msgstr "DuplicateFreeEnum" - -#~ msgid "TimePeriod" -#~ msgstr "TimePeriod" - -#~ msgid "_Private__names" -#~ msgstr "_Private__names" diff --git a/library/fnmatch.po b/library/fnmatch.po index 2dc1136128..0ca5c6f63a 100644 --- a/library/fnmatch.po +++ b/library/fnmatch.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2024-01-17 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:02+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -97,8 +97,8 @@ msgstr "" #: ../../library/fnmatch.rst:55 msgid "" -"Test whether the *filename* string matches the *pattern* string, returning :" -"const:`True` or :const:`False`. Both parameters are case-normalized using :" +"Test whether the filename string *name* matches the pattern string *pat*, " +"returning ``True`` or ``False``. Both parameters are case-normalized using :" "func:`os.path.normcase`. :func:`fnmatchcase` can be used to perform a case-" "sensitive comparison, regardless of whether that's standard for the " "operating system." @@ -112,33 +112,33 @@ msgstr "" #: ../../library/fnmatch.rst:74 msgid "" -"Test whether *filename* matches *pattern*, returning :const:`True` or :const:" -"`False`; the comparison is case-sensitive and does not apply :func:`os.path." -"normcase`." +"Test whether the filename string *name* matches the pattern string *pat*, " +"returning ``True`` or ``False``; the comparison is case-sensitive and does " +"not apply :func:`os.path.normcase`." msgstr "" #: ../../library/fnmatch.rst:81 msgid "" -"Construct a list from those elements of the iterable *names* that match " -"*pattern*. It is the same as ``[n for n in names if fnmatch(n, pattern)]``, " -"but implemented more efficiently." +"Construct a list from those elements of the :term:`iterable` *names* that " +"match pattern *pat*. It is the same as ``[n for n in names if fnmatch(n, " +"pat)]``, but implemented more efficiently." msgstr "" -#: ../../library/fnmatch.rst:87 +#: ../../library/fnmatch.rst:89 msgid "" -"Return the shell-style *pattern* converted to a regular expression for using " -"with :func:`re.match`." +"Return the shell-style pattern *pat* converted to a regular expression for " +"using with :func:`re.match`." msgstr "" -#: ../../library/fnmatch.rst:90 +#: ../../library/fnmatch.rst:92 msgid "Example:" msgstr "範例:" -#: ../../library/fnmatch.rst:104 +#: ../../library/fnmatch.rst:106 msgid "Module :mod:`glob`" msgstr ":mod:`glob` 模組" -#: ../../library/fnmatch.rst:105 +#: ../../library/fnmatch.rst:107 msgid "Unix shell-style path expansion." msgstr "" diff --git a/library/ftplib.po b/library/ftplib.po index 17e9b01527..14138b54f8 100644 --- a/library/ftplib.po +++ b/library/ftplib.po @@ -1,13 +1,13 @@ -# Copyright (C) 2001-2023, Python Software Foundation +# Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: -# Matt Wang , 2023 +# Matt Wang , 2023-2024 msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2024-01-25 06:20+0000\n" "PO-Revision-Date: 2023-04-26 19:44+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -62,43 +62,78 @@ msgstr "" msgid "Here's a sample session using the :mod:`ftplib` module::" msgstr "這是一個使用 :mod:`ftplib` 模組的會話範例:" -#: ../../library/ftplib.rst:48 -msgid "The module defines the following items:" -msgstr "此模組定義了以下項目:" - -#: ../../library/ftplib.rst:52 -msgid "" -"Return a new instance of the :class:`FTP` class. When *host* is given, the " -"method call ``connect(host)`` is made. When *user* is given, additionally " -"the method call ``login(user, passwd, acct)`` is made (where *passwd* and " -"*acct* default to the empty string when not given). The optional *timeout* " -"parameter specifies a timeout in seconds for blocking operations like the " -"connection attempt (if is not specified, the global default timeout setting " -"will be used). *source_address* is a 2-tuple ``(host, port)`` for the socket " -"to bind to as its source address before connecting. The *encoding* parameter " -"specifies the encoding for directories and filenames." -msgstr "" -"回傳 :class:`FTP` 類別的新實例。當給定 *host* 時,會呼叫方法 " -"``connect(host)``。當給定 *user* 時,還會再呼叫方法 ``login(user, passwd, " -"acct)`` (其中 *passwd* 和 *acct* 在未給定時預設為空字串)。可選的 *timeout* " -"參數以秒為單位來為如連線嘗試等阻塞操作指定超時(如果未指定,將使用全域預設超" -"時設定)。 *source_address* 是一個含兩元素的元組 ``(host, port)``,供 socket " -"在連線之前綁定到它的來源地址。 *encoding* 參數指定目錄和檔案名的編碼。" - -#: ../../library/ftplib.rst:62 +#: ../../library/ftplib.rst:51 +msgid "Reference" +msgstr "參考" + +#: ../../library/ftplib.rst:56 +msgid "FTP objects" +msgstr "FTP 物件" + +#: ../../library/ftplib.rst:87 +msgid "Return a new instance of the :class:`FTP` class." +msgstr "回傳一個新的 :class:`FTP` 類別實例。" + +#: ../../library/ftplib.rst:0 +msgid "Parameters" +msgstr "參數" + +#: ../../library/ftplib.rst:89 ../../library/ftplib.rst:461 +msgid "" +"The hostname to connect to. If given, :code:`connect(host)` is implicitly " +"called by the constructor." +msgstr "" +"要連接的主機名稱。如果有給定,:code:`connect(host)` 會由建構函式來隱式地呼" +"叫。" + +#: ../../library/ftplib.rst:93 ../../library/ftplib.rst:465 +msgid "" +"|param_doc_user| If given, :code:`login(host, passwd, acct)` is implicitly " +"called by the constructor." +msgstr "" +"|param_doc_user| 如果有給定,:code:`login(host, passwd, acct)` 會由建構函式來" +"隱式地呼叫。" + +#: ../../library/ftplib.rst:98 ../../library/ftplib.rst:212 +#: ../../library/ftplib.rst:470 +msgid "|param_doc_passwd|" +msgstr "|param_doc_passwd|" + +#: ../../library/ftplib.rst:101 ../../library/ftplib.rst:215 +#: ../../library/ftplib.rst:473 +msgid "|param_doc_acct|" +msgstr "|param_doc_acct|" + +#: ../../library/ftplib.rst:104 +msgid "" +"A timeout in seconds for blocking operations like :meth:`connect` (default: " +"the global default timeout setting)." +msgstr "" +"如 :meth:`connect` 的阻塞操作的超時設定,以秒為單位(預設:使用全域預設超時設" +"定)。" + +#: ../../library/ftplib.rst:109 ../../library/ftplib.rst:183 +#: ../../library/ftplib.rst:488 +msgid "|param_doc_source_address|" +msgstr "|param_doc_source_address|" + +#: ../../library/ftplib.rst:113 ../../library/ftplib.rst:492 +msgid "|param_doc_encoding|" +msgstr "|param_doc_encoding|" + +#: ../../library/ftplib.rst:116 msgid "The :class:`FTP` class supports the :keyword:`with` statement, e.g.:" msgstr ":class:`FTP` 類別支援 :keyword:`with` 陳述式,例如:" -#: ../../library/ftplib.rst:76 +#: ../../library/ftplib.rst:130 msgid "Support for the :keyword:`with` statement was added." msgstr "新增了對 :keyword:`with` 陳述式的支援。" -#: ../../library/ftplib.rst:79 ../../library/ftplib.rst:102 -#: ../../library/ftplib.rst:207 +#: ../../library/ftplib.rst:133 ../../library/ftplib.rst:189 msgid "*source_address* parameter was added." msgstr "新增 *source_address* 參數。" -#: ../../library/ftplib.rst:82 ../../library/ftplib.rst:110 +#: ../../library/ftplib.rst:136 ../../library/ftplib.rst:505 msgid "" "If the *timeout* parameter is set to be zero, it will raise a :class:" "`ValueError` to prevent the creation of a non-blocking socket. The " @@ -109,142 +144,76 @@ msgstr "" "socket。新增了 *encoding* 參數,預設值從 Latin-1 更改為 UTF-8 以遵循 :rfc:" "`2640`。" -#: ../../library/ftplib.rst:91 -msgid "" -"A :class:`FTP` subclass which adds TLS support to FTP as described in :rfc:" -"`4217`. Connect as usual to port 21 implicitly securing the FTP control " -"connection before authenticating. Securing the data connection requires the " -"user to explicitly ask for it by calling the :meth:`prot_p` method. " -"*context* is a :class:`ssl.SSLContext` object which allows bundling SSL " -"configuration options, certificates and private keys into a single " -"(potentially long-lived) structure. Please read :ref:`ssl-security` for " -"best practices." -msgstr "" -"一個 :class:`FTP` 子類別,它如 :rfc:`4217` 中所述地向 FTP 新增 TLS 支援。像往" -"常一樣連線到連接埠 21,在身份驗證之前隱式保護 FTP 控制連線。保護資料連線需要" -"使用者通過呼叫 :meth:`prot_p` 方法明確請求。 *context* 是一個 :class:`ssl." -"SSLContext` 物件,它允許將 SSL 配置選項、證書和私鑰捆綁到一個(可能長期存在" -"的)結構中。最佳實踐請參閱 :ref:`ssl-security`。" - -#: ../../library/ftplib.rst:105 +#: ../../library/ftplib.rst:142 msgid "" -"The class now supports hostname check with :attr:`ssl.SSLContext." -"check_hostname` and *Server Name Indication* (see :const:`ssl.HAS_SNI`)." +"Several :class:`!FTP` methods are available in two flavors: one for handling " +"text files and another for binary files. The methods are named for the " +"command which is used followed by ``lines`` for the text version or " +"``binary`` for the binary version." msgstr "" -"該類別現在支援使用 :attr:`ssl.SSLContext.check_hostname` 和 *Server Name " -"Indication* 進行主機名 (hostname) 檢查(參見 :const:`ssl.HAS_SNI`)。" - -#: ../../library/ftplib.rst:116 -msgid "The deprecated *keyfile* and *certfile* parameters have been removed." -msgstr "" - -#: ../../library/ftplib.rst:119 -msgid "Here's a sample session using the :class:`FTP_TLS` class::" -msgstr "這是一個使用 :class:`FTP_TLS` 類別的範例會話:" +":class:`!FTP` 的多個可用方法大致有分為兩個方向:一種用於處理文本檔案 (text " +"files),另一種用於二進位檔案 (binary files)。這些以在文本檔案的 ``lines`` 或" +"二進位檔案的 ``binary`` 前使用的命令命名。" -#: ../../library/ftplib.rst:132 -msgid "Exception raised when an unexpected reply is received from the server." -msgstr "伺服器收到意外回覆時所引發的例外。" +#: ../../library/ftplib.rst:147 +msgid ":class:`FTP` instances have the following methods:" +msgstr ":class:`FTP` 實例具有以下方法:" -#: ../../library/ftplib.rst:137 +#: ../../library/ftplib.rst:151 msgid "" -"Exception raised when an error code signifying a temporary error (response " -"codes in the range 400--499) is received." -msgstr "" -"當收到表示暫時錯誤的錯誤碼(400--499 範圍內的回應狀態碼)時引發的例外。" +"Set the instance's debugging level as an :class:`int`. This controls the " +"amount of debugging output printed. The debug levels are:" +msgstr "將實例的偵錯級別設定為一個 :class:`int`,這控制印出的偵錯訊息輸出量。" -#: ../../library/ftplib.rst:143 -msgid "" -"Exception raised when an error code signifying a permanent error (response " -"codes in the range 500--599) is received." -msgstr "" -"當收到表示永久錯誤的錯誤碼(500--599 範圍內的回應狀態碼)時引發的例外。" - -#: ../../library/ftplib.rst:149 -msgid "" -"Exception raised when a reply is received from the server that does not fit " -"the response specifications of the File Transfer Protocol, i.e. begin with a " -"digit in the range 1--5." -msgstr "" -"當從伺服器收到不符合檔案傳輸協定回應規範的回覆時引發例外,即 1--5 範圍內的數" -"字開頭。" +#: ../../library/ftplib.rst:155 +msgid "``0`` (default): No debug output." +msgstr "``0``\\ (預設值):不產生偵錯輸出。" #: ../../library/ftplib.rst:156 msgid "" -"The set of all exceptions (as a tuple) that methods of :class:`FTP` " -"instances may raise as a result of problems with the FTP connection (as " -"opposed to programming errors made by the caller). This set includes the " -"four exceptions listed above as well as :exc:`OSError` and :exc:`EOFError`." -msgstr "" -":class:`FTP` 實例方法由於 FTP 連線問題(相對於呼叫者的程式錯誤)而可能引發的" -"所有例外集合(元組形式)。該集合包括上面列出的四個例外以及 :exc:`OSError` " -"和 :exc:`EOFError`。" +"``1``: Produce a moderate amount of debug output, generally a single line " +"per request." +msgstr "``1``:會產生適量的偵錯輸出,通常是每個請求輸出一行。" -#: ../../library/ftplib.rst:166 -msgid "Module :mod:`netrc`" -msgstr ":mod:`netrc` 模組" - -#: ../../library/ftplib.rst:165 +#: ../../library/ftplib.rst:158 msgid "" -"Parser for the :file:`.netrc` file format. The file :file:`.netrc` is " -"typically used by FTP clients to load user authentication information before " -"prompting the user." +"``2`` or higher: Produce the maximum amount of debugging output, logging " +"each line sent and received on the control connection." msgstr "" -":file:`.netrc` 檔案格式的剖析器。:file:`.netrc` 檔案通常被 FTP 用戶端用來在提" -"示使用者之前載入使用者身份驗證資訊。" +"``2`` 或更高的值:會產生最大量的偵錯輸出,以日誌紀錄下控制連線發送和接收的每" +"個步驟。" -#: ../../library/ftplib.rst:173 -msgid "FTP Objects" -msgstr "FTP 物件" - -#: ../../library/ftplib.rst:175 +#: ../../library/ftplib.rst:163 msgid "" -"Several methods are available in two flavors: one for handling text files " -"and another for binary files. These are named for the command which is used " -"followed by ``lines`` for the text version or ``binary`` for the binary " -"version." +"Connect to the given host and port. This function should be called only once " +"for each instance; it should not be called if a *host* argument was given " +"when the :class:`FTP` instance was created. All other :class:`!FTP` methods " +"can only be called after a connection has successfully been made." msgstr "" -"有大致分為兩個方向的多個可用方法:一種用於處理文本檔案 (text files),另一種用" -"於二進位檔案 (binary files)。這些以在文本檔案的 ``lines`` 或二進位檔案的 " -"``binary`` 前使用的命令命名。" +"連線到給定的主機 (host) 和連接埠 (port)。每個實例只應呼叫此函式一次;如果在建" +"立 :class:`FTP` 實例時有給定 *host* 引數,則不應呼叫它。所有其他的 :class:`!" +"FTP` 方法只能在成功建立連線後使用。" -#: ../../library/ftplib.rst:179 -msgid ":class:`FTP` instances have the following methods:" -msgstr ":class:`FTP` 實例具有以下方法:" +#: ../../library/ftplib.rst:170 +msgid "The host to connect to." +msgstr "要連接的主機。" -#: ../../library/ftplib.rst:184 +#: ../../library/ftplib.rst:173 msgid "" -"Set the instance's debugging level. This controls the amount of debugging " -"output printed. The default, ``0``, produces no debugging output. A value " -"of ``1`` produces a moderate amount of debugging output, generally a single " -"line per request. A value of ``2`` or higher produces the maximum amount of " -"debugging output, logging each line sent and received on the control " -"connection." +"The TCP port to connect to (default: ``21``, as specified by the FTP " +"protocol specification). It is rarely needed to specify a different port " +"number." msgstr "" -"設定實例的偵錯級別。這控制印出的偵錯訊息輸出量。預設值 ``0`` 不產生偵錯輸出。" -"``1`` 會產生適量的偵錯輸出,通常是每個請求輸出一行。 ``2`` 或更高的值會產生最" -"大量的偵錯輸出,記錄發送和接收控制連線的每個步驟。" +"要連接的 TCP 連接埠(預設值:``21``,由 FTP 協定規範指定)。很少需要指定不同" +"的連接埠號碼。" -#: ../../library/ftplib.rst:193 +#: ../../library/ftplib.rst:178 msgid "" -"Connect to the given host and port. The default port number is ``21``, as " -"specified by the FTP protocol specification. It is rarely needed to specify " -"a different port number. This function should be called only once for each " -"instance; it should not be called at all if a host was given when the " -"instance was created. All other methods can only be used after a connection " -"has been made. The optional *timeout* parameter specifies a timeout in " -"seconds for the connection attempt. If no *timeout* is passed, the global " -"default timeout setting will be used. *source_address* is a 2-tuple ``(host, " -"port)`` for the socket to bind to as its source address before connecting." -msgstr "" -"連線到給定的主機 (host) 和連接埠 (port)。預設連接埠號為由 FTP 協定規範指定的 " -"``21``。通常不會需要指定不同的連接埠。每個實例只應呼叫此函式一次;如果在建立" -"實例時有給定主機,則不應呼叫它。所有其他方法只能在建立連線後使用。可選的 " -"*timeout* 參數指定連線嘗試的超時時間(以秒為單位)。如果沒有給定 *timeout*," -"將使用全域預設的超時設定。 *source_address* 是一個 2 元組 ``(host, port)``," -"供 socket 在連線之前綁定到它的來源地址。" +"A timeout in seconds for the connection attempt (default: the global default " +"timeout setting)." +msgstr "連線嘗試的超時設定,以秒為單位(預設:全域預設超時設定)。" -#: ../../library/ftplib.rst:216 +#: ../../library/ftplib.rst:198 msgid "" "Raises an :ref:`auditing event ` ``ftplib.connect`` with arguments " "``self``, ``host``, ``port``." @@ -252,7 +221,7 @@ msgstr "" "引發一個附帶引數 ``self``、``host``、``port`` 的\\ :ref:`稽核事件 " "` ``ftplib.connect``。" -#: ../../library/ftplib.rst:213 +#: ../../library/ftplib.rst:195 msgid "" "Return the welcome message sent by the server in reply to the initial " "connection. (This message sometimes contains disclaimers or help " @@ -261,36 +230,34 @@ msgstr "" "回傳伺服器為回應初始連線而發送的歡迎訊息。(此訊息有時會包含與使用者相關的免" "責聲明或幫助資訊。)" -#: ../../library/ftplib.rst:220 +#: ../../library/ftplib.rst:202 msgid "" -"Log in as the given *user*. The *passwd* and *acct* parameters are optional " -"and default to the empty string. If no *user* is specified, it defaults to " -"``'anonymous'``. If *user* is ``'anonymous'``, the default *passwd* is " -"``'anonymous@'``. This function should be called only once for each " -"instance, after a connection has been established; it should not be called " -"at all if a host and user were given when the instance was created. Most " -"FTP commands are only allowed after the client has logged in. The *acct* " -"parameter supplies \"accounting information\"; few systems implement this." +"Log on to the connected FTP server. This function should be called only once " +"for each instance, after a connection has been established; it should not be " +"called if the *host* and *user* arguments were given when the :class:`FTP` " +"instance was created. Most FTP commands are only allowed after the client " +"has logged in." msgstr "" -"以給定的 *user* 身份登錄。*passwd* 和 *acct* 為可選參數,皆預設為空字串。如果" -"未指定 *user*,則預設為 ``'anonymous'``。如果 *user* 是 ``'anonymous'``,則預" -"設的 *passwd* 會是 ``'anonymous@'``。在建立連接後,每個實例只應呼叫此函式一" -"次;如果在建立實例時有給定主機和使用者,則根本不應呼叫它。大多數 FTP 命令僅在" -"用戶端登錄後才允許使用。 *acct* 參數提供「帳戶資訊」,但很少有系統實作這一部" -"分。" +"在以連線的伺服器上登入。在建立連線後,每個實例只應呼叫此函式一次;如果在建" +"立 :class:`FTP` 實例時有給定 *host* 和 *user* 引數,則不應呼叫它。大多數 FTP " +"命令僅在用戶端登錄後才允許使用" -#: ../../library/ftplib.rst:232 +#: ../../library/ftplib.rst:209 +msgid "|param_doc_user|" +msgstr "|param_doc_user|" + +#: ../../library/ftplib.rst:221 msgid "" "Abort a file transfer that is in progress. Using this does not always work, " "but it's worth a try." msgstr "中止正在進行的檔案傳輸。使用它並不是都會成功,但值得一試。" -#: ../../library/ftplib.rst:238 +#: ../../library/ftplib.rst:227 msgid "" "Send a simple command string to the server and return the response string." msgstr "向伺服器發送一個簡單的命令字串並回傳回應字串。" -#: ../../library/ftplib.rst:251 ../../library/ftplib.rst:260 +#: ../../library/ftplib.rst:240 ../../library/ftplib.rst:249 msgid "" "Raises an :ref:`auditing event ` ``ftplib.sendcmd`` with arguments " "``self``, ``cmd``." @@ -298,7 +265,7 @@ msgstr "" "引發一個附帶引數 ``self``、``cmd`` 的\\ :ref:`稽核事件 ` ``ftplib." "sendcmd``。" -#: ../../library/ftplib.rst:245 +#: ../../library/ftplib.rst:234 msgid "" "Send a simple command string to the server and handle the response. Return " "nothing if a response code corresponding to success (codes in the range " @@ -307,25 +274,40 @@ msgstr "" "向伺服器發送一個簡單的命令字串並處理回應。如果收到代表成功的回應狀態碼(範圍" "為 200--299 的狀態碼),則不回傳任何內容,否則引發 :exc:`error_reply`。" +#: ../../library/ftplib.rst:243 +msgid "Retrieve a file in binary transfer mode." +msgstr "以二進位傳輸模式 (binary transfer mode) 取得檔案。" + +#: ../../library/ftplib.rst:245 ../../library/ftplib.rst:289 +msgid "An appropriate ``STOR`` command: :samp:`\"STOR {filename}\"`." +msgstr "一個正確的 ``STOR`` 指令::samp:`\"STOR {filename}\"`。" + +#: ../../library/ftplib.rst:248 +msgid "" +"A single parameter callable that is called for each block of data received, " +"with its single argument being the data as :class:`bytes`." +msgstr "" +"為接收到的每個資料區塊呼叫的單一參數可呼叫物件,其單一引數是以 :class:" +"`bytes` 為形式的資料。" + #: ../../library/ftplib.rst:254 msgid "" -"Retrieve a file in binary transfer mode. *cmd* should be an appropriate " -"``RETR`` command: ``'RETR filename'``. The *callback* function is called for " -"each block of data received, with a single bytes argument giving the data " -"block. The optional *blocksize* argument specifies the maximum chunk size to " -"read on the low-level socket object created to do the actual transfer (which " -"will also be the largest size of the data blocks passed to *callback*). A " -"reasonable default is chosen. *rest* means the same thing as in the :meth:" -"`transfercmd` method." -msgstr "" -"以二進位傳輸模式取得檔案。 *cmd* 應是一個正確的 ``RETR`` 命令:``'RETR " -"filename'``。為接收到的每個資料區塊 (block) 呼叫 *callback* 函式,使用一個位" -"元組引數代表資料區塊。可選的 *blocksize* 引數指定要在為執行實際傳輸而建立的低" -"階 socket 物件上讀取的最大區塊的大小(這也是傳遞給 *callback* 的資料區塊中的" -"最大大小)。會自動選擇一個合理的預設值。*rest* 與 :meth:`transfercmd` 方法中" -"的含義相同。" +"The maximum chunk size to read on the low-level :class:`~socket.socket` " +"object created to do the actual transfer. This also corresponds to the " +"largest size of data that will be passed to *callback*. Defaults to ``8192``." +msgstr "" +"在執行實際傳輸時所建立的低階 :class:`~socket.socket` 物件上讀取的最大分塊 " +"(chunk) 大小。這也對應於將傳遞給 *callback* 的最大資料大小。預設為 ``8192``。" -#: ../../library/ftplib.rst:266 +#: ../../library/ftplib.rst:261 ../../library/ftplib.rst:308 +msgid "" +"A ``REST`` command to be sent to the server. See the documentation for the " +"*rest* parameter of the :meth:`transfercmd` method." +msgstr "" +"一個要發送到伺服器的 ``REST`` 命令。參見 :meth:`transfercmd` 方法之 *rest* 參" +"數的文件。" + +#: ../../library/ftplib.rst:268 msgid "" "Retrieve a file or directory listing in the encoding specified by the " "*encoding* parameter at initialization. *cmd* should be an appropriate " @@ -334,44 +316,52 @@ msgid "" "files and information about those files. ``NLST`` retrieves a list of file " "names. The *callback* function is called for each line with a string " "argument containing the line with the trailing CRLF stripped. The default " -"*callback* prints the line to ``sys.stdout``." +"*callback* prints the line to :data:`sys.stdout`." msgstr "" "在初始化時以 *encoding* 參數指定的編碼來取得檔案或目錄列表。 *cmd* 要是一個正" "確的 ``RETR`` 命令(見 :meth:`retrbinary`)或者一個像 ``LIST`` 或 ``NLST`` 的" "命令(通常只是字串 ``'LIST'`` )。 ``LIST`` 會取得檔案列表和這些檔案的相關資" "訊。 ``NLST`` 取得檔案名稱列表。會為每一行以一個字串引數呼叫 *callback* 函" -"式,其引數包含已經刪除尾隨 CRLF 的一行。預設的 *callback* 會將各行印出到 " -"``sys.stdout``。" +"式,其引數包含已經刪除尾隨 CRLF 的一行。預設的 *callback* 會將各行印出到 :" +"data:`sys.stdout`。" -#: ../../library/ftplib.rst:279 +#: ../../library/ftplib.rst:281 msgid "" "Enable \"passive\" mode if *val* is true, otherwise disable passive mode. " "Passive mode is on by default." msgstr "" "如果 *val* 為真,則啟用「被動」模式,否則禁用被動模式。被動模式預設開啟。" -#: ../../library/ftplib.rst:285 -msgid "" -"Store a file in binary transfer mode. *cmd* should be an appropriate " -"``STOR`` command: ``\"STOR filename\"``. *fp* is a :term:`file object` " -"(opened in binary mode) which is read until EOF using its :meth:`~io.IOBase." -"read` method in blocks of size *blocksize* to provide the data to be stored. " -"The *blocksize* argument defaults to 8192. *callback* is an optional single " -"parameter callable that is called on each block of data after it is sent. " -"*rest* means the same thing as in the :meth:`transfercmd` method." -msgstr "" -"以二進位傳輸模式 (binary transfer mode) 儲存檔案。*cmd* 應該要是一個正確的 " -"``STOR`` 命令: ``\"STOR filename\"``。 *fp* 是一個\\ :term:`檔案物件 (file " -"object) ` (以二進位模式打開),使用其 :meth:`~io.IO.IOBase." -"read` 方法以讀取資料為 *blocksize* 大小的資料區塊直到 EOF,以供儲存。 " -"*blocksize* 引數預設為 8192。 *callback* 是一個可選的單參數可呼叫物件,會在每" -"個區塊發送後呼叫。 *rest* 與 :meth:`transfercmd` 方法中的含義相同。" - -#: ../../library/ftplib.rst:293 -msgid "*rest* parameter added." +#: ../../library/ftplib.rst:287 +msgid "Store a file in binary transfer mode." +msgstr "以二進位傳輸模式儲存檔案。" + +#: ../../library/ftplib.rst:292 +msgid "" +"A file object (opened in binary mode) which is read until EOF, using its :" +"meth:`~io.RawIOBase.read` method in blocks of size *blocksize* to provide " +"the data to be stored." +msgstr "" +"一個檔案物件(以二進位模式開啟),在大小為 *blocksize* 的區塊中使用其 :meth:" +"`~io.RawIOBase.read` 方法讀取直到 EOF 來提供要儲存的資料。" + +#: ../../library/ftplib.rst:298 +msgid "The read block size. Defaults to ``8192``." +msgstr "讀取區塊大小。預設為 ``8192``。" + +#: ../../library/ftplib.rst:302 +msgid "" +"A single parameter callable that is called for each block of data sent, with " +"its single argument being the data as :class:`bytes`." +msgstr "" +"為發送的每個資料區塊來呼叫的單一參數可呼叫物件,其單一引數是以 :class:" +"`bytes` 為形式的資料。" + +#: ../../library/ftplib.rst:312 +msgid "The *rest* parameter was added." msgstr "新增 *rest* 參數。" -#: ../../library/ftplib.rst:299 +#: ../../library/ftplib.rst:318 msgid "" "Store a file in line mode. *cmd* should be an appropriate ``STOR`` command " "(see :meth:`storbinary`). Lines are read until EOF from the :term:`file " @@ -384,7 +374,7 @@ msgstr "" "物件 ` *fp* (以二進位模式打開)讀取各行、直到 EOF,以提供要儲存" "的資料。 *callback* 是可選的單參數可呼叫物件,於發送後以各行進行呼叫。" -#: ../../library/ftplib.rst:308 +#: ../../library/ftplib.rst:327 msgid "" "Initiate a transfer over the data connection. If the transfer is active, " "send an ``EPRT`` or ``PORT`` command and the transfer command specified by " @@ -397,7 +387,7 @@ msgstr "" "模式,則發送 ``EPSV`` 或 ``PASV`` 命令、連線、並啟動傳輸命令。無論哪種方式," "都是回傳連線的 socket。" -#: ../../library/ftplib.rst:314 +#: ../../library/ftplib.rst:333 msgid "" "If optional *rest* is given, a ``REST`` command is sent to the server, " "passing *rest* as an argument. *rest* is usually a byte offset into the " @@ -417,7 +407,7 @@ msgstr "" "`error_reply` 例外。如果發生這種情況,只需在沒有 *rest* 引數的情況下呼叫 :" "meth:`transfercmd`。" -#: ../../library/ftplib.rst:327 +#: ../../library/ftplib.rst:346 msgid "" "Like :meth:`transfercmd`, but returns a tuple of the data connection and the " "expected size of the data. If the expected size could not be computed, " @@ -428,7 +418,7 @@ msgstr "" "無法計算預期大小,則回傳 ``None``。 *cmd* 和 *rest* 與 :meth:`transfercmd` 中" "的含義相同。" -#: ../../library/ftplib.rst:335 +#: ../../library/ftplib.rst:354 msgid "" "List a directory in a standardized format by using ``MLSD`` command (:rfc:" "`3659`). If *path* is omitted the current directory is assumed. *facts* is " @@ -446,7 +436,7 @@ msgstr "" "facts的字典。該字典的內容可能受 *facts* 引數限制,但不保證伺服器會回傳所有請" "求的 facts。" -#: ../../library/ftplib.rst:349 +#: ../../library/ftplib.rst:368 msgid "" "Return a list of file names as returned by the ``NLST`` command. The " "optional *argument* is a directory to list (default is the current server " @@ -456,30 +446,30 @@ msgstr "" "回傳由 ``NLST`` 命令回傳的檔案名稱列表。可選的 *argument* 是要列出的目錄(預" "設為當前伺服器目錄)。多個引數可用於將非標準選項傳遞給 ``NLST`` 命令。" -#: ../../library/ftplib.rst:354 ../../library/ftplib.rst:366 +#: ../../library/ftplib.rst:373 ../../library/ftplib.rst:385 msgid "If your server supports the command, :meth:`mlsd` offers a better API." msgstr "如果你的伺服器支援該命令,:meth:`mlsd` 會提供更好的 API。" -#: ../../library/ftplib.rst:359 +#: ../../library/ftplib.rst:378 msgid "" "Produce a directory listing as returned by the ``LIST`` command, printing it " "to standard output. The optional *argument* is a directory to list (default " "is the current server directory). Multiple arguments can be used to pass " "non-standard options to the ``LIST`` command. If the last argument is a " "function, it is used as a *callback* function as for :meth:`retrlines`; the " -"default prints to ``sys.stdout``. This method returns ``None``." +"default prints to :data:`sys.stdout`. This method returns ``None``." msgstr "" "生成由 ``LIST`` 命令回傳的目錄列表,並將其印出到標準輸出 (standard output)。" "可選的 *argument* 是要列出的目錄(預設為當前伺服器目錄)。有多個引數可用於將" "非標準選項傳遞給 ``LIST`` 命令。如果最後一個引數是一個函式,它被用作 :meth:" -"`retrlines` 的 *callback* 函式;預設印出到 ``sys.stdout``。此方法回傳 " +"`retrlines` 的 *callback* 函式;預設印出到 :data:`sys.stdout`。此方法回傳 " "``None``。" -#: ../../library/ftplib.rst:371 +#: ../../library/ftplib.rst:390 msgid "Rename file *fromname* on the server to *toname*." msgstr "將伺服器上的檔案 *fromname* 重新命名為 *toname*。" -#: ../../library/ftplib.rst:376 +#: ../../library/ftplib.rst:395 msgid "" "Remove the file named *filename* from the server. If successful, returns " "the text of the response, otherwise raises :exc:`error_perm` on permission " @@ -488,23 +478,23 @@ msgstr "" "從伺服器中刪除名為 *filename* 的檔案。如果成功,回傳回應的文字,否則引發 :" "exc:`error_perm` 權限錯誤或在其他錯誤發生時引發 :exc:`error_reply`。" -#: ../../library/ftplib.rst:383 +#: ../../library/ftplib.rst:402 msgid "Set the current directory on the server." msgstr "設定伺服器上的當前目錄。" -#: ../../library/ftplib.rst:388 +#: ../../library/ftplib.rst:407 msgid "Create a new directory on the server." msgstr "在伺服器上建立一個新目錄。" -#: ../../library/ftplib.rst:393 +#: ../../library/ftplib.rst:412 msgid "Return the pathname of the current directory on the server." msgstr "回傳伺服器上當前目錄的路徑名。" -#: ../../library/ftplib.rst:398 +#: ../../library/ftplib.rst:417 msgid "Remove the directory named *dirname* on the server." msgstr "刪除伺服器上名為 *dirname* 的目錄。" -#: ../../library/ftplib.rst:403 +#: ../../library/ftplib.rst:422 msgid "" "Request the size of the file named *filename* on the server. On success, " "the size of the file is returned as an integer, otherwise ``None`` is " @@ -515,7 +505,7 @@ msgstr "" "則回傳 ``None``。請注意,``SIZE`` 命令不是標準化的,但被許多常見的伺服器實作" "支援。" -#: ../../library/ftplib.rst:411 +#: ../../library/ftplib.rst:430 msgid "" "Send a ``QUIT`` command to the server and close the connection. This is the " "\"polite\" way to close a connection, but it may raise an exception if the " @@ -527,7 +517,7 @@ msgstr "" "器對 ``QUIT`` 命令作出錯誤回應,它可能會引發例外。這意味著呼叫 :meth:`close` " "方法使 :class:`FTP` 實例無法用於後續呼叫(見下文)。" -#: ../../library/ftplib.rst:420 +#: ../../library/ftplib.rst:439 msgid "" "Close the connection unilaterally. This should not be applied to an already " "closed connection such as after a successful call to :meth:`~FTP.quit`. " @@ -540,28 +530,77 @@ msgstr "" "或 :meth:`~FTP.quit` 後,你不能通過發出另一個 :meth:`login` 方法重新打開連" "線)。" -#: ../../library/ftplib.rst:428 -msgid "FTP_TLS Objects" +#: ../../library/ftplib.rst:447 +msgid "FTP_TLS objects" msgstr "FTP_TLS 物件" -#: ../../library/ftplib.rst:430 +#: ../../library/ftplib.rst:452 +msgid "" +"An :class:`FTP` subclass which adds TLS support to FTP as described in :rfc:" +"`4217`. Connect to port 21 implicitly securing the FTP control connection " +"before authenticating." +msgstr "" + +#: ../../library/ftplib.rst:458 msgid "" -":class:`FTP_TLS` class inherits from :class:`FTP`, defining these additional " -"objects:" -msgstr ":class:`FTP_TLS` 類別繼承自 :class:`FTP`,並另外定義了這些的物件:" +"The user must explicitly secure the data connection by calling the :meth:" +"`prot_p` method." +msgstr "" -#: ../../library/ftplib.rst:434 +#: ../../library/ftplib.rst:476 +msgid "" +"An SSL context object which allows bundling SSL configuration options, " +"certificates and private keys into a single, potentially long-lived, " +"structure. Please read :ref:`ssl-security` for best practices." +msgstr "" + +#: ../../library/ftplib.rst:483 +msgid "" +"A timeout in seconds for blocking operations like :meth:`~FTP.connect` " +"(default: the global default timeout setting)." +msgstr "" +"如 :meth:`~FTP.connect` 的阻塞操作的超時設定,以秒為單位(預設:使用全域預設" +"超時設定)。" + +#: ../../library/ftplib.rst:497 +msgid "Added the *source_address* parameter." +msgstr "新增 *source_address* 參數。" + +#: ../../library/ftplib.rst:500 +msgid "" +"The class now supports hostname check with :attr:`ssl.SSLContext." +"check_hostname` and *Server Name Indication* (see :const:`ssl.HAS_SNI`)." +msgstr "" +"該類別現在支援使用 :attr:`ssl.SSLContext.check_hostname` 和 *Server Name " +"Indication* 進行主機名 (hostname) 檢查(參見 :const:`ssl.HAS_SNI`)。" + +#: ../../library/ftplib.rst:511 +msgid "The deprecated *keyfile* and *certfile* parameters have been removed." +msgstr "已棄用的 *keyfile* 和 *certfile* 參數已被移除。" + +#: ../../library/ftplib.rst:514 +msgid "Here's a sample session using the :class:`FTP_TLS` class::" +msgstr "這是一個使用 :class:`FTP_TLS` 類別的範例會話:" + +#: ../../library/ftplib.rst:524 +msgid "" +":class:`!FTP_TLS` class inherits from :class:`FTP`, defining these " +"additional methods and attributes:" +msgstr "" +":class:`!FTP_TLS` 類別繼承自 :class:`FTP`,並另外定義了這些的方法與屬性:" + +#: ../../library/ftplib.rst:529 msgid "The SSL version to use (defaults to :data:`ssl.PROTOCOL_SSLv23`)." msgstr "要使用的 SSL 版本(預設為 :data:`ssl.PROTOCOL_SSLv23`)。" -#: ../../library/ftplib.rst:438 +#: ../../library/ftplib.rst:533 msgid "" "Set up a secure control connection by using TLS or SSL, depending on what is " "specified in the :attr:`ssl_version` attribute." msgstr "" "根據 :attr:`ssl_version` 屬性中指定的內容,使用 TLS 或 SSL 設定安全控制連線。" -#: ../../library/ftplib.rst:441 +#: ../../library/ftplib.rst:536 msgid "" "The method now supports hostname check with :attr:`ssl.SSLContext." "check_hostname` and *Server Name Indication* (see :const:`ssl.HAS_SNI`)." @@ -569,7 +608,7 @@ msgstr "" "該方法現在支援使用 :attr:`ssl.SSLContext.check_hostname` 和 *Server Name " "Indication* 進行主機名檢查(參見 :const:`ssl.HAS_SNI`)。" -#: ../../library/ftplib.rst:448 +#: ../../library/ftplib.rst:543 msgid "" "Revert control channel back to plaintext. This can be useful to take " "advantage of firewalls that know how to handle NAT with non-secure FTP " @@ -578,14 +617,69 @@ msgstr "" "將控制通道恢復為純文本。這對於利用知道如何在不打開固定連接埠的情況下使用非安" "全 (non-secure) FTP 以處理 NAT 的防火牆很有用。" -#: ../../library/ftplib.rst:456 +#: ../../library/ftplib.rst:551 msgid "Set up secure data connection." msgstr "設定安全資料連線。" -#: ../../library/ftplib.rst:460 +#: ../../library/ftplib.rst:555 msgid "Set up clear text data connection." msgstr "設定明文資料 (clear text data) 連線。" +#: ../../library/ftplib.rst:559 +msgid "Module variables" +msgstr "模組變數" + +#: ../../library/ftplib.rst:563 +msgid "Exception raised when an unexpected reply is received from the server." +msgstr "伺服器收到意外回覆時所引發的例外。" + +#: ../../library/ftplib.rst:568 +msgid "" +"Exception raised when an error code signifying a temporary error (response " +"codes in the range 400--499) is received." +msgstr "" +"當收到表示暫時錯誤的錯誤碼(400--499 範圍內的回應狀態碼)時引發的例外。" + +#: ../../library/ftplib.rst:574 +msgid "" +"Exception raised when an error code signifying a permanent error (response " +"codes in the range 500--599) is received." +msgstr "" +"當收到表示永久錯誤的錯誤碼(500--599 範圍內的回應狀態碼)時引發的例外。" + +#: ../../library/ftplib.rst:580 +msgid "" +"Exception raised when a reply is received from the server that does not fit " +"the response specifications of the File Transfer Protocol, i.e. begin with a " +"digit in the range 1--5." +msgstr "" +"當從伺服器收到不符合檔案傳輸協定回應規範的回覆時引發例外,即 1--5 範圍內的數" +"字開頭。" + +#: ../../library/ftplib.rst:587 +msgid "" +"The set of all exceptions (as a tuple) that methods of :class:`FTP` " +"instances may raise as a result of problems with the FTP connection (as " +"opposed to programming errors made by the caller). This set includes the " +"four exceptions listed above as well as :exc:`OSError` and :exc:`EOFError`." +msgstr "" +":class:`FTP` 實例方法由於 FTP 連線問題(相對於呼叫者的程式錯誤)而可能引發的" +"所有例外集合(元組形式)。該集合包括上面列出的四個例外以及 :exc:`OSError` " +"和 :exc:`EOFError`。" + +#: ../../library/ftplib.rst:597 +msgid "Module :mod:`netrc`" +msgstr ":mod:`netrc` 模組" + +#: ../../library/ftplib.rst:596 +msgid "" +"Parser for the :file:`.netrc` file format. The file :file:`.netrc` is " +"typically used by FTP clients to load user authentication information before " +"prompting the user." +msgstr "" +":file:`.netrc` 檔案格式的剖析器。:file:`.netrc` 檔案通常被 FTP 用戶端用來在提" +"示使用者之前載入使用者身份驗證資訊。" + #: ../../library/ftplib.rst:9 msgid "FTP" msgstr "FTP" @@ -597,21 +691,3 @@ msgstr "protocol(協定)" #: ../../library/ftplib.rst:9 msgid "ftplib (standard module)" msgstr "ftplib(標準模組)" - -#~ msgid "" -#~ "*keyfile* and *certfile* are a legacy alternative to *context* -- they " -#~ "can point to PEM-formatted private key and certificate chain files " -#~ "(respectively) for the SSL connection." -#~ msgstr "" -#~ "*keyfile* 和 *certfile* 是 *context* 的傳統替代方案 -- 它們可以(分別)指" -#~ "向 SSL 連線的 PEM 格式私鑰和憑證鏈檔案。" - -#~ msgid "" -#~ "*keyfile* and *certfile* are deprecated in favor of *context*. Please " -#~ "use :meth:`ssl.SSLContext.load_cert_chain` instead, or let :func:`ssl." -#~ "create_default_context` select the system's trusted CA certificates for " -#~ "you." -#~ msgstr "" -#~ "*keyfile* 和 *certfile* 已棄用,取而代之的是 *context*。請改用 :meth:`ssl." -#~ "SSLContext.load_cert_chain`,或讓 :func:`ssl.create_default_context` 為你" -#~ "選擇系統的可信 CA 憑證。" diff --git a/library/functions.po b/library/functions.po index 563e50e541..94272a247e 100644 --- a/library/functions.po +++ b/library/functions.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-04 13:57+0000\n" +"POT-Creation-Date: 2024-01-24 00:03+0000\n" "PO-Revision-Date: 2023-07-02 22:53+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -482,8 +482,8 @@ msgid "" "ways." msgstr "如果不一定需要 \"0b\" 前綴,還可以使用如下的方法。" -#: ../../library/functions.rst:141 ../../library/functions.rst:846 -#: ../../library/functions.rst:1164 +#: ../../library/functions.rst:141 ../../library/functions.rst:845 +#: ../../library/functions.rst:1163 msgid "See also :func:`format` for more information." msgstr "可參考 :func:`format` 獲取更多資訊。" @@ -502,8 +502,8 @@ msgstr "" "(參見 :ref:`typesnumeric`),其他 class 不能繼承自它。它只有 ``False`` 和 " "``True`` 兩個實例(參見 :ref:`typebool`)。" -#: ../../library/functions.rst:155 ../../library/functions.rst:711 -#: ../../library/functions.rst:935 +#: ../../library/functions.rst:155 ../../library/functions.rst:710 +#: ../../library/functions.rst:934 msgid "*x* is now a positional-only parameter." msgstr "" @@ -913,8 +913,8 @@ msgstr "" msgid "The complex type is described in :ref:`typesnumeric`." msgstr "複數型別在 :ref:`typesnumeric` 中有相關描述。" -#: ../../library/functions.rst:400 ../../library/functions.rst:708 -#: ../../library/functions.rst:932 +#: ../../library/functions.rst:400 ../../library/functions.rst:707 +#: ../../library/functions.rst:931 msgid "Grouping digits with underscores as in code literals is allowed." msgstr "可以使用底線將程式碼文字中的數字進行分組。" @@ -1301,18 +1301,17 @@ msgstr "" "數也可以是 NaN(非數字)或正負無窮大的字串。確切地說,除去首尾的空格後,輸入" "必須遵循以下語法中 ``floatvalue`` 的生成規則:" -#: ../../library/functions.rst:677 +#: ../../library/functions.rst:678 +#, fuzzy msgid "" -"Here ``digit`` is a Unicode decimal digit (character in the Unicode general " -"category ``Nd``). Case is not significant, so, for example, \"inf\", " -"\"Inf\", \"INFINITY\", and \"iNfINity\" are all acceptable spellings for " -"positive infinity." +"Case is not significant, so, for example, \"inf\", \"Inf\", \"INFINITY\", " +"and \"iNfINity\" are all acceptable spellings for positive infinity." msgstr "" "``digit`` 是一個 Unicode 十進位數字(Unicode 一般分類 ``Nd`` 中的字元)。字母" "大小寫都可以,例如,\"inf\"、\"Inf\"、\"INFINITY\"、\"iNfINity\" 都可以表示正" "無窮大。" -#: ../../library/functions.rst:682 +#: ../../library/functions.rst:681 msgid "" "Otherwise, if the argument is an integer or a floating point number, a " "floating point number with the same value (within Python's floating point " @@ -1322,7 +1321,7 @@ msgstr "" "否則,如果引數是整數或浮點數,則回傳具有相同值(在 Python 浮點精度範圍內)的" "浮點數。如果引數在 Python 浮點精度範圍外,則會觸發 :exc:`OverflowError`。" -#: ../../library/functions.rst:687 +#: ../../library/functions.rst:686 msgid "" "For a general Python object ``x``, ``float(x)`` delegates to ``x." "__float__()``. If :meth:`~object.__float__` is not defined then it falls " @@ -1331,28 +1330,28 @@ msgstr "" "對於一般的 Python 物件 ``x``,``float(x)`` 指派給 ``x.__float__()``。如果未定" "義 :meth:`~object.__float__` 則回退使用 :meth:`~object.__index__`。" -#: ../../library/functions.rst:691 +#: ../../library/functions.rst:690 msgid "If no argument is given, ``0.0`` is returned." msgstr "如果沒有引數,則回傳 ``0.0``。" -#: ../../library/functions.rst:693 +#: ../../library/functions.rst:692 msgid "Examples::" msgstr "" "例如:\n" "\n" "::" -#: ../../library/functions.rst:706 +#: ../../library/functions.rst:705 msgid "The float type is described in :ref:`typesnumeric`." msgstr ":ref:`typesnumeric` 描述了浮點數型別。" -#: ../../library/functions.rst:714 +#: ../../library/functions.rst:713 msgid "" "Falls back to :meth:`~object.__index__` if :meth:`~object.__float__` is not " "defined." msgstr "" -#: ../../library/functions.rst:724 +#: ../../library/functions.rst:723 msgid "" "Convert a *value* to a \"formatted\" representation, as controlled by " "*format_spec*. The interpretation of *format_spec* will depend on the type " @@ -1363,7 +1362,7 @@ msgstr "" "取決於 *value* 引數的型別,但是大多數內建型別使用標準格式化語法::ref:" "`formatspec`。" -#: ../../library/functions.rst:729 +#: ../../library/functions.rst:728 msgid "" "The default *format_spec* is an empty string which usually gives the same " "effect as calling :func:`str(value) `." @@ -1371,7 +1370,7 @@ msgstr "" "預設的 *format_spec* 是一個空字串,它通常和呼叫 :func:`str(value) ` 的效" "果相同。" -#: ../../library/functions.rst:732 +#: ../../library/functions.rst:731 msgid "" "A call to ``format(value, format_spec)`` is translated to ``type(value)." "__format__(value, format_spec)`` which bypasses the instance dictionary when " @@ -1385,7 +1384,7 @@ msgstr "" "實例中的字典。如果搜尋到 :mod:`object` 這個 method 但 *format_spec* 不為空," "或是 *format_spec* 或回傳值不是字串,則會觸發 :exc:`TypeError`。" -#: ../../library/functions.rst:739 +#: ../../library/functions.rst:738 msgid "" "``object().__format__(format_spec)`` raises :exc:`TypeError` if " "*format_spec* is not an empty string." @@ -1393,7 +1392,7 @@ msgstr "" "當 *format_spec* 不是空字串時,``object().__format__(format_spec)`` 會觸發 :" "exc:`TypeError`。" -#: ../../library/functions.rst:748 +#: ../../library/functions.rst:747 msgid "" "Return a new :class:`frozenset` object, optionally with elements taken from " "*iterable*. ``frozenset`` is a built-in class. See :class:`frozenset` and :" @@ -1403,7 +1402,7 @@ msgstr "" "素。\\ ``frozenset`` 是一個內建的 class。有關此 class 的文件,請參閱 :class:" "`frozenset` 和 :ref:`types-set`。" -#: ../../library/functions.rst:752 +#: ../../library/functions.rst:751 msgid "" "For other containers see the built-in :class:`set`, :class:`list`, :class:" "`tuple`, and :class:`dict` classes, as well as the :mod:`collections` module." @@ -1411,7 +1410,7 @@ msgstr "" "請參閱內建的 :class:`set`、:class:`list`、:class:`tuple` 和 :class:`dict` " "class,以及 :mod:`collections` module 來了解其它的容器。" -#: ../../library/functions.rst:760 +#: ../../library/functions.rst:759 msgid "" "Return the value of the named attribute of *object*. *name* must be a " "string. If the string is the name of one of the object's attributes, the " @@ -1426,7 +1425,7 @@ msgstr "" "`AttributeError`。*name* 不必是個 Python 識別符 (identifier)(請見 :func:" "`setattr`)。" -#: ../../library/functions.rst:769 +#: ../../library/functions.rst:768 msgid "" "Since :ref:`private name mangling ` happens at " "compilation time, one must manually mangle a private attribute's (attributes " @@ -1434,7 +1433,7 @@ msgid "" "`getattr`." msgstr "" -#: ../../library/functions.rst:777 +#: ../../library/functions.rst:776 msgid "" "Return the dictionary implementing the current module namespace. For code " "within functions, this is set when the function is defined and remains the " @@ -1443,7 +1442,7 @@ msgstr "" "回傳代表當前 module 命名空間的 dictionary。對於在函式中的程式碼來說,這在定義" "函式時設定且不論該函式是在何處呼叫都會保持相同。" -#: ../../library/functions.rst:784 +#: ../../library/functions.rst:783 msgid "" "The arguments are an object and a string. The result is ``True`` if the " "string is the name of one of the object's attributes, ``False`` if not. " @@ -1454,7 +1453,7 @@ msgstr "" "則回傳 ``False``。(此功能是通過呼叫 ``getattr(object, name)`` 看是否有 :exc:" "`AttributeError` 來實現的。)" -#: ../../library/functions.rst:792 +#: ../../library/functions.rst:791 msgid "" "Return the hash value of the object (if it has one). Hash values are " "integers. They are used to quickly compare dictionary keys during a " @@ -1465,7 +1464,7 @@ msgstr "" "時用來快速比較 dictionary 的鍵。相同大小的數字數值有相同的雜湊值(即使它們型" "別不同,如 1 和 1.0)。" -#: ../../library/functions.rst:799 +#: ../../library/functions.rst:798 #, fuzzy msgid "" "For objects with custom :meth:`~object.__hash__` methods, note that :func:" @@ -1474,7 +1473,7 @@ msgstr "" "請注意,如果物件實現了自己的 :meth:`__hash__` method,:func:`hash` 根據執行機" "器的位元長度來擷取回傳值。另請參閱 :meth:`__hash__ `。" -#: ../../library/functions.rst:806 +#: ../../library/functions.rst:805 msgid "" "Invoke the built-in help system. (This function is intended for interactive " "use.) If no argument is given, the interactive help system starts on the " @@ -1488,7 +1487,7 @@ msgstr "" "鍵字或文件主題中搜索該字串,並在控制台上列印幫助資訊。如果引數是其他任意物" "件,則會生成該物件的幫助頁。" -#: ../../library/functions.rst:813 +#: ../../library/functions.rst:812 msgid "" "Note that if a slash(/) appears in the parameter list of a function when " "invoking :func:`help`, it means that the parameters prior to the slash are " @@ -1496,12 +1495,12 @@ msgid "" "parameters `." msgstr "" -#: ../../library/functions.rst:818 +#: ../../library/functions.rst:817 msgid "" "This function is added to the built-in namespace by the :mod:`site` module." msgstr "該函式透過 :mod:`site` module 加入到內建命名空間。" -#: ../../library/functions.rst:820 +#: ../../library/functions.rst:819 msgid "" "Changes to :mod:`pydoc` and :mod:`inspect` mean that the reported signatures " "for callables are now more comprehensive and consistent." @@ -1509,7 +1508,7 @@ msgstr "" "變更至 :mod:`pydoc` 和 :mod:`inspect` 使得可呼叫物件的簽名信息 (signature) 更" "加全面和一致。" -#: ../../library/functions.rst:827 +#: ../../library/functions.rst:826 msgid "" "Convert an integer number to a lowercase hexadecimal string prefixed with " "\"0x\". If *x* is not a Python :class:`int` object, it has to define an :" @@ -1519,7 +1518,7 @@ msgstr "" "class:`int` 物件,則必須定義一個 :meth:`~object.__index__` method 並且回傳一" "個整數。舉例來說:" -#: ../../library/functions.rst:836 +#: ../../library/functions.rst:835 msgid "" "If you want to convert an integer number to an uppercase or lower " "hexadecimal string with prefix or not, you can use either of the following " @@ -1528,20 +1527,20 @@ msgstr "" "如果要將整數轉換為大寫或小寫的十六進位制字串,並可選擇有無 \"0x\" 前綴,則可" "以使用如下方法:" -#: ../../library/functions.rst:848 +#: ../../library/functions.rst:847 msgid "" "See also :func:`int` for converting a hexadecimal string to an integer using " "a base of 16." msgstr "另請參閱 :func:`int` 將十六進位制字串轉換為以 16 為基數的整數。" -#: ../../library/functions.rst:853 +#: ../../library/functions.rst:852 msgid "" "To obtain a hexadecimal string representation for a float, use the :meth:" "`float.hex` method." msgstr "" "如果要獲取浮點數的十六進位制字串形式,請使用 :meth:`float.hex` method。" -#: ../../library/functions.rst:859 +#: ../../library/functions.rst:858 msgid "" "Return the \"identity\" of an object. This is an integer which is " "guaranteed to be unique and constant for this object during its lifetime. " @@ -1551,18 +1550,18 @@ msgstr "" "回傳物件的 \"標識值\" 。該值是一個整數,在此物件的生命週期中保證是唯一且恆定" "的。兩個生命期不重疊的物件可能具有相同的 :func:`id` 值。" -#: ../../library/functions.rst:864 +#: ../../library/functions.rst:863 msgid "This is the address of the object in memory." msgstr "" -#: ../../library/functions.rst:866 +#: ../../library/functions.rst:865 msgid "" "Raises an :ref:`auditing event ` ``builtins.id`` with argument " "``id``." msgstr "" "引發一個附帶引數 ``id`` 的\\ :ref:`稽核事件 ` ``builtins.id``。" -#: ../../library/functions.rst:872 +#: ../../library/functions.rst:871 msgid "" "If the *prompt* argument is present, it is written to standard output " "without a trailing newline. The function then reads a line from input, " @@ -1575,7 +1574,7 @@ msgstr "" "\n" "::" -#: ../../library/functions.rst:882 +#: ../../library/functions.rst:881 msgid "" "If the :mod:`readline` module was loaded, then :func:`input` will use it to " "provide elaborate line editing and history features." @@ -1583,7 +1582,7 @@ msgstr "" "如果載入了 :mod:`readline` module,:func:`input` 將使用它來提供複雜的行編輯和" "歷史記錄功能。" -#: ../../library/functions.rst:885 +#: ../../library/functions.rst:884 msgid "" "Raises an :ref:`auditing event ` ``builtins.input`` with argument " "``prompt``." @@ -1591,7 +1590,7 @@ msgstr "" "引發一個附帶引數 ``prompt`` 的\\ :ref:`稽核事件 ` ``builtins." "input``。" -#: ../../library/functions.rst:887 +#: ../../library/functions.rst:886 msgid "" "Raises an :ref:`auditing event ` ``builtins.input`` with argument " "``prompt`` before reading input" @@ -1599,7 +1598,7 @@ msgstr "" "引發一個附帶讀取輸入前的引數 ``prompt`` 的\\ :ref:`稽核事件 ` " "``builtins.input``。" -#: ../../library/functions.rst:890 +#: ../../library/functions.rst:889 msgid "" "Raises an :ref:`auditing event ` ``builtins.input/result`` with " "argument ``result``." @@ -1607,7 +1606,7 @@ msgstr "" "引發一個附帶引數 ``result`` 的\\ :ref:`稽核事件 ` ``builtins.input/" "result``。" -#: ../../library/functions.rst:892 +#: ../../library/functions.rst:891 msgid "" "Raises an :ref:`auditing event ` ``builtins.input/result`` with " "the result after successfully reading input." @@ -1615,7 +1614,7 @@ msgstr "" "引發一個附帶成功讀取結果的\\ :ref:`稽核事件 ` ``builtins.input/" "result``。" -#: ../../library/functions.rst:899 +#: ../../library/functions.rst:898 msgid "" "Return an integer object constructed from a number or string *x*, or return " "``0`` if no arguments are given. If *x* defines :meth:`~object.__int__`, " @@ -1629,7 +1628,7 @@ msgstr "" "*x* 定義了 :meth:`~object.__index__` 則回傳 ``x.__index__()``。如果 *x* 定義" "了 :meth:`~object.__trunc__` 則回傳 ``x.__trunc__()``。對於浮點數則向零舍入。" -#: ../../library/functions.rst:906 +#: ../../library/functions.rst:905 msgid "" "If *x* is not a number or if *base* is given, then *x* must be a string, :" "class:`bytes`, or :class:`bytearray` instance representing an integer in " @@ -1642,7 +1641,7 @@ msgstr "" "前可以有 ``+`` 或 ``-``\\ (中間沒有空格)、可有個前導的零、也可被空格包圍、" "或在數字間有單一底線。" -#: ../../library/functions.rst:912 +#: ../../library/functions.rst:911 msgid "" "A base-n integer string contains digits, each representing a value from 0 to " "n-1. The values 0--9 can be represented by any Unicode decimal digit. The " @@ -1664,11 +1663,11 @@ msgstr "" "進制中的一個,所以 ``int('010', 0)`` 是非法的,但 ``int('010')`` 和 " "``int('010', 8)`` 是有效的。" -#: ../../library/functions.rst:923 +#: ../../library/functions.rst:922 msgid "The integer type is described in :ref:`typesnumeric`." msgstr "整數型別定義請參閱 :ref:`typesnumeric`。" -#: ../../library/functions.rst:925 +#: ../../library/functions.rst:924 msgid "" "If *base* is not an instance of :class:`int` and the *base* object has a :" "meth:`base.__index__ ` method, that method is called to " @@ -1680,17 +1679,17 @@ msgstr "" "使用 :meth:`base.__int__ ` 而不是 :meth:`base.__index__ " "`。" -#: ../../library/functions.rst:938 +#: ../../library/functions.rst:937 msgid "" "Falls back to :meth:`~object.__index__` if :meth:`~object.__int__` is not " "defined." msgstr "" -#: ../../library/functions.rst:941 +#: ../../library/functions.rst:940 msgid "The delegation to :meth:`~object.__trunc__` is deprecated." msgstr "" -#: ../../library/functions.rst:944 +#: ../../library/functions.rst:943 msgid "" ":class:`int` string inputs and string representations can be limited to help " "avoid denial of service attacks. A :exc:`ValueError` is raised when the " @@ -1700,7 +1699,7 @@ msgid "" "documentation." msgstr "" -#: ../../library/functions.rst:954 +#: ../../library/functions.rst:953 msgid "" "Return ``True`` if the *object* argument is an instance of the *classinfo* " "argument, or of a (direct, indirect, or :term:`virtual `) of *classinfo*. A class is considered a " @@ -1740,7 +1739,7 @@ msgstr "" "*class* 是 *classinfo* 中任一元素的 subclass 時則回傳 ``True``。其他情況,會" "觸發 :exc:`TypeError`。" -#: ../../library/functions.rst:986 +#: ../../library/functions.rst:985 msgid "" "Return an :term:`iterator` object. The first argument is interpreted very " "differently depending on the presence of the second argument. Without a " @@ -1764,18 +1763,18 @@ msgstr "" "__next__` 時會不帶引數地呼叫 *object*\\ ;如果回傳的結果是 *sentinel* 則觸" "發 :exc:`StopIteration`,否則回傳呼叫結果。" -#: ../../library/functions.rst:1000 +#: ../../library/functions.rst:999 msgid "See also :ref:`typeiter`." msgstr "另請參閱 :ref:`typeiter`。" -#: ../../library/functions.rst:1002 +#: ../../library/functions.rst:1001 msgid "" "One useful application of the second form of :func:`iter` is to build a " "block-reader. For example, reading fixed-width blocks from a binary database " "file until the end of file is reached::" msgstr "" -#: ../../library/functions.rst:1014 +#: ../../library/functions.rst:1013 msgid "" "Return the length (the number of items) of an object. The argument may be a " "sequence (such as a string, bytes, tuple, list, or range) or a collection " @@ -1784,13 +1783,13 @@ msgstr "" "回傳物件的長度(元素個數)。引數可以是序列(如 string、bytes、tuple、list 或 " "range)或集合(如 dictionary、set 或 frozen set)。" -#: ../../library/functions.rst:1020 +#: ../../library/functions.rst:1019 msgid "" "``len`` raises :exc:`OverflowError` on lengths larger than :data:`sys." "maxsize`, such as :class:`range(2 ** 100) `." msgstr "" -#: ../../library/functions.rst:1029 +#: ../../library/functions.rst:1028 msgid "" "Rather than being a function, :class:`list` is actually a mutable sequence " "type, as documented in :ref:`typesseq-list` and :ref:`typesseq`." @@ -1798,7 +1797,7 @@ msgstr "" "除了是函式,:class:`list` 也是可變序列型別,詳情請參閱 :ref:`typesseq-list` " "和 :ref:`typesseq`。" -#: ../../library/functions.rst:1035 +#: ../../library/functions.rst:1034 msgid "" "Update and return a dictionary representing the current local symbol table. " "Free variables are returned by :func:`locals` when it is called in function " @@ -1809,7 +1808,7 @@ msgstr "" "叫 :func:`locals` 時會回傳自由變數。請注意,在 module 階層中,\\ :func:" "`locals` 和 :func:`globals` 是相同的 dictionary。" -#: ../../library/functions.rst:1041 +#: ../../library/functions.rst:1040 msgid "" "The contents of this dictionary should not be modified; changes may not " "affect the values of local and free variables used by the interpreter." @@ -1817,7 +1816,7 @@ msgstr "" "此 dictionary 的內容不應該被更動;更改可能不會影響直譯器使用的本地變數或自由" "變數的值。" -#: ../../library/functions.rst:1046 +#: ../../library/functions.rst:1045 msgid "" "Return an iterator that applies *function* to every item of *iterable*, " "yielding the results. If additional *iterables* arguments are passed, " @@ -1832,13 +1831,13 @@ msgstr "" "iteratable 耗盡時 iterator 也會結束。如果函式的輸入已經是 tuple 的引數,請參" "閱 :func:`itertools.starmap`\\。" -#: ../../library/functions.rst:1058 +#: ../../library/functions.rst:1057 msgid "" "Return the largest item in an iterable or the largest of two or more " "arguments." msgstr "回傳 iterable 中最大的元素,或者回傳兩個及以上引數中最大的。" -#: ../../library/functions.rst:1061 +#: ../../library/functions.rst:1060 msgid "" "If one positional argument is provided, it should be an :term:`iterable`. " "The largest item in the iterable is returned. If two or more positional " @@ -1847,7 +1846,7 @@ msgstr "" "如果只提供了一個位置引數,它必須是個 :term:`iterable`,iterable 中最大的元素" "會被回傳。如果提供了兩個或以上的位置引數,則回傳最大的位置引數。" -#: ../../library/functions.rst:1066 ../../library/functions.rst:1104 +#: ../../library/functions.rst:1065 ../../library/functions.rst:1103 msgid "" "There are two optional keyword-only arguments. The *key* argument specifies " "a one-argument ordering function like that used for :meth:`list.sort`. The " @@ -1859,7 +1858,7 @@ msgstr "" "式,如同 :meth:`list.sort` 使用方式。*default* 引數是當 iterable 為空時回傳的" "值。如果 iterable 為空,並且沒有提供 *default*,則會觸發 :exc:`ValueError`。" -#: ../../library/functions.rst:1072 +#: ../../library/functions.rst:1071 msgid "" "If multiple items are maximal, the function returns the first one " "encountered. This is consistent with other sort-stability preserving tools " @@ -1870,15 +1869,16 @@ msgstr "" "``sorted(iterable, key=keyfunc, reverse=True)[0]`` 和 ``heapq.nlargest(1, " "iterable, key=keyfunc)`` 一致。" -#: ../../library/functions.rst:1077 ../../library/functions.rst:1115 -msgid "The *default* keyword-only argument." +#: ../../library/functions.rst:1076 ../../library/functions.rst:1114 +#, fuzzy +msgid "Added the *default* keyword-only parameter." msgstr "*default* 僅限關鍵字引數。" -#: ../../library/functions.rst:1080 ../../library/functions.rst:1118 +#: ../../library/functions.rst:1079 ../../library/functions.rst:1117 msgid "The *key* can be ``None``." msgstr "" -#: ../../library/functions.rst:1088 +#: ../../library/functions.rst:1087 msgid "" "Return a \"memory view\" object created from the given argument. See :ref:" "`typememoryview` for more information." @@ -1886,13 +1886,13 @@ msgstr "" "回傳由給定的引數建立之 \"memory view\" 物件。有關詳細資訊,請參閱 :ref:" "`typememoryview`。" -#: ../../library/functions.rst:1096 +#: ../../library/functions.rst:1095 msgid "" "Return the smallest item in an iterable or the smallest of two or more " "arguments." msgstr "回傳 iterable 中最小的元素,或者回傳兩個及以上引數中最小的。" -#: ../../library/functions.rst:1099 +#: ../../library/functions.rst:1098 msgid "" "If one positional argument is provided, it should be an :term:`iterable`. " "The smallest item in the iterable is returned. If two or more positional " @@ -1901,7 +1901,7 @@ msgstr "" "如果只提供了一個位置引數,它必須是 :term:`iterable`,iterable 中最小的元素會" "被回傳。如果提供了兩個或以上的位置引數,則回傳最小的位置引數。" -#: ../../library/functions.rst:1110 +#: ../../library/functions.rst:1109 msgid "" "If multiple items are minimal, the function returns the first one " "encountered. This is consistent with other sort-stability preserving tools " @@ -1912,7 +1912,7 @@ msgstr "" "``sorted(iterable, key=keyfunc)[0]`` 和 ``heapq.nsmallest(1, iterable, " "key=keyfunc)`` 一致。" -#: ../../library/functions.rst:1125 +#: ../../library/functions.rst:1124 msgid "" "Retrieve the next item from the :term:`iterator` by calling its :meth:" "`~iterator.__next__` method. If *default* is given, it is returned if the " @@ -1922,7 +1922,7 @@ msgstr "" "素。如果 iterator 耗盡,則回傳給定的預設值 *default*,如果沒有預設值則觸發 :" "exc:`StopIteration`。" -#: ../../library/functions.rst:1132 +#: ../../library/functions.rst:1131 msgid "" "Return a new featureless object. :class:`object` is a base for all classes. " "It has methods that are common to all instances of Python classes. This " @@ -1931,7 +1931,7 @@ msgstr "" "回傳一個沒有特徵的新物件。:class:`object` 是所有 class 的基礎,它具有所有 " "Python class 實例的通用 method。這個函式不接受任何引數。" -#: ../../library/functions.rst:1138 +#: ../../library/functions.rst:1137 msgid "" ":class:`object` does *not* have a :attr:`~object.__dict__`, so you can't " "assign arbitrary attributes to an instance of the :class:`object` class." @@ -1939,7 +1939,7 @@ msgstr "" "由於 :class:`object` *沒有* :attr:`~object.__dict__`,因此無法將任意屬性賦" "給 :class:`object` class 的實例。" -#: ../../library/functions.rst:1144 +#: ../../library/functions.rst:1143 msgid "" "Convert an integer number to an octal string prefixed with \"0o\". The " "result is a valid Python expression. If *x* is not a Python :class:`int` " @@ -1950,7 +1950,7 @@ msgstr "" "Python 運算式。如果 *x* 不是 Python 的 :class:`int` 物件,那它需要定義 :meth:" "`~object.__index__` method 回傳一個整數。舉例來說:" -#: ../../library/functions.rst:1154 +#: ../../library/functions.rst:1153 msgid "" "If you want to convert an integer number to an octal string either with the " "prefix \"0o\" or not, you can use either of the following ways." @@ -1958,7 +1958,7 @@ msgstr "" "如果要將整數轉換為八進位制字串,不論是否具備 \"0o\" 前綴,都可以使用下面的方" "法。" -#: ../../library/functions.rst:1171 +#: ../../library/functions.rst:1170 msgid "" "Open *file* and return a corresponding :term:`file object`. If the file " "cannot be opened, an :exc:`OSError` is raised. See :ref:`tut-files` for more " @@ -1967,7 +1967,7 @@ msgstr "" "開啟 *file* 並回傳對應的 :term:`file object`。如果該檔案不能開啟,則觸發 :" "exc:`OSError`。關於使用此函式的更多方法請參閱\\ :ref:`tut-files`。" -#: ../../library/functions.rst:1175 +#: ../../library/functions.rst:1174 msgid "" "*file* is a :term:`path-like object` giving the pathname (absolute or " "relative to the current working directory) of the file to be opened or an " @@ -1980,7 +1980,7 @@ msgstr "" "果有提供檔案描述器,它會隨著回傳的 I/O 物件關閉而關閉,除非 *closefd* 被設為 " "``False``。)" -#: ../../library/functions.rst:1181 +#: ../../library/functions.rst:1180 msgid "" "*mode* is an optional string that specifies the mode in which the file is " "opened. It defaults to ``'r'`` which means open for reading in text mode. " @@ -2001,71 +2001,71 @@ msgstr "" "getencoding()` 來獲取當前的本地編碼。(要讀取和寫入原始 bytes,請使用二進位制" "模式且不要指定 *encoding*。)可用的模式有:" -#: ../../library/functions.rst:1198 +#: ../../library/functions.rst:1197 msgid "Character" msgstr "字元" -#: ../../library/functions.rst:1198 +#: ../../library/functions.rst:1197 msgid "Meaning" msgstr "意義" -#: ../../library/functions.rst:1200 +#: ../../library/functions.rst:1199 msgid "``'r'``" msgstr "``'r'``" -#: ../../library/functions.rst:1200 +#: ../../library/functions.rst:1199 msgid "open for reading (default)" msgstr "讀取(預設)" -#: ../../library/functions.rst:1201 +#: ../../library/functions.rst:1200 msgid "``'w'``" msgstr "``'w'``" -#: ../../library/functions.rst:1201 +#: ../../library/functions.rst:1200 msgid "open for writing, truncating the file first" msgstr "" -#: ../../library/functions.rst:1202 +#: ../../library/functions.rst:1201 msgid "``'x'``" msgstr "``'x'``" -#: ../../library/functions.rst:1202 +#: ../../library/functions.rst:1201 msgid "open for exclusive creation, failing if the file already exists" msgstr "唯一性創建,如果文件已存在則會失敗" -#: ../../library/functions.rst:1203 +#: ../../library/functions.rst:1202 msgid "``'a'``" msgstr "``'a'``" -#: ../../library/functions.rst:1203 +#: ../../library/functions.rst:1202 msgid "open for writing, appending to the end of file if it exists" msgstr "寫入,如果文件存在則在末尾追加寫入內容" -#: ../../library/functions.rst:1204 +#: ../../library/functions.rst:1203 msgid "``'b'``" msgstr "``'b'``" -#: ../../library/functions.rst:1204 ../../library/functions.rst:1348 +#: ../../library/functions.rst:1203 ../../library/functions.rst:1347 msgid "binary mode" msgstr "binary mode(二進位模式)" -#: ../../library/functions.rst:1205 +#: ../../library/functions.rst:1204 msgid "``'t'``" msgstr "``'t'``" -#: ../../library/functions.rst:1205 +#: ../../library/functions.rst:1204 msgid "text mode (default)" msgstr "文字模式(預設)" -#: ../../library/functions.rst:1206 +#: ../../library/functions.rst:1205 msgid "``'+'``" msgstr "``'+'``" -#: ../../library/functions.rst:1206 +#: ../../library/functions.rst:1205 msgid "open for updating (reading and writing)" msgstr "更新(讀取並寫入)" -#: ../../library/functions.rst:1209 +#: ../../library/functions.rst:1208 msgid "" "The default mode is ``'r'`` (open for reading text, a synonym of ``'rt'``). " "Modes ``'w+'`` and ``'w+b'`` open and truncate the file. Modes ``'r+'`` and " @@ -2074,7 +2074,7 @@ msgstr "" "預設的模式是 ``'r'``\\ (開啟並讀取文字,同 ``'rt'``)。對於二進位制寫入," "``'w+b'`` 模式開啟並把檔案內容變成 0 bytes,``'r+b'`` 則不會捨棄原始內容。" -#: ../../library/functions.rst:1213 +#: ../../library/functions.rst:1212 msgid "" "As mentioned in the :ref:`io-overview`, Python distinguishes between binary " "and text I/O. Files opened in binary mode (including ``'b'`` in the *mode* " @@ -2085,14 +2085,14 @@ msgid "" "specified *encoding* if given." msgstr "" -#: ../../library/functions.rst:1223 +#: ../../library/functions.rst:1222 msgid "" "Python doesn't depend on the underlying operating system's notion of text " "files; all the processing is done by Python itself, and is therefore " "platform-independent." msgstr "" -#: ../../library/functions.rst:1227 +#: ../../library/functions.rst:1226 msgid "" "*buffering* is an optional integer used to set the buffering policy. Pass 0 " "to switch buffering off (only allowed in binary mode), 1 to select line " @@ -2105,7 +2105,7 @@ msgid "" "*buffering* argument is given, the default buffering policy works as follows:" msgstr "" -#: ../../library/functions.rst:1237 +#: ../../library/functions.rst:1236 msgid "" "Binary files are buffered in fixed-size chunks; the size of the buffer is " "chosen using a heuristic trying to determine the underlying device's \"block " @@ -2113,14 +2113,14 @@ msgid "" "systems, the buffer will typically be 4096 or 8192 bytes long." msgstr "" -#: ../../library/functions.rst:1242 +#: ../../library/functions.rst:1241 msgid "" "\"Interactive\" text files (files for which :meth:`~io.IOBase.isatty` " "returns ``True``) use line buffering. Other text files use the policy " "described above for binary files." msgstr "" -#: ../../library/functions.rst:1246 +#: ../../library/functions.rst:1245 msgid "" "*encoding* is the name of the encoding used to decode or encode the file. " "This should only be used in text mode. The default encoding is platform " @@ -2129,7 +2129,7 @@ msgid "" "the list of supported encodings." msgstr "" -#: ../../library/functions.rst:1252 +#: ../../library/functions.rst:1251 msgid "" "*errors* is an optional string that specifies how encoding and decoding " "errors are to be handled—this cannot be used in binary mode. A variety of " @@ -2138,25 +2138,25 @@ msgid "" "register_error` is also valid. The standard names include:" msgstr "" -#: ../../library/functions.rst:1260 +#: ../../library/functions.rst:1259 msgid "" "``'strict'`` to raise a :exc:`ValueError` exception if there is an encoding " "error. The default value of ``None`` has the same effect." msgstr "" -#: ../../library/functions.rst:1264 +#: ../../library/functions.rst:1263 msgid "" "``'ignore'`` ignores errors. Note that ignoring encoding errors can lead to " "data loss." msgstr "" -#: ../../library/functions.rst:1267 +#: ../../library/functions.rst:1266 msgid "" "``'replace'`` causes a replacement marker (such as ``'?'``) to be inserted " "where there is malformed data." msgstr "" -#: ../../library/functions.rst:1270 +#: ../../library/functions.rst:1269 msgid "" "``'surrogateescape'`` will represent any incorrect bytes as low surrogate " "code units ranging from U+DC80 to U+DCFF. These surrogate code units will " @@ -2165,33 +2165,33 @@ msgid "" "an unknown encoding." msgstr "" -#: ../../library/functions.rst:1277 +#: ../../library/functions.rst:1276 msgid "" "``'xmlcharrefreplace'`` is only supported when writing to a file. Characters " "not supported by the encoding are replaced with the appropriate XML " "character reference :samp:`&#{nnn};`." msgstr "" -#: ../../library/functions.rst:1281 +#: ../../library/functions.rst:1280 msgid "" "``'backslashreplace'`` replaces malformed data by Python's backslashed " "escape sequences." msgstr "" -#: ../../library/functions.rst:1284 +#: ../../library/functions.rst:1283 msgid "" "``'namereplace'`` (also only supported when writing) replaces unsupported " "characters with ``\\N{...}`` escape sequences." msgstr "" -#: ../../library/functions.rst:1292 +#: ../../library/functions.rst:1291 msgid "" "*newline* determines how to parse newline characters from the stream. It can " "be ``None``, ``''``, ``'\\n'``, ``'\\r'``, and ``'\\r\\n'``. It works as " "follows:" msgstr "" -#: ../../library/functions.rst:1296 +#: ../../library/functions.rst:1295 msgid "" "When reading input from the stream, if *newline* is ``None``, universal " "newlines mode is enabled. Lines in the input can end in ``'\\n'``, " @@ -2202,7 +2202,7 @@ msgid "" "given string, and the line ending is returned to the caller untranslated." msgstr "" -#: ../../library/functions.rst:1304 +#: ../../library/functions.rst:1303 msgid "" "When writing output to the stream, if *newline* is ``None``, any ``'\\n'`` " "characters written are translated to the system default line separator, :" @@ -2211,7 +2211,7 @@ msgid "" "characters written are translated to the given string." msgstr "" -#: ../../library/functions.rst:1310 +#: ../../library/functions.rst:1309 msgid "" "If *closefd* is ``False`` and a file descriptor rather than a filename was " "given, the underlying file descriptor will be kept open when the file is " @@ -2219,7 +2219,7 @@ msgid "" "otherwise, an error will be raised." msgstr "" -#: ../../library/functions.rst:1315 +#: ../../library/functions.rst:1314 msgid "" "A custom opener can be used by passing a callable as *opener*. The " "underlying file descriptor for the file object is then obtained by calling " @@ -2228,11 +2228,11 @@ msgid "" "similar to passing ``None``)." msgstr "" -#: ../../library/functions.rst:1321 +#: ../../library/functions.rst:1320 msgid "The newly created file is :ref:`non-inheritable `." msgstr "新建立的檔案是\\ :ref:`不可繼承的 `。" -#: ../../library/functions.rst:1323 +#: ../../library/functions.rst:1322 msgid "" "The following example uses the :ref:`dir_fd ` parameter of the :func:" "`os.open` function to open a file relative to a given directory::" @@ -2242,7 +2242,7 @@ msgstr "" "\n" "::" -#: ../../library/functions.rst:1336 +#: ../../library/functions.rst:1335 msgid "" "The type of :term:`file object` returned by the :func:`open` function " "depends on the mode. When :func:`open` is used to open a file in a text " @@ -2257,7 +2257,7 @@ msgid "" "FileIO`, is returned." msgstr "" -#: ../../library/functions.rst:1357 +#: ../../library/functions.rst:1356 msgid "" "See also the file handling modules, such as :mod:`fileinput`, :mod:`io` " "(where :func:`open` is declared), :mod:`os`, :mod:`os.path`, :mod:" @@ -2267,7 +2267,7 @@ msgstr "" "`open` 的 module )、:mod:`os`、:mod:`os.path`、:mod:`tempfile` 以及 :mod:" "`shutil`。" -#: ../../library/functions.rst:1361 +#: ../../library/functions.rst:1360 msgid "" "Raises an :ref:`auditing event ` ``open`` with arguments ``file``, " "``mode``, ``flags``." @@ -2275,25 +2275,25 @@ msgstr "" "引發一個附帶引數 ``file``、``model``、``flags`` 的\\ :ref:`稽核事件 " "` ``open``。" -#: ../../library/functions.rst:1363 +#: ../../library/functions.rst:1362 msgid "" "The ``mode`` and ``flags`` arguments may have been modified or inferred from " "the original call." msgstr "" -#: ../../library/functions.rst:1368 +#: ../../library/functions.rst:1367 msgid "The *opener* parameter was added." msgstr "增加了 *opener* 參數。" -#: ../../library/functions.rst:1369 +#: ../../library/functions.rst:1368 msgid "The ``'x'`` mode was added." msgstr "增加了 ``'x'`` 模式。" -#: ../../library/functions.rst:1370 +#: ../../library/functions.rst:1369 msgid ":exc:`IOError` used to be raised, it is now an alias of :exc:`OSError`." msgstr "過去觸發的 :exc:`IOError`,現在是 :exc:`OSError` 的別名。" -#: ../../library/functions.rst:1371 +#: ../../library/functions.rst:1370 msgid "" ":exc:`FileExistsError` is now raised if the file opened in exclusive " "creation mode (``'x'``) already exists." @@ -2301,11 +2301,11 @@ msgstr "" "如果檔案已存在但使用了唯一性建立模式 (\\ ``'x'``\\ ),現在會觸發 :exc:" "`FileExistsError`。" -#: ../../library/functions.rst:1376 +#: ../../library/functions.rst:1375 msgid "The file is now non-inheritable." msgstr "檔案在當前版本開始禁止繼承。" -#: ../../library/functions.rst:1380 +#: ../../library/functions.rst:1379 msgid "" "If the system call is interrupted and the signal handler does not raise an " "exception, the function now retries the system call instead of raising an :" @@ -2314,15 +2314,15 @@ msgstr "" "如果系統呼叫被中斷,但訊號處理程序沒有觸發例外,此函式現在會重試系統呼叫,而" "不是觸發 :exc:`InterruptedError`\\ (原因詳見 :pep:`475`)。" -#: ../../library/functions.rst:1383 +#: ../../library/functions.rst:1382 msgid "The ``'namereplace'`` error handler was added." msgstr "增加了 ``'namereplace'`` 錯誤處理程式。" -#: ../../library/functions.rst:1387 +#: ../../library/functions.rst:1386 msgid "Support added to accept objects implementing :class:`os.PathLike`." msgstr "增加對實現了 :class:`os.PathLike` 物件的支援。" -#: ../../library/functions.rst:1388 +#: ../../library/functions.rst:1387 msgid "" "On Windows, opening a console buffer may return a subclass of :class:`io." "RawIOBase` other than :class:`io.FileIO`." @@ -2330,11 +2330,11 @@ msgstr "" "在 Windows 上,開啟一個控制臺緩衝區可能會回傳 :class:`io.RawIOBase` 的 " "subclass,而不是 :class:`io.FileIO`。" -#: ../../library/functions.rst:1391 +#: ../../library/functions.rst:1390 msgid "The ``'U'`` mode has been removed." msgstr "``'U'`` 模式被移除。" -#: ../../library/functions.rst:1396 +#: ../../library/functions.rst:1395 msgid "" "Given a string representing one Unicode character, return an integer " "representing the Unicode code point of that character. For example, " @@ -2345,7 +2345,7 @@ msgstr "" "``ord('a')`` 回傳整數 ``97``、\\ ``ord('€')``\\ (歐元符號)回傳 ``8364``。這" "是 :func:`chr` 的逆函式。" -#: ../../library/functions.rst:1404 +#: ../../library/functions.rst:1403 msgid "" "Return *base* to the power *exp*; if *mod* is present, return *base* to the " "power *exp*, modulo *mod* (computed more efficiently than ``pow(base, exp) % " @@ -2356,7 +2356,7 @@ msgstr "" "*mod* 取餘數(比直接呼叫 ``pow(base, exp) % mod`` 計算更高效)。兩個引數形式" "的 ``pow(exp, exp)`` 等價於次方運算子:``base**exp``。" -#: ../../library/functions.rst:1409 +#: ../../library/functions.rst:1408 msgid "" "The arguments must have numeric types. With mixed operand types, the " "coercion rules for binary arithmetic operators apply. For :class:`int` " @@ -2369,7 +2369,7 @@ msgid "" "close to ``3j``." msgstr "" -#: ../../library/functions.rst:1419 +#: ../../library/functions.rst:1418 msgid "" "For :class:`int` operands *base* and *exp*, if *mod* is present, *mod* must " "also be of integer type and *mod* must be nonzero. If *mod* is present and " @@ -2378,29 +2378,29 @@ msgid "" "*base* modulo *mod*." msgstr "" -#: ../../library/functions.rst:1425 +#: ../../library/functions.rst:1424 msgid "Here's an example of computing an inverse for ``38`` modulo ``97``::" msgstr "" -#: ../../library/functions.rst:1432 +#: ../../library/functions.rst:1431 msgid "" "For :class:`int` operands, the three-argument form of ``pow`` now allows the " "second argument to be negative, permitting computation of modular inverses." msgstr "" -#: ../../library/functions.rst:1437 +#: ../../library/functions.rst:1436 msgid "" "Allow keyword arguments. Formerly, only positional arguments were supported." msgstr "" -#: ../../library/functions.rst:1444 +#: ../../library/functions.rst:1443 msgid "" "Print *objects* to the text stream *file*, separated by *sep* and followed " "by *end*. *sep*, *end*, *file*, and *flush*, if present, must be given as " "keyword arguments." msgstr "" -#: ../../library/functions.rst:1448 +#: ../../library/functions.rst:1447 msgid "" "All non-keyword arguments are converted to strings like :func:`str` does and " "written to the stream, separated by *sep* and followed by *end*. Both *sep* " @@ -2409,7 +2409,7 @@ msgid "" "*end*." msgstr "" -#: ../../library/functions.rst:1454 +#: ../../library/functions.rst:1453 msgid "" "The *file* argument must be an object with a ``write(string)`` method; if it " "is not present or ``None``, :data:`sys.stdout` will be used. Since printed " @@ -2417,38 +2417,38 @@ msgid "" "binary mode file objects. For these, use ``file.write(...)`` instead." msgstr "" -#: ../../library/functions.rst:1459 +#: ../../library/functions.rst:1458 msgid "" "Output buffering is usually determined by *file*. However, if *flush* is " "true, the stream is forcibly flushed." msgstr "" -#: ../../library/functions.rst:1463 +#: ../../library/functions.rst:1462 msgid "Added the *flush* keyword argument." msgstr "增加了 *flush* 關鍵字引數。" -#: ../../library/functions.rst:1469 +#: ../../library/functions.rst:1468 msgid "Return a property attribute." msgstr "回傳 property 屬性。" -#: ../../library/functions.rst:1471 +#: ../../library/functions.rst:1470 msgid "" "*fget* is a function for getting an attribute value. *fset* is a function " "for setting an attribute value. *fdel* is a function for deleting an " "attribute value. And *doc* creates a docstring for the attribute." msgstr "" -#: ../../library/functions.rst:1475 +#: ../../library/functions.rst:1474 msgid "A typical use is to define a managed attribute ``x``::" msgstr "" -#: ../../library/functions.rst:1492 +#: ../../library/functions.rst:1491 msgid "" "If *c* is an instance of *C*, ``c.x`` will invoke the getter, ``c.x = " "value`` will invoke the setter, and ``del c.x`` the deleter." msgstr "" -#: ../../library/functions.rst:1495 +#: ../../library/functions.rst:1494 msgid "" "If given, *doc* will be the docstring of the property attribute. Otherwise, " "the property will copy *fget*'s docstring (if it exists). This makes it " @@ -2456,14 +2456,14 @@ msgid "" "term:`decorator`::" msgstr "" -#: ../../library/functions.rst:1508 +#: ../../library/functions.rst:1507 msgid "" "The ``@property`` decorator turns the :meth:`!voltage` method into a " "\"getter\" for a read-only attribute with the same name, and it sets the " "docstring for *voltage* to \"Get the current voltage.\"" msgstr "" -#: ../../library/functions.rst:1516 +#: ../../library/functions.rst:1515 msgid "" "A property object has ``getter``, ``setter``, and ``deleter`` methods usable " "as decorators that create a copy of the property with the corresponding " @@ -2471,30 +2471,30 @@ msgid "" "with an example:" msgstr "" -#: ../../library/functions.rst:1540 +#: ../../library/functions.rst:1539 msgid "" "This code is exactly equivalent to the first example. Be sure to give the " "additional functions the same name as the original property (``x`` in this " "case.)" msgstr "" -#: ../../library/functions.rst:1544 +#: ../../library/functions.rst:1543 msgid "" "The returned property object also has the attributes ``fget``, ``fset``, and " "``fdel`` corresponding to the constructor arguments." msgstr "" -#: ../../library/functions.rst:1547 +#: ../../library/functions.rst:1546 msgid "The docstrings of property objects are now writeable." msgstr "" -#: ../../library/functions.rst:1556 +#: ../../library/functions.rst:1555 msgid "" "Rather than being a function, :class:`range` is actually an immutable " "sequence type, as documented in :ref:`typesseq-range` and :ref:`typesseq`." msgstr "" -#: ../../library/functions.rst:1562 +#: ../../library/functions.rst:1561 msgid "" "Return a string containing a printable representation of an object. For " "many types, this function makes an attempt to return a string that would " @@ -2507,7 +2507,7 @@ msgid "" "raise :exc:`RuntimeError`." msgstr "" -#: ../../library/functions.rst:1576 +#: ../../library/functions.rst:1575 msgid "" "Return a reverse :term:`iterator`. *seq* must be an object which has a :" "meth:`~object.__reversed__` method or supports the sequence protocol (the :" @@ -2515,14 +2515,14 @@ msgid "" "with integer arguments starting at ``0``)." msgstr "" -#: ../../library/functions.rst:1584 +#: ../../library/functions.rst:1583 msgid "" "Return *number* rounded to *ndigits* precision after the decimal point. If " "*ndigits* is omitted or is ``None``, it returns the nearest integer to its " "input." msgstr "" -#: ../../library/functions.rst:1588 +#: ../../library/functions.rst:1587 msgid "" "For the built-in types supporting :func:`round`, values are rounded to the " "closest multiple of 10 to the power minus *ndigits*; if two multiples are " @@ -2533,13 +2533,13 @@ msgid "" "``None``. Otherwise, the return value has the same type as *number*." msgstr "" -#: ../../library/functions.rst:1597 +#: ../../library/functions.rst:1596 msgid "" "For a general Python object ``number``, ``round`` delegates to ``number." "__round__``." msgstr "" -#: ../../library/functions.rst:1602 +#: ../../library/functions.rst:1601 msgid "" "The behavior of :func:`round` for floats can be surprising: for example, " "``round(2.675, 2)`` gives ``2.67`` instead of the expected ``2.68``. This is " @@ -2548,21 +2548,21 @@ msgid "" "information." msgstr "" -#: ../../library/functions.rst:1614 +#: ../../library/functions.rst:1613 msgid "" "Return a new :class:`set` object, optionally with elements taken from " "*iterable*. ``set`` is a built-in class. See :class:`set` and :ref:`types-" "set` for documentation about this class." msgstr "" -#: ../../library/functions.rst:1618 +#: ../../library/functions.rst:1617 msgid "" "For other containers see the built-in :class:`frozenset`, :class:`list`, :" "class:`tuple`, and :class:`dict` classes, as well as the :mod:`collections` " "module." msgstr "" -#: ../../library/functions.rst:1625 +#: ../../library/functions.rst:1624 msgid "" "This is the counterpart of :func:`getattr`. The arguments are an object, a " "string, and an arbitrary value. The string may name an existing attribute " @@ -2571,7 +2571,7 @@ msgid "" "is equivalent to ``x.foobar = 123``." msgstr "" -#: ../../library/functions.rst:1631 +#: ../../library/functions.rst:1630 msgid "" "*name* need not be a Python identifier as defined in :ref:`identifiers` " "unless the object chooses to enforce that, for example in a custom :meth:" @@ -2580,21 +2580,21 @@ msgid "" "notation, but is accessible through :func:`getattr` etc.." msgstr "" -#: ../../library/functions.rst:1639 +#: ../../library/functions.rst:1638 msgid "" "Since :ref:`private name mangling ` happens at " "compilation time, one must manually mangle a private attribute's (attributes " "with two leading underscores) name in order to set it with :func:`setattr`." msgstr "" -#: ../../library/functions.rst:1648 +#: ../../library/functions.rst:1647 msgid "" "Return a :term:`slice` object representing the set of indices specified by " "``range(start, stop, step)``. The *start* and *step* arguments default to " "``None``." msgstr "" -#: ../../library/functions.rst:1656 +#: ../../library/functions.rst:1655 msgid "" "Slice objects have read-only data attributes :attr:`!start`, :attr:`!stop`, " "and :attr:`!step` which merely return the argument values (or their " @@ -2602,48 +2602,48 @@ msgid "" "by NumPy and other third-party packages." msgstr "" -#: ../../library/functions.rst:1661 +#: ../../library/functions.rst:1660 msgid "" "Slice objects are also generated when extended indexing syntax is used. For " "example: ``a[start:stop:step]`` or ``a[start:stop, i]``. See :func:" "`itertools.islice` for an alternate version that returns an :term:`iterator`." msgstr "" -#: ../../library/functions.rst:1666 +#: ../../library/functions.rst:1665 msgid "" "Slice objects are now :term:`hashable` (provided :attr:`~slice.start`, :attr:" "`~slice.stop`, and :attr:`~slice.step` are hashable)." msgstr "" -#: ../../library/functions.rst:1672 +#: ../../library/functions.rst:1671 msgid "Return a new sorted list from the items in *iterable*." msgstr "" -#: ../../library/functions.rst:1674 +#: ../../library/functions.rst:1673 msgid "" "Has two optional arguments which must be specified as keyword arguments." msgstr "有兩個選擇性引數,只能使用關鍵字引數來指定。" -#: ../../library/functions.rst:1676 +#: ../../library/functions.rst:1675 msgid "" "*key* specifies a function of one argument that is used to extract a " "comparison key from each element in *iterable* (for example, ``key=str." "lower``). The default value is ``None`` (compare the elements directly)." msgstr "" -#: ../../library/functions.rst:1680 +#: ../../library/functions.rst:1679 msgid "" "*reverse* is a boolean value. If set to ``True``, then the list elements " "are sorted as if each comparison were reversed." msgstr "" -#: ../../library/functions.rst:1683 +#: ../../library/functions.rst:1682 msgid "" "Use :func:`functools.cmp_to_key` to convert an old-style *cmp* function to a " "*key* function." msgstr "" -#: ../../library/functions.rst:1686 +#: ../../library/functions.rst:1685 msgid "" "The built-in :func:`sorted` function is guaranteed to be stable. A sort is " "stable if it guarantees not to change the relative order of elements that " @@ -2651,7 +2651,7 @@ msgid "" "example, sort by department, then by salary grade)." msgstr "" -#: ../../library/functions.rst:1691 +#: ../../library/functions.rst:1690 msgid "" "The sort algorithm uses only ``<`` comparisons between items. While " "defining an :meth:`~object.__lt__` method will suffice for sorting, :PEP:`8` " @@ -2663,22 +2663,22 @@ msgid "" "method." msgstr "" -#: ../../library/functions.rst:1700 +#: ../../library/functions.rst:1699 msgid "" "For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`." msgstr "" -#: ../../library/functions.rst:1704 +#: ../../library/functions.rst:1703 msgid "Transform a method into a static method." msgstr "" -#: ../../library/functions.rst:1706 +#: ../../library/functions.rst:1705 msgid "" "A static method does not receive an implicit first argument. To declare a " "static method, use this idiom::" msgstr "" -#: ../../library/functions.rst:1713 +#: ../../library/functions.rst:1712 msgid "" "The ``@staticmethod`` form is a function :term:`decorator` -- see :ref:" "`function` for details." @@ -2686,21 +2686,21 @@ msgstr "" "``@staticmethod`` 語法是一個函式 :term:`decorator` - 參見 :ref:`function` 中" "的詳細介紹。" -#: ../../library/functions.rst:1716 +#: ../../library/functions.rst:1715 msgid "" "A static method can be called either on the class (such as ``C.f()``) or on " "an instance (such as ``C().f()``). Moreover, they can be called as regular " "functions (such as ``f()``)." msgstr "" -#: ../../library/functions.rst:1720 +#: ../../library/functions.rst:1719 msgid "" "Static methods in Python are similar to those found in Java or C++. Also, " "see :func:`classmethod` for a variant that is useful for creating alternate " "class constructors." msgstr "" -#: ../../library/functions.rst:1724 +#: ../../library/functions.rst:1723 msgid "" "Like all decorators, it is also possible to call ``staticmethod`` as a " "regular function and do something with its result. This is needed in some " @@ -2709,36 +2709,36 @@ msgid "" "cases, use this idiom::" msgstr "" -#: ../../library/functions.rst:1736 +#: ../../library/functions.rst:1735 msgid "For more information on static methods, see :ref:`types`." msgstr "關於 static method 的更多資訊,請參考 :ref:`types`。" -#: ../../library/functions.rst:1738 +#: ../../library/functions.rst:1737 msgid "" "Static methods now inherit the method attributes (``__module__``, " "``__name__``, ``__qualname__``, ``__doc__`` and ``__annotations__``), have a " "new ``__wrapped__`` attribute, and are now callable as regular functions." msgstr "" -#: ../../library/functions.rst:1753 +#: ../../library/functions.rst:1752 msgid "" "Return a :class:`str` version of *object*. See :func:`str` for details." msgstr "" -#: ../../library/functions.rst:1755 +#: ../../library/functions.rst:1754 msgid "" "``str`` is the built-in string :term:`class`. For general information about " "strings, see :ref:`textseq`." msgstr "" -#: ../../library/functions.rst:1761 +#: ../../library/functions.rst:1760 msgid "" "Sums *start* and the items of an *iterable* from left to right and returns " "the total. The *iterable*'s items are normally numbers, and the start value " "is not allowed to be a string." msgstr "" -#: ../../library/functions.rst:1765 +#: ../../library/functions.rst:1764 msgid "" "For some use cases, there are good alternatives to :func:`sum`. The " "preferred, fast way to concatenate a sequence of strings is by calling ``''." @@ -2747,37 +2747,37 @@ msgid "" "using :func:`itertools.chain`." msgstr "" -#: ../../library/functions.rst:1771 +#: ../../library/functions.rst:1770 msgid "The *start* parameter can be specified as a keyword argument." msgstr "*start* 參數可被指定為關鍵字引數。" -#: ../../library/functions.rst:1774 +#: ../../library/functions.rst:1773 msgid "" "Summation of floats switched to an algorithm that gives higher accuracy on " "most builds." msgstr "" -#: ../../library/functions.rst:1781 +#: ../../library/functions.rst:1780 msgid "" "Return a proxy object that delegates method calls to a parent or sibling " "class of *type*. This is useful for accessing inherited methods that have " "been overridden in a class." msgstr "" -#: ../../library/functions.rst:1785 +#: ../../library/functions.rst:1784 msgid "" "The *object_or_type* determines the :term:`method resolution order` to be " "searched. The search starts from the class right after the *type*." msgstr "" -#: ../../library/functions.rst:1789 +#: ../../library/functions.rst:1788 msgid "" "For example, if :attr:`~class.__mro__` of *object_or_type* is ``D -> B -> C -" "> A -> object`` and the value of *type* is ``B``, then :func:`super` " "searches ``C -> A -> object``." msgstr "" -#: ../../library/functions.rst:1793 +#: ../../library/functions.rst:1792 msgid "" "The :attr:`~class.__mro__` attribute of the *object_or_type* lists the " "method resolution search order used by both :func:`getattr` and :func:" @@ -2785,7 +2785,7 @@ msgid "" "hierarchy is updated." msgstr "" -#: ../../library/functions.rst:1798 +#: ../../library/functions.rst:1797 msgid "" "If the second argument is omitted, the super object returned is unbound. If " "the second argument is an object, ``isinstance(obj, type)`` must be true. " @@ -2793,7 +2793,7 @@ msgid "" "(this is useful for classmethods)." msgstr "" -#: ../../library/functions.rst:1803 +#: ../../library/functions.rst:1802 msgid "" "There are two typical use cases for *super*. In a class hierarchy with " "single inheritance, *super* can be used to refer to parent classes without " @@ -2801,7 +2801,7 @@ msgid "" "closely parallels the use of *super* in other programming languages." msgstr "" -#: ../../library/functions.rst:1808 +#: ../../library/functions.rst:1807 msgid "" "The second use case is to support cooperative multiple inheritance in a " "dynamic execution environment. This use case is unique to Python and is not " @@ -2814,18 +2814,18 @@ msgid "" "classes that are unknown prior to runtime)." msgstr "" -#: ../../library/functions.rst:1818 +#: ../../library/functions.rst:1817 msgid "For both use cases, a typical superclass call looks like this::" msgstr "" -#: ../../library/functions.rst:1825 +#: ../../library/functions.rst:1824 msgid "" "In addition to method lookups, :func:`super` also works for attribute " "lookups. One possible use case for this is calling :term:`descriptors " "` in a parent or sibling class." msgstr "" -#: ../../library/functions.rst:1829 +#: ../../library/functions.rst:1828 msgid "" "Note that :func:`super` is implemented as part of the binding process for " "explicit dotted attribute lookups such as ``super().__getitem__(name)``. It " @@ -2835,7 +2835,7 @@ msgid "" "using statements or operators such as ``super()[name]``." msgstr "" -#: ../../library/functions.rst:1837 +#: ../../library/functions.rst:1836 msgid "" "Also note that, aside from the zero argument form, :func:`super` is not " "limited to use inside methods. The two argument form specifies the " @@ -2845,33 +2845,33 @@ msgid "" "accessing the current instance for ordinary methods." msgstr "" -#: ../../library/functions.rst:1844 +#: ../../library/functions.rst:1843 msgid "" "For practical suggestions on how to design cooperative classes using :func:" "`super`, see `guide to using super() `_." msgstr "" -#: ../../library/functions.rst:1854 +#: ../../library/functions.rst:1853 msgid "" "Rather than being a function, :class:`tuple` is actually an immutable " "sequence type, as documented in :ref:`typesseq-tuple` and :ref:`typesseq`." msgstr "" -#: ../../library/functions.rst:1863 +#: ../../library/functions.rst:1862 msgid "" "With one argument, return the type of an *object*. The return value is a " "type object and generally the same object as returned by :attr:`object." "__class__ `." msgstr "" -#: ../../library/functions.rst:1867 +#: ../../library/functions.rst:1866 msgid "" "The :func:`isinstance` built-in function is recommended for testing the type " "of an object, because it takes subclasses into account." msgstr "" -#: ../../library/functions.rst:1871 +#: ../../library/functions.rst:1870 msgid "" "With three arguments, return a new type object. This is essentially a " "dynamic form of the :keyword:`class` statement. The *name* string is the " @@ -2884,11 +2884,11 @@ msgid "" "identical :class:`type` objects:" msgstr "" -#: ../../library/functions.rst:1886 +#: ../../library/functions.rst:1885 msgid "See also :ref:`bltin-type-objects`." msgstr "另請參閱 :ref:`bltin-type-objects`。" -#: ../../library/functions.rst:1888 +#: ../../library/functions.rst:1887 msgid "" "Keyword arguments provided to the three argument form are passed to the " "appropriate metaclass machinery (usually :meth:`~object.__init_subclass__`) " @@ -2896,23 +2896,23 @@ msgid "" "would." msgstr "" -#: ../../library/functions.rst:1893 +#: ../../library/functions.rst:1892 msgid "See also :ref:`class-customization`." msgstr "另請參閱 :ref:`class-customization`。" -#: ../../library/functions.rst:1895 +#: ../../library/functions.rst:1894 msgid "" "Subclasses of :class:`type` which don't override ``type.__new__`` may no " "longer use the one-argument form to get the type of an object." msgstr "" -#: ../../library/functions.rst:1902 +#: ../../library/functions.rst:1901 msgid "" "Return the :attr:`~object.__dict__` attribute for a module, class, instance, " "or any other object with a :attr:`~object.__dict__` attribute." msgstr "" -#: ../../library/functions.rst:1905 +#: ../../library/functions.rst:1904 msgid "" "Objects such as modules and instances have an updateable :attr:`~object." "__dict__` attribute; however, other objects may have write restrictions on " @@ -2920,54 +2920,54 @@ msgid "" "`types.MappingProxyType` to prevent direct dictionary updates)." msgstr "" -#: ../../library/functions.rst:1910 +#: ../../library/functions.rst:1909 msgid "" "Without an argument, :func:`vars` acts like :func:`locals`. Note, the " "locals dictionary is only useful for reads since updates to the locals " "dictionary are ignored." msgstr "" -#: ../../library/functions.rst:1914 +#: ../../library/functions.rst:1913 msgid "" "A :exc:`TypeError` exception is raised if an object is specified but it " "doesn't have a :attr:`~object.__dict__` attribute (for example, if its class " "defines the :attr:`~object.__slots__` attribute)." msgstr "" -#: ../../library/functions.rst:1920 +#: ../../library/functions.rst:1919 msgid "" "Iterate over several iterables in parallel, producing tuples with an item " "from each one." msgstr "" -#: ../../library/functions.rst:1923 +#: ../../library/functions.rst:1922 msgid "Example::" msgstr "" "例如:\n" "\n" "::" -#: ../../library/functions.rst:1932 +#: ../../library/functions.rst:1931 msgid "" "More formally: :func:`zip` returns an iterator of tuples, where the *i*-th " "tuple contains the *i*-th element from each of the argument iterables." msgstr "" -#: ../../library/functions.rst:1935 +#: ../../library/functions.rst:1934 msgid "" "Another way to think of :func:`zip` is that it turns rows into columns, and " "columns into rows. This is similar to `transposing a matrix `_." msgstr "" -#: ../../library/functions.rst:1939 +#: ../../library/functions.rst:1938 msgid "" ":func:`zip` is lazy: The elements won't be processed until the iterable is " "iterated on, e.g. by a :keyword:`!for` loop or by wrapping in a :class:" "`list`." msgstr "" -#: ../../library/functions.rst:1943 +#: ../../library/functions.rst:1942 msgid "" "One thing to consider is that the iterables passed to :func:`zip` could have " "different lengths; sometimes by design, and sometimes because of a bug in " @@ -2975,51 +2975,51 @@ msgid "" "approaches to dealing with this issue:" msgstr "" -#: ../../library/functions.rst:1948 +#: ../../library/functions.rst:1947 msgid "" "By default, :func:`zip` stops when the shortest iterable is exhausted. It " "will ignore the remaining items in the longer iterables, cutting off the " "result to the length of the shortest iterable::" msgstr "" -#: ../../library/functions.rst:1955 +#: ../../library/functions.rst:1954 msgid "" ":func:`zip` is often used in cases where the iterables are assumed to be of " "equal length. In such cases, it's recommended to use the ``strict=True`` " "option. Its output is the same as regular :func:`zip`::" msgstr "" -#: ../../library/functions.rst:1962 +#: ../../library/functions.rst:1961 msgid "" "Unlike the default behavior, it raises a :exc:`ValueError` if one iterable " "is exhausted before the others:" msgstr "" -#: ../../library/functions.rst:1980 +#: ../../library/functions.rst:1979 msgid "" "Without the ``strict=True`` argument, any bug that results in iterables of " "different lengths will be silenced, possibly manifesting as a hard-to-find " "bug in another part of the program." msgstr "" -#: ../../library/functions.rst:1984 +#: ../../library/functions.rst:1983 msgid "" "Shorter iterables can be padded with a constant value to make all the " "iterables have the same length. This is done by :func:`itertools." "zip_longest`." msgstr "" -#: ../../library/functions.rst:1988 +#: ../../library/functions.rst:1987 msgid "" "Edge cases: With a single iterable argument, :func:`zip` returns an iterator " "of 1-tuples. With no arguments, it returns an empty iterator." msgstr "" -#: ../../library/functions.rst:1991 +#: ../../library/functions.rst:1990 msgid "Tips and tricks:" msgstr "" -#: ../../library/functions.rst:1993 +#: ../../library/functions.rst:1992 msgid "" "The left-to-right evaluation order of the iterables is guaranteed. This " "makes possible an idiom for clustering a data series into n-length groups " @@ -3028,23 +3028,23 @@ msgid "" "iterator. This has the effect of dividing the input into n-length chunks." msgstr "" -#: ../../library/functions.rst:1999 +#: ../../library/functions.rst:1998 msgid "" ":func:`zip` in conjunction with the ``*`` operator can be used to unzip a " "list::" msgstr "" -#: ../../library/functions.rst:2010 +#: ../../library/functions.rst:2009 msgid "Added the ``strict`` argument." msgstr "增加了 ``strict`` 引數。" -#: ../../library/functions.rst:2022 +#: ../../library/functions.rst:2021 msgid "" "This is an advanced function that is not needed in everyday Python " "programming, unlike :func:`importlib.import_module`." msgstr "" -#: ../../library/functions.rst:2025 +#: ../../library/functions.rst:2024 msgid "" "This function is invoked by the :keyword:`import` statement. It can be " "replaced (by importing the :mod:`builtins` module and assigning to " @@ -3056,7 +3056,7 @@ msgid "" "discouraged in favor of :func:`importlib.import_module`." msgstr "" -#: ../../library/functions.rst:2034 +#: ../../library/functions.rst:2033 msgid "" "The function imports the module *name*, potentially using the given " "*globals* and *locals* to determine how to interpret the name in a package " @@ -3066,7 +3066,7 @@ msgid "" "determine the package context of the :keyword:`import` statement." msgstr "" -#: ../../library/functions.rst:2041 +#: ../../library/functions.rst:2040 msgid "" "*level* specifies whether to use absolute or relative imports. ``0`` (the " "default) means only perform absolute imports. Positive values for *level* " @@ -3075,7 +3075,7 @@ msgid "" "details)." msgstr "" -#: ../../library/functions.rst:2047 +#: ../../library/functions.rst:2046 msgid "" "When the *name* variable is of the form ``package.module``, normally, the " "top-level package (the name up till the first dot) is returned, *not* the " @@ -3083,58 +3083,58 @@ msgid "" "given, the module named by *name* is returned." msgstr "" -#: ../../library/functions.rst:2052 +#: ../../library/functions.rst:2051 msgid "" "For example, the statement ``import spam`` results in bytecode resembling " "the following code::" msgstr "" -#: ../../library/functions.rst:2057 +#: ../../library/functions.rst:2056 msgid "The statement ``import spam.ham`` results in this call::" msgstr "" -#: ../../library/functions.rst:2061 +#: ../../library/functions.rst:2060 msgid "" "Note how :func:`__import__` returns the toplevel module here because this is " "the object that is bound to a name by the :keyword:`import` statement." msgstr "" -#: ../../library/functions.rst:2064 +#: ../../library/functions.rst:2063 msgid "" "On the other hand, the statement ``from spam.ham import eggs, sausage as " "saus`` results in ::" msgstr "" -#: ../../library/functions.rst:2071 +#: ../../library/functions.rst:2070 msgid "" "Here, the ``spam.ham`` module is returned from :func:`__import__`. From " "this object, the names to import are retrieved and assigned to their " "respective names." msgstr "" -#: ../../library/functions.rst:2075 +#: ../../library/functions.rst:2074 msgid "" "If you simply want to import a module (potentially within a package) by " "name, use :func:`importlib.import_module`." msgstr "" -#: ../../library/functions.rst:2078 +#: ../../library/functions.rst:2077 msgid "" "Negative values for *level* are no longer supported (which also changes the " "default value to 0)." msgstr "" -#: ../../library/functions.rst:2082 +#: ../../library/functions.rst:2081 msgid "" "When the command line options :option:`-E` or :option:`-I` are being used, " "the environment variable :envvar:`PYTHONCASEOK` is now ignored." msgstr "" -#: ../../library/functions.rst:2087 +#: ../../library/functions.rst:2086 msgid "Footnotes" msgstr "註解" -#: ../../library/functions.rst:2088 +#: ../../library/functions.rst:2087 msgid "" "Note that the parser only accepts the Unix-style end of line convention. If " "you are reading the code from a file, make sure to use newline conversion " @@ -3147,7 +3147,7 @@ msgstr "" msgid "Boolean" msgstr "Boolean(布林值)" -#: ../../library/functions.rst:153 ../../library/functions.rst:1861 +#: ../../library/functions.rst:153 ../../library/functions.rst:1860 msgid "type" msgstr "type(型別)" @@ -3167,86 +3167,86 @@ msgstr "NaN" msgid "Infinity" msgstr "Infinity(無窮)" -#: ../../library/functions.rst:718 +#: ../../library/functions.rst:717 msgid "__format__" msgstr "__format__" -#: ../../library/functions.rst:718 ../../library/functions.rst:1745 +#: ../../library/functions.rst:717 ../../library/functions.rst:1744 msgid "string" msgstr "string(字串)" -#: ../../library/functions.rst:718 +#: ../../library/functions.rst:717 msgid "format() (built-in function)" msgstr "format()(內建函式)" -#: ../../library/functions.rst:1166 +#: ../../library/functions.rst:1165 msgid "file object" msgstr "file object(檔案物件)" -#: ../../library/functions.rst:1166 ../../library/functions.rst:1287 +#: ../../library/functions.rst:1165 ../../library/functions.rst:1286 msgid "open() built-in function" msgstr "open() 內建函式" -#: ../../library/functions.rst:1194 +#: ../../library/functions.rst:1193 msgid "file" msgstr "file(檔案)" -#: ../../library/functions.rst:1194 +#: ../../library/functions.rst:1193 msgid "modes" msgstr "modes(模式)" -#: ../../library/functions.rst:1287 +#: ../../library/functions.rst:1286 msgid "universal newlines" msgstr "universal newlines" -#: ../../library/functions.rst:1348 +#: ../../library/functions.rst:1347 msgid "line-buffered I/O" msgstr "line-buffered I/O(列緩衝 I/O)" -#: ../../library/functions.rst:1348 +#: ../../library/functions.rst:1347 msgid "unbuffered I/O" msgstr "unbuffered I/O(非緩衝 I/O)" -#: ../../library/functions.rst:1348 +#: ../../library/functions.rst:1347 msgid "buffer size, I/O" msgstr "buffer size, I/O(緩衝區大小、I/O)" -#: ../../library/functions.rst:1348 +#: ../../library/functions.rst:1347 msgid "I/O control" msgstr "I/O control(I/O 控制)" -#: ../../library/functions.rst:1348 +#: ../../library/functions.rst:1347 msgid "buffering" msgstr "buffering(緩衝)" -#: ../../library/functions.rst:1348 +#: ../../library/functions.rst:1347 msgid "text mode" msgstr "text mode(文字模式)" -#: ../../library/functions.rst:1348 ../../library/functions.rst:2016 +#: ../../library/functions.rst:1347 ../../library/functions.rst:2015 msgid "module" msgstr "module(模組)" -#: ../../library/functions.rst:1348 +#: ../../library/functions.rst:1347 msgid "sys" msgstr "sys" -#: ../../library/functions.rst:1745 +#: ../../library/functions.rst:1744 msgid "str() (built-in function)" msgstr "str() (內建函式)" -#: ../../library/functions.rst:1861 +#: ../../library/functions.rst:1860 msgid "object" msgstr "object(物件)" -#: ../../library/functions.rst:2016 +#: ../../library/functions.rst:2015 msgid "statement" msgstr "statement(陳述式)" -#: ../../library/functions.rst:2016 +#: ../../library/functions.rst:2015 msgid "import" msgstr "import(引入)" -#: ../../library/functions.rst:2016 +#: ../../library/functions.rst:2015 msgid "builtins" msgstr "builtins(內建)" diff --git a/library/functools.po b/library/functools.po index 3286029405..9326da869c 100644 --- a/library/functools.po +++ b/library/functools.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-20 15:45+0000\n" +"POT-Creation-Date: 2024-01-24 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:02+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -234,7 +234,7 @@ msgstr "" #: ../../library/functools.rst:197 msgid "" -"The wrapped function is instrumented with a :func:`cache_parameters` " +"The wrapped function is instrumented with a :func:`!cache_parameters` " "function that returns a new :class:`dict` showing the values for *maxsize* " "and *typed*. This is for information purposes only. Mutating the values " "has no effect." @@ -312,8 +312,8 @@ msgid "Added the *user_function* option." msgstr "新增 *user_function* 選項。" #: ../../library/functools.rst:278 -msgid "Added the function :func:`cache_parameters`" -msgstr "新增 :func:`cache_parameters` 函式。" +msgid "Added the function :func:`!cache_parameters`" +msgstr "新增 :func:`!cache_parameters` 函式。" #: ../../library/functools.rst:283 msgid "" @@ -647,7 +647,7 @@ msgstr "" #: ../../library/functools.rst:742 msgid "" ":class:`partial` objects are like :class:`function` objects in that they are " -"callable, weak referencable, and can have attributes. There are some " +"callable, weak referenceable, and can have attributes. There are some " "important differences. For instance, the :attr:`~definition.__name__` and :" "attr:`__doc__` attributes are not created automatically. Also, :class:" "`partial` objects defined in classes behave like static methods and do not " diff --git a/library/heapq.po b/library/heapq.po index b7753731ea..b8f97c5a2d 100644 --- a/library/heapq.po +++ b/library/heapq.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-10-19 17:24+0800\n" +"POT-Creation-Date: 2024-01-11 00:04+0000\n" "PO-Revision-Date: 2023-07-01 18:20+0800\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -397,13 +397,13 @@ msgid "" "above) into the 0 position, and then percolate this new 0 down the tree, " "exchanging values, until the invariant is re-established. This is clearly " "logarithmic on the total number of items in the tree. By iterating over all " -"items, you get an O(n log n) sort." +"items, you get an *O*\\ (*n* log *n*) sort." msgstr "" "如果能確保滿足這個 heap 的不變式,那麼索引 0 顯然是最終的贏家。移除並找到「下" "一個」贏家最簡單的演算法為:將一個輸家(例如上圖中的單元 30)移動到位置 0,然" "後從新的位置 0 不斷與下方的位置交換值來向下傳遞,直到滿足不變式為止。這個過程" "的複雜度顯然是樹的節點數目的對數級別。透過對所有項目疊代,可以得到一個複雜度" -"為 O(n log n) 的排序。" +"為 *O*\\ (*n* log *n*) 的排序。" #: ../../library/heapq.rst:275 msgid "" diff --git a/library/http.client.po b/library/http.client.po index 93bb6fe069..865db89629 100644 --- a/library/http.client.po +++ b/library/http.client.po @@ -1,5 +1,4 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -7,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2024-01-24 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:03+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -127,7 +126,7 @@ msgstr "" #: ../../library/http.client.rst:92 msgid "" "This class now performs all the necessary certificate and hostname checks by " -"default. To revert to the previous, unverified, behavior :func:`ssl." +"default. To revert to the previous, unverified, behavior :func:`!ssl." "_create_unverified_context` can be passed to the *context* parameter." msgstr "" @@ -142,7 +141,7 @@ msgstr "" msgid "" "This class now sends an ALPN extension with protocol indicator ``http/1.1`` " "when no *context* is given. Custom *context* should set ALPN protocols with :" -"meth:`~ssl.SSLContext.set_alpn_protocol`." +"meth:`~ssl.SSLContext.set_alpn_protocols`." msgstr "" #: ../../library/http.client.rst:108 @@ -170,7 +169,7 @@ msgstr "" #: ../../library/http.client.rst:126 msgid "" "Parse the headers from a file pointer *fp* representing a HTTP request/" -"response. The file has to be a :class:`BufferedIOBase` reader (i.e. not " +"response. The file has to be a :class:`~io.BufferedIOBase` reader (i.e. not " "text) and must provide a valid :rfc:`2822` style header." msgstr "" @@ -462,8 +461,9 @@ msgstr "" #: ../../library/http.client.rst:419 msgid "" -"As an alternative to using the :meth:`request` method described above, you " -"can also send your request step by step, by using the four functions below." +"As an alternative to using the :meth:`~HTTPConnection.request` method " +"described above, you can also send your request step by step, by using the " +"four functions below." msgstr "" #: ../../library/http.client.rst:426 @@ -513,16 +513,16 @@ msgid "" msgstr "" #: ../../library/http.client.rst:464 -msgid "Chunked encoding support. The *encode_chunked* parameter was added." +msgid "Added chunked encoding support and the *encode_chunked* parameter." msgstr "" -#: ../../library/http.client.rst:471 +#: ../../library/http.client.rst:470 msgid "" "Send data to the server. This should be used directly only after the :meth:" "`endheaders` method has been called and before :meth:`getresponse` is called." msgstr "" -#: ../../library/http.client.rst:486 +#: ../../library/http.client.rst:485 msgid "" "Raises an :ref:`auditing event ` ``http.client.send`` with " "arguments ``self``, ``data``." @@ -530,34 +530,34 @@ msgstr "" "引發一個附帶引數 ``self``、``data`` 的\\ :ref:`稽核事件 ` ``http." "client.send``。" -#: ../../library/http.client.rst:481 +#: ../../library/http.client.rst:480 msgid "HTTPResponse Objects" msgstr "HTTPResponse 物件" -#: ../../library/http.client.rst:483 +#: ../../library/http.client.rst:482 msgid "" "An :class:`HTTPResponse` instance wraps the HTTP response from the server. " "It provides access to the request headers and the entity body. The response " "is an iterable object and can be used in a with statement." msgstr "" -#: ../../library/http.client.rst:488 +#: ../../library/http.client.rst:487 msgid "" "The :class:`io.BufferedIOBase` interface is now implemented and all of its " "reader operations are supported." msgstr "" -#: ../../library/http.client.rst:495 +#: ../../library/http.client.rst:494 msgid "Reads and returns the response body, or up to the next *amt* bytes." msgstr "" -#: ../../library/http.client.rst:499 +#: ../../library/http.client.rst:498 msgid "" "Reads up to the next len(b) bytes of the response body into the buffer *b*. " "Returns the number of bytes read." msgstr "" -#: ../../library/http.client.rst:506 +#: ../../library/http.client.rst:505 msgid "" "Return the value of the header *name*, or *default* if there is no header " "matching *name*. If there is more than one header with the name *name*, " @@ -565,87 +565,87 @@ msgid "" "than a single string, its elements are similarly returned joined by commas." msgstr "" -#: ../../library/http.client.rst:513 +#: ../../library/http.client.rst:512 msgid "Return a list of (header, value) tuples." msgstr "" -#: ../../library/http.client.rst:517 +#: ../../library/http.client.rst:516 msgid "Return the ``fileno`` of the underlying socket." msgstr "" -#: ../../library/http.client.rst:521 +#: ../../library/http.client.rst:520 msgid "" "A :class:`http.client.HTTPMessage` instance containing the response " "headers. :class:`http.client.HTTPMessage` is a subclass of :class:`email." "message.Message`." msgstr "" -#: ../../library/http.client.rst:527 +#: ../../library/http.client.rst:526 msgid "" "HTTP protocol version used by server. 10 for HTTP/1.0, 11 for HTTP/1.1." msgstr "" -#: ../../library/http.client.rst:531 +#: ../../library/http.client.rst:530 msgid "" "URL of the resource retrieved, commonly used to determine if a redirect was " "followed." msgstr "" -#: ../../library/http.client.rst:535 +#: ../../library/http.client.rst:534 msgid "" "Headers of the response in the form of an :class:`email.message." "EmailMessage` instance." msgstr "" -#: ../../library/http.client.rst:539 +#: ../../library/http.client.rst:538 msgid "Status code returned by server." msgstr "" -#: ../../library/http.client.rst:543 +#: ../../library/http.client.rst:542 msgid "Reason phrase returned by server." msgstr "" -#: ../../library/http.client.rst:547 +#: ../../library/http.client.rst:546 msgid "" "A debugging hook. If :attr:`debuglevel` is greater than zero, messages will " "be printed to stdout as the response is read and parsed." msgstr "" -#: ../../library/http.client.rst:552 +#: ../../library/http.client.rst:551 msgid "Is ``True`` if the stream is closed." msgstr "" -#: ../../library/http.client.rst:556 +#: ../../library/http.client.rst:555 msgid "Deprecated in favor of :attr:`~HTTPResponse.url`." msgstr "" -#: ../../library/http.client.rst:561 +#: ../../library/http.client.rst:560 msgid "Deprecated in favor of :attr:`~HTTPResponse.headers`." msgstr "" -#: ../../library/http.client.rst:566 +#: ../../library/http.client.rst:565 msgid "Deprecated in favor of :attr:`~HTTPResponse.status`." msgstr "" -#: ../../library/http.client.rst:570 +#: ../../library/http.client.rst:569 msgid "Examples" msgstr "範例" -#: ../../library/http.client.rst:572 +#: ../../library/http.client.rst:571 msgid "Here is an example session that uses the ``GET`` method::" msgstr "" -#: ../../library/http.client.rst:597 +#: ../../library/http.client.rst:596 msgid "" "Here is an example session that uses the ``HEAD`` method. Note that the " "``HEAD`` method never returns any data. ::" msgstr "" -#: ../../library/http.client.rst:612 +#: ../../library/http.client.rst:611 msgid "Here is an example session that uses the ``POST`` method::" msgstr "" -#: ../../library/http.client.rst:628 +#: ../../library/http.client.rst:627 msgid "" "Client side HTTP ``PUT`` requests are very similar to ``POST`` requests. The " "difference lies only on the server side where HTTP servers will allow " @@ -655,11 +655,11 @@ msgid "" "``PUT`` method::" msgstr "" -#: ../../library/http.client.rst:649 +#: ../../library/http.client.rst:648 msgid "HTTPMessage Objects" msgstr "HTTPMessage 物件" -#: ../../library/http.client.rst:651 +#: ../../library/http.client.rst:652 msgid "" "An :class:`http.client.HTTPMessage` instance holds the headers from an HTTP " "response. It is implemented using the :class:`email.message.Message` class." diff --git a/library/http.server.po b/library/http.server.po index cc401e3029..a1b88b1600 100644 --- a/library/http.server.po +++ b/library/http.server.po @@ -1,5 +1,4 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -7,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-13 13:14+0000\n" +"POT-Creation-Date: 2024-01-24 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:03+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -20,7 +19,7 @@ msgstr "" #: ../../library/http.server.rst:2 msgid ":mod:`http.server` --- HTTP servers" -msgstr "" +msgstr ":mod:`http.server` — HTTP 伺服器" #: ../../library/http.server.rst:7 msgid "**Source code:** :source:`Lib/http/server.py`" @@ -28,7 +27,7 @@ msgstr "**原始碼:**\\ :source:`Lib/http/server.py`" #: ../../library/http.server.rst:17 msgid "This module defines classes for implementing HTTP servers." -msgstr "" +msgstr "此模組定義了用於實作 HTTP 伺服器的類別。" #: ../../library/http.server.rst:22 msgid "" @@ -391,8 +390,8 @@ msgid "" msgstr "" #: ../../library/http.server.rst:331 -msgid "The *directory* parameter." -msgstr "*directory* 參數。" +msgid "Added the *directory* parameter." +msgstr "新增 *directory* 參數。" #: ../../library/http.server.rst:334 msgid "The *directory* parameter accepts a :term:`path-like object`." @@ -529,12 +528,12 @@ msgid "" msgstr "" #: ../../library/http.server.rst:441 -msgid "``--bind`` argument was introduced." -msgstr "" +msgid "Added the ``--bind`` option." +msgstr "新增 ``--bind`` 選項。" #: ../../library/http.server.rst:444 -msgid "``--bind`` argument enhanced to support IPv6" -msgstr "" +msgid "Support IPv6 in the ``--bind`` option." +msgstr "於 ``--bind`` 選項中支援 IPv6。" #: ../../library/http.server.rst:447 msgid "" @@ -544,8 +543,8 @@ msgid "" msgstr "" #: ../../library/http.server.rst:453 -msgid "``--directory`` argument was introduced." -msgstr "" +msgid "Added the ``--directory`` option." +msgstr "新增 ``--directory`` 選項。" #: ../../library/http.server.rst:456 msgid "" @@ -555,8 +554,8 @@ msgid "" msgstr "" #: ../../library/http.server.rst:462 -msgid "``--protocol`` argument was introduced." -msgstr "" +msgid "Added the ``--protocol`` option." +msgstr "新增 ``--protocol`` 選項。" #: ../../library/http.server.rst:467 msgid "" diff --git a/library/idle.po b/library/idle.po index 0046d297a0..ddb0bbe1e2 100644 --- a/library/idle.po +++ b/library/idle.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-29 12:27+0000\n" +"POT-Creation-Date: 2024-01-18 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:03+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -35,46 +35,42 @@ msgid "IDLE has the following features:" msgstr "" #: ../../library/idle.rst:21 -msgid "coded in 100% pure Python, using the :mod:`tkinter` GUI toolkit" -msgstr "" - -#: ../../library/idle.rst:23 msgid "cross-platform: works mostly the same on Windows, Unix, and macOS" msgstr "" -#: ../../library/idle.rst:25 +#: ../../library/idle.rst:23 msgid "" "Python shell window (interactive interpreter) with colorizing of code input, " "output, and error messages" msgstr "" -#: ../../library/idle.rst:28 +#: ../../library/idle.rst:26 msgid "" "multi-window text editor with multiple undo, Python colorizing, smart " "indent, call tips, auto completion, and other features" msgstr "" -#: ../../library/idle.rst:31 +#: ../../library/idle.rst:29 msgid "" "search within any window, replace within editor windows, and search through " "multiple files (grep)" msgstr "" -#: ../../library/idle.rst:34 +#: ../../library/idle.rst:32 msgid "" "debugger with persistent breakpoints, stepping, and viewing of global and " "local namespaces" msgstr "" -#: ../../library/idle.rst:37 +#: ../../library/idle.rst:35 msgid "configuration, browsers, and other dialogs" msgstr "" -#: ../../library/idle.rst:40 +#: ../../library/idle.rst:38 msgid "Menus" msgstr "目錄" -#: ../../library/idle.rst:42 +#: ../../library/idle.rst:40 msgid "" "IDLE has two main window types, the Shell window and the Editor window. It " "is possible to have multiple editor windows simultaneously. On Windows and " @@ -82,81 +78,81 @@ msgid "" "which window type it is associated with." msgstr "" -#: ../../library/idle.rst:47 +#: ../../library/idle.rst:45 msgid "" "Output windows, such as used for Edit => Find in Files, are a subtype of " "editor window. They currently have the same top menu but a different " "default title and context menu." msgstr "" -#: ../../library/idle.rst:51 +#: ../../library/idle.rst:49 msgid "" "On macOS, there is one application menu. It dynamically changes according " "to the window currently selected. It has an IDLE menu, and some entries " "described below are moved around to conform to Apple guidelines." msgstr "" -#: ../../library/idle.rst:56 +#: ../../library/idle.rst:54 msgid "File menu (Shell and Editor)" msgstr "" -#: ../../library/idle.rst:59 +#: ../../library/idle.rst:57 msgid "New File" msgstr "新增檔案" -#: ../../library/idle.rst:59 +#: ../../library/idle.rst:57 msgid "Create a new file editing window." msgstr "" -#: ../../library/idle.rst:62 +#: ../../library/idle.rst:60 msgid "Open..." msgstr "" -#: ../../library/idle.rst:62 +#: ../../library/idle.rst:60 msgid "Open an existing file with an Open dialog." msgstr "" -#: ../../library/idle.rst:65 +#: ../../library/idle.rst:63 msgid "Open Module..." msgstr "" -#: ../../library/idle.rst:65 +#: ../../library/idle.rst:63 msgid "Open an existing module (searches sys.path)." msgstr "" -#: ../../library/idle.rst:68 +#: ../../library/idle.rst:66 msgid "Recent Files" msgstr "" -#: ../../library/idle.rst:68 +#: ../../library/idle.rst:66 msgid "Open a list of recent files. Click one to open it." msgstr "" -#: ../../library/idle.rst:76 +#: ../../library/idle.rst:74 msgid "Module Browser" msgstr "" -#: ../../library/idle.rst:75 +#: ../../library/idle.rst:73 msgid "" "Show functions, classes, and methods in the current Editor file in a tree " "structure. In the shell, open a module first." msgstr "" -#: ../../library/idle.rst:80 +#: ../../library/idle.rst:78 msgid "Path Browser" msgstr "" -#: ../../library/idle.rst:79 +#: ../../library/idle.rst:77 msgid "" "Show sys.path directories, modules, functions, classes and methods in a tree " "structure." msgstr "" -#: ../../library/idle.rst:86 +#: ../../library/idle.rst:84 msgid "Save" msgstr "" -#: ../../library/idle.rst:83 +#: ../../library/idle.rst:81 msgid "" "Save the current window to the associated file, if there is one. Windows " "that have been changed since being opened or last saved have a \\* before " @@ -164,11 +160,11 @@ msgid "" "instead." msgstr "" -#: ../../library/idle.rst:93 +#: ../../library/idle.rst:91 msgid "Save As..." msgstr "" -#: ../../library/idle.rst:89 +#: ../../library/idle.rst:87 msgid "" "Save the current window with a Save As dialog. The file saved becomes the " "new associated file for the window. (If your file namager is set to hide " @@ -177,283 +173,283 @@ msgid "" "text files, except that on macOS Aqua,'.py' is added for all files.)" msgstr "" -#: ../../library/idle.rst:97 +#: ../../library/idle.rst:95 msgid "Save Copy As..." msgstr "" -#: ../../library/idle.rst:96 +#: ../../library/idle.rst:94 msgid "" "Save the current window to different file without changing the associated " "file. (See Save As note above about filename extensions.)" msgstr "" -#: ../../library/idle.rst:100 +#: ../../library/idle.rst:98 msgid "Print Window" msgstr "" -#: ../../library/idle.rst:100 +#: ../../library/idle.rst:98 msgid "Print the current window to the default printer." msgstr "" -#: ../../library/idle.rst:105 +#: ../../library/idle.rst:103 msgid "Close Window" msgstr "" -#: ../../library/idle.rst:103 +#: ../../library/idle.rst:101 msgid "" "Close the current window (if an unsaved editor, ask to save; if an unsaved " "Shell, ask to quit execution). Calling ``exit()`` or ``close()`` in the " "Shell window also closes Shell. If this is the only window, also exit IDLE." msgstr "" -#: ../../library/idle.rst:108 +#: ../../library/idle.rst:106 msgid "Exit IDLE" msgstr "離開 IDLE" -#: ../../library/idle.rst:108 +#: ../../library/idle.rst:106 msgid "Close all windows and quit IDLE (ask to save unsaved edit windows)." msgstr "" -#: ../../library/idle.rst:111 +#: ../../library/idle.rst:109 msgid "Edit menu (Shell and Editor)" msgstr "" -#: ../../library/idle.rst:115 +#: ../../library/idle.rst:113 msgid "Undo" msgstr "" -#: ../../library/idle.rst:114 +#: ../../library/idle.rst:112 msgid "" "Undo the last change to the current window. A maximum of 1000 changes may " "be undone." msgstr "" -#: ../../library/idle.rst:118 +#: ../../library/idle.rst:116 msgid "Redo" msgstr "" -#: ../../library/idle.rst:118 +#: ../../library/idle.rst:116 msgid "Redo the last undone change to the current window." msgstr "" -#: ../../library/idle.rst:121 +#: ../../library/idle.rst:119 msgid "Select All" msgstr "Select All(選擇全部)" -#: ../../library/idle.rst:121 +#: ../../library/idle.rst:119 msgid "Select the entire contents of the current window." msgstr "" -#: ../../library/idle.rst:124 ../../library/idle.rst:355 -#: ../../library/idle.rst:370 +#: ../../library/idle.rst:122 ../../library/idle.rst:353 +#: ../../library/idle.rst:368 msgid "Cut" msgstr "Cut(剪下)" -#: ../../library/idle.rst:124 ../../library/idle.rst:370 +#: ../../library/idle.rst:122 ../../library/idle.rst:368 msgid "" "Copy selection into the system-wide clipboard; then delete the selection." msgstr "" -#: ../../library/idle.rst:127 ../../library/idle.rst:355 -#: ../../library/idle.rst:373 +#: ../../library/idle.rst:125 ../../library/idle.rst:353 +#: ../../library/idle.rst:371 msgid "Copy" msgstr "Copy(複製)" -#: ../../library/idle.rst:127 ../../library/idle.rst:373 +#: ../../library/idle.rst:125 ../../library/idle.rst:371 msgid "Copy selection into the system-wide clipboard." msgstr "" -#: ../../library/idle.rst:130 ../../library/idle.rst:355 -#: ../../library/idle.rst:376 +#: ../../library/idle.rst:128 ../../library/idle.rst:353 +#: ../../library/idle.rst:374 msgid "Paste" msgstr "Paste(貼上)" -#: ../../library/idle.rst:130 ../../library/idle.rst:376 +#: ../../library/idle.rst:128 ../../library/idle.rst:374 msgid "Insert contents of the system-wide clipboard into the current window." msgstr "" -#: ../../library/idle.rst:132 +#: ../../library/idle.rst:130 msgid "The clipboard functions are also available in context menus." msgstr "" -#: ../../library/idle.rst:135 +#: ../../library/idle.rst:133 msgid "Find..." msgstr "" -#: ../../library/idle.rst:135 +#: ../../library/idle.rst:133 msgid "Open a search dialog with many options" msgstr "" -#: ../../library/idle.rst:138 +#: ../../library/idle.rst:136 msgid "Find Again" msgstr "" -#: ../../library/idle.rst:138 +#: ../../library/idle.rst:136 msgid "Repeat the last search, if there is one." msgstr "" -#: ../../library/idle.rst:141 +#: ../../library/idle.rst:139 msgid "Find Selection" msgstr "" -#: ../../library/idle.rst:141 +#: ../../library/idle.rst:139 msgid "Search for the currently selected string, if there is one." msgstr "" -#: ../../library/idle.rst:144 +#: ../../library/idle.rst:142 msgid "Find in Files..." msgstr "" -#: ../../library/idle.rst:144 +#: ../../library/idle.rst:142 msgid "Open a file search dialog. Put results in a new output window." msgstr "" -#: ../../library/idle.rst:147 +#: ../../library/idle.rst:145 msgid "Replace..." msgstr "" -#: ../../library/idle.rst:147 +#: ../../library/idle.rst:145 msgid "Open a search-and-replace dialog." msgstr "" -#: ../../library/idle.rst:152 +#: ../../library/idle.rst:150 msgid "Go to Line" msgstr "" -#: ../../library/idle.rst:150 +#: ../../library/idle.rst:148 msgid "" "Move the cursor to the beginning of the line requested and make that line " "visible. A request past the end of the file goes to the end. Clear any " "selection and update the line and column status." msgstr "" -#: ../../library/idle.rst:156 +#: ../../library/idle.rst:154 msgid "Show Completions" msgstr "" -#: ../../library/idle.rst:155 +#: ../../library/idle.rst:153 msgid "" "Open a scrollable list allowing selection of existing names. See :ref:" "`Completions ` in the Editing and navigation section below." msgstr "" -#: ../../library/idle.rst:160 +#: ../../library/idle.rst:158 msgid "Expand Word" msgstr "" -#: ../../library/idle.rst:159 +#: ../../library/idle.rst:157 msgid "" "Expand a prefix you have typed to match a full word in the same window; " "repeat to get a different expansion." msgstr "" -#: ../../library/idle.rst:165 +#: ../../library/idle.rst:163 msgid "Show Call Tip" msgstr "" -#: ../../library/idle.rst:163 +#: ../../library/idle.rst:161 msgid "" "After an unclosed parenthesis for a function, open a small window with " "function parameter hints. See :ref:`Calltips ` in the Editing and " "navigation section below." msgstr "" -#: ../../library/idle.rst:168 +#: ../../library/idle.rst:166 msgid "Show Surrounding Parens" msgstr "" -#: ../../library/idle.rst:168 +#: ../../library/idle.rst:166 msgid "Highlight the surrounding parenthesis." msgstr "" -#: ../../library/idle.rst:173 +#: ../../library/idle.rst:171 msgid "Format menu (Editor window only)" msgstr "" -#: ../../library/idle.rst:178 +#: ../../library/idle.rst:176 msgid "Format Paragraph" msgstr "" -#: ../../library/idle.rst:176 +#: ../../library/idle.rst:174 msgid "" "Reformat the current blank-line-delimited paragraph in comment block or " "multiline string or selected line in a string. All lines in the paragraph " "will be formatted to less than N columns, where N defaults to 72." msgstr "" -#: ../../library/idle.rst:181 +#: ../../library/idle.rst:179 msgid "Indent Region" msgstr "" -#: ../../library/idle.rst:181 +#: ../../library/idle.rst:179 msgid "Shift selected lines right by the indent width (default 4 spaces)." msgstr "" -#: ../../library/idle.rst:184 +#: ../../library/idle.rst:182 msgid "Dedent Region" msgstr "" -#: ../../library/idle.rst:184 +#: ../../library/idle.rst:182 msgid "Shift selected lines left by the indent width (default 4 spaces)." msgstr "" -#: ../../library/idle.rst:187 +#: ../../library/idle.rst:185 msgid "Comment Out Region" msgstr "" -#: ../../library/idle.rst:187 +#: ../../library/idle.rst:185 msgid "Insert ## in front of selected lines." msgstr "" -#: ../../library/idle.rst:190 +#: ../../library/idle.rst:188 msgid "Uncomment Region" msgstr "" -#: ../../library/idle.rst:190 +#: ../../library/idle.rst:188 msgid "Remove leading # or ## from selected lines." msgstr "" -#: ../../library/idle.rst:194 +#: ../../library/idle.rst:192 msgid "Tabify Region" msgstr "" -#: ../../library/idle.rst:193 +#: ../../library/idle.rst:191 msgid "" "Turn *leading* stretches of spaces into tabs. (Note: We recommend using 4 " "space blocks to indent Python code.)" msgstr "" -#: ../../library/idle.rst:197 +#: ../../library/idle.rst:195 msgid "Untabify Region" msgstr "" -#: ../../library/idle.rst:197 +#: ../../library/idle.rst:195 msgid "Turn *all* tabs into the correct number of spaces." msgstr "" -#: ../../library/idle.rst:200 +#: ../../library/idle.rst:198 msgid "Toggle Tabs" msgstr "" -#: ../../library/idle.rst:200 +#: ../../library/idle.rst:198 msgid "Open a dialog to switch between indenting with spaces and tabs." msgstr "" -#: ../../library/idle.rst:204 +#: ../../library/idle.rst:202 msgid "New Indent Width" msgstr "" -#: ../../library/idle.rst:203 +#: ../../library/idle.rst:201 msgid "" "Open a dialog to change indent width. The accepted default by the Python " "community is 4 spaces." msgstr "" -#: ../../library/idle.rst:210 +#: ../../library/idle.rst:208 msgid "Strip Trailing Chitespace" msgstr "" -#: ../../library/idle.rst:207 +#: ../../library/idle.rst:205 msgid "" "Remove trailing space and other whitespace characters after the last non-" "whitespace character of a line by applying str.rstrip to each line, " @@ -461,15 +457,15 @@ msgid "" "extra newlines at the end of the file." msgstr "" -#: ../../library/idle.rst:216 +#: ../../library/idle.rst:214 msgid "Run menu (Editor window only)" msgstr "" -#: ../../library/idle.rst:227 +#: ../../library/idle.rst:225 msgid "Run Module" msgstr "" -#: ../../library/idle.rst:221 +#: ../../library/idle.rst:219 msgid "" "Do :ref:`Check Module `. If no error, restart the shell to " "clean the environment, then execute the module. Output is displayed in the " @@ -479,22 +475,22 @@ msgid "" "similar to executing a file with ``python -i file`` at a command line." msgstr "" -#: ../../library/idle.rst:234 +#: ../../library/idle.rst:232 msgid "Run... Customized" msgstr "" -#: ../../library/idle.rst:232 +#: ../../library/idle.rst:230 msgid "" "Same as :ref:`Run Module `, but run the module with customized " "settings. *Command Line Arguments* extend :data:`sys.argv` as if passed on " "a command line. The module can be run in the Shell without restarting." msgstr "" -#: ../../library/idle.rst:243 +#: ../../library/idle.rst:241 msgid "Check Module" msgstr "" -#: ../../library/idle.rst:239 +#: ../../library/idle.rst:237 msgid "" "Check the syntax of the module currently open in the Editor window. If the " "module has not been saved IDLE will either prompt the user to save or " @@ -503,70 +499,70 @@ msgid "" "window." msgstr "" -#: ../../library/idle.rst:249 +#: ../../library/idle.rst:247 msgid "Python Shell" msgstr "" -#: ../../library/idle.rst:248 +#: ../../library/idle.rst:246 msgid "Open or wake up the Python Shell window." msgstr "" -#: ../../library/idle.rst:252 +#: ../../library/idle.rst:250 msgid "Shell menu (Shell window only)" msgstr "" -#: ../../library/idle.rst:255 +#: ../../library/idle.rst:253 msgid "View Last Restart" msgstr "" -#: ../../library/idle.rst:255 +#: ../../library/idle.rst:253 msgid "Scroll the shell window to the last Shell restart." msgstr "" -#: ../../library/idle.rst:258 +#: ../../library/idle.rst:256 msgid "Restart Shell" msgstr "" -#: ../../library/idle.rst:258 +#: ../../library/idle.rst:256 msgid "" "Restart the shell to clean the environment and reset display and exception " "handling." msgstr "" -#: ../../library/idle.rst:261 +#: ../../library/idle.rst:259 msgid "Previous History" msgstr "" -#: ../../library/idle.rst:261 +#: ../../library/idle.rst:259 msgid "" "Cycle through earlier commands in history which match the current entry." msgstr "" -#: ../../library/idle.rst:264 +#: ../../library/idle.rst:262 msgid "Next History" msgstr "" -#: ../../library/idle.rst:264 +#: ../../library/idle.rst:262 msgid "Cycle through later commands in history which match the current entry." msgstr "" -#: ../../library/idle.rst:267 +#: ../../library/idle.rst:265 msgid "Interrupt Execution" msgstr "" -#: ../../library/idle.rst:267 +#: ../../library/idle.rst:265 msgid "Stop a running program." msgstr "" -#: ../../library/idle.rst:270 +#: ../../library/idle.rst:268 msgid "Debug menu (Shell window only)" msgstr "" -#: ../../library/idle.rst:277 +#: ../../library/idle.rst:275 msgid "Go to File/Line" msgstr "" -#: ../../library/idle.rst:273 +#: ../../library/idle.rst:271 msgid "" "Look on the current line. with the cursor, and the line above for a filename " "and line number. If found, open the file if not already open, and show the " @@ -575,45 +571,45 @@ msgid "" "Shell window and Output windows." msgstr "" -#: ../../library/idle.rst:286 +#: ../../library/idle.rst:284 msgid "Debugger (toggle)" msgstr "" -#: ../../library/idle.rst:284 +#: ../../library/idle.rst:282 msgid "" "When activated, code entered in the Shell or run from an Editor will run " "under the debugger. In the Editor, breakpoints can be set with the context " "menu. This feature is still incomplete and somewhat experimental." msgstr "" -#: ../../library/idle.rst:290 +#: ../../library/idle.rst:288 msgid "Stack Viewer" msgstr "" -#: ../../library/idle.rst:289 +#: ../../library/idle.rst:287 msgid "" "Show the stack traceback of the last exception in a tree widget, with access " "to locals and globals." msgstr "" -#: ../../library/idle.rst:293 +#: ../../library/idle.rst:291 msgid "Auto-open Stack Viewer" msgstr "" -#: ../../library/idle.rst:293 +#: ../../library/idle.rst:291 msgid "" "Toggle automatically opening the stack viewer on an unhandled exception." msgstr "" -#: ../../library/idle.rst:296 +#: ../../library/idle.rst:294 msgid "Options menu (Shell and Editor)" msgstr "" -#: ../../library/idle.rst:304 +#: ../../library/idle.rst:302 msgid "Configure IDLE" msgstr "" -#: ../../library/idle.rst:299 +#: ../../library/idle.rst:297 msgid "" "Open a configuration dialog and change preferences for the following: fonts, " "indentation, keybindings, text color themes, startup windows and size, " @@ -622,39 +618,39 @@ msgid "" "see :ref:`Setting preferences ` under Help and preferences." msgstr "" -#: ../../library/idle.rst:306 +#: ../../library/idle.rst:304 msgid "" "Most configuration options apply to all windows or all future windows. The " "option items below only apply to the active window." msgstr "" -#: ../../library/idle.rst:313 +#: ../../library/idle.rst:311 msgid "Show/Hide Code Context (Editor Window only)" msgstr "" -#: ../../library/idle.rst:310 +#: ../../library/idle.rst:308 msgid "" "Open a pane at the top of the edit window which shows the block context of " "the code which has scrolled above the top of the window. See :ref:`Code " "Context ` in the Editing and Navigation section below." msgstr "" -#: ../../library/idle.rst:318 +#: ../../library/idle.rst:316 msgid "Show/Hide Line Numbers (Editor Window only)" msgstr "" -#: ../../library/idle.rst:316 +#: ../../library/idle.rst:314 msgid "" "Open a column to the left of the edit window which shows the number of each " "line of text. The default is off, which may be changed in the preferences " "(see :ref:`Setting preferences `)." msgstr "" -#: ../../library/idle.rst:326 +#: ../../library/idle.rst:324 msgid "Zoom/Restore Height" msgstr "" -#: ../../library/idle.rst:321 +#: ../../library/idle.rst:319 msgid "" "Toggles the window between normal size and maximum height. The initial size " "defaults to 40 lines by 80 chars unless changed on the General tab of the " @@ -664,74 +660,74 @@ msgid "" "no effect when a window is maximized." msgstr "" -#: ../../library/idle.rst:329 +#: ../../library/idle.rst:327 msgid "Window menu (Shell and Editor)" msgstr "" -#: ../../library/idle.rst:331 +#: ../../library/idle.rst:329 msgid "" "Lists the names of all open windows; select one to bring it to the " "foreground (deiconifying it if necessary)." msgstr "" -#: ../../library/idle.rst:335 +#: ../../library/idle.rst:333 msgid "Help menu (Shell and Editor)" msgstr "" -#: ../../library/idle.rst:338 +#: ../../library/idle.rst:336 msgid "About IDLE" msgstr "" -#: ../../library/idle.rst:338 +#: ../../library/idle.rst:336 msgid "Display version, copyright, license, credits, and more." msgstr "" -#: ../../library/idle.rst:342 +#: ../../library/idle.rst:340 msgid "IDLE Help" msgstr "" -#: ../../library/idle.rst:341 +#: ../../library/idle.rst:339 msgid "" "Display this IDLE document, detailing the menu options, basic editing and " "navigation, and other tips." msgstr "" -#: ../../library/idle.rst:346 +#: ../../library/idle.rst:344 msgid "Python Docs" msgstr "" -#: ../../library/idle.rst:345 +#: ../../library/idle.rst:343 msgid "" "Access local Python documentation, if installed, or start a web browser and " "open docs.python.org showing the latest Python documentation." msgstr "" -#: ../../library/idle.rst:349 +#: ../../library/idle.rst:347 msgid "Turtle Demo" msgstr "" -#: ../../library/idle.rst:349 +#: ../../library/idle.rst:347 msgid "Run the turtledemo module with example Python code and turtle drawings." msgstr "" -#: ../../library/idle.rst:351 +#: ../../library/idle.rst:349 msgid "" "Additional help sources may be added here with the Configure IDLE dialog " "under the General tab. See the :ref:`Help sources ` subsection " "below for more on Help menu choices." msgstr "" -#: ../../library/idle.rst:364 +#: ../../library/idle.rst:362 msgid "Context menus" msgstr "" -#: ../../library/idle.rst:366 +#: ../../library/idle.rst:364 msgid "" "Open a context menu by right-clicking in a window (Control-click on macOS). " "Context menus have the standard clipboard functions also on the Edit menu." msgstr "" -#: ../../library/idle.rst:378 +#: ../../library/idle.rst:376 msgid "" "Editor windows also have breakpoint functions. Lines with a breakpoint set " "are specially marked. Breakpoints only have an effect when running under " @@ -739,66 +735,66 @@ msgid "" "directory." msgstr "" -#: ../../library/idle.rst:355 ../../library/idle.rst:384 +#: ../../library/idle.rst:353 ../../library/idle.rst:382 msgid "Set Breakpoint" msgstr "" -#: ../../library/idle.rst:384 +#: ../../library/idle.rst:382 msgid "Set a breakpoint on the current line." msgstr "" -#: ../../library/idle.rst:355 ../../library/idle.rst:387 +#: ../../library/idle.rst:353 ../../library/idle.rst:385 msgid "Clear Breakpoint" msgstr "" -#: ../../library/idle.rst:387 +#: ../../library/idle.rst:385 msgid "Clear the breakpoint on that line." msgstr "" -#: ../../library/idle.rst:389 +#: ../../library/idle.rst:387 msgid "Shell and Output windows also have the following." msgstr "" -#: ../../library/idle.rst:392 +#: ../../library/idle.rst:390 msgid "Go to file/line" msgstr "" -#: ../../library/idle.rst:392 +#: ../../library/idle.rst:390 msgid "Same as in Debug menu." msgstr "" -#: ../../library/idle.rst:394 +#: ../../library/idle.rst:392 msgid "" "The Shell window also has an output squeezing facility explained in the " "*Python Shell window* subsection below." msgstr "" -#: ../../library/idle.rst:400 +#: ../../library/idle.rst:398 msgid "Squeeze" msgstr "" -#: ../../library/idle.rst:398 +#: ../../library/idle.rst:396 msgid "" "If the cursor is over an output line, squeeze all the output between the " "code above and the prompt below down to a 'Squeezed text' label." msgstr "" -#: ../../library/idle.rst:405 +#: ../../library/idle.rst:403 msgid "Editing and Navigation" msgstr "" -#: ../../library/idle.rst:408 +#: ../../library/idle.rst:406 msgid "Editor windows" msgstr "" -#: ../../library/idle.rst:410 +#: ../../library/idle.rst:408 msgid "" "IDLE may open editor windows when it starts, depending on settings and how " "you start IDLE. Thereafter, use the File menu. There can be only one open " "editor window for a given file." msgstr "" -#: ../../library/idle.rst:414 +#: ../../library/idle.rst:412 msgid "" "The title bar contains the name of the file, the full path, and the version " "of Python and IDLE running the window. The status bar contains the line " @@ -806,99 +802,79 @@ msgid "" "numbers with 0." msgstr "" -#: ../../library/idle.rst:419 +#: ../../library/idle.rst:417 msgid "" "IDLE assumes that files with a known .py* extension contain Python code and " "that other files do not. Run Python code with the Run menu." msgstr "" -#: ../../library/idle.rst:423 +#: ../../library/idle.rst:421 msgid "Key bindings" msgstr "" -#: ../../library/idle.rst:425 +#: ../../library/idle.rst:423 msgid "" -"In this section, 'C' refers to the :kbd:`Control` key on Windows and Unix " -"and the :kbd:`Command` key on macOS." +"The IDLE insertion cursor is a thin vertical bar between character " +"positions. When characters are entered, the insertion cursor and everything " +"to its right moves right one character and the new character is entered in " +"the new space." msgstr "" #: ../../library/idle.rst:428 -msgid ":kbd:`Backspace` deletes to the left; :kbd:`Del` deletes to the right" -msgstr "" - -#: ../../library/idle.rst:430 msgid "" -":kbd:`C-Backspace` delete word left; :kbd:`C-Del` delete word to the right" -msgstr "" - -#: ../../library/idle.rst:432 -msgid "Arrow keys and :kbd:`Page Up`/:kbd:`Page Down` to move around" +"Several non-character keys move the cursor and possibly delete characters. " +"Deletion does not puts text on the clipboard, but IDLE has an undo list. " +"Wherever this doc discusses keys, 'C' refers to the :kbd:`Control` key on " +"Windows and Unix and the :kbd:`Command` key on macOS. (And all such " +"dicussions assume that the keys have not been re-bound to something else.)" msgstr "" -#: ../../library/idle.rst:434 -msgid ":kbd:`C-LeftArrow` and :kbd:`C-RightArrow` moves by words" +#: ../../library/idle.rst:435 +msgid "Arrow keys move the cursor one character or line." msgstr "" -#: ../../library/idle.rst:436 -msgid ":kbd:`Home`/:kbd:`End` go to begin/end of line" -msgstr "" - -#: ../../library/idle.rst:438 -msgid ":kbd:`C-Home`/:kbd:`C-End` go to begin/end of file" +#: ../../library/idle.rst:437 +msgid "" +":kbd:`C-LeftArrow` and :kbd:`C-RightArrow` moves left or right one word." msgstr "" -#: ../../library/idle.rst:440 -msgid "Some useful Emacs bindings are inherited from Tcl/Tk:" +#: ../../library/idle.rst:439 +msgid ":kbd:`Home` and :kbd:`End` go to the beginning or end of the line." msgstr "" -#: ../../library/idle.rst:442 -msgid ":kbd:`C-a` beginning of line" +#: ../../library/idle.rst:441 +msgid ":kbd:`Page Up` and :kbd:`Page Down` go up or down one screen." msgstr "" -#: ../../library/idle.rst:444 -msgid ":kbd:`C-e` end of line" +#: ../../library/idle.rst:443 +msgid ":kbd:`C-Home` and :kbd:`C-End` go to beginning or end of the file." msgstr "" -#: ../../library/idle.rst:446 -msgid ":kbd:`C-k` kill line (but doesn't put it in clipboard)" +#: ../../library/idle.rst:445 +msgid "" +":kbd:`Backspace` and :kbd:`Del` (or :kbd:`C-d`) delete the previous or next " +"character." msgstr "" #: ../../library/idle.rst:448 -msgid ":kbd:`C-l` center window around the insertion point" +msgid ":kbd:`C-Backspace` and :kbd:`C-Del` delete one word left or right." msgstr "" #: ../../library/idle.rst:450 -msgid "" -":kbd:`C-b` go backward one character without deleting (usually you can also " -"use the cursor key for this)" +msgid ":kbd:`C-k` deletes ('kills') everything to the right." msgstr "" -#: ../../library/idle.rst:453 -msgid "" -":kbd:`C-f` go forward one character without deleting (usually you can also " -"use the cursor key for this)" -msgstr "" - -#: ../../library/idle.rst:456 -msgid "" -":kbd:`C-p` go up one line (usually you can also use the cursor key for this)" -msgstr "" - -#: ../../library/idle.rst:459 -msgid ":kbd:`C-d` delete next character" -msgstr "" - -#: ../../library/idle.rst:461 +#: ../../library/idle.rst:452 msgid "" "Standard keybindings (like :kbd:`C-c` to copy and :kbd:`C-v` to paste) may " "work. Keybindings are selected in the Configure IDLE dialog." msgstr "" -#: ../../library/idle.rst:465 +#: ../../library/idle.rst:456 msgid "Automatic indentation" msgstr "" -#: ../../library/idle.rst:467 +#: ../../library/idle.rst:458 msgid "" "After a block-opening statement, the next line is indented by 4 spaces (in " "the Python Shell window by one tab). After certain keywords (break, return " @@ -908,17 +884,17 @@ msgid "" "tabs are restricted to four spaces due to Tcl/Tk limitations." msgstr "" -#: ../../library/idle.rst:474 +#: ../../library/idle.rst:465 msgid "" "See also the indent/dedent region commands on the :ref:`Format menu `." msgstr "" -#: ../../library/idle.rst:478 +#: ../../library/idle.rst:469 msgid "Search and Replace" msgstr "" -#: ../../library/idle.rst:480 +#: ../../library/idle.rst:471 msgid "" "Any selection becomes a search target. However, only selections within a " "line work because searches are only performed within lines with the terminal " @@ -926,11 +902,11 @@ msgid "" "interpreted according to the Python re module." msgstr "" -#: ../../library/idle.rst:488 +#: ../../library/idle.rst:479 msgid "Completions" msgstr "" -#: ../../library/idle.rst:490 +#: ../../library/idle.rst:481 msgid "" "Completions are supplied, when requested and available, for module names, " "attributes of classes or functions, or filenames. Each request method " @@ -943,7 +919,7 @@ msgid "" "box. A double click within the box selects and closes." msgstr "" -#: ../../library/idle.rst:501 +#: ../../library/idle.rst:492 msgid "" "One way to open a box is to type a key character and wait for a predefined " "interval. This defaults to 2 seconds; customize it in the settings dialog. " @@ -955,7 +931,7 @@ msgid "" "directory name and a separator." msgstr "" -#: ../../library/idle.rst:511 +#: ../../library/idle.rst:502 msgid "" "Instead of waiting, or after a box is closed, open a completion box " "immediately with Show Completions on the Edit menu. The default hot key is :" @@ -966,7 +942,7 @@ msgid "" "directory." msgstr "" -#: ../../library/idle.rst:519 +#: ../../library/idle.rst:510 msgid "" "Hitting :kbd:`Tab` after a prefix usually has the same effect as Show " "Completions. (With no prefix, it indents.) However, if there is only one " @@ -974,14 +950,14 @@ msgid "" "without opening a box." msgstr "" -#: ../../library/idle.rst:524 +#: ../../library/idle.rst:515 msgid "" "Invoking 'Show Completions', or hitting :kbd:`Tab` after a prefix, outside " "of a string and without a preceding '.' opens a box with keywords, builtin " "names, and available module-level names." msgstr "" -#: ../../library/idle.rst:528 +#: ../../library/idle.rst:519 msgid "" "When editing code in an editor (as oppose to Shell), increase the available " "module-level names by running your code and not restarting the Shell " @@ -989,18 +965,18 @@ msgid "" "file. This also increases possible attribute completions." msgstr "" -#: ../../library/idle.rst:534 +#: ../../library/idle.rst:525 msgid "" "Completion boxes initially exclude names beginning with '_' or, for modules, " "not included in '__all__'. The hidden names can be accessed by typing '_' " "after '.', either before or after the box is opened." msgstr "" -#: ../../library/idle.rst:541 +#: ../../library/idle.rst:532 msgid "Calltips" msgstr "" -#: ../../library/idle.rst:543 +#: ../../library/idle.rst:534 msgid "" "A calltip is shown automatically when one types :kbd:`(` after the name of " "an *accessible* function. A function name expression may include dots and " @@ -1010,7 +986,7 @@ msgid "" "or enter its shortcut to display a calltip." msgstr "" -#: ../../library/idle.rst:550 +#: ../../library/idle.rst:541 msgid "" "The calltip consists of the function's signature and docstring up to the " "latter's first blank line or the fifth non-blank line. (Some builtin " @@ -1019,14 +995,14 @@ msgid "" "or name (keyword) only. Details are subject to change." msgstr "" -#: ../../library/idle.rst:556 +#: ../../library/idle.rst:547 msgid "" "In Shell, the accessible functions depends on what modules have been " "imported into the user process, including those imported by Idle itself, and " "which definitions have been run, all since the last restart." msgstr "" -#: ../../library/idle.rst:560 +#: ../../library/idle.rst:551 msgid "" "For example, restart the Shell and enter ``itertools.count(``. A calltip " "appears because Idle imports itertools into the user process for its own " @@ -1036,18 +1012,18 @@ msgid "" "display a calltip." msgstr "" -#: ../../library/idle.rst:567 +#: ../../library/idle.rst:558 msgid "" "In an editor, import statements have no effect until one runs the file. One " "might want to run a file after writing import statements, after adding " "function definitions, or after opening an existing file." msgstr "" -#: ../../library/idle.rst:574 +#: ../../library/idle.rst:565 msgid "Code Context" msgstr "" -#: ../../library/idle.rst:576 +#: ../../library/idle.rst:567 msgid "" "Within an editor window containing Python code, code context can be toggled " "in order to show or hide a pane at the top of the window. When shown, this " @@ -1061,23 +1037,23 @@ msgid "" "the top of the editor." msgstr "" -#: ../../library/idle.rst:587 +#: ../../library/idle.rst:578 msgid "" "The text and background colors for the context pane can be configured under " "the Highlights tab in the Configure IDLE dialog." msgstr "" -#: ../../library/idle.rst:591 +#: ../../library/idle.rst:582 msgid "Shell window" msgstr "" -#: ../../library/idle.rst:593 +#: ../../library/idle.rst:584 msgid "" "In IDLE's Shell, enter, edit, and recall complete statements. (Most consoles " "and terminals only work with a single physical line at a time)." msgstr "" -#: ../../library/idle.rst:596 +#: ../../library/idle.rst:587 msgid "" "Submit a single-line statement for execution by hitting :kbd:`Return` with " "the cursor anywhere on the line. If a line is extended with Backslash (:kbd:" @@ -1085,7 +1061,7 @@ msgid "" "compound statement by entering a blank line after the statement." msgstr "" -#: ../../library/idle.rst:602 +#: ../../library/idle.rst:593 msgid "" "When one pastes code into Shell, it is not compiled and possibly executed " "until one hits :kbd:`Return`, as specified above. One may edit pasted code " @@ -1094,7 +1070,7 @@ msgid "" "one." msgstr "" -#: ../../library/idle.rst:608 +#: ../../library/idle.rst:599 msgid "" "Lines containing ``RESTART`` mean that the user execution process has been " "re-started. This occurs when the user execution process has crashed, when " @@ -1102,50 +1078,38 @@ msgid "" "window." msgstr "" -#: ../../library/idle.rst:613 +#: ../../library/idle.rst:604 msgid "" "The editing features described in previous subsections work when entering " -"code interactively. IDLE's Shell window also responds to the following keys." -msgstr "" - -#: ../../library/idle.rst:616 -msgid ":kbd:`C-c` interrupts executing command" +"code interactively. IDLE's Shell window also responds to the following:" msgstr "" -#: ../../library/idle.rst:618 -msgid "" -":kbd:`C-d` sends end-of-file; closes window if typed at a ``>>>`` prompt" +#: ../../library/idle.rst:607 +msgid ":kbd:`C-c` attemps to interrupt statement execution (but may fail)." msgstr "" -#: ../../library/idle.rst:620 -msgid ":kbd:`Alt-/` (Expand word) is also useful to reduce typing" +#: ../../library/idle.rst:609 +msgid ":kbd:`C-d` closes Shell if typed at a ``>>>`` prompt." msgstr "" -#: ../../library/idle.rst:622 -msgid "Command history" -msgstr "" - -#: ../../library/idle.rst:624 +#: ../../library/idle.rst:611 msgid "" -":kbd:`Alt-p` retrieves previous command matching what you have typed. On " -"macOS use :kbd:`C-p`." -msgstr "" - -#: ../../library/idle.rst:627 -msgid ":kbd:`Alt-n` retrieves next. On macOS use :kbd:`C-n`." +":kbd:`Alt-p` and :kbd:`Alt-n` (:kbd:`C-p` and :kbd:`C-n` on macOS) retrieve " +"to the current prompt the previous or next previously entered statement that " +"matches anything already typed." msgstr "" -#: ../../library/idle.rst:629 +#: ../../library/idle.rst:615 msgid "" -":kbd:`Return` while the cursor is on any previous command retrieves that " -"command" +":kbd:`Return` while the cursor is on any previous statement appends the " +"latter to anything already typed at the prompt." msgstr "" -#: ../../library/idle.rst:633 +#: ../../library/idle.rst:619 msgid "Text colors" msgstr "" -#: ../../library/idle.rst:635 +#: ../../library/idle.rst:621 msgid "" "Idle defaults to black on white text, but colors text with special meanings. " "For the shell, these are shell output, shell error, user output, and user " @@ -1155,7 +1119,7 @@ msgid "" "(when present), found text (when possible), and selected text." msgstr "" -#: ../../library/idle.rst:642 +#: ../../library/idle.rst:628 msgid "" "IDLE also highlights the :ref:`soft keywords ` :keyword:" "`match`, :keyword:`case `, and :keyword:`_ ` in " @@ -1164,7 +1128,7 @@ msgid "" "patterns." msgstr "" -#: ../../library/idle.rst:648 +#: ../../library/idle.rst:634 msgid "" "Text coloring is done in the background, so uncolorized text is occasionally " "visible. To change the color scheme, use the Configure IDLE dialog " @@ -1172,11 +1136,11 @@ msgid "" "and text in popups and dialogs is not user-configurable." msgstr "" -#: ../../library/idle.rst:655 +#: ../../library/idle.rst:641 msgid "Startup and Code Execution" msgstr "" -#: ../../library/idle.rst:657 +#: ../../library/idle.rst:643 msgid "" "Upon startup with the ``-s`` option, IDLE will execute the file referenced " "by the environment variables :envvar:`IDLESTARTUP` or :envvar:" @@ -1188,7 +1152,7 @@ msgid "" "modules." msgstr "" -#: ../../library/idle.rst:665 +#: ../../library/idle.rst:651 msgid "" "In addition, ``Tk`` also loads a startup file if it is present. Note that " "the Tk file is loaded unconditionally. This additional file is ``.Idle.py`` " @@ -1197,15 +1161,15 @@ msgid "" "importing functions to be used from IDLE's Python shell." msgstr "" -#: ../../library/idle.rst:672 +#: ../../library/idle.rst:658 msgid "Command line usage" msgstr "命令列用法" -#: ../../library/idle.rst:688 +#: ../../library/idle.rst:674 msgid "If there are arguments:" msgstr "" -#: ../../library/idle.rst:690 +#: ../../library/idle.rst:676 msgid "" "If ``-``, ``-c``, or ``r`` is used, all arguments are placed in ``sys." "argv[1:...]`` and ``sys.argv[0]`` is set to ``''``, ``'-c'``, or ``'-r'``. " @@ -1213,17 +1177,17 @@ msgid "" "dialog." msgstr "" -#: ../../library/idle.rst:695 +#: ../../library/idle.rst:681 msgid "" "Otherwise, arguments are files opened for editing and ``sys.argv`` reflects " "the arguments passed to IDLE itself." msgstr "" -#: ../../library/idle.rst:699 +#: ../../library/idle.rst:685 msgid "Startup failure" msgstr "" -#: ../../library/idle.rst:701 +#: ../../library/idle.rst:687 msgid "" "IDLE uses a socket to communicate between the IDLE GUI process and the user " "code execution process. A connection must be established whenever the Shell " @@ -1233,7 +1197,7 @@ msgid "" "directs the user here. It then exits." msgstr "" -#: ../../library/idle.rst:708 +#: ../../library/idle.rst:694 msgid "" "One specific connection failure on Unix systems results from misconfigured " "masquerading rules somewhere in a system's network setup. When IDLE is " @@ -1243,7 +1207,7 @@ msgid "" "``tcplisten `` in another." msgstr "" -#: ../../library/idle.rst:716 +#: ../../library/idle.rst:702 msgid "" "A common cause of failure is a user-written file with the same name as a " "standard library module, such as *random.py* and *tkinter.py*. When such a " @@ -1252,7 +1216,7 @@ msgid "" "file." msgstr "" -#: ../../library/idle.rst:722 +#: ../../library/idle.rst:708 msgid "" "Though less common than in the past, an antivirus or firewall program may " "stop the connection. If the program cannot be taught to allow the " @@ -1262,7 +1226,7 @@ msgid "" "connections." msgstr "" -#: ../../library/idle.rst:729 +#: ../../library/idle.rst:715 msgid "" "Python installation issues occasionally stop IDLE: multiple versions can " "clash, or a single installation might need admin access. If one undo the " @@ -1270,7 +1234,7 @@ msgid "" "completely remove Python and start over." msgstr "" -#: ../../library/idle.rst:734 +#: ../../library/idle.rst:720 msgid "" "A zombie pythonw.exe process could be a problem. On Windows, use Task " "Manager to check for one and stop it if there is. Sometimes a restart " @@ -1279,7 +1243,7 @@ msgid "" "may fix a temporary problem." msgstr "" -#: ../../library/idle.rst:740 +#: ../../library/idle.rst:726 msgid "" "When IDLE first starts, it attempts to read user configuration files in ``~/." "idlerc/`` (~ is one's home directory). If there is a problem, an error " @@ -1290,14 +1254,14 @@ msgid "" "with the settings dialog." msgstr "" -#: ../../library/idle.rst:748 +#: ../../library/idle.rst:734 msgid "" "If IDLE quits with no message, and it was not started from a console, try " "starting it from a console or terminal (``python -m idlelib``) and see if " "this results in an error message." msgstr "" -#: ../../library/idle.rst:752 +#: ../../library/idle.rst:738 msgid "" "On Unix-based systems with tcl/tk older than ``8.6.11`` (see ``About IDLE``) " "certain characters of certain fonts can cause a tk failure with a message to " @@ -1306,11 +1270,11 @@ msgid "" "upgrade tcl/tk, then re-configure IDLE to use a font that works better." msgstr "" -#: ../../library/idle.rst:760 +#: ../../library/idle.rst:746 msgid "Running user code" msgstr "" -#: ../../library/idle.rst:762 +#: ../../library/idle.rst:748 msgid "" "With rare exceptions, the result of executing Python code with IDLE is " "intended to be the same as executing the same code by the default method, " @@ -1320,7 +1284,7 @@ msgid "" "``threading.active_count()`` returns 2 instead of 1." msgstr "" -#: ../../library/idle.rst:769 +#: ../../library/idle.rst:755 msgid "" "By default, IDLE runs user code in a separate OS process rather than in the " "user interface process that runs the shell and editor. In the execution " @@ -1330,7 +1294,7 @@ msgid "" "__stderr__`` are not touched, but may be ``None``." msgstr "" -#: ../../library/idle.rst:776 +#: ../../library/idle.rst:762 msgid "" "Sending print output from one process to a text widget in another is slower " "than printing to a system terminal in the same process. This has the most " @@ -1342,7 +1306,7 @@ msgid "" "fields and lines." msgstr "" -#: ../../library/idle.rst:785 +#: ../../library/idle.rst:771 msgid "" "IDLE's standard stream replacements are not inherited by subprocesses " "created in the execution process, whether directly by user code or by " @@ -1353,14 +1317,14 @@ msgid "" "attached to that window for input and output." msgstr "" -#: ../../library/idle.rst:794 +#: ../../library/idle.rst:780 msgid "" "If ``sys`` is reset by user code, such as with ``importlib.reload(sys)``, " "IDLE's changes are lost and input from the keyboard and output to the screen " "will not work correctly." msgstr "" -#: ../../library/idle.rst:798 +#: ../../library/idle.rst:784 msgid "" "When Shell has the focus, it controls the keyboard and screen. This is " "normally transparent, but functions that directly access the keyboard and " @@ -1368,7 +1332,7 @@ msgid "" "determine whether a key has been pressed and if so, which." msgstr "" -#: ../../library/idle.rst:803 +#: ../../library/idle.rst:789 msgid "" "The IDLE code running in the execution process adds frames to the call stack " "that would not be there otherwise. IDLE wraps ``sys.getrecursionlimit`` and " @@ -1376,17 +1340,17 @@ msgid "" "frames." msgstr "" -#: ../../library/idle.rst:808 +#: ../../library/idle.rst:794 msgid "" "When user code raises SystemExit either directly or by calling sys.exit, " "IDLE returns to a Shell prompt instead of exiting." msgstr "" -#: ../../library/idle.rst:812 +#: ../../library/idle.rst:798 msgid "User output in Shell" msgstr "" -#: ../../library/idle.rst:814 +#: ../../library/idle.rst:800 msgid "" "When a program outputs text, the result is determined by the corresponding " "output device. When IDLE executes user code, ``sys.stdout`` and ``sys." @@ -1396,7 +1360,7 @@ msgid "" "rather than production runs." msgstr "" -#: ../../library/idle.rst:821 +#: ../../library/idle.rst:807 msgid "" "For instance, Shell never throws away output. A program that sends " "unlimited output to Shell will eventually fill memory, resulting in a memory " @@ -1405,7 +1369,7 @@ msgid "" "lines, with 300 the default." msgstr "" -#: ../../library/idle.rst:827 +#: ../../library/idle.rst:813 msgid "" "A Tk Text widget, and hence IDLE's Shell, displays characters (codepoints) " "in the BMP (Basic Multilingual Plane) subset of Unicode. Which characters " @@ -1419,7 +1383,7 @@ msgid "" "spacing behavior.) ::" msgstr "" -#: ../../library/idle.rst:845 +#: ../../library/idle.rst:831 msgid "" "The ``repr`` function is used for interactive echo of expression values. It " "returns an altered version of the input string in which control codes, some " @@ -1428,13 +1392,13 @@ msgid "" "regardless of how they are displayed." msgstr "" -#: ../../library/idle.rst:851 +#: ../../library/idle.rst:837 msgid "" "Normal and error output are generally kept separate (on separate lines) from " "code input and each other. They each get different highlight colors." msgstr "" -#: ../../library/idle.rst:854 +#: ../../library/idle.rst:840 msgid "" "For SyntaxError tracebacks, the normal '^' marking where the error was " "detected is replaced by coloring the text with an error highlight. When code " @@ -1443,7 +1407,7 @@ msgid "" "opened if necessary." msgstr "" -#: ../../library/idle.rst:860 +#: ../../library/idle.rst:846 msgid "" "Shell has a special facility for squeezing output lines down to a 'Squeezed " "text' label. This is done automatically for output over N lines (N = 50 by " @@ -1452,18 +1416,18 @@ msgid "" "on the output. This can be useful lines long enough to slow down scrolling." msgstr "" -#: ../../library/idle.rst:868 +#: ../../library/idle.rst:854 msgid "" "Squeezed output is expanded in place by double-clicking the label. It can " "also be sent to the clipboard or a separate view window by right-clicking " "the label." msgstr "" -#: ../../library/idle.rst:873 +#: ../../library/idle.rst:859 msgid "Developing tkinter applications" msgstr "" -#: ../../library/idle.rst:875 +#: ../../library/idle.rst:861 msgid "" "IDLE is intentionally different from standard Python in order to facilitate " "development of tkinter programs. Enter ``import tkinter as tk; root = tk." @@ -1475,7 +1439,7 @@ msgid "" "changes in standard Python until one enters ``root.update()``." msgstr "" -#: ../../library/idle.rst:884 +#: ../../library/idle.rst:870 msgid "" "Most tkinter programs run ``root.mainloop()``, which usually does not return " "until the tk app is destroyed. If the program is run with ``python -i`` or " @@ -1483,7 +1447,7 @@ msgid "" "``mainloop()`` returns, at which time there is nothing left to interact with." msgstr "" -#: ../../library/idle.rst:890 +#: ../../library/idle.rst:876 msgid "" "When running a tkinter program from an IDLE editor, one can comment out the " "mainloop call. One then gets a shell prompt immediately and can interact " @@ -1491,11 +1455,11 @@ msgid "" "mainloop call when running in standard Python." msgstr "" -#: ../../library/idle.rst:896 +#: ../../library/idle.rst:882 msgid "Running without a subprocess" msgstr "" -#: ../../library/idle.rst:898 +#: ../../library/idle.rst:884 msgid "" "By default, IDLE executes user code in a separate subprocess via a socket, " "which uses the internal loopback interface. This connection is not " @@ -1503,7 +1467,7 @@ msgid "" "firewall software complains anyway, you can ignore it." msgstr "" -#: ../../library/idle.rst:903 +#: ../../library/idle.rst:889 msgid "" "If the attempt to make the socket connection fails, Idle will notify you. " "Such failures are sometimes transient, but if persistent, the problem may be " @@ -1512,7 +1476,7 @@ msgid "" "command line switch." msgstr "" -#: ../../library/idle.rst:909 +#: ../../library/idle.rst:895 msgid "" "If IDLE is started with the -n command line switch it will run in a single " "process and will not create the subprocess which runs the RPC Python " @@ -1526,15 +1490,15 @@ msgid "" "at all possible." msgstr "" -#: ../../library/idle.rst:924 +#: ../../library/idle.rst:910 msgid "Help and Preferences" msgstr "" -#: ../../library/idle.rst:929 +#: ../../library/idle.rst:915 msgid "Help sources" msgstr "" -#: ../../library/idle.rst:931 +#: ../../library/idle.rst:917 msgid "" "Help menu entry \"IDLE Help\" displays a formatted html version of the IDLE " "chapter of the Library Reference. The result, in a read-only tkinter text " @@ -1544,7 +1508,7 @@ msgid "" "the opened box." msgstr "" -#: ../../library/idle.rst:939 +#: ../../library/idle.rst:925 msgid "" "Help menu entry \"Python Docs\" opens the extensive sources of help, " "including tutorials, available at ``docs.python.org/x.y``, where 'x.y' is " @@ -1553,17 +1517,17 @@ msgid "" "instead." msgstr "" -#: ../../library/idle.rst:945 +#: ../../library/idle.rst:931 msgid "" "Selected URLs can be added or removed from the help menu at any time using " "the General tab of the Configure IDLE dialog." msgstr "" -#: ../../library/idle.rst:951 +#: ../../library/idle.rst:937 msgid "Setting preferences" msgstr "" -#: ../../library/idle.rst:953 +#: ../../library/idle.rst:939 msgid "" "The font preferences, highlighting, keys, and general preferences can be " "changed via Configure IDLE on the Option menu. Non-default user settings are " @@ -1572,7 +1536,7 @@ msgid "" "or more of the files in ``.idlerc``." msgstr "" -#: ../../library/idle.rst:959 +#: ../../library/idle.rst:945 msgid "" "On the Font tab, see the text sample for the effect of font face and size on " "multiple characters in multiple languages. Edit the sample to add other " @@ -1581,7 +1545,7 @@ msgid "" "them to the top of the sample and try changing first size and then font." msgstr "" -#: ../../library/idle.rst:966 +#: ../../library/idle.rst:952 msgid "" "On the Highlights and Keys tab, select a built-in or custom color theme and " "key set. To use a newer built-in color theme or key set with older IDLEs, " @@ -1589,22 +1553,22 @@ msgid "" "IDLEs." msgstr "" -#: ../../library/idle.rst:972 +#: ../../library/idle.rst:958 msgid "IDLE on macOS" msgstr "" -#: ../../library/idle.rst:974 +#: ../../library/idle.rst:960 msgid "" "Under System Preferences: Dock, one can set \"Prefer tabs when opening " "documents\" to \"Always\". This setting is not compatible with the tk/" "tkinter GUI framework used by IDLE, and it breaks a few IDLE features." msgstr "" -#: ../../library/idle.rst:979 +#: ../../library/idle.rst:965 msgid "Extensions" msgstr "" -#: ../../library/idle.rst:981 +#: ../../library/idle.rst:967 msgid "" "IDLE contains an extension facility. Preferences for extensions can be " "changed with the Extensions tab of the preferences dialog. See the beginning " @@ -1613,21 +1577,21 @@ msgid "" "testing." msgstr "" -#: ../../library/idle.rst:989 +#: ../../library/idle.rst:975 msgid "idlelib" msgstr "idlelib" -#: ../../library/idle.rst:994 +#: ../../library/idle.rst:980 msgid "**Source code:** :source:`Lib/idlelib`" msgstr "**原始碼:**\\ :source:`Lib/idlelib/`" -#: ../../library/idle.rst:998 +#: ../../library/idle.rst:984 msgid "" "The Lib/idlelib package implements the IDLE application. See the rest of " "this page for how to use IDLE." msgstr "" -#: ../../library/idle.rst:1001 +#: ../../library/idle.rst:987 msgid "" "The files in idlelib are described in idlelib/README.txt. Access it either " "in idlelib or click Help => About IDLE on the IDLE menu. This file also " @@ -1644,26 +1608,26 @@ msgstr "Python Editor(Python 編輯器)" msgid "Integrated Development Environment" msgstr "Integrated Development Environment(整合開發環境)" -#: ../../library/idle.rst:70 +#: ../../library/idle.rst:68 msgid "Module browser" msgstr "Module browser(模組瀏覽器)" -#: ../../library/idle.rst:70 +#: ../../library/idle.rst:68 msgid "Path browser" msgstr "Path browser(路徑瀏覽器)" -#: ../../library/idle.rst:212 +#: ../../library/idle.rst:210 msgid "Run script" msgstr "Run script(執行腳本)" -#: ../../library/idle.rst:279 +#: ../../library/idle.rst:277 msgid "debugger" msgstr "debugger(除錯器)" -#: ../../library/idle.rst:279 +#: ../../library/idle.rst:277 msgid "stack viewer" msgstr "stack viewer(堆疊檢視器)" -#: ../../library/idle.rst:355 +#: ../../library/idle.rst:353 msgid "breakpoints" msgstr "breakpoints(中斷點)" diff --git a/library/locale.po b/library/locale.po index cc0b0f00fa..e82f233fe4 100644 --- a/library/locale.po +++ b/library/locale.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-13 13:14+0000\n" +"POT-Creation-Date: 2024-01-24 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -20,7 +20,7 @@ msgstr "" #: ../../library/locale.rst:2 msgid ":mod:`locale` --- Internationalization services" -msgstr "" +msgstr ":mod:`locale` — 國際化服務" #: ../../library/locale.rst:10 msgid "**Source code:** :source:`Lib/locale.py`" @@ -36,8 +36,8 @@ msgstr "" #: ../../library/locale.rst:21 msgid "" -"The :mod:`locale` module is implemented on top of the :mod:`_locale` module, " -"which in turn uses an ANSI C locale implementation if available." +"The :mod:`locale` module is implemented on top of the :mod:`!_locale` " +"module, which in turn uses an ANSI C locale implementation if available." msgstr "" #: ../../library/locale.rst:24 @@ -366,67 +366,67 @@ msgid "" "format." msgstr "" -#: ../../library/locale.rst:197 +#: ../../library/locale.rst:203 msgid "Get the name of the n-th day of the week." msgstr "" -#: ../../library/locale.rst:201 +#: ../../library/locale.rst:207 msgid "" "This follows the US convention of :const:`DAY_1` being Sunday, not the " "international convention (ISO 8601) that Monday is the first day of the week." msgstr "" -#: ../../library/locale.rst:207 +#: ../../library/locale.rst:219 msgid "Get the abbreviated name of the n-th day of the week." msgstr "" -#: ../../library/locale.rst:211 +#: ../../library/locale.rst:234 msgid "Get the name of the n-th month." msgstr "" -#: ../../library/locale.rst:215 +#: ../../library/locale.rst:249 msgid "Get the abbreviated name of the n-th month." msgstr "" -#: ../../library/locale.rst:219 +#: ../../library/locale.rst:253 msgid "Get the radix character (decimal dot, decimal comma, etc.)." msgstr "" -#: ../../library/locale.rst:223 +#: ../../library/locale.rst:257 msgid "Get the separator character for thousands (groups of three digits)." msgstr "" -#: ../../library/locale.rst:227 +#: ../../library/locale.rst:261 msgid "" "Get a regular expression that can be used with the regex function to " "recognize a positive response to a yes/no question." msgstr "" -#: ../../library/locale.rst:232 +#: ../../library/locale.rst:266 msgid "" -"Get a regular expression that can be used with the regex(3) function to " +"Get a regular expression that can be used with the ``regex(3)`` function to " "recognize a negative response to a yes/no question." msgstr "" -#: ../../library/locale.rst:237 +#: ../../library/locale.rst:271 msgid "" "The regular expressions for :const:`YESEXPR` and :const:`NOEXPR` use syntax " -"suitable for the :c:func:`regex` function from the C library, which might " -"differ from the syntax used in :mod:`re`." +"suitable for the ``regex`` function from the C library, which might differ " +"from the syntax used in :mod:`re`." msgstr "" -#: ../../library/locale.rst:244 +#: ../../library/locale.rst:278 msgid "" "Get the currency symbol, preceded by \"-\" if the symbol should appear " "before the value, \"+\" if the symbol should appear after the value, or \"." "\" if the symbol should replace the radix character." msgstr "" -#: ../../library/locale.rst:250 +#: ../../library/locale.rst:284 msgid "Get a string that represents the era used in the current locale." msgstr "" -#: ../../library/locale.rst:252 +#: ../../library/locale.rst:286 msgid "" "Most locales do not define this value. An example of a locale which does " "define this value is the Japanese one. In Japan, the traditional " @@ -434,7 +434,7 @@ msgid "" "then-emperor's reign." msgstr "" -#: ../../library/locale.rst:257 +#: ../../library/locale.rst:291 msgid "" "Normally it should not be necessary to use this value directly. Specifying " "the ``E`` modifier in their format strings causes the :func:`time.strftime` " @@ -443,37 +443,37 @@ msgid "" "systems." msgstr "" -#: ../../library/locale.rst:265 +#: ../../library/locale.rst:299 msgid "" "Get a format string for :func:`time.strftime` to represent date and time in " "a locale-specific era-based way." msgstr "" -#: ../../library/locale.rst:270 +#: ../../library/locale.rst:304 msgid "" "Get a format string for :func:`time.strftime` to represent a date in a " "locale-specific era-based way." msgstr "" -#: ../../library/locale.rst:275 +#: ../../library/locale.rst:309 msgid "" "Get a format string for :func:`time.strftime` to represent a time in a " "locale-specific era-based way." msgstr "" -#: ../../library/locale.rst:280 +#: ../../library/locale.rst:314 msgid "" "Get a representation of up to 100 values used to represent the values 0 to " "99." msgstr "" -#: ../../library/locale.rst:286 +#: ../../library/locale.rst:320 msgid "" "Tries to determine the default locale settings and returns them as a tuple " "of the form ``(language code, encoding)``." msgstr "" -#: ../../library/locale.rst:289 +#: ../../library/locale.rst:323 msgid "" "According to POSIX, a program which has not called ``setlocale(LC_ALL, '')`` " "runs using the portable ``'C'`` locale. Calling ``setlocale(LC_ALL, '')`` " @@ -482,7 +482,7 @@ msgid "" "emulate the behavior in the way described above." msgstr "" -#: ../../library/locale.rst:295 +#: ../../library/locale.rst:329 msgid "" "To maintain compatibility with other platforms, not only the :envvar:`LANG` " "variable is tested, but a list of variables given as envvars parameter. The " @@ -492,21 +492,21 @@ msgid "" "``'LC_CTYPE'``, ``'LANG'`` and ``'LANGUAGE'``, in that order." msgstr "" -#: ../../library/locale.rst:302 ../../library/locale.rst:315 +#: ../../library/locale.rst:336 ../../library/locale.rst:349 msgid "" "Except for the code ``'C'``, the language code corresponds to :rfc:`1766`. " "*language code* and *encoding* may be ``None`` if their values cannot be " "determined." msgstr "" -#: ../../library/locale.rst:311 +#: ../../library/locale.rst:345 msgid "" "Returns the current setting for the given locale category as sequence " "containing *language code*, *encoding*. *category* may be one of the :const:" "`!LC_\\*` values except :const:`LC_ALL`. It defaults to :const:`LC_CTYPE`." msgstr "" -#: ../../library/locale.rst:322 +#: ../../library/locale.rst:356 msgid "" "Return the :term:`locale encoding` used for text data, according to user " "preferences. User preferences are expressed differently on different " @@ -514,82 +514,82 @@ msgid "" "this function only returns a guess." msgstr "" -#: ../../library/locale.rst:327 +#: ../../library/locale.rst:361 msgid "" "On some systems, it is necessary to invoke :func:`setlocale` to obtain the " "user preferences, so this function is not thread-safe. If invoking setlocale " "is not necessary or desired, *do_setlocale* should be set to ``False``." msgstr "" -#: ../../library/locale.rst:331 +#: ../../library/locale.rst:365 msgid "" "On Android or if the :ref:`Python UTF-8 Mode ` is enabled, always " "return ``'utf-8'``, the :term:`locale encoding` and the *do_setlocale* " "argument are ignored." msgstr "" -#: ../../library/locale.rst:335 ../../library/locale.rst:353 +#: ../../library/locale.rst:369 ../../library/locale.rst:387 msgid "" "The :ref:`Python preinitialization ` configures the LC_CTYPE " "locale. See also the :term:`filesystem encoding and error handler`." msgstr "" -#: ../../library/locale.rst:338 +#: ../../library/locale.rst:372 msgid "" "The function now always returns ``\"utf-8\"`` on Android or if the :ref:" "`Python UTF-8 Mode ` is enabled." msgstr "" -#: ../../library/locale.rst:345 +#: ../../library/locale.rst:379 msgid "Get the current :term:`locale encoding`:" msgstr "" -#: ../../library/locale.rst:347 +#: ../../library/locale.rst:381 msgid "On Android and VxWorks, return ``\"utf-8\"``." msgstr "" -#: ../../library/locale.rst:348 +#: ../../library/locale.rst:382 msgid "" "On Unix, return the encoding of the current :data:`LC_CTYPE` locale. Return " "``\"utf-8\"`` if ``nl_langinfo(CODESET)`` returns an empty string: for " "example, if the current LC_CTYPE locale is not supported." msgstr "" -#: ../../library/locale.rst:351 +#: ../../library/locale.rst:385 msgid "On Windows, return the ANSI code page." msgstr "" -#: ../../library/locale.rst:356 +#: ../../library/locale.rst:390 msgid "" "This function is similar to :func:`getpreferredencoding(False) " "` except this function ignores the :ref:`Python UTF-8 " "Mode `." msgstr "" -#: ../../library/locale.rst:365 +#: ../../library/locale.rst:399 msgid "" "Returns a normalized locale code for the given locale name. The returned " "locale code is formatted for use with :func:`setlocale`. If normalization " "fails, the original name is returned unchanged." msgstr "" -#: ../../library/locale.rst:369 +#: ../../library/locale.rst:403 msgid "" "If the given encoding is not known, the function defaults to the default " "encoding for the locale code just like :func:`setlocale`." msgstr "" -#: ../../library/locale.rst:375 +#: ../../library/locale.rst:409 msgid "Sets the locale for *category* to the default setting." msgstr "" -#: ../../library/locale.rst:377 +#: ../../library/locale.rst:411 msgid "" "The default setting is determined by calling :func:`getdefaultlocale`. " "*category* defaults to :const:`LC_ALL`." msgstr "" -#: ../../library/locale.rst:385 +#: ../../library/locale.rst:419 msgid "" "Compares two strings according to the current :const:`LC_COLLATE` setting. " "As any other compare function, returns a negative, or a positive value, or " @@ -597,7 +597,7 @@ msgid "" "is equal to it." msgstr "" -#: ../../library/locale.rst:393 +#: ../../library/locale.rst:427 msgid "" "Transforms a string to one that can be used in locale-aware comparisons. " "For example, ``strxfrm(s1) < strxfrm(s2)`` is equivalent to ``strcoll(s1, " @@ -605,7 +605,7 @@ msgid "" "repeatedly, e.g. when collating a sequence of strings." msgstr "" -#: ../../library/locale.rst:402 +#: ../../library/locale.rst:436 msgid "" "Formats a number *val* according to the current :const:`LC_NUMERIC` setting. " "The format follows the conventions of the ``%`` operator. For floating " @@ -613,29 +613,29 @@ msgid "" "is ``True``, also takes the grouping into account." msgstr "" -#: ../../library/locale.rst:407 +#: ../../library/locale.rst:441 msgid "" "If *monetary* is true, the conversion uses monetary thousands separator and " "grouping strings." msgstr "" -#: ../../library/locale.rst:410 +#: ../../library/locale.rst:444 msgid "" "Processes formatting specifiers as in ``format % val``, but takes the " "current locale settings into account." msgstr "" -#: ../../library/locale.rst:413 +#: ../../library/locale.rst:447 msgid "The *monetary* keyword parameter was added." msgstr "" -#: ../../library/locale.rst:419 +#: ../../library/locale.rst:453 msgid "" "Formats a number *val* according to the current :const:`LC_MONETARY` " "settings." msgstr "" -#: ../../library/locale.rst:421 +#: ../../library/locale.rst:455 msgid "" "The returned string includes the currency symbol if *symbol* is true, which " "is the default. If *grouping* is ``True`` (which is not the default), " @@ -643,43 +643,43 @@ msgid "" "not the default), the international currency symbol is used." msgstr "" -#: ../../library/locale.rst:428 +#: ../../library/locale.rst:462 msgid "" "This function will not work with the 'C' locale, so you have to set a locale " "via :func:`setlocale` first." msgstr "" -#: ../../library/locale.rst:434 +#: ../../library/locale.rst:468 msgid "" "Formats a floating point number using the same format as the built-in " "function ``str(float)``, but takes the decimal point into account." msgstr "" -#: ../../library/locale.rst:440 +#: ../../library/locale.rst:474 msgid "" "Converts a string into a normalized number string, following the :const:" "`LC_NUMERIC` settings." msgstr "" -#: ../../library/locale.rst:448 +#: ../../library/locale.rst:482 msgid "" "Converts a normalized number string into a formatted string following the :" "const:`LC_NUMERIC` settings." msgstr "" -#: ../../library/locale.rst:456 +#: ../../library/locale.rst:490 msgid "" "Converts a string to a number, following the :const:`LC_NUMERIC` settings, " "by calling *func* on the result of calling :func:`delocalize` on *string*." msgstr "" -#: ../../library/locale.rst:462 +#: ../../library/locale.rst:496 msgid "" "Converts a string to an integer, following the :const:`LC_NUMERIC` " "conventions." msgstr "" -#: ../../library/locale.rst:467 +#: ../../library/locale.rst:501 msgid "" "Locale category for the character type functions. Most importantly, this " "category defines the text encoding, i.e. how bytes are interpreted as " @@ -689,32 +689,32 @@ msgid "" "SSH connections." msgstr "" -#: ../../library/locale.rst:474 +#: ../../library/locale.rst:508 msgid "" "Python doesn't internally use locale-dependent character transformation " "functions from ``ctype.h``. Instead, an internal ``pyctype.h`` provides " "locale-independent equivalents like :c:macro:`!Py_TOLOWER`." msgstr "" -#: ../../library/locale.rst:481 +#: ../../library/locale.rst:515 msgid "" "Locale category for sorting strings. The functions :func:`strcoll` and :" "func:`strxfrm` of the :mod:`locale` module are affected." msgstr "" -#: ../../library/locale.rst:487 +#: ../../library/locale.rst:521 msgid "" "Locale category for the formatting of time. The function :func:`time." "strftime` follows these conventions." msgstr "" -#: ../../library/locale.rst:493 +#: ../../library/locale.rst:527 msgid "" "Locale category for formatting of monetary values. The available options " "are available from the :func:`localeconv` function." msgstr "" -#: ../../library/locale.rst:499 +#: ../../library/locale.rst:533 msgid "" "Locale category for message display. Python currently does not support " "application specific locale-aware messages. Messages displayed by the " @@ -722,13 +722,13 @@ msgid "" "affected by this category." msgstr "" -#: ../../library/locale.rst:504 +#: ../../library/locale.rst:538 msgid "" "This value may not be available on operating systems not conforming to the " "POSIX standard, most notably Windows." msgstr "" -#: ../../library/locale.rst:510 +#: ../../library/locale.rst:544 msgid "" "Locale category for formatting numbers. The functions :func:" "`format_string`, :func:`atoi`, :func:`atof` and :func:`.str` of the :mod:" @@ -736,7 +736,7 @@ msgid "" "operations are not affected." msgstr "" -#: ../../library/locale.rst:518 +#: ../../library/locale.rst:552 msgid "" "Combination of all locale settings. If this flag is used when the locale is " "changed, setting the locale for all categories is attempted. If that fails " @@ -746,24 +746,24 @@ msgid "" "settings." msgstr "" -#: ../../library/locale.rst:527 +#: ../../library/locale.rst:561 msgid "" "This is a symbolic constant used for different values returned by :func:" "`localeconv`." msgstr "" -#: ../../library/locale.rst:531 +#: ../../library/locale.rst:565 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/locale.rst:544 +#: ../../library/locale.rst:578 msgid "Background, details, hints, tips and caveats" msgstr "" -#: ../../library/locale.rst:546 +#: ../../library/locale.rst:580 msgid "" "The C standard defines the locale as a program-wide property that may be " "relatively expensive to change. On top of that, some implementations are " @@ -771,7 +771,7 @@ msgid "" "This makes the locale somewhat painful to use correctly." msgstr "" -#: ../../library/locale.rst:551 +#: ../../library/locale.rst:585 msgid "" "Initially, when a program is started, the locale is the ``C`` locale, no " "matter what the user's preferred locale is. There is one exception: the :" @@ -781,7 +781,7 @@ msgid "" "categories by calling ``setlocale(LC_ALL, '')``." msgstr "" -#: ../../library/locale.rst:558 +#: ../../library/locale.rst:592 msgid "" "It is generally a bad idea to call :func:`setlocale` in some library " "routine, since as a side effect it affects the entire program. Saving and " @@ -789,7 +789,7 @@ msgid "" "that happen to run before the settings have been restored." msgstr "" -#: ../../library/locale.rst:563 +#: ../../library/locale.rst:597 msgid "" "If, when coding a module for general use, you need a locale independent " "version of an operation that is affected by the locale (such as certain " @@ -800,14 +800,14 @@ msgid "" "settings." msgstr "" -#: ../../library/locale.rst:570 +#: ../../library/locale.rst:604 msgid "" "The only way to perform numeric operations according to the locale is to use " "the special functions defined by this module: :func:`atof`, :func:`atoi`, :" "func:`format_string`, :func:`.str`." msgstr "" -#: ../../library/locale.rst:574 +#: ../../library/locale.rst:608 msgid "" "There is no way to perform case conversions and character classifications " "according to the locale. For (Unicode) text strings these are done " @@ -818,11 +818,11 @@ msgid "" "whitespace." msgstr "" -#: ../../library/locale.rst:585 +#: ../../library/locale.rst:619 msgid "For extension writers and programs that embed Python" msgstr "" -#: ../../library/locale.rst:587 +#: ../../library/locale.rst:621 msgid "" "Extension modules should never call :func:`setlocale`, except to find out " "what the current locale is. But since the return value can only be used " @@ -830,37 +830,37 @@ msgid "" "whether or not the locale is ``C``)." msgstr "" -#: ../../library/locale.rst:592 +#: ../../library/locale.rst:626 msgid "" "When Python code uses the :mod:`locale` module to change the locale, this " "also affects the embedding application. If the embedding application " -"doesn't want this to happen, it should remove the :mod:`_locale` extension " +"doesn't want this to happen, it should remove the :mod:`!_locale` extension " "module (which does all the work) from the table of built-in modules in the :" -"file:`config.c` file, and make sure that the :mod:`_locale` module is not " +"file:`config.c` file, and make sure that the :mod:`!_locale` module is not " "accessible as a shared library." msgstr "" -#: ../../library/locale.rst:603 +#: ../../library/locale.rst:637 msgid "Access to message catalogs" msgstr "" -#: ../../library/locale.rst:611 +#: ../../library/locale.rst:646 msgid "" "The locale module exposes the C library's gettext interface on systems that " -"provide this interface. It consists of the functions :func:`!gettext`, :" -"func:`!dgettext`, :func:`!dcgettext`, :func:`!textdomain`, :func:`!" -"bindtextdomain`, and :func:`!bind_textdomain_codeset`. These are similar to " -"the same functions in the :mod:`gettext` module, but use the C library's " -"binary format for message catalogs, and the C library's search algorithms " -"for locating message catalogs." +"provide this interface. It consists of the functions :func:`gettext`, :func:" +"`dgettext`, :func:`dcgettext`, :func:`textdomain`, :func:`bindtextdomain`, " +"and :func:`bind_textdomain_codeset`. These are similar to the same " +"functions in the :mod:`gettext` module, but use the C library's binary " +"format for message catalogs, and the C library's search algorithms for " +"locating message catalogs." msgstr "" -#: ../../library/locale.rst:618 +#: ../../library/locale.rst:653 msgid "" "Python applications should normally find no need to invoke these functions, " "and should use :mod:`gettext` instead. A known exception to this rule are " -"applications that link with additional C libraries which internally invoke :" -"c:func:`gettext` or :c:func:`dcgettext`. For these applications, it may be " +"applications that link with additional C libraries which internally invoke C " +"functions ``gettext`` or ``dcgettext``. For these applications, it may be " "necessary to bind the text domain, so that the libraries can properly locate " "their message catalogs." msgstr "" diff --git a/library/logging.config.po b/library/logging.config.po index 5c32192cc9..bae0d74453 100644 --- a/library/logging.config.po +++ b/library/logging.config.po @@ -1,5 +1,4 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -7,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2024-01-24 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -150,9 +149,9 @@ msgstr "參數" #: ../../library/logging.config.rst:94 msgid "" "A filename, or a file-like object, or an instance derived from :class:" -"`~configparser.RawConfigParser`. If a ``RawConfigParser``-derived instance " -"is passed, it is used as is. Otherwise, a :class:`~configparser." -"Configparser` is instantiated, and the configuration read by it from the " +"`~configparser.RawConfigParser`. If a :class:`!RawConfigParser`-derived " +"instance is passed, it is used as is. Otherwise, a :class:`~configparser." +"ConfigParser` is instantiated, and the configuration read by it from the " "object passed in ``fname``. If that has a :meth:`readline` method, it is " "assumed to be a file-like object and read using :meth:`~configparser." "ConfigParser.read_file`; otherwise, it is assumed to be a filename and " @@ -161,7 +160,8 @@ msgstr "" #: ../../library/logging.config.rst:106 msgid "" -"Defaults to be passed to the ConfigParser can be specified in this argument." +"Defaults to be passed to the :class:`!ConfigParser` can be specified in this " +"argument." msgstr "" #: ../../library/logging.config.rst:109 @@ -197,7 +197,7 @@ msgid "" msgstr "" #: ../../library/logging.config.rst:130 -msgid "The *encoding* parameter is added." +msgid "Added the *encoding* parameter." msgstr "" #: ../../library/logging.config.rst:133 diff --git a/library/logging.handlers.po b/library/logging.handlers.po index 3df1e532ef..b1ff60e1c6 100644 --- a/library/logging.handlers.po +++ b/library/logging.handlers.po @@ -1,5 +1,4 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -7,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-11-03 00:03+0000\n" +"POT-Creation-Date: 2024-01-24 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1258,8 +1257,8 @@ msgid "" msgstr "" #: ../../library/logging.handlers.rst:874 -msgid "The *timeout* argument was added." -msgstr "新增 *timeout* 引數。" +msgid "Added the *timeout* parameter." +msgstr "新增 *timeout* 參數。" #: ../../library/logging.handlers.rst:879 msgid "Formats the record and sends it to the specified addressees." diff --git a/library/logging.po b/library/logging.po index b3823e886e..390af27587 100644 --- a/library/logging.po +++ b/library/logging.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2024-01-24 00:03+0000\n" "PO-Revision-Date: 2023-08-20 16:49+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -779,15 +779,15 @@ msgid "" msgstr "" #: ../../library/logging.rst:618 -msgid "The *style* parameter." +msgid "Added the *style* parameter." msgstr "新增 *style* 參數。" #: ../../library/logging.rst:621 -msgid "The *validate* parameter." +msgid "Added the *validate* parameter." msgstr "新增 *validate* 參數。" #: ../../library/logging.rst:624 -msgid "The *defaults* parameter." +msgid "Added the *defaults* parameter." msgstr "新增 *defaults* 參數。" #: ../../library/logging.rst:630 diff --git a/library/mmap.po b/library/mmap.po index 418b0e75fc..59e5eff00f 100644 --- a/library/mmap.po +++ b/library/mmap.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-24 00:03+0000\n" +"POT-Creation-Date: 2024-01-12 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -109,8 +109,8 @@ msgid "" "same file. If you specify the name of an existing tag, that tag is opened, " "otherwise a new tag of this name is created. If this parameter is omitted " "or ``None``, the mapping is created without a name. Avoiding the use of the " -"tag parameter will assist in keeping your code portable between Unix and " -"Windows." +"*tagname* parameter will assist in keeping your code portable between Unix " +"and Windows." msgstr "" #: ../../library/mmap.rst:68 diff --git a/library/multiprocessing.shared_memory.po b/library/multiprocessing.shared_memory.po index 8e60398c1b..1418e5355e 100644 --- a/library/multiprocessing.shared_memory.po +++ b/library/multiprocessing.shared_memory.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-26 00:03+0000\n" +"POT-Creation-Date: 2024-01-17 00:03+0000\n" "PO-Revision-Date: 2023-12-11 00:03+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -35,14 +35,15 @@ msgid "" "multicore or symmetric multiprocessor (SMP) machine. To assist with the " "life-cycle management of shared memory especially across distinct processes, " "a :class:`~multiprocessing.managers.BaseManager` subclass, :class:" -"`SharedMemoryManager`, is also provided in the ``multiprocessing.managers`` " -"module." +"`~multiprocessing.managers.SharedMemoryManager`, is also provided in the :" +"mod:`multiprocessing.managers` module." msgstr "" "該模組提供了一個 :class:`SharedMemory` 類別,用於分配和管理被多核心或對稱多處" "理器 (symmetric multiprocessor, SMP) 機器上的一個或多個行程存取的共享記憶體。" -"為了協助共享記憶體的生命週期管理,特別是跨不同行程的管理,``multiprocessing." -"managers`` 模組中還提供了一個 :class:`~multiprocessing.managers.BaseManager` " -"子類別 :class:`SharedMemoryManager`。" +"為了協助共享記憶體的生命週期管理,特別是跨不同行程的管理,:mod:" +"`multiprocessing.managers` 模組中還提供了一個 :class:`~multiprocessing." +"managers.BaseManager` 子類別 :class:`~multiprocessing.managers." +"SharedMemoryManager`。" #: ../../library/multiprocessing.shared_memory.rst:26 msgid "" @@ -68,146 +69,153 @@ msgstr "" #: ../../library/multiprocessing.shared_memory.rst:41 msgid "" -"Creates a new shared memory block or attaches to an existing shared memory " -"block. Each shared memory block is assigned a unique name. In this way, one " -"process can create a shared memory block with a particular name and a " -"different process can attach to that same shared memory block using that " -"same name." +"Create an instance of the :class:`!SharedMemory` class for either creating a " +"new shared memory block or attaching to an existing shared memory block. " +"Each shared memory block is assigned a unique name. In this way, one process " +"can create a shared memory block with a particular name and a different " +"process can attach to that same shared memory block using that same name." msgstr "" -"建立新的共享記憶體區塊或附加到現有的共享記憶體區塊。每個共享記憶體區塊都被分" -"配了一個唯一的名稱。透過這種方式,一個行程可以建立具有特定名稱的共享記憶體區" -"塊,而不同的行程可以使用該相同名稱附加到同一共享記憶體區塊。" +"建立 :class:`!SharedMemory` 類別的實例,用於建立新的共享記憶體區塊或附加到現" +"有的共享記憶體區塊。每個共享記憶體區塊都被分配了一個唯一的名稱。透過這種方" +"式,一個行程可以建立具有特定名稱的共享記憶體區塊,而不同的行程可以使用該相同" +"名稱附加到同一共享記憶體塊。" -#: ../../library/multiprocessing.shared_memory.rst:47 +#: ../../library/multiprocessing.shared_memory.rst:48 msgid "" "As a resource for sharing data across processes, shared memory blocks may " "outlive the original process that created them. When one process no longer " "needs access to a shared memory block that might still be needed by other " -"processes, the :meth:`close()` method should be called. When a shared memory " -"block is no longer needed by any process, the :meth:`unlink()` method should " +"processes, the :meth:`close` method should be called. When a shared memory " +"block is no longer needed by any process, the :meth:`unlink` method should " "be called to ensure proper cleanup." msgstr "" "作為跨行程共享資料的資源,共享記憶體區塊的壽命可能比建立它們的原始行程還要" "長。當一個行程不再需要存取但其他行程可能仍需要的共享記憶體區塊時,應該呼叫 :" -"meth:`close()` 方法。當任何行程不再需要共享記憶體區塊時,應呼叫 :meth:" -"`unlink()` 方法以確保正確清理。" +"meth:`close` 方法。當任何行程不再需要共享記憶體區塊時,應呼叫 :meth:`unlink` " +"方法以確保正確清理。" -#: ../../library/multiprocessing.shared_memory.rst:54 +#: ../../library/multiprocessing.shared_memory.rst:0 +msgid "Parameters" +msgstr "參數" + +#: ../../library/multiprocessing.shared_memory.rst:55 msgid "" -"*name* is the unique name for the requested shared memory, specified as a " -"string. When creating a new shared memory block, if ``None`` (the default) " -"is supplied for the name, a novel name will be generated." +"The unique name for the requested shared memory, specified as a string. When " +"creating a new shared memory block, if ``None`` (the default) is supplied " +"for the name, a novel name will be generated." msgstr "" -"*name* 是所請求的共享記憶體的唯一名稱,指定為字串。建立新的共享記憶體區塊時," -"如果名稱提供為 ``None``\\ (預設值),則會生成一個新的名稱。" +"所請求的共享記憶體的唯一名稱,指定為字串。建立新的共享記憶體區塊時,如果名稱" +"提供為 ``None``\\ (預設值),則會生成一個新的名稱。" -#: ../../library/multiprocessing.shared_memory.rst:58 +#: ../../library/multiprocessing.shared_memory.rst:61 msgid "" -"*create* controls whether a new shared memory block is created (``True``) or " -"an existing shared memory block is attached (``False``)." +"Control whether a new shared memory block is created (``True``) or an " +"existing shared memory block is attached (``False``)." msgstr "" -"*create* 控制是否建立新的共享記憶體區塊 (``True``) 或附加現有的共享記憶體區" -"塊 (``False``)。" +"控制是否建立新的共享記憶體區塊 (``True``) 或附加現有的共享記憶體區塊 " +"(``False``)。" -#: ../../library/multiprocessing.shared_memory.rst:61 +#: ../../library/multiprocessing.shared_memory.rst:65 msgid "" -"*size* specifies the requested number of bytes when creating a new shared " -"memory block. Because some platforms choose to allocate chunks of memory " -"based upon that platform's memory page size, the exact size of the shared " -"memory block may be larger or equal to the size requested. When attaching " -"to an existing shared memory block, the ``size`` parameter is ignored." +"The requested number of bytes when creating a new shared memory block. " +"Because some platforms choose to allocate chunks of memory based upon that " +"platform's memory page size, the exact size of the shared memory block may " +"be larger or equal to the size requested. When attaching to an existing " +"shared memory block, the *size* parameter is ignored." msgstr "" -"*size* 指定了建立新共享記憶體區塊時請求的位元組數。由於某些平台會根據該平台的" -"記憶體頁 (memory page) 大小來選擇分配記憶體區塊,因此共享記憶體區塊的確切大小" -"可能大於或等於請求的大小。當附加到現有共享記憶體區塊時,``size`` 參數將被忽" -"略。" +"指定建立新共享記憶體區塊時請求的位元組數。由於某些平台會根據該平台的記憶體頁 " +"(memory page) 大小來選擇分配記憶體區塊,因此共享記憶體區塊的確切大小可能大於" +"或等於請求的大小。當附加到現有共享記憶體區塊時,``size`` 參數將被忽略。" -#: ../../library/multiprocessing.shared_memory.rst:69 +#: ../../library/multiprocessing.shared_memory.rst:75 msgid "" -"Closes access to the shared memory from this instance. In order to ensure " -"proper cleanup of resources, all instances should call ``close()`` once the " -"instance is no longer needed. Note that calling ``close()`` does not cause " -"the shared memory block itself to be destroyed." +"Close access to the shared memory from this instance. In order to ensure " +"proper cleanup of resources, all instances should call :meth:`close` once " +"the instance is no longer needed. Note that calling :meth:`!close` does not " +"cause the shared memory block itself to be destroyed." msgstr "" "關閉從此實例對共享記憶體的存取。為了確保正確清理資源,一旦實例不再被需要,所" -"有實例都應該呼叫 ``close()``。請注意,呼叫 ``close()`` 不會使得共享記憶體區塊" -"本身被銷毀。" +"有實例都應該呼叫 :meth:`close`。請注意,呼叫 :meth:`!close` 不會使得共享記憶" +"體區塊本身被銷毀。" -#: ../../library/multiprocessing.shared_memory.rst:77 +#: ../../library/multiprocessing.shared_memory.rst:83 msgid "" -"Requests that the underlying shared memory block be destroyed. In order to " -"ensure proper cleanup of resources, ``unlink()`` should be called once (and " -"only once) across all processes which have need for the shared memory " +"Request that the underlying shared memory block be destroyed. In order to " +"ensure proper cleanup of resources, :meth:`unlink` should be called once " +"(and only once) across all processes which have need for the shared memory " "block. After requesting its destruction, a shared memory block may or may " "not be immediately destroyed and this behavior may differ across platforms. " -"Attempts to access data inside the shared memory block after ``unlink()`` " +"Attempts to access data inside the shared memory block after :meth:`!unlink` " "has been called may result in memory access errors. Note: the last process " -"relinquishing its hold on a shared memory block may call ``unlink()`` and :" -"meth:`close()` in either order." +"relinquishing its hold on a shared memory block may call :meth:`!unlink` " +"and :meth:`close` in either order." msgstr "" "請求銷毀底層共享記憶體區塊。為了確保正確清理資源,應該在需要共享記憶體區塊的" -"所有行程中呼叫一次(且僅一次)\\ ``unlink()``。請求銷毀後,共享記憶體區塊可能" -"會也可能不會立即銷毀,此行為可能因平台而異。呼叫 ``unlink()`` 後嘗試存取共享" -"記憶體區塊內的資料可能會導致記憶體存取錯誤。注意:最後一個放棄持有某共享記憶" -"體區塊的行程可以按任意順序呼叫 ``unlink()`` 和 :meth:`close()`。" +"所有行程中呼叫一次(且僅一次)\\ :meth:`unlink`。請求銷毀後,共享記憶體區塊可" +"能會也可能不會立即銷毀,此行為可能因平台而異。呼叫 :meth:`!unlink` 後嘗試存取" +"共享記憶體區塊內的資料可能會導致記憶體存取錯誤。注意:最後一個放棄持有某共享" +"記憶體區塊的行程可以按任意順序呼叫 :meth:`!unlink` 和 :meth:`close`。" -#: ../../library/multiprocessing.shared_memory.rst:90 +#: ../../library/multiprocessing.shared_memory.rst:96 msgid "A memoryview of contents of the shared memory block." msgstr "共享記憶體區塊內容的記憶體視圖 (memoryview)。" -#: ../../library/multiprocessing.shared_memory.rst:94 +#: ../../library/multiprocessing.shared_memory.rst:100 msgid "Read-only access to the unique name of the shared memory block." msgstr "對共享記憶體區塊之唯一名稱的唯讀存取。" -#: ../../library/multiprocessing.shared_memory.rst:98 +#: ../../library/multiprocessing.shared_memory.rst:104 msgid "Read-only access to size in bytes of the shared memory block." msgstr "對共享記憶體區塊大小(以位元組為單位)的唯讀存取。" -#: ../../library/multiprocessing.shared_memory.rst:101 +#: ../../library/multiprocessing.shared_memory.rst:107 msgid "" "The following example demonstrates low-level use of :class:`SharedMemory` " "instances::" msgstr "以下範例示範了 :class:`SharedMemory` 實例的低階使用方式: ::" -#: ../../library/multiprocessing.shared_memory.rst:127 +#: ../../library/multiprocessing.shared_memory.rst:133 msgid "" "The following example demonstrates a practical use of the :class:" "`SharedMemory` class with `NumPy arrays `_, accessing " -"the same ``numpy.ndarray`` from two distinct Python shells:" +"the same :class:`!numpy.ndarray` from two distinct Python shells:" msgstr "" "以下範例示範了 :class:`SharedMemory` 類別與 `NumPy 陣列 `_\\ 的實際用法:從兩個不同的 Python shell 存取相同的 ``numpy.ndarray``:" +">`_\\ 的實際用法:從兩個不同的 Python shell 存取相同的 :class:`!numpy." +"ndarray`:" -#: ../../library/multiprocessing.shared_memory.rst:181 +#: ../../library/multiprocessing.shared_memory.rst:187 msgid "" -"A subclass of :class:`~multiprocessing.managers.BaseManager` which can be " +"A subclass of :class:`multiprocessing.managers.BaseManager` which can be " "used for the management of shared memory blocks across processes." msgstr "" -":class:`~multiprocessing.managers.BaseManager` 的子類別,可用於跨行程管理共享" +":class:`multiprocessing.managers.BaseManager` 的子類別,可用於跨行程管理共享" "記憶體區塊。" -#: ../../library/multiprocessing.shared_memory.rst:184 +#: ../../library/multiprocessing.shared_memory.rst:190 msgid "" -"A call to :meth:`~multiprocessing.managers.BaseManager.start` on a :class:" -"`SharedMemoryManager` instance causes a new process to be started. This new " +"A call to :meth:`~multiprocessing.managers.BaseManager.start` on a :class:`!" +"SharedMemoryManager` instance causes a new process to be started. This new " "process's sole purpose is to manage the life cycle of all shared memory " "blocks created through it. To trigger the release of all shared memory " "blocks managed by that process, call :meth:`~multiprocessing.managers." -"BaseManager.shutdown()` on the instance. This triggers a :meth:`SharedMemory." -"unlink()` call on all of the :class:`SharedMemory` objects managed by that " -"process and then stops the process itself. By creating ``SharedMemory`` " -"instances through a ``SharedMemoryManager``, we avoid the need to manually " -"track and trigger the freeing of shared memory resources." +"BaseManager.shutdown` on the instance. This triggers a :meth:" +"`~multiprocessing.shared_memory.SharedMemory.unlink` call on all of the :" +"class:`SharedMemory` objects managed by that process and then stops the " +"process itself. By creating :class:`!SharedMemory` instances through a :" +"class:`!SharedMemoryManager`, we avoid the need to manually track and " +"trigger the freeing of shared memory resources." msgstr "" -"在 :class:`SharedMemoryManager` 實例上呼叫 :meth:`~multiprocessing.managers." +"在 :class:`!SharedMemoryManager` 實例上呼叫 :meth:`~multiprocessing.managers." "BaseManager.start` 會啟動一個新行程。這個新行程的唯一目的是管理那些透過它建立" "出的所有共享記憶體區塊的生命週期。要觸發釋放該行程管理的所有共享記憶體區塊," -"請在實例上呼叫 :meth:`~multiprocessing.managers.BaseManager.shutdown()`,這會" -"觸發對該行程管理的所有 :class:`SharedMemory` 物件的 :meth:`SharedMemory." -"unlink()` 呼叫,然後再停止這個行程。透過 ``SharedMemoryManager`` 建立 " -"``SharedMemory`` 實例,我們無需手動追蹤和觸發共享記憶體資源的釋放。" +"請在實例上呼叫 :meth:`~multiprocessing.managers.BaseManager.shutdown`,這會觸" +"發對該行程管理的所有 :class:`SharedMemory` 物件的 :meth:`~multiprocessing." +"shared_memory.SharedMemory.unlink` 呼叫,然後再停止這個行程。透過 :class:`!" +"SharedMemoryManager` 建立 :class:`!SharedMemory` 實例,我們無需手動追蹤和觸" +"發共享記憶體資源的釋放。" -#: ../../library/multiprocessing.shared_memory.rst:196 +#: ../../library/multiprocessing.shared_memory.rst:202 msgid "" "This class provides methods for creating and returning :class:`SharedMemory` " "instances and for creating a list-like object (:class:`ShareableList`) " @@ -216,112 +224,143 @@ msgstr "" "此類別提供了用於建立和回傳 :class:`SharedMemory` 實例以及建立由共享記憶體支援" "的類串列物件 (:class:`ShareableList`) 的方法。" -#: ../../library/multiprocessing.shared_memory.rst:200 +#: ../../library/multiprocessing.shared_memory.rst:206 msgid "" -"Refer to :class:`multiprocessing.managers.BaseManager` for a description of " +"Refer to :class:`~multiprocessing.managers.BaseManager` for a description of " "the inherited *address* and *authkey* optional input arguments and how they " -"may be used to connect to an existing ``SharedMemoryManager`` service from " -"other processes." +"may be used to connect to an existing :class:`!SharedMemoryManager` service " +"from other processes." msgstr "" -"請參閱 :class:`multiprocessing.managers.BaseManager` 了解繼承的 *address* 和 " -"*authkey* 可選輸入引數的描述以及如何使用它們從其他行程連接到現有的 " -"``SharedMemoryManager`` 服務。" +"請參閱 :class:`~multiprocessing.managers.BaseManager` 了解繼承的 *address* " +"和 *authkey* 可選輸入引數的描述以及如何使用它們從其他行程連接到現有的 :class:" +"`!SharedMemoryManager` 服務。" -#: ../../library/multiprocessing.shared_memory.rst:207 +#: ../../library/multiprocessing.shared_memory.rst:213 msgid "" "Create and return a new :class:`SharedMemory` object with the specified " -"``size`` in bytes." +"*size* in bytes." msgstr "" -"建立並回傳一個新的 :class:`SharedMemory` 物件,該物件具有指定的 ``size``\\ " -"(以位元組為單位)。" +"建立並回傳一個新的 :class:`SharedMemory` 物件,該物件具有指定的 *size*\\ (以" +"位元組為單位)。" -#: ../../library/multiprocessing.shared_memory.rst:212 +#: ../../library/multiprocessing.shared_memory.rst:218 msgid "" "Create and return a new :class:`ShareableList` object, initialized by the " -"values from the input ``sequence``." +"values from the input *sequence*." msgstr "" -"建立並回傳一個新的 :class:`ShareableList` 物件,該物件由輸入 ``sequence`` 中" -"的值初始化。" +"建立並回傳一個新的 :class:`ShareableList` 物件,該物件由輸入 *sequence* 中的" +"值初始化。" -#: ../../library/multiprocessing.shared_memory.rst:216 +#: ../../library/multiprocessing.shared_memory.rst:222 msgid "" "The following example demonstrates the basic mechanisms of a :class:" -"`SharedMemoryManager`:" -msgstr "以下範例示範了 :class:`SharedMemoryManager` 的基本作用機制:" +"`~multiprocessing.managers.SharedMemoryManager`:" +msgstr "" +"以下範例示範了 :class:`~multiprocessing.managers.SharedMemoryManager` 的基本" +"作用機制:" -#: ../../library/multiprocessing.shared_memory.rst:234 +#: ../../library/multiprocessing.shared_memory.rst:240 msgid "" "The following example depicts a potentially more convenient pattern for " -"using :class:`SharedMemoryManager` objects via the :keyword:`with` statement " -"to ensure that all shared memory blocks are released after they are no " -"longer needed:" +"using :class:`~multiprocessing.managers.SharedMemoryManager` objects via " +"the :keyword:`with` statement to ensure that all shared memory blocks are " +"released after they are no longer needed:" msgstr "" "以下範例描述了一種可能更方便的模式,即透過 :keyword:`with` 陳述式使用 :class:" -"`SharedMemoryManager` 物件,以確保所有共享記憶體區塊不再被需要後都被釋放:" +"`~multiprocessing.managers.SharedMemoryManager` 物件,以確保所有共享記憶體區" +"塊不再被需要後都被釋放:" -#: ../../library/multiprocessing.shared_memory.rst:253 +#: ../../library/multiprocessing.shared_memory.rst:259 msgid "" -"When using a :class:`SharedMemoryManager` in a :keyword:`with` statement, " -"the shared memory blocks created using that manager are all released when " -"the :keyword:`with` statement's code block finishes execution." -msgstr "" -"在 :keyword:`with` 陳述式中使用 :class:`SharedMemoryManager` 時,當 :keyword:" -"`with` 陳述式的程式碼區塊執行完畢時,使用該管理器建立的共享記憶體區塊都會被釋" -"放。" - -#: ../../library/multiprocessing.shared_memory.rst:260 -msgid "" -"Provides a mutable list-like object where all values stored within are " -"stored in a shared memory block. This constrains storable values to only " -"the ``int`` (signed 64-bit), ``float``, ``bool``, ``str`` (less than 10M " -"bytes each when encoded as utf-8), ``bytes`` (less than 10M bytes each), and " -"``None`` built-in data types. It also notably differs from the built-in " -"``list`` type in that these lists can not change their overall length (i.e. " -"no append, insert, etc.) and do not support the dynamic creation of new :" -"class:`ShareableList` instances via slicing." +"When using a :class:`~multiprocessing.managers.SharedMemoryManager` in a :" +"keyword:`with` statement, the shared memory blocks created using that " +"manager are all released when the :keyword:`!with` statement's code block " +"finishes execution." msgstr "" -"提供一個類似串列的可變物件,其中有被儲存的所有值都儲存在共享記憶體區塊中。這" -"限制了可存儲的值只能夠是內建資料型別 ``int``\\ (帶符號的 64 位元 (signed 64-" -"bit))、``float``、``bool``、``str``\\ (編碼為 utf-8 時個別小於 10M 位元" -"組)、``bytes``\\ (個別小於 10M 位元組)和 ``None``。它還與內建的 ``list`` " -"型別有顯著不同,因為這些串列不能更改其總長度(即不能追加 (append)、插入等)," -"並且不支援透過切片動態建立新的 :class:`ShareableList` 實例。" - -#: ../../library/multiprocessing.shared_memory.rst:270 -msgid "" -"*sequence* is used in populating a new ``ShareableList`` full of values. Set " -"to ``None`` to instead attach to an already existing ``ShareableList`` by " -"its unique shared memory name." +"在 :keyword:`with` 陳述式中使用 :class:`~multiprocessing.managers." +"SharedMemoryManager` 時,當 :keyword:`!with` 陳述式的程式碼區塊執行完畢時,使" +"用該管理器建立的共享記憶體區塊都會被釋放。" + +#: ../../library/multiprocessing.shared_memory.rst:267 +msgid "" +"Provide a mutable list-like object where all values stored within are stored " +"in a shared memory block. This constrains storable values to the following " +"built-in data types:" msgstr "" -"*sequence* 用於填充 (populate) 一個充滿值的新 ``ShareableList``。設定為 " -"``None`` 以透過其唯一的共享記憶體名稱來附加到已經存在的 ``ShareableList``。" +"提供一個類似 list 的可變物件,其中儲存的所有值都儲存在共享記憶體區塊中。這將" +"可儲存值限制為以下內建資料型別:" + +#: ../../library/multiprocessing.shared_memory.rst:271 +msgid ":class:`int` (signed 64-bit)" +msgstr ":class:`int` (有符號 64 位元)" + +#: ../../library/multiprocessing.shared_memory.rst:272 +msgid ":class:`float`" +msgstr ":class:`float`" + +#: ../../library/multiprocessing.shared_memory.rst:273 +msgid ":class:`bool`" +msgstr ":class:`bool`" #: ../../library/multiprocessing.shared_memory.rst:274 +msgid ":class:`str` (less than 10M bytes each when encoded as UTF-8)" +msgstr ":class:`str` (編碼為 UTF-8 時每個小於 10M 位元組)" + +#: ../../library/multiprocessing.shared_memory.rst:275 +msgid ":class:`bytes` (less than 10M bytes each)" +msgstr ":class:`bytes` (每個小於 10M 位元組)" + +#: ../../library/multiprocessing.shared_memory.rst:276 +msgid "``None``" +msgstr "``None``" + +#: ../../library/multiprocessing.shared_memory.rst:278 +msgid "" +"It also notably differs from the built-in :class:`list` type in that these " +"lists can not change their overall length (i.e. no :meth:`!append`, :meth:`!" +"insert`, etc.) and do not support the dynamic creation of new :class:`!" +"ShareableList` instances via slicing." +msgstr "" +"它也與內建 :class:`list` 型別明顯不同,因為這些 list 不能更改其總長度(即沒" +"有 :meth:`!append`、:meth:`!insert` 等)並且不支援通過切片動態建立新的 :" +"class:`!ShareableList` 實例。" + +#: ../../library/multiprocessing.shared_memory.rst:284 +msgid "" +"*sequence* is used in populating a new :class:`!ShareableList` full of " +"values. Set to ``None`` to instead attach to an already existing :class:`!" +"ShareableList` by its unique shared memory name." +msgstr "" +"*sequence* 用於填充 (populate) 一個充滿值的新 :class:`!ShareableList`。設定" +"為 ``None`` 以透過其唯一的共享記憶體名稱來附加到已經存在的 :class:`!" +"ShareableList`。" + +#: ../../library/multiprocessing.shared_memory.rst:288 msgid "" "*name* is the unique name for the requested shared memory, as described in " -"the definition for :class:`SharedMemory`. When attaching to an existing " -"``ShareableList``, specify its shared memory block's unique name while " -"leaving ``sequence`` set to ``None``." +"the definition for :class:`SharedMemory`. When attaching to an existing :" +"class:`!ShareableList`, specify its shared memory block's unique name while " +"leaving *sequence* set to ``None``." msgstr "" "如 :class:`SharedMemory` 的定義中所述,*name* 是被請求之共享記憶體的唯一名" -"稱。當附加到現有的 ``ShareableList`` 時,指定其共享記憶體區塊的唯一名稱,同時" -"將 ``sequence`` 設定為 ``None``。" +"稱。當附加到現有的 :class:`!ShareableList` 時,指定其共享記憶體區塊的唯一名" +"稱,同時將 *sequence* 設定為 ``None``。" -#: ../../library/multiprocessing.shared_memory.rst:281 +#: ../../library/multiprocessing.shared_memory.rst:295 msgid "" "A known issue exists for :class:`bytes` and :class:`str` values. If they end " "with ``\\x00`` nul bytes or characters, those may be *silently stripped* " -"when fetching them by index from the :class:`ShareableList`. This ``." +"when fetching them by index from the :class:`!ShareableList`. This ``." "rstrip(b'\\x00')`` behavior is considered a bug and may go away in the " "future. See :gh:`106939`." msgstr "" ":class:`bytes` 和 :class:`str` 值存在一個已知問題。如果它們以 ``\\x00`` nul " -"位元組或字元結尾,那麼當透過索引從 :class:`ShareableList` 中獲取它們時,這些" +"位元組或字元結尾,那麼當透過索引從 :class:`!ShareableList` 中獲取它們時,這些" "位元組或字元可能會被\\ *默默地剝離 (silently stripped)*。這種 ``." "rstrip(b'\\x00')`` 行為被認為是一個錯誤,將來可能會消失。請參閱 :gh:" "`106939`。" -#: ../../library/multiprocessing.shared_memory.rst:287 +#: ../../library/multiprocessing.shared_memory.rst:301 msgid "" "For applications where rstripping of trailing nulls is a problem, work " "around it by always unconditionally appending an extra non-0 byte to the end " @@ -331,35 +370,35 @@ msgstr "" "(workaround) 是始終無條件地在儲存時於此類值的末尾追加一個額外非 0 位元組,並" "在獲取時也無條件地刪除它:" -#: ../../library/multiprocessing.shared_memory.rst:310 -msgid "Returns the number of occurrences of ``value``." -msgstr "回傳 ``value`` 出現的次數。" +#: ../../library/multiprocessing.shared_memory.rst:324 +msgid "Return the number of occurrences of *value*." +msgstr "回傳 *value* 出現的次數。" -#: ../../library/multiprocessing.shared_memory.rst:314 +#: ../../library/multiprocessing.shared_memory.rst:328 msgid "" -"Returns first index position of ``value``. Raises :exc:`ValueError` if " -"``value`` is not present." +"Return first index position of *value*. Raise :exc:`ValueError` if *value* " +"is not present." msgstr "" -"回傳 ``value`` 的第一個索引位置。如果 ``value`` 不存在,則引發 :exc:" +"回傳 *value* 的第一個索引位置。如果 *value* 不存在,則引發 :exc:" "`ValueError`。" -#: ../../library/multiprocessing.shared_memory.rst:319 +#: ../../library/multiprocessing.shared_memory.rst:333 msgid "" "Read-only attribute containing the :mod:`struct` packing format used by all " "currently stored values." msgstr "唯讀屬性,包含所有目前有儲存的值所使用的 :mod:`struct` 打包格式。" -#: ../../library/multiprocessing.shared_memory.rst:324 +#: ../../library/multiprocessing.shared_memory.rst:338 msgid "The :class:`SharedMemory` instance where the values are stored." msgstr "儲存值的 :class:`SharedMemory` 實例。" -#: ../../library/multiprocessing.shared_memory.rst:327 +#: ../../library/multiprocessing.shared_memory.rst:341 msgid "" "The following example demonstrates basic use of a :class:`ShareableList` " "instance:" msgstr "以下範例示範了 :class:`ShareableList` 實例的基本用法:" -#: ../../library/multiprocessing.shared_memory.rst:360 +#: ../../library/multiprocessing.shared_memory.rst:374 msgid "" "The following example depicts how one, two, or many processes may access the " "same :class:`ShareableList` by supplying the name of the shared memory block " @@ -368,18 +407,19 @@ msgstr "" "以下範例描述了一個、兩個或多個行程如何透過提供後面的共享記憶體區塊名稱來存取" "同一個 :class:`ShareableList`:" -#: ../../library/multiprocessing.shared_memory.rst:375 +#: ../../library/multiprocessing.shared_memory.rst:389 msgid "" -"The following examples demonstrates that ``ShareableList`` (and underlying " -"``SharedMemory``) objects can be pickled and unpickled if needed. Note, that " -"it will still be the same shared object. This happens, because the " -"deserialized object has the same unique name and is just attached to an " -"existing object with the same name (if the object is still alive):" +"The following examples demonstrates that :class:`ShareableList` (and " +"underlying :class:`SharedMemory`) objects can be pickled and unpickled if " +"needed. Note, that it will still be the same shared object. This happens, " +"because the deserialized object has the same unique name and is just " +"attached to an existing object with the same name (if the object is still " +"alive):" msgstr "" -"以下範例示範了如果需要,可以對 ``ShareableList``\\ (和底層 " -"``SharedMemory``\\ )物件進行 pickle 和 unpickle。請注意,它仍然是相同的共享" -"物件。發生這種情況是因為反序列化的物件具有相同的唯一名稱,並且只是附加到具有" -"相同名稱的現有物件(如果該物件仍然存在):" +"以下範例示範了如果需要,可以對 :class:`ShareableList`\\ (和底層 :class:" +"`SharedMemory`\\ )物件進行 pickle 和 unpickle。請注意,它仍然是相同的共享物" +"件。發生這種情況是因為反序列化的物件具有相同的唯一名稱,並且只是附加到具有相" +"同名稱的現有物件(如果該物件仍然存在):" #: ../../library/multiprocessing.shared_memory.rst:11 msgid "Shared Memory" @@ -392,3 +432,21 @@ msgstr "POSIX Shared Memory(POSIX 共享記憶體)" #: ../../library/multiprocessing.shared_memory.rst:11 msgid "Named Shared Memory" msgstr "Named Shared Memory(附名共享記憶體)" + +#~ msgid "" +#~ "Provides a mutable list-like object where all values stored within are " +#~ "stored in a shared memory block. This constrains storable values to only " +#~ "the ``int`` (signed 64-bit), ``float``, ``bool``, ``str`` (less than 10M " +#~ "bytes each when encoded as utf-8), ``bytes`` (less than 10M bytes each), " +#~ "and ``None`` built-in data types. It also notably differs from the built-" +#~ "in ``list`` type in that these lists can not change their overall length " +#~ "(i.e. no append, insert, etc.) and do not support the dynamic creation of " +#~ "new :class:`ShareableList` instances via slicing." +#~ msgstr "" +#~ "提供一個類似串列的可變物件,其中有被儲存的所有值都儲存在共享記憶體區塊中。" +#~ "這限制了可存儲的值只能夠是內建資料型別 ``int``\\ (帶符號的 64 位元 " +#~ "(signed 64-bit))、``float``、``bool``、``str``\\ (編碼為 utf-8 時個別小" +#~ "於 10M 位元組)、``bytes``\\ (個別小於 10M 位元組)和 ``None``。它還與內" +#~ "建的 ``list`` 型別有顯著不同,因為這些串列不能更改其總長度(即不能追加 " +#~ "(append)、插入等),並且不支援透過切片動態建立新的 :class:`ShareableList` " +#~ "實例。" diff --git a/library/os.po b/library/os.po index 4a8ac8ca36..2d87e3e0c4 100644 --- a/library/os.po +++ b/library/os.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-17 00:04+0000\n" +"POT-Creation-Date: 2024-01-24 00:03+0000\n" "PO-Revision-Date: 2023-08-30 23:53+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -306,27 +306,27 @@ msgstr "" #: ../../library/os.rst:1637 ../../library/os.rst:2021 #: ../../library/os.rst:2110 ../../library/os.rst:2150 #: ../../library/os.rst:2433 ../../library/os.rst:2455 -#: ../../library/os.rst:4039 ../../library/os.rst:4046 -#: ../../library/os.rst:4053 ../../library/os.rst:4060 -#: ../../library/os.rst:4067 ../../library/os.rst:4074 -#: ../../library/os.rst:4081 ../../library/os.rst:4089 -#: ../../library/os.rst:4097 ../../library/os.rst:4104 -#: ../../library/os.rst:4111 ../../library/os.rst:4120 -#: ../../library/os.rst:4128 ../../library/os.rst:4136 -#: ../../library/os.rst:4143 ../../library/os.rst:4150 -#: ../../library/os.rst:4226 ../../library/os.rst:4266 -#: ../../library/os.rst:4273 ../../library/os.rst:4303 -#: ../../library/os.rst:4430 ../../library/os.rst:4479 -#: ../../library/os.rst:4716 ../../library/os.rst:4750 -#: ../../library/os.rst:4808 ../../library/os.rst:4822 -#: ../../library/os.rst:4839 ../../library/os.rst:4854 -#: ../../library/os.rst:4865 ../../library/os.rst:4877 -#: ../../library/os.rst:4890 ../../library/os.rst:4899 -#: ../../library/os.rst:4909 ../../library/os.rst:4922 -#: ../../library/os.rst:4973 ../../library/os.rst:4984 -#: ../../library/os.rst:4996 ../../library/os.rst:5003 -#: ../../library/os.rst:5012 ../../library/os.rst:5021 -#: ../../library/os.rst:5030 ../../library/os.rst:5039 +#: ../../library/os.rst:4040 ../../library/os.rst:4047 +#: ../../library/os.rst:4054 ../../library/os.rst:4061 +#: ../../library/os.rst:4068 ../../library/os.rst:4075 +#: ../../library/os.rst:4082 ../../library/os.rst:4090 +#: ../../library/os.rst:4098 ../../library/os.rst:4105 +#: ../../library/os.rst:4112 ../../library/os.rst:4121 +#: ../../library/os.rst:4129 ../../library/os.rst:4137 +#: ../../library/os.rst:4144 ../../library/os.rst:4151 +#: ../../library/os.rst:4227 ../../library/os.rst:4267 +#: ../../library/os.rst:4274 ../../library/os.rst:4304 +#: ../../library/os.rst:4431 ../../library/os.rst:4480 +#: ../../library/os.rst:4717 ../../library/os.rst:4751 +#: ../../library/os.rst:4812 ../../library/os.rst:4826 +#: ../../library/os.rst:4843 ../../library/os.rst:4858 +#: ../../library/os.rst:4869 ../../library/os.rst:4881 +#: ../../library/os.rst:4894 ../../library/os.rst:4903 +#: ../../library/os.rst:4913 ../../library/os.rst:4926 +#: ../../library/os.rst:4977 ../../library/os.rst:4988 +#: ../../library/os.rst:5000 ../../library/os.rst:5007 +#: ../../library/os.rst:5016 ../../library/os.rst:5025 +#: ../../library/os.rst:5034 ../../library/os.rst:5043 msgid ":ref:`Availability `: Unix, not Emscripten, not WASI." msgstr ":ref:`適用 `:Unix、非 Emscripten、非 WASI。" @@ -484,10 +484,10 @@ msgstr "" #: ../../library/os.rst:322 ../../library/os.rst:1086 ../../library/os.rst:1097 #: ../../library/os.rst:1110 ../../library/os.rst:1357 #: ../../library/os.rst:1649 ../../library/os.rst:1797 -#: ../../library/os.rst:2533 ../../library/os.rst:3378 -#: ../../library/os.rst:3415 ../../library/os.rst:4031 -#: ../../library/os.rst:4567 ../../library/os.rst:4578 -#: ../../library/os.rst:4695 +#: ../../library/os.rst:2533 ../../library/os.rst:3379 +#: ../../library/os.rst:3416 ../../library/os.rst:4032 +#: ../../library/os.rst:4568 ../../library/os.rst:4579 +#: ../../library/os.rst:4696 msgid ":ref:`Availability `: Unix, Windows." msgstr ":ref:`適用 `:Unix、Windows。" @@ -516,11 +516,11 @@ msgstr "" #: ../../library/os.rst:1735 ../../library/os.rst:1770 #: ../../library/os.rst:2093 ../../library/os.rst:2124 #: ../../library/os.rst:2181 ../../library/os.rst:2499 -#: ../../library/os.rst:2511 ../../library/os.rst:3244 -#: ../../library/os.rst:3401 ../../library/os.rst:3634 -#: ../../library/os.rst:5187 ../../library/os.rst:5196 -#: ../../library/os.rst:5217 ../../library/os.rst:5227 -#: ../../library/os.rst:5236 +#: ../../library/os.rst:2511 ../../library/os.rst:3245 +#: ../../library/os.rst:3402 ../../library/os.rst:3635 +#: ../../library/os.rst:5191 ../../library/os.rst:5200 +#: ../../library/os.rst:5221 ../../library/os.rst:5231 +#: ../../library/os.rst:5240 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" @@ -592,10 +592,10 @@ msgid "" "getpwuid(os.getuid())[0]`` to get the login name of the current real user id." msgstr "" -#: ../../library/os.rst:426 ../../library/os.rst:462 ../../library/os.rst:3996 -#: ../../library/os.rst:4250 ../../library/os.rst:4548 -#: ../../library/os.rst:4672 ../../library/os.rst:4788 -#: ../../library/os.rst:4957 +#: ../../library/os.rst:426 ../../library/os.rst:462 ../../library/os.rst:3997 +#: ../../library/os.rst:4251 ../../library/os.rst:4549 +#: ../../library/os.rst:4673 ../../library/os.rst:4792 +#: ../../library/os.rst:4961 msgid "" ":ref:`Availability `: Unix, Windows, not Emscripten, not WASI." msgstr ":ref:`適用 `:Unix、Windows、非 Emscripten、非 WASI。" @@ -893,7 +893,7 @@ msgid "" "or even ``socket.gethostbyaddr(socket.gethostname())``." msgstr "" -#: ../../library/os.rst:789 ../../library/os.rst:4697 +#: ../../library/os.rst:789 ../../library/os.rst:4698 msgid "" "Return type changed from a tuple to a tuple-like object with named " "attributes." @@ -1134,7 +1134,7 @@ msgstr "" #: ../../library/os.rst:1006 ../../library/os.rst:1021 #: ../../library/os.rst:1112 ../../library/os.rst:1651 #: ../../library/os.rst:2066 ../../library/os.rst:2095 -#: ../../library/os.rst:3380 +#: ../../library/os.rst:3381 msgid "" "The function is limited on Emscripten and WASI, see :ref:`wasm-availability` " "for more information." @@ -1239,7 +1239,7 @@ msgstr "" "引發一個附帶引數 ``fd``、``length`` 的\\ :ref:`稽核事件 ` ``os." "truncate``。" -#: ../../library/os.rst:1099 ../../library/os.rst:3419 +#: ../../library/os.rst:1099 ../../library/os.rst:3420 msgid "Added support for Windows" msgstr "新增對 Windows 的支援" @@ -1436,14 +1436,16 @@ msgid "" "a file descriptor in a file object, use :func:`fdopen`." msgstr "" -#: ../../library/os.rst:1254 ../../library/os.rst:2367 -#: ../../library/os.rst:2435 ../../library/os.rst:2457 -#: ../../library/os.rst:2538 ../../library/os.rst:2569 -msgid "The *dir_fd* argument." -msgstr "*dir_fd* 引數。" +#: ../../library/os.rst:1254 ../../library/os.rst:2331 +#: ../../library/os.rst:2367 ../../library/os.rst:2435 +#: ../../library/os.rst:2457 ../../library/os.rst:2538 +#: ../../library/os.rst:2569 ../../library/os.rst:2676 +#: ../../library/os.rst:3436 +msgid "Added the *dir_fd* parameter." +msgstr "新增 *dir_fd* 參數。" #: ../../library/os.rst:1257 ../../library/os.rst:1576 -#: ../../library/os.rst:1752 ../../library/os.rst:4790 +#: ../../library/os.rst:1752 ../../library/os.rst:4794 msgid "" "If the system call is interrupted and the signal handler does not raise an " "exception, the function now retries the system call instead of raising an :" @@ -1460,11 +1462,11 @@ msgstr "" #: ../../library/os.rst:2460 ../../library/os.rst:2501 #: ../../library/os.rst:2572 ../../library/os.rst:2591 #: ../../library/os.rst:2679 ../../library/os.rst:2969 -#: ../../library/os.rst:3258 ../../library/os.rst:3422 -#: ../../library/os.rst:3438 ../../library/os.rst:3478 -#: ../../library/os.rst:3577 ../../library/os.rst:3638 -#: ../../library/os.rst:3822 ../../library/os.rst:4002 -#: ../../library/os.rst:4555 +#: ../../library/os.rst:3259 ../../library/os.rst:3423 +#: ../../library/os.rst:3439 ../../library/os.rst:3479 +#: ../../library/os.rst:3578 ../../library/os.rst:3639 +#: ../../library/os.rst:3823 ../../library/os.rst:4003 +#: ../../library/os.rst:4556 msgid "Accepts a :term:`path-like object`." msgstr "" @@ -2007,8 +2009,8 @@ msgid "Get the \"inheritable\" flag of the specified handle (a boolean)." msgstr "" #: ../../library/os.rst:1849 ../../library/os.rst:1855 -#: ../../library/os.rst:3927 ../../library/os.rst:4590 -#: ../../library/os.rst:4635 +#: ../../library/os.rst:3928 ../../library/os.rst:4591 +#: ../../library/os.rst:4636 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" @@ -2240,8 +2242,8 @@ msgstr "" "chflags``。" #: ../../library/os.rst:2023 -msgid "The *follow_symlinks* argument." -msgstr "*follow_symlinks* 引數。" +msgid "Added the *follow_symlinks* parameter." +msgstr "新增 *follow_symlinks* 參數。" #: ../../library/os.rst:2032 msgid "" @@ -2327,7 +2329,7 @@ msgid ":const:`stat.S_IXOTH`" msgstr ":const:`stat.S_IXOTH`" #: ../../library/os.rst:2056 ../../library/os.rst:2084 -#: ../../library/os.rst:3468 +#: ../../library/os.rst:3469 msgid "" "This function can support :ref:`specifying a file descriptor `, :" "ref:`paths relative to directory descriptors ` and :ref:`not " @@ -2411,13 +2413,12 @@ msgid "" msgstr "" #: ../../library/os.rst:2168 -#, fuzzy msgid "" ":ref:`Availability `: Unix, not Linux, FreeBSD >= 1.3, NetBSD " ">= 1.3, not OpenBSD" msgstr "" -":ref:`適用 `:Linux 2.6.30 以上、FreeBSD 6.0 以上、OpenBSD 2.7 " -"以上、AIX 7.1 以上。" +":ref:`適用 `:Unix、非 Linux、FreeBSD 1.3 以上、NetBSD 1.3 以" +"上、非 OpenBSD。" #: ../../library/os.rst:2175 msgid "" @@ -2449,16 +2450,16 @@ msgstr "" msgid ":ref:`Availability `: Unix, Windows, not Emscripten." msgstr ":ref:`適用 `:Unix、Windows、非 Emscripten。" -#: ../../library/os.rst:2199 +#: ../../library/os.rst:2199 ../../library/os.rst:4253 msgid "Added Windows support." msgstr "新支援 Windows。" #: ../../library/os.rst:2202 -msgid "Added the *src_dir_fd*, *dst_dir_fd*, and *follow_symlinks* arguments." -msgstr "增加 *src_dir_fd*\\ 、\\ *dst_dir_fd* 與 *follow_symlinks* 引數。" +msgid "Added the *src_dir_fd*, *dst_dir_fd*, and *follow_symlinks* parameters." +msgstr "新增 *src_dir_fd*、*dst_dir_fd* 與 *follow_symlinks* 參數。" #: ../../library/os.rst:2205 ../../library/os.rst:2623 -#: ../../library/os.rst:2660 ../../library/os.rst:3390 +#: ../../library/os.rst:2660 ../../library/os.rst:3391 msgid "Accepts a :term:`path-like object` for *src* and *dst*." msgstr "" @@ -2506,7 +2507,7 @@ msgstr "" msgid "The *path* parameter became optional." msgstr "" -#: ../../library/os.rst:2239 ../../library/os.rst:3249 +#: ../../library/os.rst:2239 ../../library/os.rst:3250 msgid "Added support for specifying *path* as an open file descriptor." msgstr "" @@ -2621,14 +2622,10 @@ msgid "" msgstr "" #: ../../library/os.rst:2328 ../../library/os.rst:2535 -#: ../../library/os.rst:3383 +#: ../../library/os.rst:3384 msgid "Added support for Windows 6.0 (Vista) symbolic links." msgstr "" -#: ../../library/os.rst:2331 -msgid "Added the *dir_fd* parameter." -msgstr "新增 *dir_fd* 參數。" - #: ../../library/os.rst:2337 msgid "" "On Windows, now opens reparse points that represent another path (name " @@ -2703,8 +2700,8 @@ msgid "This function handles UNC paths correctly." msgstr "" #: ../../library/os.rst:2401 -msgid "The *exist_ok* parameter." -msgstr "*exist_ok* 參數。" +msgid "Added the *exist_ok* parameter." +msgstr "新增 *exist_ok* 參數。" #: ../../library/os.rst:2406 msgid "" @@ -2774,8 +2771,8 @@ msgid "" "included in that mapping, passing an integer for *name* is also accepted." msgstr "" -#: ../../library/os.rst:2496 ../../library/os.rst:3242 -#: ../../library/os.rst:3411 +#: ../../library/os.rst:2496 ../../library/os.rst:3243 +#: ../../library/os.rst:3412 msgid "" "This function can support :ref:`specifying a file descriptor `." msgstr "" @@ -2832,7 +2829,7 @@ msgid "" msgstr "" #: ../../library/os.rst:2558 ../../library/os.rst:2671 -#: ../../library/os.rst:3362 +#: ../../library/os.rst:3363 msgid "" "This function can support :ref:`paths relative to directory descriptors " "`." @@ -2851,7 +2848,7 @@ msgid "This function is semantically identical to :func:`unlink`." msgstr "" #: ../../library/os.rst:2567 ../../library/os.rst:2589 -#: ../../library/os.rst:3433 +#: ../../library/os.rst:3434 msgid "" "Raises an :ref:`auditing event ` ``os.remove`` with arguments " "``path``, ``dir_fd``." @@ -2918,8 +2915,8 @@ msgstr "" "稽核事件 ` ``os.rename``。" #: ../../library/os.rst:2620 -msgid "The *src_dir_fd* and *dst_dir_fd* arguments." -msgstr "*src_dir_fd* 與 *dst_dir_fd* 引數。" +msgid "Added the *src_dir_fd* and *dst_dir_fd* parameters." +msgstr "新增 *src_dir_fd* 與 *dst_dir_fd* 參數。" #: ../../library/os.rst:2629 msgid "" @@ -2965,10 +2962,6 @@ msgstr "" "引發一個附帶引數 ``path``、``dir_fd`` 的\\ :ref:`稽核事件 ` ``os." "rmdir``。" -#: ../../library/os.rst:2676 ../../library/os.rst:3435 -msgid "The *dir_fd* parameter." -msgstr "*dir_fd* 參數。" - #: ../../library/os.rst:2685 msgid "" "Return an iterator of :class:`os.DirEntry` objects corresponding to the " @@ -3299,9 +3292,9 @@ msgid "" "``follow_symlinks=False``, or use :func:`lstat`." msgstr "" -#: ../../library/os.rst:2934 ../../library/os.rst:3801 -#: ../../library/os.rst:3817 ../../library/os.rst:3833 -#: ../../library/os.rst:3853 +#: ../../library/os.rst:2934 ../../library/os.rst:3802 +#: ../../library/os.rst:3818 ../../library/os.rst:3834 +#: ../../library/os.rst:3854 msgid "" "This function can support :ref:`specifying a file descriptor ` and :" "ref:`not following symlinks `." @@ -3321,12 +3314,9 @@ msgid "" "junction points, which will raise the usual exceptions." msgstr "" -#: ../../library/os.rst:2950 ../../library/os.rst:3721 +#: ../../library/os.rst:2950 ../../library/os.rst:3722 msgid "Example::" -msgstr "" -"範例:\n" -"\n" -"::" +msgstr "範例: ::" #: ../../library/os.rst:2963 msgid ":func:`fstat` and :func:`lstat` functions." @@ -3334,9 +3324,9 @@ msgstr ":func:`fstat` 和 :func:`lstat` 函式。" #: ../../library/os.rst:2965 msgid "" -"Added the *dir_fd* and *follow_symlinks* arguments, specifying a file " +"Added the *dir_fd* and *follow_symlinks* parameters, specifying a file " "descriptor instead of a path." -msgstr "" +msgstr "新增 *dir_fd* 與 *follow_symlinks* 參數,指定一個檔案描述器而非路徑。" #: ../../library/os.rst:2972 msgid "" @@ -3429,41 +3419,41 @@ msgstr "" msgid "Time of most recent access expressed in nanoseconds as an integer." msgstr "" -#: ../../library/os.rst:3050 +#: ../../library/os.rst:3052 msgid "" "Time of most recent content modification expressed in nanoseconds as an " "integer." msgstr "" -#: ../../library/os.rst:3055 +#: ../../library/os.rst:3059 msgid "" "Time of most recent metadata change expressed in nanoseconds as an integer." msgstr "" -#: ../../library/os.rst:3058 +#: ../../library/os.rst:3064 msgid "" "``st_ctime_ns`` is deprecated on Windows. Use ``st_birthtime_ns`` for the " "file creation time. In the future, ``st_ctime`` will contain the time of the " "most recent metadata change, as for other platforms." msgstr "" -#: ../../library/os.rst:3065 +#: ../../library/os.rst:3071 msgid "" "Time of file creation expressed in seconds. This attribute is not always " "available, and may raise :exc:`AttributeError`." msgstr "" -#: ../../library/os.rst:3068 +#: ../../library/os.rst:3074 msgid "``st_birthtime`` is now available on Windows." msgstr "" -#: ../../library/os.rst:3073 +#: ../../library/os.rst:3079 msgid "" "Time of file creation expressed in nanoseconds as an integer. This attribute " "is not always available, and may raise :exc:`AttributeError`." msgstr "" -#: ../../library/os.rst:3081 +#: ../../library/os.rst:3087 msgid "" "The exact meaning and resolution of the :attr:`st_atime`, :attr:`st_mtime`, :" "attr:`st_ctime` and :attr:`st_birthtime` attributes depend on the operating " @@ -3473,7 +3463,7 @@ msgid "" "details." msgstr "" -#: ../../library/os.rst:3088 +#: ../../library/os.rst:3094 msgid "" "Similarly, although :attr:`st_atime_ns`, :attr:`st_mtime_ns`, :attr:" "`st_ctime_ns` and :attr:`st_birthtime_ns` are always expressed in " @@ -3486,74 +3476,74 @@ msgid "" "`st_birthtime_ns`." msgstr "" -#: ../../library/os.rst:3098 +#: ../../library/os.rst:3104 msgid "" "On some Unix systems (such as Linux), the following attributes may also be " "available:" msgstr "" -#: ../../library/os.rst:3103 +#: ../../library/os.rst:3109 msgid "" "Number of 512-byte blocks allocated for file. This may be smaller than :attr:" "`st_size`/512 when the file has holes." msgstr "" -#: ../../library/os.rst:3108 +#: ../../library/os.rst:3114 msgid "" "\"Preferred\" blocksize for efficient file system I/O. Writing to a file in " "smaller chunks may cause an inefficient read-modify-rewrite." msgstr "" -#: ../../library/os.rst:3113 +#: ../../library/os.rst:3119 msgid "Type of device if an inode device." msgstr "" -#: ../../library/os.rst:3117 +#: ../../library/os.rst:3123 msgid "User defined flags for file." msgstr "" -#: ../../library/os.rst:3119 +#: ../../library/os.rst:3125 msgid "" "On other Unix systems (such as FreeBSD), the following attributes may be " "available (but may be only filled out if root tries to use them):" msgstr "" -#: ../../library/os.rst:3124 +#: ../../library/os.rst:3130 msgid "File generation number." msgstr "" -#: ../../library/os.rst:3126 +#: ../../library/os.rst:3132 msgid "" "On Solaris and derivatives, the following attributes may also be available:" msgstr "" -#: ../../library/os.rst:3131 +#: ../../library/os.rst:3137 msgid "" "String that uniquely identifies the type of the filesystem that contains the " "file." msgstr "" -#: ../../library/os.rst:3134 +#: ../../library/os.rst:3140 msgid "On macOS systems, the following attributes may also be available:" msgstr "" -#: ../../library/os.rst:3138 +#: ../../library/os.rst:3144 msgid "Real size of the file." msgstr "" -#: ../../library/os.rst:3142 +#: ../../library/os.rst:3148 msgid "Creator of the file." msgstr "" -#: ../../library/os.rst:3146 +#: ../../library/os.rst:3152 msgid "File type." msgstr "" -#: ../../library/os.rst:3148 +#: ../../library/os.rst:3154 msgid "On Windows systems, the following attributes are also available:" msgstr "" -#: ../../library/os.rst:3152 +#: ../../library/os.rst:3158 msgid "" "Windows file attributes: ``dwFileAttributes`` member of the " "``BY_HANDLE_FILE_INFORMATION`` structure returned by :c:func:`!" @@ -3561,7 +3551,7 @@ msgid "" "FILE_ATTRIBUTE_ARCHIVE>` constants in the :mod:`stat` module." msgstr "" -#: ../../library/os.rst:3160 +#: ../../library/os.rst:3168 msgid "" "When :attr:`st_file_attributes` has the :const:`~stat." "FILE_ATTRIBUTE_REPARSE_POINT` set, this field contains the tag identifying " @@ -3569,14 +3559,14 @@ msgid "" "IO_REPARSE_TAG_SYMLINK>` constants in the :mod:`stat` module." msgstr "" -#: ../../library/os.rst:3165 +#: ../../library/os.rst:3173 msgid "" "The standard module :mod:`stat` defines functions and constants that are " "useful for extracting information from a :c:struct:`stat` structure. (On " "Windows, some items are filled with dummy values.)" msgstr "" -#: ../../library/os.rst:3169 +#: ../../library/os.rst:3177 msgid "" "For backward compatibility, a :class:`stat_result` instance is also " "accessible as a tuple of at least 10 integers giving the most important (and " @@ -3588,59 +3578,49 @@ msgid "" "class:`stat_result` as a tuple always returns integers." msgstr "" -#: ../../library/os.rst:3178 -msgid "" -"Added the :attr:`st_atime_ns`, :attr:`st_mtime_ns`, and :attr:`st_ctime_ns` " -"members." -msgstr "" - -#: ../../library/os.rst:3182 -msgid "Added the :attr:`st_file_attributes` member on Windows." -msgstr "在 Windows 上新增 :attr:`st_file_attributes` 成員。" - -#: ../../library/os.rst:3185 +#: ../../library/os.rst:3186 msgid "Windows now returns the file index as :attr:`st_ino` when available." msgstr "" -#: ../../library/os.rst:3189 +#: ../../library/os.rst:3190 msgid "Added the :attr:`st_fstype` member to Solaris/derivatives." msgstr "" -#: ../../library/os.rst:3192 +#: ../../library/os.rst:3193 msgid "Added the :attr:`st_reparse_tag` member on Windows." msgstr "在 Windows 上新增 :attr:`st_reparse_tag` 成員。" -#: ../../library/os.rst:3195 +#: ../../library/os.rst:3196 msgid "" "On Windows, the :attr:`st_mode` member now identifies special files as :" "const:`S_IFCHR`, :const:`S_IFIFO` or :const:`S_IFBLK` as appropriate." msgstr "" -#: ../../library/os.rst:3200 +#: ../../library/os.rst:3201 msgid "" "On Windows, :attr:`st_ctime` is deprecated. Eventually, it will contain the " "last metadata change time, for consistency with other platforms, but for now " "still contains creation time. Use :attr:`st_birthtime` for the creation time." msgstr "" -#: ../../library/os.rst:3206 +#: ../../library/os.rst:3207 msgid "" "On Windows, :attr:`st_ino` may now be up to 128 bits, depending on the file " "system. Previously it would not be above 64 bits, and larger file " "identifiers would be arbitrarily packed." msgstr "" -#: ../../library/os.rst:3211 +#: ../../library/os.rst:3212 msgid "" "On Windows, :attr:`st_rdev` no longer returns a value. Previously it would " "contain the same as :attr:`st_dev`, which was incorrect." msgstr "" -#: ../../library/os.rst:3215 +#: ../../library/os.rst:3216 msgid "Added the :attr:`st_birthtime` member on Windows." -msgstr "" +msgstr "在 Windows 上新增 :attr:`st_birthtime` 成員。" -#: ../../library/os.rst:3221 +#: ../../library/os.rst:3222 msgid "" "Perform a :c:func:`!statvfs` system call on the given path. The return " "value is an object whose attributes describe the filesystem on the given " @@ -3650,7 +3630,7 @@ msgid "" "`f_favail`, :attr:`f_flag`, :attr:`f_namemax`, :attr:`f_fsid`." msgstr "" -#: ../../library/os.rst:3228 +#: ../../library/os.rst:3229 msgid "" "Two module-level constants are defined for the :attr:`f_flag` attribute's " "bit-flags: if :const:`ST_RDONLY` is set, the filesystem is mounted read-" @@ -3658,7 +3638,7 @@ msgid "" "are disabled or not supported." msgstr "" -#: ../../library/os.rst:3233 +#: ../../library/os.rst:3234 msgid "" "Additional module-level constants are defined for GNU/glibc based systems. " "These are :const:`ST_NODEV` (disallow access to device special files), :" @@ -3671,11 +3651,11 @@ msgid "" "relative to mtime/ctime)." msgstr "" -#: ../../library/os.rst:3246 +#: ../../library/os.rst:3247 msgid "The :const:`ST_RDONLY` and :const:`ST_NOSUID` constants were added." msgstr "新增 :const:`ST_RDONLY` 與 :const:`ST_NOSUID` 常數。" -#: ../../library/os.rst:3252 +#: ../../library/os.rst:3253 msgid "" "The :const:`ST_NODEV`, :const:`ST_NOEXEC`, :const:`ST_SYNCHRONOUS`, :const:" "`ST_MANDLOCK`, :const:`ST_WRITE`, :const:`ST_APPEND`, :const:" @@ -3683,11 +3663,11 @@ msgid "" "`ST_RELATIME` constants were added." msgstr "" -#: ../../library/os.rst:3261 -msgid "Added :attr:`f_fsid`." -msgstr "新增 :attr:`f_fsid`\\ 。" +#: ../../library/os.rst:3262 +msgid "Added the :attr:`f_fsid` attribute." +msgstr "新增 :attr:`f_fsid` 屬性。" -#: ../../library/os.rst:3267 +#: ../../library/os.rst:3268 msgid "" "A :class:`set` object indicating which functions in the :mod:`os` module " "accept an open file descriptor for their *dir_fd* parameter. Different " @@ -3699,7 +3679,7 @@ msgid "" "(Specifying ``None`` for *dir_fd* is always supported on all platforms.)" msgstr "" -#: ../../library/os.rst:3277 +#: ../../library/os.rst:3278 msgid "" "To check whether a particular function accepts an open file descriptor for " "its *dir_fd* parameter, use the ``in`` operator on ``supports_dir_fd``. As " @@ -3707,13 +3687,13 @@ msgid "" "open file descriptors for *dir_fd* on the local platform::" msgstr "" -#: ../../library/os.rst:3284 +#: ../../library/os.rst:3285 msgid "" "Currently *dir_fd* parameters only work on Unix platforms; none of them work " "on Windows." msgstr "" -#: ../../library/os.rst:3292 +#: ../../library/os.rst:3293 msgid "" "A :class:`set` object indicating whether :func:`os.access` permits " "specifying ``True`` for its *effective_ids* parameter on the local platform. " @@ -3722,19 +3702,19 @@ msgid "" "func:`os.access`; otherwise it will be empty." msgstr "" -#: ../../library/os.rst:3298 +#: ../../library/os.rst:3299 msgid "" "This expression evaluates to ``True`` if :func:`os.access` supports " "``effective_ids=True`` on the local platform::" msgstr "" -#: ../../library/os.rst:3303 +#: ../../library/os.rst:3304 msgid "" "Currently *effective_ids* is only supported on Unix platforms; it does not " "work on Windows." msgstr "" -#: ../../library/os.rst:3311 +#: ../../library/os.rst:3312 msgid "" "A :class:`set` object indicating which functions in the :mod:`os` module " "permit specifying their *path* parameter as an open file descriptor on the " @@ -3743,7 +3723,7 @@ msgid "" "*path* arguments is not available on all platforms Python supports." msgstr "" -#: ../../library/os.rst:3318 +#: ../../library/os.rst:3319 msgid "" "To determine whether a particular function permits specifying an open file " "descriptor for its *path* parameter, use the ``in`` operator on " @@ -3752,7 +3732,7 @@ msgid "" "platform::" msgstr "" -#: ../../library/os.rst:3331 +#: ../../library/os.rst:3332 msgid "" "A :class:`set` object indicating which functions in the :mod:`os` module " "accept ``False`` for their *follow_symlinks* parameter on the local " @@ -3765,7 +3745,7 @@ msgid "" "on all platforms.)" msgstr "" -#: ../../library/os.rst:3341 +#: ../../library/os.rst:3342 msgid "" "To check whether a particular function accepts ``False`` for its " "*follow_symlinks* parameter, use the ``in`` operator on " @@ -3774,11 +3754,11 @@ msgid "" "stat` on the local platform::" msgstr "" -#: ../../library/os.rst:3354 +#: ../../library/os.rst:3355 msgid "Create a symbolic link pointing to *src* named *dst*." msgstr "" -#: ../../library/os.rst:3356 +#: ../../library/os.rst:3357 msgid "" "On Windows, a symlink represents either a file or a directory, and does not " "morph to the target dynamically. If the target is present, the type of the " @@ -3788,7 +3768,7 @@ msgid "" "ignored." msgstr "" -#: ../../library/os.rst:3367 +#: ../../library/os.rst:3368 msgid "" "On newer versions of Windows 10, unprivileged accounts can create symlinks " "if Developer Mode is enabled. When Developer Mode is not available/enabled, " @@ -3796,12 +3776,12 @@ msgid "" "must be run as an administrator." msgstr "" -#: ../../library/os.rst:3373 +#: ../../library/os.rst:3374 msgid "" ":exc:`OSError` is raised when the function is called by an unprivileged user." msgstr "" -#: ../../library/os.rst:3376 +#: ../../library/os.rst:3377 msgid "" "Raises an :ref:`auditing event ` ``os.symlink`` with arguments " "``src``, ``dst``, ``dir_fd``." @@ -3809,27 +3789,27 @@ msgstr "" "引發一個附帶引數 ``src``、``dst``、``dir_fd`` 的\\ :ref:`稽核事件 " "` ``os.symlink``。" -#: ../../library/os.rst:3386 +#: ../../library/os.rst:3387 msgid "" -"Added the *dir_fd* argument, and now allow *target_is_directory* on non-" +"Added the *dir_fd* parameter, and now allow *target_is_directory* on non-" "Windows platforms." msgstr "" -#: ../../library/os.rst:3393 +#: ../../library/os.rst:3394 msgid "Added support for unelevated symlinks on Windows with Developer Mode." msgstr "" -#: ../../library/os.rst:3399 +#: ../../library/os.rst:3400 msgid "Force write of everything to disk." msgstr "" -#: ../../library/os.rst:3408 +#: ../../library/os.rst:3409 msgid "" "Truncate the file corresponding to *path*, so that it is at most *length* " "bytes in size." msgstr "" -#: ../../library/os.rst:3413 +#: ../../library/os.rst:3414 msgid "" "Raises an :ref:`auditing event ` ``os.truncate`` with arguments " "``path``, ``length``." @@ -3837,46 +3817,46 @@ msgstr "" "引發一個附帶引數 ``path``、``length`` 的\\ :ref:`稽核事件 ` ``os." "truncate``。" -#: ../../library/os.rst:3428 +#: ../../library/os.rst:3429 msgid "" "Remove (delete) the file *path*. This function is semantically identical " "to :func:`remove`; the ``unlink`` name is its traditional Unix name. Please " "see the documentation for :func:`remove` for further information." msgstr "" -#: ../../library/os.rst:3444 +#: ../../library/os.rst:3445 msgid "Set the access and modified times of the file specified by *path*." msgstr "" -#: ../../library/os.rst:3446 +#: ../../library/os.rst:3447 msgid "" ":func:`utime` takes two optional parameters, *times* and *ns*. These specify " "the times set on *path* and are used as follows:" msgstr "" -#: ../../library/os.rst:3449 +#: ../../library/os.rst:3450 msgid "" "If *ns* is specified, it must be a 2-tuple of the form ``(atime_ns, " "mtime_ns)`` where each member is an int expressing nanoseconds." msgstr "" -#: ../../library/os.rst:3452 +#: ../../library/os.rst:3453 msgid "" "If *times* is not ``None``, it must be a 2-tuple of the form ``(atime, " "mtime)`` where each member is an int or float expressing seconds." msgstr "" -#: ../../library/os.rst:3455 +#: ../../library/os.rst:3456 msgid "" "If *times* is ``None`` and *ns* is unspecified, this is equivalent to " "specifying ``ns=(atime_ns, mtime_ns)`` where both times are the current time." msgstr "" -#: ../../library/os.rst:3459 +#: ../../library/os.rst:3460 msgid "It is an error to specify tuples for both *times* and *ns*." msgstr "" -#: ../../library/os.rst:3461 +#: ../../library/os.rst:3462 msgid "" "Note that the exact times you set here may not be returned by a subsequent :" "func:`~os.stat` call, depending on the resolution with which your operating " @@ -3886,7 +3866,7 @@ msgid "" "func:`utime`." msgstr "" -#: ../../library/os.rst:3472 +#: ../../library/os.rst:3473 msgid "" "Raises an :ref:`auditing event ` ``os.utime`` with arguments " "``path``, ``times``, ``ns``, ``dir_fd``." @@ -3894,13 +3874,13 @@ msgstr "" "引發一個附帶引數 ``path``、``times``、``ns``、``dir_fd`` 的\\ :ref:`稽核事件 " "` ``os.utime``。" -#: ../../library/os.rst:3474 +#: ../../library/os.rst:3475 msgid "" "Added support for specifying *path* as an open file descriptor, and the " "*dir_fd*, *follow_symlinks*, and *ns* parameters." msgstr "" -#: ../../library/os.rst:3488 +#: ../../library/os.rst:3489 msgid "" "Generate the file names in a directory tree by walking the tree either top-" "down or bottom-up. For each directory in the tree rooted at directory *top* " @@ -3908,7 +3888,7 @@ msgid "" "filenames)``." msgstr "" -#: ../../library/os.rst:3493 +#: ../../library/os.rst:3494 msgid "" "*dirpath* is a string, the path to the directory. *dirnames* is a list of " "the names of the subdirectories in *dirpath* (including symlinks to " @@ -3922,7 +3902,7 @@ msgid "" "unspecified." msgstr "" -#: ../../library/os.rst:3504 +#: ../../library/os.rst:3505 msgid "" "If optional argument *topdown* is ``True`` or not specified, the triple for " "a directory is generated before the triples for any of its subdirectories " @@ -3933,7 +3913,7 @@ msgid "" "its subdirectories are generated." msgstr "" -#: ../../library/os.rst:3512 +#: ../../library/os.rst:3513 msgid "" "When *topdown* is ``True``, the caller can modify the *dirnames* list in-" "place (perhaps using :keyword:`del` or slice assignment), and :func:`walk` " @@ -3946,7 +3926,7 @@ msgid "" "itself is generated." msgstr "" -#: ../../library/os.rst:3521 +#: ../../library/os.rst:3522 msgid "" "By default, errors from the :func:`scandir` call are ignored. If optional " "argument *onerror* is specified, it should be a function; it will be called " @@ -3956,42 +3936,42 @@ msgid "" "object." msgstr "" -#: ../../library/os.rst:3527 +#: ../../library/os.rst:3528 msgid "" "By default, :func:`walk` will not walk down into symbolic links that resolve " "to directories. Set *followlinks* to ``True`` to visit directories pointed " "to by symlinks, on systems that support them." msgstr "" -#: ../../library/os.rst:3533 +#: ../../library/os.rst:3534 msgid "" "Be aware that setting *followlinks* to ``True`` can lead to infinite " "recursion if a link points to a parent directory of itself. :func:`walk` " "does not keep track of the directories it visited already." msgstr "" -#: ../../library/os.rst:3539 +#: ../../library/os.rst:3540 msgid "" "If you pass a relative pathname, don't change the current working directory " "between resumptions of :func:`walk`. :func:`walk` never changes the current " "directory, and assumes that its caller doesn't either." msgstr "" -#: ../../library/os.rst:3543 ../../library/os.rst:3604 +#: ../../library/os.rst:3544 ../../library/os.rst:3605 msgid "" "This example displays the number of bytes taken by non-directory files in " "each directory under the starting directory, except that it doesn't look " "under any CVS subdirectory::" msgstr "" -#: ../../library/os.rst:3556 +#: ../../library/os.rst:3557 msgid "" "In the next example (simple implementation of :func:`shutil.rmtree`), " "walking the tree bottom-up is essential, :func:`rmdir` doesn't allow " "deleting a directory before the directory is empty::" msgstr "" -#: ../../library/os.rst:3571 +#: ../../library/os.rst:3572 msgid "" "Raises an :ref:`auditing event ` ``os.walk`` with arguments " "``top``, ``topdown``, ``onerror``, ``followlinks``." @@ -3999,25 +3979,25 @@ msgstr "" "引發一個附帶引數 ``top``、``topdown``、``onerror``、``followlinks`` 的\\ :" "ref:`稽核事件 ` ``os.walk``。" -#: ../../library/os.rst:3573 +#: ../../library/os.rst:3574 msgid "" "This function now calls :func:`os.scandir` instead of :func:`os.listdir`, " "making it faster by reducing the number of calls to :func:`os.stat`." msgstr "" -#: ../../library/os.rst:3587 +#: ../../library/os.rst:3588 msgid "" "This behaves exactly like :func:`walk`, except that it yields a 4-tuple " "``(dirpath, dirnames, filenames, dirfd)``, and it supports ``dir_fd``." msgstr "" -#: ../../library/os.rst:3590 +#: ../../library/os.rst:3591 msgid "" "*dirpath*, *dirnames* and *filenames* are identical to :func:`walk` output, " "and *dirfd* is a file descriptor referring to the directory *dirpath*." msgstr "" -#: ../../library/os.rst:3593 +#: ../../library/os.rst:3594 msgid "" "This function always supports :ref:`paths relative to directory descriptors " "` and :ref:`not following symlinks `. Note however " @@ -4025,20 +4005,20 @@ msgid "" "*follow_symlinks* is ``False``." msgstr "" -#: ../../library/os.rst:3600 +#: ../../library/os.rst:3601 msgid "" "Since :func:`fwalk` yields file descriptors, those are only valid until the " "next iteration step, so you should duplicate them (e.g. with :func:`dup`) if " "you want to keep them longer." msgstr "" -#: ../../library/os.rst:3617 +#: ../../library/os.rst:3618 msgid "" "In the next example, walking the tree bottom-up is essential: :func:`rmdir` " "doesn't allow deleting a directory before the directory is empty::" msgstr "" -#: ../../library/os.rst:3632 +#: ../../library/os.rst:3633 msgid "" "Raises an :ref:`auditing event ` ``os.fwalk`` with arguments " "``top``, ``topdown``, ``onerror``, ``follow_symlinks``, ``dir_fd``." @@ -4046,11 +4026,11 @@ msgstr "" "引發一個附帶引數 ``top``、``topdown``、``onerror``、``follow_symlinks``、" "``dir_fd`` 的\\ :ref:`稽核事件 ` ``os.fwalk``。" -#: ../../library/os.rst:3641 +#: ../../library/os.rst:3642 msgid "Added support for :class:`bytes` paths." -msgstr "" +msgstr "新增對 :class:`bytes` 路徑的支援。" -#: ../../library/os.rst:3647 +#: ../../library/os.rst:3648 msgid "" "Create an anonymous file and return a file descriptor that refers to it. " "*flags* must be one of the ``os.MFD_*`` constants available on the system " @@ -4058,7 +4038,7 @@ msgid "" "descriptor is :ref:`non-inheritable `." msgstr "" -#: ../../library/os.rst:3652 +#: ../../library/os.rst:3653 msgid "" "The name supplied in *name* is used as a filename and will be displayed as " "the target of the corresponding symbolic link in the directory ``/proc/self/" @@ -4068,23 +4048,23 @@ msgid "" "side effects." msgstr "" -#: ../../library/os.rst:3659 +#: ../../library/os.rst:3660 msgid ":ref:`Availability `: Linux >= 3.17 with glibc >= 2.27." msgstr ":ref:`適用 `:Linux 3.17 以上且具有 glibc 2.27 以上。" -#: ../../library/os.rst:3682 +#: ../../library/os.rst:3683 msgid "These flags can be passed to :func:`memfd_create`." -msgstr "" +msgstr "這些旗標可以傳給 :func:`memfd_create`。" -#: ../../library/os.rst:3684 +#: ../../library/os.rst:3685 msgid ":ref:`Availability `: Linux >= 3.17 with glibc >= 2.27" msgstr ":ref:`適用 `:Linux 3.17 以上且具有 glibc 2.27 以上" -#: ../../library/os.rst:3686 +#: ../../library/os.rst:3687 msgid "The ``MFD_HUGE*`` flags are only available since Linux 4.14." -msgstr "" +msgstr "``MFD_HUGE*`` 旗標僅在 Linux 4.14 以上可用。" -#: ../../library/os.rst:3693 +#: ../../library/os.rst:3694 msgid "" "Create and return an event file descriptor. The file descriptors supports " "raw :func:`read` and :func:`write` with a buffer size of 8, :func:`~select." @@ -4093,7 +4073,7 @@ msgid "" "ref:`non-inheritable `." msgstr "" -#: ../../library/os.rst:3699 +#: ../../library/os.rst:3700 msgid "" "*initval* is the initial value of the event counter. The initial value must " "be an 32 bit unsigned integer. Please note that the initial value is limited " @@ -4101,87 +4081,87 @@ msgid "" "integer with a maximum value of 2\\ :sup:`64`\\ -\\ 2." msgstr "" -#: ../../library/os.rst:3704 +#: ../../library/os.rst:3705 msgid "" "*flags* can be constructed from :const:`EFD_CLOEXEC`, :const:`EFD_NONBLOCK`, " "and :const:`EFD_SEMAPHORE`." msgstr "" -#: ../../library/os.rst:3707 +#: ../../library/os.rst:3708 msgid "" "If :const:`EFD_SEMAPHORE` is specified and the event counter is non-zero, :" "func:`eventfd_read` returns 1 and decrements the counter by one." msgstr "" -#: ../../library/os.rst:3710 +#: ../../library/os.rst:3711 msgid "" "If :const:`EFD_SEMAPHORE` is not specified and the event counter is non-" "zero, :func:`eventfd_read` returns the current event counter value and " "resets the counter to zero." msgstr "" -#: ../../library/os.rst:3714 +#: ../../library/os.rst:3715 msgid "" "If the event counter is zero and :const:`EFD_NONBLOCK` is not specified, :" "func:`eventfd_read` blocks." msgstr "" -#: ../../library/os.rst:3717 +#: ../../library/os.rst:3718 msgid "" ":func:`eventfd_write` increments the event counter. Write blocks if the " "write operation would increment the counter to a value larger than 2\\ :sup:" "`64`\\ -\\ 2." msgstr "" -#: ../../library/os.rst:3738 +#: ../../library/os.rst:3739 msgid ":ref:`Availability `: Linux >= 2.6.27 with glibc >= 2.8" msgstr ":ref:`適用 `:Linux 2.6.27 以上且具有 glibc 2.8 以上" -#: ../../library/os.rst:3744 +#: ../../library/os.rst:3745 msgid "" "Read value from an :func:`eventfd` file descriptor and return a 64 bit " "unsigned int. The function does not verify that *fd* is an :func:`eventfd`." msgstr "" -#: ../../library/os.rst:3747 ../../library/os.rst:3756 -#: ../../library/os.rst:3764 ../../library/os.rst:3773 +#: ../../library/os.rst:3748 ../../library/os.rst:3757 +#: ../../library/os.rst:3765 ../../library/os.rst:3774 msgid ":ref:`Availability `: Linux >= 2.6.27" msgstr ":ref:`適用 `:Linux 2.6.27 以上" -#: ../../library/os.rst:3753 +#: ../../library/os.rst:3754 msgid "" "Add value to an :func:`eventfd` file descriptor. *value* must be a 64 bit " "unsigned int. The function does not verify that *fd* is an :func:`eventfd`." msgstr "" -#: ../../library/os.rst:3762 +#: ../../library/os.rst:3763 msgid "Set close-on-exec flag for new :func:`eventfd` file descriptor." msgstr "" -#: ../../library/os.rst:3770 +#: ../../library/os.rst:3771 msgid "" "Set :const:`O_NONBLOCK` status flag for new :func:`eventfd` file descriptor." -msgstr "" +msgstr "設定新的 :func:`eventfd` 檔案描述器的 :const:`O_NONBLOCK` 狀態旗標。" -#: ../../library/os.rst:3779 +#: ../../library/os.rst:3780 msgid "" "Provide semaphore-like semantics for reads from a :func:`eventfd` file " "descriptor. On read the internal counter is decremented by one." msgstr "" -#: ../../library/os.rst:3782 +#: ../../library/os.rst:3783 msgid ":ref:`Availability `: Linux >= 2.6.30" msgstr ":ref:`適用 `:Linux 2.6.30 以上" -#: ../../library/os.rst:3788 +#: ../../library/os.rst:3789 msgid "Linux extended attributes" msgstr "" -#: ../../library/os.rst:3792 +#: ../../library/os.rst:3793 msgid "These functions are all available on Linux only." msgstr "" -#: ../../library/os.rst:3796 +#: ../../library/os.rst:3797 msgid "" "Return the value of the extended filesystem attribute *attribute* for " "*path*. *attribute* can be bytes or str (directly or indirectly through the :" @@ -4189,7 +4169,7 @@ msgid "" "encoding." msgstr "" -#: ../../library/os.rst:3804 +#: ../../library/os.rst:3805 msgid "" "Raises an :ref:`auditing event ` ``os.getxattr`` with arguments " "``path``, ``attribute``." @@ -4197,12 +4177,12 @@ msgstr "" "引發一個附帶引數 ``path``、``attribute`` 的\\ :ref:`稽核事件 ` " "``os.getxattr``。" -#: ../../library/os.rst:3806 ../../library/os.rst:3838 -#: ../../library/os.rst:3863 +#: ../../library/os.rst:3807 ../../library/os.rst:3839 +#: ../../library/os.rst:3864 msgid "Accepts a :term:`path-like object` for *path* and *attribute*." msgstr "" -#: ../../library/os.rst:3812 +#: ../../library/os.rst:3813 msgid "" "Return a list of the extended filesystem attributes on *path*. The " "attributes in the list are represented as strings decoded with the " @@ -4210,14 +4190,14 @@ msgid "" "the current directory." msgstr "" -#: ../../library/os.rst:3820 +#: ../../library/os.rst:3821 msgid "" "Raises an :ref:`auditing event ` ``os.listxattr`` with argument " "``path``." msgstr "" "引發一個附帶引數 ``path`` 的\\ :ref:`稽核事件 ` ``os.listxattr``。" -#: ../../library/os.rst:3828 +#: ../../library/os.rst:3829 msgid "" "Removes the extended filesystem attribute *attribute* from *path*. " "*attribute* should be bytes or str (directly or indirectly through the :" @@ -4225,7 +4205,7 @@ msgid "" "`filesystem encoding and error handler`." msgstr "" -#: ../../library/os.rst:3836 +#: ../../library/os.rst:3837 msgid "" "Raises an :ref:`auditing event ` ``os.removexattr`` with arguments " "``path``, ``attribute``." @@ -4233,7 +4213,7 @@ msgstr "" "引發一個附帶引數 ``path``、``attribute`` 的\\ :ref:`稽核事件 ` " "``os.removexattr``。" -#: ../../library/os.rst:3844 +#: ../../library/os.rst:3845 msgid "" "Set the extended filesystem attribute *attribute* on *path* to *value*. " "*attribute* must be a bytes or str with no embedded NULs (directly or " @@ -4245,13 +4225,13 @@ msgid "" "will not be created and ``EEXISTS`` will be raised." msgstr "" -#: ../../library/os.rst:3858 +#: ../../library/os.rst:3859 msgid "" "A bug in Linux kernel versions less than 2.6.39 caused the flags argument to " "be ignored on some filesystems." msgstr "" -#: ../../library/os.rst:3861 +#: ../../library/os.rst:3862 msgid "" "Raises an :ref:`auditing event ` ``os.setxattr`` with arguments " "``path``, ``attribute``, ``value``, ``flags``." @@ -4259,33 +4239,33 @@ msgstr "" "引發一個附帶引數 ``path``、``attribute``、``value``、``flags`` 的\\ :ref:`稽" "核事件 ` ``os.setxattr``。" -#: ../../library/os.rst:3869 +#: ../../library/os.rst:3870 msgid "" "The maximum size the value of an extended attribute can be. Currently, this " "is 64 KiB on Linux." msgstr "" -#: ../../library/os.rst:3875 +#: ../../library/os.rst:3876 msgid "" "This is a possible value for the flags argument in :func:`setxattr`. It " "indicates the operation must create an attribute." msgstr "" -#: ../../library/os.rst:3881 +#: ../../library/os.rst:3882 msgid "" "This is a possible value for the flags argument in :func:`setxattr`. It " "indicates the operation must replace an existing attribute." msgstr "" -#: ../../library/os.rst:3888 +#: ../../library/os.rst:3889 msgid "Process Management" -msgstr "" +msgstr "行程管理" -#: ../../library/os.rst:3890 +#: ../../library/os.rst:3891 msgid "These functions may be used to create and manage processes." msgstr "" -#: ../../library/os.rst:3892 +#: ../../library/os.rst:3893 msgid "" "The various :func:`exec\\* ` functions take a list of arguments for " "the new program loaded into the process. In each case, the first of these " @@ -4296,7 +4276,7 @@ msgid "" "standard output; ``foo`` will seem to be ignored." msgstr "" -#: ../../library/os.rst:3903 +#: ../../library/os.rst:3904 msgid "" "Generate a :const:`SIGABRT` signal to the current process. On Unix, the " "default behavior is to produce a core dump; on Windows, the process " @@ -4305,31 +4285,31 @@ msgid "" "`SIGABRT` with :func:`signal.signal`." msgstr "" -#: ../../library/os.rst:3912 +#: ../../library/os.rst:3913 msgid "Add a path to the DLL search path." msgstr "" -#: ../../library/os.rst:3914 +#: ../../library/os.rst:3915 msgid "" "This search path is used when resolving dependencies for imported extension " "modules (the module itself is resolved through :data:`sys.path`), and also " "by :mod:`ctypes`." msgstr "" -#: ../../library/os.rst:3918 +#: ../../library/os.rst:3919 msgid "" "Remove the directory by calling **close()** on the returned object or using " "it in a :keyword:`with` statement." msgstr "" -#: ../../library/os.rst:3921 +#: ../../library/os.rst:3922 msgid "" "See the `Microsoft documentation `_ for more information about how " "DLLs are loaded." msgstr "" -#: ../../library/os.rst:3925 +#: ../../library/os.rst:3926 msgid "" "Raises an :ref:`auditing event ` ``os.add_dll_directory`` with " "argument ``path``." @@ -4337,7 +4317,7 @@ msgstr "" "引發一個附帶引數 ``path`` 的\\ :ref:`稽核事件 ` ``os." "add_dll_directory``。" -#: ../../library/os.rst:3929 +#: ../../library/os.rst:3930 msgid "" "Previous versions of CPython would resolve DLLs using the default behavior " "for the current process. This led to inconsistencies, such as only sometimes " @@ -4345,14 +4325,14 @@ msgid "" "such as ``AddDllDirectory`` having no effect." msgstr "" -#: ../../library/os.rst:3936 +#: ../../library/os.rst:3937 msgid "" "In 3.8, the two primary ways DLLs are loaded now explicitly override the " "process-wide behavior to ensure consistency. See the :ref:`porting notes " "` for information on updating libraries." msgstr "" -#: ../../library/os.rst:3951 +#: ../../library/os.rst:3952 msgid "" "These functions all execute a new program, replacing the current process; " "they do not return. On Unix, the new executable is loaded into the current " @@ -4360,7 +4340,7 @@ msgid "" "reported as :exc:`OSError` exceptions." msgstr "" -#: ../../library/os.rst:3956 +#: ../../library/os.rst:3957 msgid "" "The current process is replaced immediately. Open file objects and " "descriptors are not flushed, so if there may be data buffered on these open " @@ -4368,7 +4348,7 @@ msgid "" "fsync` before calling an :func:`exec\\* ` function." msgstr "" -#: ../../library/os.rst:3962 +#: ../../library/os.rst:3963 msgid "" "The \"l\" and \"v\" variants of the :func:`exec\\* ` functions differ " "in how command-line arguments are passed. The \"l\" variants are perhaps " @@ -4381,7 +4361,7 @@ msgid "" "is not enforced." msgstr "" -#: ../../library/os.rst:3971 +#: ../../library/os.rst:3972 msgid "" "The variants which include a \"p\" near the end (:func:`execlp`, :func:" "`execlpe`, :func:`execvp`, and :func:`execvpe`) will use the :envvar:`PATH` " @@ -4395,7 +4375,7 @@ msgid "" "even on Windows, as plain names will not be resolved." msgstr "" -#: ../../library/os.rst:3982 +#: ../../library/os.rst:3983 msgid "" "For :func:`execle`, :func:`execlpe`, :func:`execve`, and :func:`execvpe` " "(note that these all end in \"e\"), the *env* parameter must be a mapping " @@ -4405,7 +4385,7 @@ msgid "" "process to inherit the environment of the current process." msgstr "" -#: ../../library/os.rst:3989 +#: ../../library/os.rst:3990 msgid "" "For :func:`execve` on some platforms, *path* may also be specified as an " "open file descriptor. This functionality may not be supported on your " @@ -4414,7 +4394,7 @@ msgid "" "`NotImplementedError`." msgstr "" -#: ../../library/os.rst:3994 +#: ../../library/os.rst:3995 msgid "" "Raises an :ref:`auditing event ` ``os.exec`` with arguments " "``path``, ``args``, ``env``." @@ -4422,25 +4402,25 @@ msgstr "" "引發一個附帶引數 ``path``、``args``、``env`` 的\\ :ref:`稽核事件 ` " "``os.exec``。" -#: ../../library/os.rst:3998 +#: ../../library/os.rst:3999 msgid "" "Added support for specifying *path* as an open file descriptor for :func:" "`execve`." msgstr "" -#: ../../library/os.rst:4007 +#: ../../library/os.rst:4008 msgid "" "Exit the process with status *n*, without calling cleanup handlers, flushing " "stdio buffers, etc." msgstr "" -#: ../../library/os.rst:4012 +#: ../../library/os.rst:4013 msgid "" "The standard way to exit is :func:`sys.exit(n) `. :func:`!_exit` " "should normally only be used in the child process after a :func:`fork`." msgstr "" -#: ../../library/os.rst:4015 +#: ../../library/os.rst:4016 msgid "" "The following exit codes are defined and can be used with :func:`_exit`, " "although they are not required. These are typically used for system " @@ -4448,139 +4428,139 @@ msgid "" "delivery program." msgstr "" -#: ../../library/os.rst:4021 +#: ../../library/os.rst:4022 msgid "" "Some of these may not be available on all Unix platforms, since there is " "some variation. These constants are defined where they are defined by the " "underlying platform." msgstr "" -#: ../../library/os.rst:4028 +#: ../../library/os.rst:4029 msgid "" "Exit code that means no error occurred. May be taken from the defined value " "of ``EXIT_SUCCESS`` on some platforms. Generally has a value of zero." msgstr "" -#: ../../library/os.rst:4036 +#: ../../library/os.rst:4037 msgid "" "Exit code that means the command was used incorrectly, such as when the " "wrong number of arguments are given." msgstr "" -#: ../../library/os.rst:4044 +#: ../../library/os.rst:4045 msgid "Exit code that means the input data was incorrect." msgstr "" -#: ../../library/os.rst:4051 +#: ../../library/os.rst:4052 msgid "Exit code that means an input file did not exist or was not readable." msgstr "" -#: ../../library/os.rst:4058 +#: ../../library/os.rst:4059 msgid "Exit code that means a specified user did not exist." msgstr "" -#: ../../library/os.rst:4065 +#: ../../library/os.rst:4066 msgid "Exit code that means a specified host did not exist." msgstr "" -#: ../../library/os.rst:4072 +#: ../../library/os.rst:4073 msgid "Exit code that means that a required service is unavailable." msgstr "" -#: ../../library/os.rst:4079 +#: ../../library/os.rst:4080 msgid "Exit code that means an internal software error was detected." msgstr "" -#: ../../library/os.rst:4086 +#: ../../library/os.rst:4087 msgid "" "Exit code that means an operating system error was detected, such as the " "inability to fork or create a pipe." msgstr "" -#: ../../library/os.rst:4094 +#: ../../library/os.rst:4095 msgid "" "Exit code that means some system file did not exist, could not be opened, or " "had some other kind of error." msgstr "" -#: ../../library/os.rst:4102 +#: ../../library/os.rst:4103 msgid "Exit code that means a user specified output file could not be created." msgstr "" -#: ../../library/os.rst:4109 +#: ../../library/os.rst:4110 msgid "" "Exit code that means that an error occurred while doing I/O on some file." msgstr "" -#: ../../library/os.rst:4116 +#: ../../library/os.rst:4117 msgid "" "Exit code that means a temporary failure occurred. This indicates something " "that may not really be an error, such as a network connection that couldn't " "be made during a retryable operation." msgstr "" -#: ../../library/os.rst:4125 +#: ../../library/os.rst:4126 msgid "" "Exit code that means that a protocol exchange was illegal, invalid, or not " "understood." msgstr "" -#: ../../library/os.rst:4133 +#: ../../library/os.rst:4134 msgid "" "Exit code that means that there were insufficient permissions to perform the " "operation (but not intended for file system problems)." msgstr "" -#: ../../library/os.rst:4141 +#: ../../library/os.rst:4142 msgid "Exit code that means that some kind of configuration error occurred." msgstr "" -#: ../../library/os.rst:4148 +#: ../../library/os.rst:4149 msgid "Exit code that means something like \"an entry was not found\"." msgstr "" -#: ../../library/os.rst:4155 +#: ../../library/os.rst:4156 msgid "" "Fork a child process. Return ``0`` in the child and the child's process id " "in the parent. If an error occurs :exc:`OSError` is raised." msgstr "" -#: ../../library/os.rst:4158 +#: ../../library/os.rst:4159 msgid "" "Note that some platforms including FreeBSD <= 6.3 and Cygwin have known " "issues when using ``fork()`` from a thread." msgstr "" -#: ../../library/os.rst:4161 +#: ../../library/os.rst:4162 msgid "" "Raises an :ref:`auditing event ` ``os.fork`` with no arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``os.fork``。" -#: ../../library/os.rst:4165 +#: ../../library/os.rst:4166 msgid "" "If you use TLS sockets in an application calling ``fork()``, see the warning " "in the :mod:`ssl` documentation." msgstr "" -#: ../../library/os.rst:4170 ../../library/os.rst:4214 +#: ../../library/os.rst:4171 ../../library/os.rst:4215 msgid "" "On macOS the use of this function is unsafe when mixed with using higher-" "level system APIs, and that includes using :mod:`urllib.request`." msgstr "" -#: ../../library/os.rst:4173 +#: ../../library/os.rst:4174 msgid "" "Calling ``fork()`` in a subinterpreter is no longer supported (:exc:" "`RuntimeError` is raised)." msgstr "" -#: ../../library/os.rst:4177 +#: ../../library/os.rst:4178 msgid "" "If Python is able to detect that your process has multiple threads, :func:" "`os.fork` now raises a :exc:`DeprecationWarning`." msgstr "" -#: ../../library/os.rst:4181 +#: ../../library/os.rst:4182 msgid "" "We chose to surface this as a warning, when detectable, to better inform " "developers of a design problem that the POSIX platform specifically notes as " @@ -4591,25 +4571,25 @@ msgid "" "``free``)." msgstr "" -#: ../../library/os.rst:4190 +#: ../../library/os.rst:4191 msgid "" "Users of macOS or users of libc or malloc implementations other than those " "typically found in glibc to date are among those already more likely to " "experience deadlocks running such code." msgstr "" -#: ../../library/os.rst:4194 +#: ../../library/os.rst:4195 msgid "" "See `this discussion on fork being incompatible with threads `_ for technical details of why we're surfacing " "this longstanding platform compatibility problem to developers." msgstr "" -#: ../../library/os.rst:4199 ../../library/os.rst:4446 +#: ../../library/os.rst:4200 ../../library/os.rst:4447 msgid ":ref:`Availability `: POSIX, not Emscripten, not WASI." msgstr ":ref:`適用 `:POSIX、非 Emscripten、非 WASI。" -#: ../../library/os.rst:4204 +#: ../../library/os.rst:4205 msgid "" "Fork a child process, using a new pseudo-terminal as the child's controlling " "terminal. Return a pair of ``(pid, fd)``, where *pid* is ``0`` in the child, " @@ -4618,31 +4598,31 @@ msgid "" "the :mod:`pty` module. If an error occurs :exc:`OSError` is raised." msgstr "" -#: ../../library/os.rst:4210 +#: ../../library/os.rst:4211 msgid "" "Raises an :ref:`auditing event ` ``os.forkpty`` with no arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``os.forkpty``。" -#: ../../library/os.rst:4217 +#: ../../library/os.rst:4218 msgid "" "If Python is able to detect that your process has multiple threads, this now " "raises a :exc:`DeprecationWarning`. See the longer explanation on :func:`os." "fork`." msgstr "" -#: ../../library/os.rst:4222 +#: ../../library/os.rst:4223 msgid "" "Calling ``forkpty()`` in a subinterpreter is no longer supported (:exc:" "`RuntimeError` is raised)." msgstr "" -#: ../../library/os.rst:4235 +#: ../../library/os.rst:4236 msgid "" "Send signal *sig* to the process *pid*. Constants for the specific signals " "available on the host platform are defined in the :mod:`signal` module." msgstr "" -#: ../../library/os.rst:4238 +#: ../../library/os.rst:4239 msgid "" "Windows: The :const:`signal.CTRL_C_EVENT` and :const:`signal." "CTRL_BREAK_EVENT` signals are special signals which can only be sent to " @@ -4653,11 +4633,11 @@ msgid "" "process handles to be killed." msgstr "" -#: ../../library/os.rst:4246 +#: ../../library/os.rst:4247 msgid "See also :func:`signal.pthread_kill`." msgstr "另請參閱 :func:`signal.pthread_kill`\\ 。" -#: ../../library/os.rst:4248 +#: ../../library/os.rst:4249 msgid "" "Raises an :ref:`auditing event ` ``os.kill`` with arguments " "``pid``, ``sig``." @@ -4665,15 +4645,11 @@ msgstr "" "引發一個附帶引數 ``pid``、``sig`` 的\\ :ref:`稽核事件 ` ``os." "kill``。" -#: ../../library/os.rst:4252 -msgid "Windows support." -msgstr "" - -#: ../../library/os.rst:4262 +#: ../../library/os.rst:4263 msgid "Send the signal *sig* to the process group *pgid*." msgstr "" -#: ../../library/os.rst:4264 +#: ../../library/os.rst:4265 msgid "" "Raises an :ref:`auditing event ` ``os.killpg`` with arguments " "``pgid``, ``sig``." @@ -4681,27 +4657,27 @@ msgstr "" "引發一個附帶引數 ``pgid``、``sig`` 的\\ :ref:`稽核事件 ` ``os." "killpg``。" -#: ../../library/os.rst:4271 +#: ../../library/os.rst:4272 msgid "" "Add *increment* to the process's \"niceness\". Return the new niceness." msgstr "" -#: ../../library/os.rst:4278 +#: ../../library/os.rst:4279 msgid "" "Return a file descriptor referring to the process *pid* with *flags* set. " "This descriptor can be used to perform process management without races and " "signals." msgstr "" -#: ../../library/os.rst:4282 +#: ../../library/os.rst:4283 msgid "See the :manpage:`pidfd_open(2)` man page for more details." msgstr "更多細節請見 :manpage:`pidfd_open(2)` 手冊頁。" -#: ../../library/os.rst:4284 +#: ../../library/os.rst:4285 msgid ":ref:`Availability `: Linux >= 5.3" msgstr ":ref:`適用 `:Linux 5.3 以上" -#: ../../library/os.rst:4289 +#: ../../library/os.rst:4290 msgid "" "This flag indicates that the file descriptor will be non-blocking. If the " "process referred to by the file descriptor has not yet terminated, then an " @@ -4709,17 +4685,17 @@ msgid "" "immediately return the error :const:`~errno.EAGAIN` rather than blocking." msgstr "" -#: ../../library/os.rst:4294 +#: ../../library/os.rst:4295 msgid ":ref:`Availability `: Linux >= 5.10" msgstr ":ref:`適用 `:Linux 5.10 以上" -#: ../../library/os.rst:4300 +#: ../../library/os.rst:4301 msgid "" "Lock program segments into memory. The value of *op* (defined in ````) determines which segments are locked." msgstr "" -#: ../../library/os.rst:4308 +#: ../../library/os.rst:4309 msgid "" "Open a pipe to or from command *cmd*. The return value is an open file " "object connected to the pipe, which can be read or written depending on " @@ -4729,7 +4705,7 @@ msgid "" "rather than bytes." msgstr "" -#: ../../library/os.rst:4316 +#: ../../library/os.rst:4317 msgid "" "The ``close`` method returns :const:`None` if the subprocess exited " "successfully, or the subprocess's return code if there was an error. On " @@ -4741,60 +4717,60 @@ msgid "" "contains the signed integer return code from the child process." msgstr "" -#: ../../library/os.rst:4326 +#: ../../library/os.rst:4327 msgid "" "On Unix, :func:`waitstatus_to_exitcode` can be used to convert the ``close`` " "method result (exit status) into an exit code if it is not ``None``. On " "Windows, the ``close`` method result is directly the exit code (or ``None``)." msgstr "" -#: ../../library/os.rst:4331 +#: ../../library/os.rst:4332 msgid "" "This is implemented using :class:`subprocess.Popen`; see that class's " "documentation for more powerful ways to manage and communicate with " "subprocesses." msgstr "" -#: ../../library/os.rst:4335 +#: ../../library/os.rst:4336 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr ":ref:`適用 `:非 Emscripten、非 WASI。" -#: ../../library/os.rst:4338 +#: ../../library/os.rst:4339 msgid "" "The :ref:`Python UTF-8 Mode ` affects encodings used for *cmd* " "and pipe contents." msgstr "" -#: ../../library/os.rst:4341 +#: ../../library/os.rst:4342 msgid "" ":func:`popen` is a simple wrapper around :class:`subprocess.Popen`. Use :" "class:`subprocess.Popen` or :func:`subprocess.run` to control options like " "encodings." msgstr "" -#: ../../library/os.rst:4350 +#: ../../library/os.rst:4351 msgid "Wraps the :c:func:`!posix_spawn` C library API for use from Python." msgstr "" -#: ../../library/os.rst:4352 +#: ../../library/os.rst:4353 msgid "" "Most users should use :func:`subprocess.run` instead of :func:`posix_spawn`." msgstr "" -#: ../../library/os.rst:4354 +#: ../../library/os.rst:4355 msgid "" "The positional-only arguments *path*, *args*, and *env* are similar to :func:" "`execve`." msgstr "" -#: ../../library/os.rst:4357 +#: ../../library/os.rst:4358 msgid "" "The *path* parameter is the path to the executable file. The *path* should " "contain a directory. Use :func:`posix_spawnp` to pass an executable file " "without directory." msgstr "" -#: ../../library/os.rst:4361 +#: ../../library/os.rst:4362 msgid "" "The *file_actions* argument may be a sequence of tuples describing actions " "to take on specific file descriptors in the child process between the C " @@ -4803,31 +4779,31 @@ msgid "" "describing the remaining tuple elements:" msgstr "" -#: ../../library/os.rst:4369 +#: ../../library/os.rst:4370 msgid "(``os.POSIX_SPAWN_OPEN``, *fd*, *path*, *flags*, *mode*)" msgstr "(``os.POSIX_SPAWN_OPEN``, *fd*, *path*, *flags*, *mode*)" -#: ../../library/os.rst:4371 +#: ../../library/os.rst:4372 msgid "Performs ``os.dup2(os.open(path, flags, mode), fd)``." msgstr "" -#: ../../library/os.rst:4375 +#: ../../library/os.rst:4376 msgid "(``os.POSIX_SPAWN_CLOSE``, *fd*)" msgstr "(``os.POSIX_SPAWN_CLOSE``, *fd*)" -#: ../../library/os.rst:4377 +#: ../../library/os.rst:4378 msgid "Performs ``os.close(fd)``." msgstr "" -#: ../../library/os.rst:4381 +#: ../../library/os.rst:4382 msgid "(``os.POSIX_SPAWN_DUP2``, *fd*, *new_fd*)" msgstr "(``os.POSIX_SPAWN_DUP2``, *fd*, *new_fd*)" -#: ../../library/os.rst:4383 +#: ../../library/os.rst:4384 msgid "Performs ``os.dup2(fd, new_fd)``." msgstr "" -#: ../../library/os.rst:4385 +#: ../../library/os.rst:4386 msgid "" "These tuples correspond to the C library :c:func:`!" "posix_spawn_file_actions_addopen`, :c:func:`!" @@ -4836,7 +4812,7 @@ msgid "" "`!posix_spawn` call itself." msgstr "" -#: ../../library/os.rst:4391 +#: ../../library/os.rst:4392 msgid "" "The *setpgroup* argument will set the process group of the child to the " "value specified. If the value specified is 0, the child's process group ID " @@ -4845,7 +4821,7 @@ msgid "" "corresponds to the C library :c:macro:`!POSIX_SPAWN_SETPGROUP` flag." msgstr "" -#: ../../library/os.rst:4397 +#: ../../library/os.rst:4398 msgid "" "If the *resetids* argument is ``True`` it will reset the effective UID and " "GID of the child to the real UID and GID of the parent process. If the " @@ -4856,7 +4832,7 @@ msgid "" "library :c:macro:`!POSIX_SPAWN_RESETIDS` flag." msgstr "" -#: ../../library/os.rst:4405 +#: ../../library/os.rst:4406 msgid "" "If the *setsid* argument is ``True``, it will create a new session ID for " "``posix_spawn``. *setsid* requires :c:macro:`!POSIX_SPAWN_SETSID` or :c:" @@ -4864,7 +4840,7 @@ msgid "" "is raised." msgstr "" -#: ../../library/os.rst:4410 +#: ../../library/os.rst:4411 msgid "" "The *setsigmask* argument will set the signal mask to the signal set " "specified. If the parameter is not used, then the child inherits the " @@ -4872,14 +4848,14 @@ msgid "" "POSIX_SPAWN_SETSIGMASK` flag." msgstr "" -#: ../../library/os.rst:4415 +#: ../../library/os.rst:4416 msgid "" "The *sigdef* argument will reset the disposition of all signals in the set " "specified. This argument corresponds to the C library :c:macro:`!" "POSIX_SPAWN_SETSIGDEF` flag." msgstr "" -#: ../../library/os.rst:4419 +#: ../../library/os.rst:4420 msgid "" "The *scheduler* argument must be a tuple containing the (optional) scheduler " "policy and an instance of :class:`sched_param` with the scheduler " @@ -4889,7 +4865,7 @@ msgid "" "POSIX_SPAWN_SETSCHEDULER` flags." msgstr "" -#: ../../library/os.rst:4426 ../../library/os.rst:4442 +#: ../../library/os.rst:4427 ../../library/os.rst:4443 msgid "" "Raises an :ref:`auditing event ` ``os.posix_spawn`` with arguments " "``path``, ``argv``, ``env``." @@ -4897,72 +4873,72 @@ msgstr "" "引發一個附帶引數 ``path``、``argv``、``env`` 的\\ :ref:`稽核事件 ` " "``os.posix_spawn``。" -#: ../../library/os.rst:4436 +#: ../../library/os.rst:4437 msgid "Wraps the :c:func:`!posix_spawnp` C library API for use from Python." msgstr "" -#: ../../library/os.rst:4438 +#: ../../library/os.rst:4439 msgid "" "Similar to :func:`posix_spawn` except that the system searches for the " "*executable* file in the list of directories specified by the :envvar:`PATH` " "environment variable (in the same way as for ``execvp(3)``)." msgstr "" -#: ../../library/os.rst:4448 +#: ../../library/os.rst:4449 msgid "See :func:`posix_spawn` documentation." -msgstr "" +msgstr "見 :func:`posix_spawn` 文件。" -#: ../../library/os.rst:4454 +#: ../../library/os.rst:4455 msgid "" "Register callables to be executed when a new child process is forked using :" "func:`os.fork` or similar process cloning APIs. The parameters are optional " "and keyword-only. Each specifies a different call point." msgstr "" -#: ../../library/os.rst:4459 +#: ../../library/os.rst:4460 msgid "*before* is a function called before forking a child process." msgstr "" -#: ../../library/os.rst:4460 +#: ../../library/os.rst:4461 msgid "" "*after_in_parent* is a function called from the parent process after forking " "a child process." msgstr "" -#: ../../library/os.rst:4462 +#: ../../library/os.rst:4463 msgid "*after_in_child* is a function called from the child process." msgstr "" -#: ../../library/os.rst:4464 +#: ../../library/os.rst:4465 msgid "" "These calls are only made if control is expected to return to the Python " "interpreter. A typical :mod:`subprocess` launch will not trigger them as " "the child is not going to re-enter the interpreter." msgstr "" -#: ../../library/os.rst:4468 +#: ../../library/os.rst:4469 msgid "" "Functions registered for execution before forking are called in reverse " "registration order. Functions registered for execution after forking " "(either in the parent or in the child) are called in registration order." msgstr "" -#: ../../library/os.rst:4473 +#: ../../library/os.rst:4474 msgid "" "Note that :c:func:`fork` calls made by third-party C code may not call those " "functions, unless it explicitly calls :c:func:`PyOS_BeforeFork`, :c:func:" "`PyOS_AfterFork_Parent` and :c:func:`PyOS_AfterFork_Child`." msgstr "" -#: ../../library/os.rst:4477 +#: ../../library/os.rst:4478 msgid "There is no way to unregister a function." msgstr "" -#: ../../library/os.rst:4493 +#: ../../library/os.rst:4494 msgid "Execute the program *path* in a new process." msgstr "" -#: ../../library/os.rst:4495 +#: ../../library/os.rst:4496 msgid "" "(Note that the :mod:`subprocess` module provides more powerful facilities " "for spawning new processes and retrieving their results; using that module " @@ -4970,7 +4946,7 @@ msgid "" "`subprocess-replacements` section.)" msgstr "" -#: ../../library/os.rst:4500 +#: ../../library/os.rst:4501 msgid "" "If *mode* is :const:`P_NOWAIT`, this function returns the process id of the " "new process; if *mode* is :const:`P_WAIT`, returns the process's exit code " @@ -4979,13 +4955,13 @@ msgid "" "handle, so can be used with the :func:`waitpid` function." msgstr "" -#: ../../library/os.rst:4506 +#: ../../library/os.rst:4507 msgid "" "Note on VxWorks, this function doesn't return ``-signal`` when the new " "process is killed. Instead it raises OSError exception." msgstr "" -#: ../../library/os.rst:4509 +#: ../../library/os.rst:4510 msgid "" "The \"l\" and \"v\" variants of the :func:`spawn\\* ` functions " "differ in how command-line arguments are passed. The \"l\" variants are " @@ -4997,7 +4973,7 @@ msgid "" "to the child process must start with the name of the command being run." msgstr "" -#: ../../library/os.rst:4518 +#: ../../library/os.rst:4519 msgid "" "The variants which include a second \"p\" near the end (:func:`spawnlp`, :" "func:`spawnlpe`, :func:`spawnvp`, and :func:`spawnvpe`) will use the :envvar:" @@ -5010,7 +4986,7 @@ msgid "" "appropriate absolute or relative path." msgstr "" -#: ../../library/os.rst:4528 +#: ../../library/os.rst:4529 msgid "" "For :func:`spawnle`, :func:`spawnlpe`, :func:`spawnve`, and :func:`spawnvpe` " "(note that these all end in \"e\"), the *env* parameter must be a mapping " @@ -5022,13 +4998,13 @@ msgid "" "values will cause the function to fail, with a return value of ``127``." msgstr "" -#: ../../library/os.rst:4537 +#: ../../library/os.rst:4538 msgid "" "As an example, the following calls to :func:`spawnlp` and :func:`spawnvpe` " "are equivalent::" msgstr "" -#: ../../library/os.rst:4546 +#: ../../library/os.rst:4547 msgid "" "Raises an :ref:`auditing event ` ``os.spawn`` with arguments " "``mode``, ``path``, ``args``, ``env``." @@ -5036,7 +5012,7 @@ msgstr "" "引發一個附帶引數 ``mode``、``path``、``args``、``env`` 的\\ :ref:`稽核事件 " "` ``os.spawn``。" -#: ../../library/os.rst:4550 +#: ../../library/os.rst:4551 msgid "" ":func:`spawnlp`, :func:`spawnlpe`, :func:`spawnvp` and :func:`spawnvpe` are " "not available on Windows. :func:`spawnle` and :func:`spawnve` are not " @@ -5044,7 +5020,7 @@ msgid "" "instead." msgstr "" -#: ../../library/os.rst:4562 +#: ../../library/os.rst:4563 msgid "" "Possible values for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. If either of these values is given, the :func:" @@ -5052,7 +5028,7 @@ msgid "" "been created, with the process id as the return value." msgstr "" -#: ../../library/os.rst:4572 +#: ../../library/os.rst:4573 msgid "" "Possible value for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. If this is given as *mode*, the :func:`spawn\\* " @@ -5061,7 +5037,7 @@ msgid "" "successful, or ``-signal`` if a signal kills the process." msgstr "" -#: ../../library/os.rst:4584 +#: ../../library/os.rst:4585 msgid "" "Possible values for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. These are less portable than those listed above. :" @@ -5071,11 +5047,11 @@ msgid "" "function will not return." msgstr "" -#: ../../library/os.rst:4595 +#: ../../library/os.rst:4596 msgid "Start a file with its associated application." msgstr "" -#: ../../library/os.rst:4597 +#: ../../library/os.rst:4598 msgid "" "When *operation* is not specified, this acts like double-clicking the file " "in Windows Explorer, or giving the file name as an argument to the :program:" @@ -5083,7 +5059,7 @@ msgid "" "whatever application (if any) its extension is associated." msgstr "" -#: ../../library/os.rst:4602 +#: ../../library/os.rst:4603 msgid "" "When another *operation* is given, it must be a \"command verb\" that " "specifies what should be done with the file. Common verbs documented by " @@ -5091,28 +5067,28 @@ msgid "" "as well as ``'explore'`` and ``'find'`` (to be used on directories)." msgstr "" -#: ../../library/os.rst:4607 +#: ../../library/os.rst:4608 msgid "" "When launching an application, specify *arguments* to be passed as a single " "string. This argument may have no effect when using this function to launch " "a document." msgstr "" -#: ../../library/os.rst:4611 +#: ../../library/os.rst:4612 msgid "" "The default working directory is inherited, but may be overridden by the " "*cwd* argument. This should be an absolute path. A relative *path* will be " "resolved against this argument." msgstr "" -#: ../../library/os.rst:4615 +#: ../../library/os.rst:4616 msgid "" "Use *show_cmd* to override the default window style. Whether this has any " "effect will depend on the application being launched. Values are integers as " "supported by the Win32 :c:func:`!ShellExecute` function." msgstr "" -#: ../../library/os.rst:4619 +#: ../../library/os.rst:4620 msgid "" ":func:`startfile` returns as soon as the associated application is launched. " "There is no option to wait for the application to close, and no way to " @@ -5123,14 +5099,14 @@ msgid "" "encoded for Win32." msgstr "" -#: ../../library/os.rst:4627 +#: ../../library/os.rst:4628 msgid "" "To reduce interpreter startup overhead, the Win32 :c:func:`!ShellExecute` " "function is not resolved until this function is first called. If the " "function cannot be resolved, :exc:`NotImplementedError` will be raised." msgstr "" -#: ../../library/os.rst:4631 +#: ../../library/os.rst:4632 msgid "" "Raises an :ref:`auditing event ` ``os.startfile`` with arguments " "``path``, ``operation``." @@ -5138,7 +5114,7 @@ msgstr "" "引發一個附帶引數 ``path``、``operation`` 的\\ :ref:`稽核事件 ` " "``os.startfile``。" -#: ../../library/os.rst:4633 +#: ../../library/os.rst:4634 msgid "" "Raises an :ref:`auditing event ` ``os.startfile/2`` with arguments " "``path``, ``operation``, ``arguments``, ``cwd``, ``show_cmd``." @@ -5146,13 +5122,13 @@ msgstr "" "引發一個附帶引數 ``path``、``operation``、``arguments``、``cwd``、" "``show_cmd`` 的\\ :ref:`稽核事件 ` ``os.startfile/2``。" -#: ../../library/os.rst:4637 +#: ../../library/os.rst:4638 msgid "" "Added the *arguments*, *cwd* and *show_cmd* arguments, and the ``os." "startfile/2`` audit event." msgstr "" -#: ../../library/os.rst:4644 +#: ../../library/os.rst:4645 msgid "" "Execute the command (a string) in a subshell. This is implemented by " "calling the Standard C function :c:func:`system`, and has the same " @@ -5163,13 +5139,13 @@ msgid "" "value of the Python function is system-dependent." msgstr "" -#: ../../library/os.rst:4652 +#: ../../library/os.rst:4653 msgid "" "On Unix, the return value is the exit status of the process encoded in the " "format specified for :func:`wait`." msgstr "" -#: ../../library/os.rst:4655 +#: ../../library/os.rst:4656 msgid "" "On Windows, the return value is that returned by the system shell after " "running *command*. The shell is given by the Windows environment variable :" @@ -5178,7 +5154,7 @@ msgid "" "shell documentation." msgstr "" -#: ../../library/os.rst:4661 +#: ../../library/os.rst:4662 msgid "" "The :mod:`subprocess` module provides more powerful facilities for spawning " "new processes and retrieving their results; using that module is preferable " @@ -5186,54 +5162,54 @@ msgid "" "the :mod:`subprocess` documentation for some helpful recipes." msgstr "" -#: ../../library/os.rst:4666 +#: ../../library/os.rst:4667 msgid "" "On Unix, :func:`waitstatus_to_exitcode` can be used to convert the result " "(exit status) into an exit code. On Windows, the result is directly the exit " "code." msgstr "" -#: ../../library/os.rst:4670 +#: ../../library/os.rst:4671 msgid "" "Raises an :ref:`auditing event ` ``os.system`` with argument " "``command``." msgstr "" "引發一個附帶引數 ``command`` 的\\ :ref:`稽核事件 ` ``os.system``。" -#: ../../library/os.rst:4677 +#: ../../library/os.rst:4678 msgid "" "Returns the current global process times. The return value is an object with " "five attributes:" msgstr "" -#: ../../library/os.rst:4680 +#: ../../library/os.rst:4681 msgid ":attr:`!user` - user time" -msgstr "" +msgstr ":attr:`!user` - 使用者時間" -#: ../../library/os.rst:4681 +#: ../../library/os.rst:4682 msgid ":attr:`!system` - system time" msgstr ":attr:`!system` - 系統時間" -#: ../../library/os.rst:4682 +#: ../../library/os.rst:4683 msgid ":attr:`!children_user` - user time of all child processes" -msgstr "" +msgstr ":attr:`!children_user` - 所有子行程的使用者時間" -#: ../../library/os.rst:4683 +#: ../../library/os.rst:4684 msgid ":attr:`!children_system` - system time of all child processes" -msgstr "" +msgstr ":attr:`!children_system` - 所有子行程的系統時間" -#: ../../library/os.rst:4684 +#: ../../library/os.rst:4685 msgid ":attr:`!elapsed` - elapsed real time since a fixed point in the past" msgstr "" -#: ../../library/os.rst:4686 +#: ../../library/os.rst:4687 msgid "" "For backwards compatibility, this object also behaves like a five-tuple " "containing :attr:`!user`, :attr:`!system`, :attr:`!children_user`, :attr:`!" "children_system`, and :attr:`!elapsed` in that order." msgstr "" -#: ../../library/os.rst:4690 +#: ../../library/os.rst:4691 msgid "" "See the Unix manual page :manpage:`times(2)` and `times(3) `_ manual page on Unix or `the " @@ -5243,7 +5219,7 @@ msgid "" "attributes are zero." msgstr "" -#: ../../library/os.rst:4704 +#: ../../library/os.rst:4705 msgid "" "Wait for completion of a child process, and return a tuple containing its " "pid and exit status indication: a 16-bit number, whose low byte is the " @@ -5252,83 +5228,87 @@ msgid "" "if a core file was produced." msgstr "" -#: ../../library/os.rst:4710 +#: ../../library/os.rst:4711 msgid "" "If there are no children that could be waited for, :exc:`ChildProcessError` " "is raised." msgstr "" -#: ../../library/os.rst:4713 ../../library/os.rst:4785 +#: ../../library/os.rst:4714 ../../library/os.rst:4789 msgid "" ":func:`waitstatus_to_exitcode` can be used to convert the exit status into " "an exit code." msgstr "" -#: ../../library/os.rst:4720 +#: ../../library/os.rst:4721 msgid "" "The other :func:`!wait*` functions documented below can be used to wait for " "the completion of a specific child process and have more options. :func:" "`waitpid` is the only one also available on Windows." msgstr "" -#: ../../library/os.rst:4727 +#: ../../library/os.rst:4728 msgid "Wait for the completion of a child process." msgstr "" -#: ../../library/os.rst:4729 +#: ../../library/os.rst:4730 msgid "" "*idtype* can be :data:`P_PID`, :data:`P_PGID`, :data:`P_ALL`, or (on Linux) :" "data:`P_PIDFD`. The interpretation of *id* depends on it; see their " "individual descriptions." msgstr "" -#: ../../library/os.rst:4732 +#: ../../library/os.rst:4733 msgid "" "*options* is an OR combination of flags. At least one of :data:`WEXITED`, :" "data:`WSTOPPED` or :data:`WCONTINUED` is required; :data:`WNOHANG` and :data:" "`WNOWAIT` are additional optional flags." msgstr "" -#: ../../library/os.rst:4736 +#: ../../library/os.rst:4737 msgid "" "The return value is an object representing the data contained in the :c:type:" "`siginfo_t` structure with the following attributes:" msgstr "" -#: ../../library/os.rst:4739 +#: ../../library/os.rst:4740 msgid ":attr:`!si_pid` (process ID)" msgstr "" -#: ../../library/os.rst:4740 +#: ../../library/os.rst:4741 msgid ":attr:`!si_uid` (real user ID of the child)" msgstr "" -#: ../../library/os.rst:4741 +#: ../../library/os.rst:4742 msgid ":attr:`!si_signo` (always :const:`~signal.SIGCHLD`)" msgstr "" -#: ../../library/os.rst:4742 +#: ../../library/os.rst:4743 msgid "" ":attr:`!si_status` (the exit status or signal number, depending on :attr:`!" "si_code`)" msgstr "" -#: ../../library/os.rst:4743 +#: ../../library/os.rst:4744 msgid ":attr:`!si_code` (see :data:`CLD_EXITED` for possible values)" msgstr "" -#: ../../library/os.rst:4745 +#: ../../library/os.rst:4746 msgid "" "If :data:`WNOHANG` is specified and there are no matching children in the " "requested state, ``None`` is returned. Otherwise, if there are no matching " "children that could be waited for, :exc:`ChildProcessError` is raised." msgstr "" -#: ../../library/os.rst:4757 +#: ../../library/os.rst:4754 +msgid "This function is not available on macOS." +msgstr "" + +#: ../../library/os.rst:4761 msgid "The details of this function differ on Unix and Windows." msgstr "" -#: ../../library/os.rst:4759 +#: ../../library/os.rst:4763 msgid "" "On Unix: Wait for completion of a child process given by process id *pid*, " "and return a tuple containing its process id and exit status indication " @@ -5337,7 +5317,7 @@ msgid "" "operation." msgstr "" -#: ../../library/os.rst:4764 +#: ../../library/os.rst:4768 msgid "" "If *pid* is greater than ``0``, :func:`waitpid` requests status information " "for that specific process. If *pid* is ``0``, the request is for the status " @@ -5347,7 +5327,7 @@ msgid "" "group ``-pid`` (the absolute value of *pid*)." msgstr "" -#: ../../library/os.rst:4771 +#: ../../library/os.rst:4775 msgid "" "*options* is an OR combination of flags. If it contains :data:`WNOHANG` and " "there are no matching children in the requested state, ``(0, 0)`` is " @@ -5356,7 +5336,7 @@ msgid "" "are :data:`WUNTRACED` and :data:`WCONTINUED`." msgstr "" -#: ../../library/os.rst:4777 +#: ../../library/os.rst:4781 msgid "" "On Windows: Wait for completion of a process given by process handle *pid*, " "and return a tuple containing *pid*, and its exit status shifted left by 8 " @@ -5368,7 +5348,7 @@ msgid "" "process handles." msgstr "" -#: ../../library/os.rst:4798 +#: ../../library/os.rst:4802 msgid "" "Similar to :func:`waitpid`, except no process id argument is given and a 3-" "element tuple containing the child's process id, exit status indication, and " @@ -5377,13 +5357,13 @@ msgid "" "same as that provided to :func:`waitpid` and :func:`wait4`." msgstr "" -#: ../../library/os.rst:4805 ../../library/os.rst:4819 +#: ../../library/os.rst:4809 ../../library/os.rst:4823 msgid "" ":func:`waitstatus_to_exitcode` can be used to convert the exit status into " "an exitcode." msgstr "" -#: ../../library/os.rst:4813 +#: ../../library/os.rst:4817 msgid "" "Similar to :func:`waitpid`, except a 3-element tuple, containing the child's " "process id, exit status indication, and resource usage information is " @@ -5392,118 +5372,118 @@ msgid "" "to :func:`waitpid`." msgstr "" -#: ../../library/os.rst:4830 +#: ../../library/os.rst:4834 msgid "" "These are the possible values for *idtype* in :func:`waitid`. They affect " "how *id* is interpreted:" msgstr "" -#: ../../library/os.rst:4833 +#: ../../library/os.rst:4837 msgid ":data:`!P_PID` - wait for the child whose PID is *id*." msgstr "" -#: ../../library/os.rst:4834 +#: ../../library/os.rst:4838 msgid ":data:`!P_PGID` - wait for any child whose progress group ID is *id*." msgstr "" -#: ../../library/os.rst:4835 +#: ../../library/os.rst:4839 msgid ":data:`!P_ALL` - wait for any child; *id* is ignored." msgstr "" -#: ../../library/os.rst:4836 +#: ../../library/os.rst:4840 msgid "" ":data:`!P_PIDFD` - wait for the child identified by the file descriptor *id* " "(a process file descriptor created with :func:`pidfd_open`)." msgstr "" -#: ../../library/os.rst:4841 +#: ../../library/os.rst:4845 msgid ":data:`!P_PIDFD` is only available on Linux >= 5.4." msgstr "" -#: ../../library/os.rst:4844 +#: ../../library/os.rst:4848 msgid "The :data:`!P_PIDFD` constant." msgstr "" -#: ../../library/os.rst:4850 +#: ../../library/os.rst:4854 msgid "" "This *options* flag for :func:`waitpid`, :func:`wait3`, :func:`wait4`, and :" "func:`waitid` causes child processes to be reported if they have been " "continued from a job control stop since they were last reported." msgstr "" -#: ../../library/os.rst:4859 +#: ../../library/os.rst:4863 msgid "" "This *options* flag for :func:`waitid` causes child processes that have " "terminated to be reported." msgstr "" -#: ../../library/os.rst:4862 +#: ../../library/os.rst:4866 msgid "" "The other ``wait*`` functions always report children that have terminated, " "so this option is not available for them." msgstr "" -#: ../../library/os.rst:4872 +#: ../../library/os.rst:4876 msgid "" "This *options* flag for :func:`waitid` causes child processes that have been " "stopped by the delivery of a signal to be reported." msgstr "" -#: ../../library/os.rst:4875 ../../library/os.rst:4907 +#: ../../library/os.rst:4879 ../../library/os.rst:4911 msgid "This option is not available for the other ``wait*`` functions." msgstr "" -#: ../../library/os.rst:4884 +#: ../../library/os.rst:4888 msgid "" "This *options* flag for :func:`waitpid`, :func:`wait3`, and :func:`wait4` " "causes child processes to also be reported if they have been stopped but " "their current state has not been reported since they were stopped." msgstr "" -#: ../../library/os.rst:4888 +#: ../../library/os.rst:4892 msgid "This option is not available for :func:`waitid`." msgstr "" -#: ../../library/os.rst:4895 +#: ../../library/os.rst:4899 msgid "" "This *options* flag causes :func:`waitpid`, :func:`wait3`, :func:`wait4`, " "and :func:`waitid` to return right away if no child process status is " "available immediately." msgstr "" -#: ../../library/os.rst:4904 +#: ../../library/os.rst:4908 msgid "" "This *options* flag causes :func:`waitid` to leave the child in a waitable " "state, so that a later :func:`!wait*` call can be used to retrieve the child " "status information again." msgstr "" -#: ../../library/os.rst:4919 +#: ../../library/os.rst:4923 msgid "" "These are the possible values for :attr:`!si_code` in the result returned " "by :func:`waitid`." msgstr "" -#: ../../library/os.rst:4926 +#: ../../library/os.rst:4930 msgid "Added :data:`CLD_KILLED` and :data:`CLD_STOPPED` values." msgstr "" -#: ../../library/os.rst:4932 +#: ../../library/os.rst:4936 msgid "Convert a wait status to an exit code." msgstr "" -#: ../../library/os.rst:4934 +#: ../../library/os.rst:4938 msgid "On Unix:" msgstr "" -#: ../../library/os.rst:4936 +#: ../../library/os.rst:4940 msgid "" "If the process exited normally (if ``WIFEXITED(status)`` is true), return " "the process exit status (return ``WEXITSTATUS(status)``): result greater " "than or equal to 0." msgstr "" -#: ../../library/os.rst:4939 +#: ../../library/os.rst:4943 msgid "" "If the process was terminated by a signal (if ``WIFSIGNALED(status)`` is " "true), return ``-signum`` where *signum* is the number of the signal that " @@ -5511,15 +5491,15 @@ msgid "" "than 0." msgstr "" -#: ../../library/os.rst:4943 +#: ../../library/os.rst:4947 msgid "Otherwise, raise a :exc:`ValueError`." msgstr "" -#: ../../library/os.rst:4945 +#: ../../library/os.rst:4949 msgid "On Windows, return *status* shifted right by 8 bits." msgstr "" -#: ../../library/os.rst:4947 +#: ../../library/os.rst:4951 msgid "" "On Unix, if the process is being traced or if :func:`waitpid` was called " "with :data:`WUNTRACED` option, the caller must first check if " @@ -5527,221 +5507,221 @@ msgid "" "``WIFSTOPPED(status)`` is true." msgstr "" -#: ../../library/os.rst:4954 +#: ../../library/os.rst:4958 msgid "" ":func:`WIFEXITED`, :func:`WEXITSTATUS`, :func:`WIFSIGNALED`, :func:" "`WTERMSIG`, :func:`WIFSTOPPED`, :func:`WSTOPSIG` functions." msgstr "" -#: ../../library/os.rst:4962 +#: ../../library/os.rst:4966 msgid "" "The following functions take a process status code as returned by :func:" "`system`, :func:`wait`, or :func:`waitpid` as a parameter. They may be used " "to determine the disposition of a process." msgstr "" -#: ../../library/os.rst:4968 +#: ../../library/os.rst:4972 msgid "" "Return ``True`` if a core dump was generated for the process, otherwise " "return ``False``." msgstr "" -#: ../../library/os.rst:4971 ../../library/os.rst:5037 +#: ../../library/os.rst:4975 ../../library/os.rst:5041 msgid "This function should be employed only if :func:`WIFSIGNALED` is true." msgstr "" -#: ../../library/os.rst:4978 +#: ../../library/os.rst:4982 msgid "" "Return ``True`` if a stopped child has been resumed by delivery of :const:" "`~signal.SIGCONT` (if the process has been continued from a job control " "stop), otherwise return ``False``." msgstr "" -#: ../../library/os.rst:4982 +#: ../../library/os.rst:4986 msgid "See :data:`WCONTINUED` option." msgstr "參閱 :data:`WCONTINUED` 選項。" -#: ../../library/os.rst:4989 +#: ../../library/os.rst:4993 msgid "" "Return ``True`` if the process was stopped by delivery of a signal, " "otherwise return ``False``." msgstr "" -#: ../../library/os.rst:4992 +#: ../../library/os.rst:4996 msgid "" ":func:`WIFSTOPPED` only returns ``True`` if the :func:`waitpid` call was " "done using :data:`WUNTRACED` option or when the process is being traced " "(see :manpage:`ptrace(2)`)." msgstr "" -#: ../../library/os.rst:5000 +#: ../../library/os.rst:5004 msgid "" "Return ``True`` if the process was terminated by a signal, otherwise return " "``False``." msgstr "" -#: ../../library/os.rst:5008 +#: ../../library/os.rst:5012 msgid "" "Return ``True`` if the process exited terminated normally, that is, by " "calling ``exit()`` or ``_exit()``, or by returning from ``main()``; " "otherwise return ``False``." msgstr "" -#: ../../library/os.rst:5017 +#: ../../library/os.rst:5021 msgid "Return the process exit status." msgstr "" -#: ../../library/os.rst:5019 +#: ../../library/os.rst:5023 msgid "This function should be employed only if :func:`WIFEXITED` is true." msgstr "" -#: ../../library/os.rst:5026 +#: ../../library/os.rst:5030 msgid "Return the signal which caused the process to stop." msgstr "" -#: ../../library/os.rst:5028 +#: ../../library/os.rst:5032 msgid "This function should be employed only if :func:`WIFSTOPPED` is true." msgstr "" -#: ../../library/os.rst:5035 +#: ../../library/os.rst:5039 msgid "Return the number of the signal that caused the process to terminate." msgstr "" -#: ../../library/os.rst:5043 +#: ../../library/os.rst:5047 msgid "Interface to the scheduler" msgstr "" -#: ../../library/os.rst:5045 +#: ../../library/os.rst:5049 msgid "" "These functions control how a process is allocated CPU time by the operating " "system. They are only available on some Unix platforms. For more detailed " "information, consult your Unix manpages." msgstr "" -#: ../../library/os.rst:5051 +#: ../../library/os.rst:5055 msgid "" "The following scheduling policies are exposed if they are supported by the " "operating system." msgstr "" -#: ../../library/os.rst:5056 +#: ../../library/os.rst:5060 msgid "The default scheduling policy." msgstr "" -#: ../../library/os.rst:5060 +#: ../../library/os.rst:5064 msgid "" "Scheduling policy for CPU-intensive processes that tries to preserve " "interactivity on the rest of the computer." msgstr "" -#: ../../library/os.rst:5065 +#: ../../library/os.rst:5069 msgid "Scheduling policy for extremely low priority background tasks." msgstr "" -#: ../../library/os.rst:5069 +#: ../../library/os.rst:5073 msgid "Scheduling policy for sporadic server programs." msgstr "" -#: ../../library/os.rst:5073 +#: ../../library/os.rst:5077 msgid "A First In First Out scheduling policy." msgstr "" -#: ../../library/os.rst:5077 +#: ../../library/os.rst:5081 msgid "A round-robin scheduling policy." msgstr "" -#: ../../library/os.rst:5081 +#: ../../library/os.rst:5085 msgid "" "This flag can be OR'ed with any other scheduling policy. When a process with " "this flag set forks, its child's scheduling policy and priority are reset to " "the default." msgstr "" -#: ../../library/os.rst:5088 +#: ../../library/os.rst:5092 msgid "" "This class represents tunable scheduling parameters used in :func:" "`sched_setparam`, :func:`sched_setscheduler`, and :func:`sched_getparam`. It " "is immutable." msgstr "" -#: ../../library/os.rst:5092 +#: ../../library/os.rst:5096 msgid "At the moment, there is only one possible parameter:" msgstr "" -#: ../../library/os.rst:5096 +#: ../../library/os.rst:5100 msgid "The scheduling priority for a scheduling policy." msgstr "" -#: ../../library/os.rst:5101 +#: ../../library/os.rst:5105 msgid "" "Get the minimum priority value for *policy*. *policy* is one of the " "scheduling policy constants above." msgstr "" -#: ../../library/os.rst:5107 +#: ../../library/os.rst:5111 msgid "" "Get the maximum priority value for *policy*. *policy* is one of the " "scheduling policy constants above." msgstr "" -#: ../../library/os.rst:5113 +#: ../../library/os.rst:5117 msgid "" "Set the scheduling policy for the process with PID *pid*. A *pid* of 0 means " "the calling process. *policy* is one of the scheduling policy constants " "above. *param* is a :class:`sched_param` instance." msgstr "" -#: ../../library/os.rst:5120 +#: ../../library/os.rst:5124 msgid "" "Return the scheduling policy for the process with PID *pid*. A *pid* of 0 " "means the calling process. The result is one of the scheduling policy " "constants above." msgstr "" -#: ../../library/os.rst:5127 +#: ../../library/os.rst:5131 msgid "" "Set the scheduling parameters for the process with PID *pid*. A *pid* of 0 " "means the calling process. *param* is a :class:`sched_param` instance." msgstr "" -#: ../../library/os.rst:5133 +#: ../../library/os.rst:5137 msgid "" "Return the scheduling parameters as a :class:`sched_param` instance for the " "process with PID *pid*. A *pid* of 0 means the calling process." msgstr "" -#: ../../library/os.rst:5139 +#: ../../library/os.rst:5143 msgid "" "Return the round-robin quantum in seconds for the process with PID *pid*. A " "*pid* of 0 means the calling process." msgstr "" -#: ../../library/os.rst:5145 +#: ../../library/os.rst:5149 msgid "Voluntarily relinquish the CPU." msgstr "" -#: ../../library/os.rst:5150 +#: ../../library/os.rst:5154 msgid "" "Restrict the process with PID *pid* (or the current process if zero) to a " "set of CPUs. *mask* is an iterable of integers representing the set of CPUs " "to which the process should be restricted." msgstr "" -#: ../../library/os.rst:5157 +#: ../../library/os.rst:5161 msgid "Return the set of CPUs the process with PID *pid* is restricted to." msgstr "" -#: ../../library/os.rst:5159 +#: ../../library/os.rst:5163 msgid "" "If *pid* is zero, return the set of CPUs the calling thread of the current " "process is restricted to." msgstr "" -#: ../../library/os.rst:5166 +#: ../../library/os.rst:5170 msgid "Miscellaneous System Information" msgstr "" -#: ../../library/os.rst:5171 +#: ../../library/os.rst:5175 msgid "" "Return string-valued system configuration values. *name* specifies the " "configuration value to retrieve; it may be a string which is the name of a " @@ -5752,13 +5732,13 @@ msgid "" "included in that mapping, passing an integer for *name* is also accepted." msgstr "" -#: ../../library/os.rst:5179 +#: ../../library/os.rst:5183 msgid "" "If the configuration value specified by *name* isn't defined, ``None`` is " "returned." msgstr "" -#: ../../library/os.rst:5182 +#: ../../library/os.rst:5186 msgid "" "If *name* is a string and is not known, :exc:`ValueError` is raised. If a " "specific value for *name* is not supported by the host system, even if it is " @@ -5766,34 +5746,34 @@ msgid "" "`errno.EINVAL` for the error number." msgstr "" -#: ../../library/os.rst:5192 +#: ../../library/os.rst:5196 msgid "" "Dictionary mapping names accepted by :func:`confstr` to the integer values " "defined for those names by the host operating system. This can be used to " "determine the set of names known to the system." msgstr "" -#: ../../library/os.rst:5201 +#: ../../library/os.rst:5205 msgid "" "Return the number of logical CPUs in the system. Returns ``None`` if " "undetermined." msgstr "" -#: ../../library/os.rst:5204 +#: ../../library/os.rst:5208 msgid "" "This number is not equivalent to the number of logical CPUs the current " "process can use. ``len(os.sched_getaffinity(0))`` gets the number of logical " "CPUs the calling thread of the current process is restricted to" msgstr "" -#: ../../library/os.rst:5213 +#: ../../library/os.rst:5217 msgid "" "Return the number of processes in the system run queue averaged over the " "last 1, 5, and 15 minutes or raises :exc:`OSError` if the load average was " "unobtainable." msgstr "" -#: ../../library/os.rst:5222 +#: ../../library/os.rst:5226 msgid "" "Return integer-valued system configuration values. If the configuration " "value specified by *name* isn't defined, ``-1`` is returned. The comments " @@ -5802,44 +5782,44 @@ msgid "" "``sysconf_names``." msgstr "" -#: ../../library/os.rst:5232 +#: ../../library/os.rst:5236 msgid "" "Dictionary mapping names accepted by :func:`sysconf` to the integer values " "defined for those names by the host operating system. This can be used to " "determine the set of names known to the system." msgstr "" -#: ../../library/os.rst:5238 +#: ../../library/os.rst:5242 msgid "Add ``'SC_MINSIGSTKSZ'`` name." msgstr "" -#: ../../library/os.rst:5241 +#: ../../library/os.rst:5245 msgid "" "The following data values are used to support path manipulation operations. " "These are defined for all platforms." msgstr "" -#: ../../library/os.rst:5244 +#: ../../library/os.rst:5248 msgid "" "Higher-level operations on pathnames are defined in the :mod:`os.path` " "module." msgstr "" -#: ../../library/os.rst:5250 +#: ../../library/os.rst:5254 msgid "" "The constant string used by the operating system to refer to the current " "directory. This is ``'.'`` for Windows and POSIX. Also available via :mod:" "`os.path`." msgstr "" -#: ../../library/os.rst:5258 +#: ../../library/os.rst:5262 msgid "" "The constant string used by the operating system to refer to the parent " "directory. This is ``'..'`` for Windows and POSIX. Also available via :mod:" "`os.path`." msgstr "" -#: ../../library/os.rst:5267 +#: ../../library/os.rst:5271 msgid "" "The character used by the operating system to separate pathname components. " "This is ``'/'`` for POSIX and ``'\\\\'`` for Windows. Note that knowing " @@ -5848,7 +5828,7 @@ msgid "" "useful. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5277 +#: ../../library/os.rst:5281 msgid "" "An alternative character used by the operating system to separate pathname " "components, or ``None`` if only one separator character exists. This is set " @@ -5856,27 +5836,27 @@ msgid "" "via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5286 +#: ../../library/os.rst:5290 msgid "" "The character which separates the base filename from the extension; for " "example, the ``'.'`` in :file:`os.py`. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5294 +#: ../../library/os.rst:5298 msgid "" "The character conventionally used by the operating system to separate search " "path components (as in :envvar:`PATH`), such as ``':'`` for POSIX or ``';'`` " "for Windows. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5301 +#: ../../library/os.rst:5305 msgid "" "The default search path used by :func:`exec\\*p\\* ` and :func:" "`spawn\\*p\\* ` if the environment doesn't have a ``'PATH'`` key. " "Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5308 +#: ../../library/os.rst:5312 msgid "" "The string used to separate (or, rather, terminate) lines on the current " "platform. This may be a single character, such as ``'\\n'`` for POSIX, or " @@ -5885,36 +5865,36 @@ msgid "" "default); use a single ``'\\n'`` instead, on all platforms." msgstr "" -#: ../../library/os.rst:5317 +#: ../../library/os.rst:5321 msgid "" "The file path of the null device. For example: ``'/dev/null'`` for POSIX, " "``'nul'`` for Windows. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5328 +#: ../../library/os.rst:5332 msgid "" "Flags for use with the :func:`~sys.setdlopenflags` and :func:`~sys." "getdlopenflags` functions. See the Unix manual page :manpage:`dlopen(3)` " "for what the different flags mean." msgstr "" -#: ../../library/os.rst:5336 +#: ../../library/os.rst:5340 msgid "Random numbers" msgstr "" -#: ../../library/os.rst:5341 +#: ../../library/os.rst:5345 msgid "" "Get up to *size* random bytes. The function can return less bytes than " "requested." msgstr "" -#: ../../library/os.rst:5344 +#: ../../library/os.rst:5348 msgid "" "These bytes can be used to seed user-space random number generators or for " "cryptographic purposes." msgstr "" -#: ../../library/os.rst:5347 +#: ../../library/os.rst:5351 msgid "" "``getrandom()`` relies on entropy gathered from device drivers and other " "sources of environmental noise. Unnecessarily reading large quantities of " @@ -5922,36 +5902,36 @@ msgid "" "``/dev/urandom`` devices." msgstr "" -#: ../../library/os.rst:5352 +#: ../../library/os.rst:5356 msgid "" "The flags argument is a bit mask that can contain zero or more of the " "following values ORed together: :py:const:`os.GRND_RANDOM` and :py:data:" "`GRND_NONBLOCK`." msgstr "" -#: ../../library/os.rst:5356 +#: ../../library/os.rst:5360 msgid "" "See also the `Linux getrandom() manual page `_." msgstr "" -#: ../../library/os.rst:5359 +#: ../../library/os.rst:5363 msgid ":ref:`Availability `: Linux >= 3.17." msgstr ":ref:`適用 `:Linux 3.17 以上。" -#: ../../library/os.rst:5365 +#: ../../library/os.rst:5369 msgid "" "Return a bytestring of *size* random bytes suitable for cryptographic use." msgstr "" -#: ../../library/os.rst:5367 +#: ../../library/os.rst:5371 msgid "" "This function returns random bytes from an OS-specific randomness source. " "The returned data should be unpredictable enough for cryptographic " "applications, though its exact quality depends on the OS implementation." msgstr "" -#: ../../library/os.rst:5371 +#: ../../library/os.rst:5375 msgid "" "On Linux, if the ``getrandom()`` syscall is available, it is used in " "blocking mode: block until the system urandom entropy pool is initialized " @@ -5961,63 +5941,63 @@ msgid "" "to poll until the system urandom entropy pool is initialized." msgstr "" -#: ../../library/os.rst:5378 +#: ../../library/os.rst:5382 msgid "" "On a Unix-like system, random bytes are read from the ``/dev/urandom`` " "device. If the ``/dev/urandom`` device is not available or not readable, " "the :exc:`NotImplementedError` exception is raised." msgstr "" -#: ../../library/os.rst:5382 +#: ../../library/os.rst:5386 msgid "On Windows, it will use ``BCryptGenRandom()``." msgstr "" -#: ../../library/os.rst:5385 +#: ../../library/os.rst:5389 msgid "" "The :mod:`secrets` module provides higher level functions. For an easy-to-" "use interface to the random number generator provided by your platform, " "please see :class:`random.SystemRandom`." msgstr "" -#: ../../library/os.rst:5389 +#: ../../library/os.rst:5393 msgid "" "On Linux, ``getrandom()`` is now used in blocking mode to increase the " "security." msgstr "" -#: ../../library/os.rst:5393 +#: ../../library/os.rst:5397 msgid "" "On Linux, if the ``getrandom()`` syscall blocks (the urandom entropy pool is " "not initialized yet), fall back on reading ``/dev/urandom``." msgstr "" -#: ../../library/os.rst:5397 +#: ../../library/os.rst:5401 msgid "" "On Linux 3.17 and newer, the ``getrandom()`` syscall is now used when " "available. On OpenBSD 5.6 and newer, the C ``getentropy()`` function is now " "used. These functions avoid the usage of an internal file descriptor." msgstr "" -#: ../../library/os.rst:5403 +#: ../../library/os.rst:5407 msgid "" "On Windows, ``BCryptGenRandom()`` is used instead of ``CryptGenRandom()`` " "which is deprecated." msgstr "" -#: ../../library/os.rst:5409 +#: ../../library/os.rst:5413 msgid "" "By default, when reading from ``/dev/random``, :func:`getrandom` blocks if " "no random bytes are available, and when reading from ``/dev/urandom``, it " "blocks if the entropy pool has not yet been initialized." msgstr "" -#: ../../library/os.rst:5413 +#: ../../library/os.rst:5417 msgid "" "If the :py:data:`GRND_NONBLOCK` flag is set, then :func:`getrandom` does not " "block in these cases, but instead immediately raises :exc:`BlockingIOError`." msgstr "" -#: ../../library/os.rst:5420 +#: ../../library/os.rst:5424 msgid "" "If this bit is set, then random bytes are drawn from the ``/dev/" "random`` pool instead of the ``/dev/urandom`` pool." @@ -6033,7 +6013,7 @@ msgstr "" #: ../../library/os.rst:372 ../../library/os.rst:438 ../../library/os.rst:447 #: ../../library/os.rst:456 ../../library/os.rst:470 ../../library/os.rst:666 -#: ../../library/os.rst:4231 ../../library/os.rst:4258 +#: ../../library/os.rst:4232 ../../library/os.rst:4259 msgid "process" msgstr "process" @@ -6086,8 +6066,8 @@ msgid "pty" msgstr "pty" #: ../../library/os.rst:1979 ../../library/os.rst:2376 -#: ../../library/os.rst:2578 ../../library/os.rst:3484 -#: ../../library/os.rst:3583 +#: ../../library/os.rst:2578 ../../library/os.rst:3485 +#: ../../library/os.rst:3584 msgid "directory" msgstr "directory(目錄)" @@ -6111,56 +6091,56 @@ msgstr "以及 os.makedirs()" msgid "stat" msgstr "stat" -#: ../../library/os.rst:3484 ../../library/os.rst:3583 +#: ../../library/os.rst:3485 ../../library/os.rst:3584 msgid "walking" msgstr "" -#: ../../library/os.rst:3484 ../../library/os.rst:3583 +#: ../../library/os.rst:3485 ../../library/os.rst:3584 msgid "traversal" msgstr "traversal(遍歷)" -#: ../../library/os.rst:4231 ../../library/os.rst:4258 +#: ../../library/os.rst:4232 ../../library/os.rst:4259 msgid "killing" msgstr "" -#: ../../library/os.rst:4231 ../../library/os.rst:4258 +#: ../../library/os.rst:4232 ../../library/os.rst:4259 msgid "signalling" msgstr "signalling(信號)" -#: ../../library/os.rst:5247 ../../library/os.rst:5283 +#: ../../library/os.rst:5251 ../../library/os.rst:5287 msgid ". (dot)" msgstr ". (點)" -#: ../../library/os.rst:5247 ../../library/os.rst:5255 -#: ../../library/os.rst:5263 ../../library/os.rst:5274 -#: ../../library/os.rst:5283 +#: ../../library/os.rst:5251 ../../library/os.rst:5259 +#: ../../library/os.rst:5267 ../../library/os.rst:5278 +#: ../../library/os.rst:5287 msgid "in pathnames" msgstr "於 pathnames(路徑名稱)中" -#: ../../library/os.rst:5255 +#: ../../library/os.rst:5259 msgid ".." msgstr ".." -#: ../../library/os.rst:5263 ../../library/os.rst:5274 +#: ../../library/os.rst:5267 ../../library/os.rst:5278 msgid "/ (slash)" msgstr "/ (斜線)" -#: ../../library/os.rst:5264 +#: ../../library/os.rst:5268 msgid "\\ (backslash)" msgstr "\\ (反斜線)" -#: ../../library/os.rst:5264 +#: ../../library/os.rst:5268 msgid "in pathnames (Windows)" msgstr "in pathnames (Windows)(在路徑名稱中 (Windows))" -#: ../../library/os.rst:5290 +#: ../../library/os.rst:5294 msgid ": (colon)" msgstr ": (冒號)" -#: ../../library/os.rst:5290 +#: ../../library/os.rst:5294 msgid "path separator (POSIX)" msgstr "path separator (POSIX)(路徑分隔器 (POSIX))" -#: ../../library/os.rst:5290 +#: ../../library/os.rst:5294 msgid "; (semicolon)" msgstr "; (分號)" diff --git a/library/pathlib.po b/library/pathlib.po index 40136b2459..24a94144cc 100644 --- a/library/pathlib.po +++ b/library/pathlib.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-09 00:03+0000\n" +"POT-Creation-Date: 2024-01-24 00:03+0000\n" "PO-Revision-Date: 2023-12-30 18:12+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -201,8 +201,8 @@ msgstr "" ":class:`PurePath` 的一個子類別,該路徑類型表示非 Windows 檔案系統的路徑: ::" #: ../../library/pathlib.rst:168 ../../library/pathlib.rst:180 -#: ../../library/pathlib.rst:742 ../../library/pathlib.rst:752 -#: ../../library/pathlib.rst:762 +#: ../../library/pathlib.rst:749 ../../library/pathlib.rst:759 +#: ../../library/pathlib.rst:769 msgid "*pathsegments* is specified similarly to :class:`PurePath`." msgstr "*pathsegments* 的指定方式與 :class:`PurePath` 類似。" @@ -441,13 +441,19 @@ msgstr "" msgid "Return whether or not this path is relative to the *other* path." msgstr "回傳此路徑是否為 *other* 路徑的相對路徑。" -#: ../../library/pathlib.rst:516 +#: ../../library/pathlib.rst:512 +msgid "" +"This method is string-based; it neither accesses the filesystem nor treats " +"\"``..``\" segments specially. The following code is equivalent:" +msgstr "" + +#: ../../library/pathlib.rst:523 msgid "" "Passing additional arguments is deprecated; if supplied, they are joined " "with *other*." msgstr "額外引數的傳入已棄用;如果有的話,它們會與 *other* 連接在一起。" -#: ../../library/pathlib.rst:521 +#: ../../library/pathlib.rst:528 msgid "" "With :class:`PureWindowsPath`, return ``True`` if the path is considered " "reserved under Windows, ``False`` otherwise. With :class:`PurePosixPath`, " @@ -457,19 +463,19 @@ msgstr "" "``True``,否則回傳 ``False``。對 :class:`PurePosixPath` 來說,總是回傳 " "``False``。" -#: ../../library/pathlib.rst:530 +#: ../../library/pathlib.rst:537 msgid "" "File system calls on reserved paths can fail mysteriously or have unintended " "effects." msgstr "在保留路徑上的檔案系統呼叫會神秘地失敗或有意外的效果。" -#: ../../library/pathlib.rst:536 +#: ../../library/pathlib.rst:543 msgid "" "Calling this method is equivalent to combining the path with each of the " "given *pathsegments* in turn::" msgstr "呼叫此方法會依序結合每個所給定的 *pathsegments* 到路徑上: ::" -#: ../../library/pathlib.rst:551 +#: ../../library/pathlib.rst:558 msgid "" "Match this path against the provided glob-style pattern. Return ``True`` if " "matching is successful, ``False`` otherwise." @@ -477,7 +483,7 @@ msgstr "" "將路徑與 glob 形式的樣式 (glob-style pattern) 做比對。如果比對成功則回傳 " "``True``,否則回傳 ``False``。" -#: ../../library/pathlib.rst:554 +#: ../../library/pathlib.rst:561 msgid "" "If *pattern* is relative, the path can be either relative or absolute, and " "matching is done from the right::" @@ -485,37 +491,37 @@ msgstr "" "如果 *pattern* 是相對的,則路徑可以是相對或絕對的,而且會從右邊來完成比" "對: ::" -#: ../../library/pathlib.rst:564 +#: ../../library/pathlib.rst:571 msgid "" "If *pattern* is absolute, the path must be absolute, and the whole path must " "match::" msgstr "如果 *pattern* 是絕對的,則路徑必須是絕對的,且整個路徑都要比對到: ::" -#: ../../library/pathlib.rst:572 +#: ../../library/pathlib.rst:579 msgid "" "The *pattern* may be another path object; this speeds up matching the same " "pattern against multiple files::" msgstr "*pattern* 可以是另一個路徑物件;這會加速對多個檔案比對相同的樣式: ::" -#: ../../library/pathlib.rst:579 +#: ../../library/pathlib.rst:586 msgid "Accepts an object implementing the :class:`os.PathLike` interface." msgstr "接受一個有實作 :class:`os.PathLike` 介面的物件。" -#: ../../library/pathlib.rst:582 +#: ../../library/pathlib.rst:589 msgid "As with other methods, case-sensitivity follows platform defaults::" msgstr "像其它方法一樣,是否區分大小寫會遵循平台的預設行為: ::" -#: ../../library/pathlib.rst:589 +#: ../../library/pathlib.rst:596 msgid "" "Set *case_sensitive* to ``True`` or ``False`` to override this behaviour." msgstr "將 *case_sensitive* 設定成 ``True`` 或 ``False`` 會覆蓋這個行為。" -#: ../../library/pathlib.rst:591 ../../library/pathlib.rst:934 -#: ../../library/pathlib.rst:1347 +#: ../../library/pathlib.rst:598 ../../library/pathlib.rst:945 +#: ../../library/pathlib.rst:1358 msgid "The *case_sensitive* parameter was added." msgstr "新增 *case_sensitive* 參數。" -#: ../../library/pathlib.rst:597 +#: ../../library/pathlib.rst:604 msgid "" "Compute a version of this path relative to the path represented by *other*. " "If it's impossible, :exc:`ValueError` is raised::" @@ -523,7 +529,7 @@ msgstr "" "計算這個路徑相對於 *other* 所表示路徑的版本。如果做不到會引發 :exc:" "`ValueError`: ::" -#: ../../library/pathlib.rst:612 +#: ../../library/pathlib.rst:619 msgid "" "When *walk_up* is False (the default), the path must start with *other*. " "When the argument is True, ``..`` entries may be added to form the relative " @@ -534,7 +540,7 @@ msgstr "" "可能會加入 ``..`` 以組成相對路徑。在其他情況下,例如路徑參考到不同的磁碟機," "則會引發 :exc:`ValueError`: ::" -#: ../../library/pathlib.rst:627 +#: ../../library/pathlib.rst:634 msgid "" "This function is part of :class:`PurePath` and works with strings. It does " "not check or access the underlying file structure. This can impact the " @@ -545,19 +551,19 @@ msgstr "" "的檔案架構。這會影響到 *walk_up* 選項,因為它假設路徑中沒有符號連結;如果需要" "解析符號連結的話可以先呼叫 :meth:`~Path.resolve`。" -#: ../../library/pathlib.rst:633 +#: ../../library/pathlib.rst:640 msgid "" "The *walk_up* parameter was added (old behavior is the same as " "``walk_up=False``)." msgstr "加入 *walk_up* 參數(舊的行為和 ``walk_up=False`` 相同)。" -#: ../../library/pathlib.rst:638 +#: ../../library/pathlib.rst:645 msgid "" "Passing additional positional arguments is deprecated; if supplied, they are " "joined with *other*." msgstr "額外位置引數的傳入已棄用;如果有的話,它們會與 *other* 連接在一起。" -#: ../../library/pathlib.rst:643 +#: ../../library/pathlib.rst:650 msgid "" "Return a new path with the :attr:`name` changed. If the original path " "doesn't have a name, ValueError is raised::" @@ -565,7 +571,7 @@ msgstr "" "回傳一個修改 :attr:`name` 後的新路徑。如果原始路徑沒有名稱則引發 " "ValueError: ::" -#: ../../library/pathlib.rst:660 +#: ../../library/pathlib.rst:667 msgid "" "Return a new path with the :attr:`stem` changed. If the original path " "doesn't have a name, ValueError is raised::" @@ -573,7 +579,7 @@ msgstr "" "回傳一個修改 :attr:`stem` 後的新路徑。如果原始路徑沒有名稱則引發 " "ValueError: ::" -#: ../../library/pathlib.rst:684 +#: ../../library/pathlib.rst:691 msgid "" "Return a new path with the :attr:`suffix` changed. If the original path " "doesn't have a suffix, the new *suffix* is appended instead. If the " @@ -582,7 +588,7 @@ msgstr "" "回傳一個修改 :attr:`suffix` 後的新路徑。如果原始路徑沒有後綴,新的 *suffix* " "會附加在後面。如果 *suffix* 是一個空字串,原來的後綴會被移除: ::" -#: ../../library/pathlib.rst:701 +#: ../../library/pathlib.rst:708 msgid "" "Create a new path object of the same type by combining the given " "*pathsegments*. This method is called whenever a derivative path is created, " @@ -593,55 +599,55 @@ msgstr "" "建立的時候會呼叫這個方法,例如從 :attr:`parent` 和 :meth:`relative_to` 建立衍" "生路徑。子類別可以覆寫此方法來傳遞資訊給衍生路徑,例如: ::" -#: ../../library/pathlib.rst:727 +#: ../../library/pathlib.rst:734 msgid "Concrete paths" msgstr "" -#: ../../library/pathlib.rst:729 +#: ../../library/pathlib.rst:736 msgid "" "Concrete paths are subclasses of the pure path classes. In addition to " "operations provided by the latter, they also provide methods to do system " "calls on path objects. There are three ways to instantiate concrete paths:" msgstr "" -#: ../../library/pathlib.rst:735 +#: ../../library/pathlib.rst:742 msgid "" "A subclass of :class:`PurePath`, this class represents concrete paths of the " "system's path flavour (instantiating it creates either a :class:`PosixPath` " "or a :class:`WindowsPath`)::" msgstr "" -#: ../../library/pathlib.rst:746 +#: ../../library/pathlib.rst:753 msgid "" "A subclass of :class:`Path` and :class:`PurePosixPath`, this class " "represents concrete non-Windows filesystem paths::" msgstr "" -#: ../../library/pathlib.rst:756 +#: ../../library/pathlib.rst:763 msgid "" "A subclass of :class:`Path` and :class:`PureWindowsPath`, this class " "represents concrete Windows filesystem paths::" msgstr "" -#: ../../library/pathlib.rst:764 +#: ../../library/pathlib.rst:771 msgid "" "You can only instantiate the class flavour that corresponds to your system " "(allowing system calls on non-compatible path flavours could lead to bugs or " "failures in your application)::" msgstr "" -#: ../../library/pathlib.rst:784 +#: ../../library/pathlib.rst:791 msgid "Methods" msgstr "" -#: ../../library/pathlib.rst:786 +#: ../../library/pathlib.rst:793 msgid "" "Concrete paths provide the following methods in addition to pure paths " "methods. Many of these methods can raise an :exc:`OSError` if a system call " "fails (for example because the path doesn't exist)." msgstr "" -#: ../../library/pathlib.rst:792 +#: ../../library/pathlib.rst:799 msgid "" ":meth:`~Path.exists()`, :meth:`~Path.is_dir()`, :meth:`~Path.is_file()`, :" "meth:`~Path.is_mount()`, :meth:`~Path.is_symlink()`, :meth:`~Path." @@ -651,79 +657,86 @@ msgid "" "the OS level." msgstr "" -#: ../../library/pathlib.rst:802 +#: ../../library/pathlib.rst:809 msgid "" "Return a new path object representing the current directory (as returned by :" "func:`os.getcwd`)::" msgstr "" -#: ../../library/pathlib.rst:811 +#: ../../library/pathlib.rst:818 msgid "" "Return a new path object representing the user's home directory (as returned " "by :func:`os.path.expanduser` with ``~`` construct). If the home directory " "can't be resolved, :exc:`RuntimeError` is raised." msgstr "" -#: ../../library/pathlib.rst:825 +#: ../../library/pathlib.rst:832 msgid "" "Return a :class:`os.stat_result` object containing information about this " "path, like :func:`os.stat`. The result is looked up at each call to this " "method." msgstr "" -#: ../../library/pathlib.rst:828 +#: ../../library/pathlib.rst:835 msgid "" "This method normally follows symlinks; to stat a symlink add the argument " "``follow_symlinks=False``, or use :meth:`~Path.lstat`." msgstr "" -#: ../../library/pathlib.rst:839 ../../library/pathlib.rst:859 -#: ../../library/pathlib.rst:880 +#: ../../library/pathlib.rst:846 ../../library/pathlib.rst:866 +#: ../../library/pathlib.rst:887 msgid "The *follow_symlinks* parameter was added." msgstr "新增 *follow_symlinks* 參數。" -#: ../../library/pathlib.rst:844 +#: ../../library/pathlib.rst:851 msgid "Change the file mode and permissions, like :func:`os.chmod`." msgstr "" -#: ../../library/pathlib.rst:846 +#: ../../library/pathlib.rst:853 msgid "" "This method normally follows symlinks. Some Unix flavours support changing " "permissions on the symlink itself; on these platforms you may add the " "argument ``follow_symlinks=False``, or use :meth:`~Path.lchmod`." msgstr "" -#: ../../library/pathlib.rst:864 +#: ../../library/pathlib.rst:871 msgid "Return ``True`` if the path points to an existing file or directory." msgstr "" -#: ../../library/pathlib.rst:866 +#: ../../library/pathlib.rst:873 msgid "" "This method normally follows symlinks; to check if a symlink exists, add the " "argument ``follow_symlinks=False``." msgstr "" -#: ../../library/pathlib.rst:885 +#: ../../library/pathlib.rst:892 msgid "" "Return a new path with expanded ``~`` and ``~user`` constructs, as returned " "by :meth:`os.path.expanduser`. If a home directory can't be resolved, :exc:" "`RuntimeError` is raised." msgstr "" -#: ../../library/pathlib.rst:900 +#: ../../library/pathlib.rst:907 msgid "" "Glob the given relative *pattern* in the directory represented by this path, " "yielding all matching files (of any kind)::" msgstr "" -#: ../../library/pathlib.rst:908 +#: ../../library/pathlib.rst:915 msgid "" "Patterns are the same as for :mod:`fnmatch`, with the addition of \"``**``\" " "which means \"this directory and all subdirectories, recursively\". In " "other words, it enables recursive globbing::" msgstr "" -#: ../../library/pathlib.rst:919 ../../library/pathlib.rst:1336 +#: ../../library/pathlib.rst:926 +msgid "" +"This method calls :meth:`Path.is_dir` on the top-level directory and " +"propagates any :exc:`OSError` exception that is raised. Subsequent :exc:" +"`OSError` exceptions from scanning directories are suppressed." +msgstr "" + +#: ../../library/pathlib.rst:930 ../../library/pathlib.rst:1347 msgid "" "By default, or when the *case_sensitive* keyword-only argument is set to " "``None``, this method matches paths using platform-specific casing rules: " @@ -731,13 +744,13 @@ msgid "" "*case_sensitive* to ``True`` or ``False`` to override this behaviour." msgstr "" -#: ../../library/pathlib.rst:925 +#: ../../library/pathlib.rst:936 msgid "" "Using the \"``**``\" pattern in large directory trees may consume an " "inordinate amount of time." msgstr "" -#: ../../library/pathlib.rst:928 +#: ../../library/pathlib.rst:939 msgid "" "Raises an :ref:`auditing event ` ``pathlib.Path.glob`` with " "arguments ``self``, ``pattern``." @@ -745,45 +758,45 @@ msgstr "" "引發一個附帶引數 ``self``、``pattern`` 的\\ :ref:`稽核事件 ` " "``pathlib.Path.glob``。" -#: ../../library/pathlib.rst:930 ../../library/pathlib.rst:1343 +#: ../../library/pathlib.rst:941 ../../library/pathlib.rst:1354 msgid "" "Return only directories if *pattern* ends with a pathname components " "separator (:data:`~os.sep` or :data:`~os.altsep`)." msgstr "" -#: ../../library/pathlib.rst:940 +#: ../../library/pathlib.rst:951 msgid "" "Return the name of the group owning the file. :exc:`KeyError` is raised if " "the file's gid isn't found in the system database." msgstr "" -#: ../../library/pathlib.rst:946 +#: ../../library/pathlib.rst:957 msgid "" "Return ``True`` if the path points to a directory (or a symbolic link " "pointing to a directory), ``False`` if it points to another kind of file." msgstr "" -#: ../../library/pathlib.rst:949 ../../library/pathlib.rst:958 -#: ../../library/pathlib.rst:1000 ../../library/pathlib.rst:1009 -#: ../../library/pathlib.rst:1018 ../../library/pathlib.rst:1027 +#: ../../library/pathlib.rst:960 ../../library/pathlib.rst:969 +#: ../../library/pathlib.rst:1011 ../../library/pathlib.rst:1020 +#: ../../library/pathlib.rst:1029 ../../library/pathlib.rst:1038 msgid "" "``False`` is also returned if the path doesn't exist or is a broken symlink; " "other errors (such as permission errors) are propagated." msgstr "" -#: ../../library/pathlib.rst:955 +#: ../../library/pathlib.rst:966 msgid "" "Return ``True`` if the path points to a regular file (or a symbolic link " "pointing to a regular file), ``False`` if it points to another kind of file." msgstr "" -#: ../../library/pathlib.rst:964 +#: ../../library/pathlib.rst:975 msgid "" "Return ``True`` if the path points to a junction, and ``False`` for any " "other type of file. Currently only Windows supports junctions." msgstr "" -#: ../../library/pathlib.rst:972 +#: ../../library/pathlib.rst:983 msgid "" "Return ``True`` if the path is a :dfn:`mount point`: a point in a file " "system where a different file system has been mounted. On POSIX, the " @@ -795,53 +808,53 @@ msgid "" "mounted filesystem directory." msgstr "" -#: ../../library/pathlib.rst:983 +#: ../../library/pathlib.rst:994 msgid "Windows support was added." msgstr "" -#: ../../library/pathlib.rst:989 +#: ../../library/pathlib.rst:1000 msgid "" "Return ``True`` if the path points to a symbolic link, ``False`` otherwise." msgstr "" -#: ../../library/pathlib.rst:991 +#: ../../library/pathlib.rst:1002 msgid "" "``False`` is also returned if the path doesn't exist; other errors (such as " "permission errors) are propagated." msgstr "" -#: ../../library/pathlib.rst:997 +#: ../../library/pathlib.rst:1008 msgid "" "Return ``True`` if the path points to a Unix socket (or a symbolic link " "pointing to a Unix socket), ``False`` if it points to another kind of file." msgstr "" -#: ../../library/pathlib.rst:1006 +#: ../../library/pathlib.rst:1017 msgid "" "Return ``True`` if the path points to a FIFO (or a symbolic link pointing to " "a FIFO), ``False`` if it points to another kind of file." msgstr "" -#: ../../library/pathlib.rst:1015 +#: ../../library/pathlib.rst:1026 msgid "" "Return ``True`` if the path points to a block device (or a symbolic link " "pointing to a block device), ``False`` if it points to another kind of file." msgstr "" -#: ../../library/pathlib.rst:1024 +#: ../../library/pathlib.rst:1035 msgid "" "Return ``True`` if the path points to a character device (or a symbolic link " "pointing to a character device), ``False`` if it points to another kind of " "file." msgstr "" -#: ../../library/pathlib.rst:1033 +#: ../../library/pathlib.rst:1044 msgid "" "When the path points to a directory, yield path objects of the directory " "contents::" msgstr "" -#: ../../library/pathlib.rst:1047 +#: ../../library/pathlib.rst:1058 msgid "" "The children are yielded in arbitrary order, and the special entries ``'.'`` " "and ``'..'`` are not included. If a file is removed from or added to the " @@ -849,20 +862,20 @@ msgid "" "be included is unspecified." msgstr "" -#: ../../library/pathlib.rst:1054 +#: ../../library/pathlib.rst:1065 msgid "" "Generate the file names in a directory tree by walking the tree either top-" "down or bottom-up." msgstr "" -#: ../../library/pathlib.rst:1057 +#: ../../library/pathlib.rst:1068 msgid "" "For each directory in the directory tree rooted at *self* (including *self* " "but excluding '.' and '..'), the method yields a 3-tuple of ``(dirpath, " "dirnames, filenames)``." msgstr "" -#: ../../library/pathlib.rst:1061 +#: ../../library/pathlib.rst:1072 msgid "" "*dirpath* is a :class:`Path` to the directory currently being walked, " "*dirnames* is a list of strings for the names of subdirectories in *dirpath* " @@ -872,7 +885,7 @@ msgid "" "name``. Whether or not the lists are sorted is file system-dependent." msgstr "" -#: ../../library/pathlib.rst:1069 +#: ../../library/pathlib.rst:1080 msgid "" "If the optional argument *top_down* is true (which is the default), the " "triple for a directory is generated before the triples for any of its " @@ -883,7 +896,7 @@ msgid "" "the directory and its subdirectories are walked." msgstr "" -#: ../../library/pathlib.rst:1077 +#: ../../library/pathlib.rst:1088 msgid "" "When *top_down* is true, the caller can modify the *dirnames* list in-place " "(for example, using :keyword:`del` or slice assignment), and :meth:`Path." @@ -896,7 +909,7 @@ msgid "" "generated by the time *dirnames* is yielded to the caller." msgstr "" -#: ../../library/pathlib.rst:1087 +#: ../../library/pathlib.rst:1098 msgid "" "By default, errors from :func:`os.scandir` are ignored. If the optional " "argument *on_error* is specified, it should be a callable; it will be called " @@ -905,7 +918,7 @@ msgid "" "filename is available as the ``filename`` attribute of the exception object." msgstr "" -#: ../../library/pathlib.rst:1093 +#: ../../library/pathlib.rst:1104 msgid "" "By default, :meth:`Path.walk` does not follow symbolic links, and instead " "adds them to the *filenames* list. Set *follow_symlinks* to true to resolve " @@ -914,14 +927,14 @@ msgid "" "(where supported)." msgstr "" -#: ../../library/pathlib.rst:1100 +#: ../../library/pathlib.rst:1111 msgid "" "Be aware that setting *follow_symlinks* to true can lead to infinite " "recursion if a link points to a parent directory of itself. :meth:`Path." "walk` does not keep track of the directories it has already visited." msgstr "" -#: ../../library/pathlib.rst:1105 +#: ../../library/pathlib.rst:1116 msgid "" ":meth:`Path.walk` assumes the directories it walks are not modified during " "execution. For example, if a directory from *dirnames* has been replaced " @@ -930,81 +943,83 @@ msgid "" "*dirnames* as appropriate." msgstr "" -#: ../../library/pathlib.rst:1113 +#: ../../library/pathlib.rst:1124 msgid "" "Unlike :func:`os.walk`, :meth:`Path.walk` lists symlinks to directories in " "*filenames* if *follow_symlinks* is false." msgstr "" -#: ../../library/pathlib.rst:1116 +#: ../../library/pathlib.rst:1127 msgid "" "This example displays the number of bytes used by all files in each " "directory, while ignoring ``__pycache__`` directories::" msgstr "" -#: ../../library/pathlib.rst:1132 +#: ../../library/pathlib.rst:1143 msgid "" "This next example is a simple implementation of :func:`shutil.rmtree`. " "Walking the tree bottom-up is essential as :func:`rmdir` doesn't allow " "deleting a directory before it is empty::" msgstr "" -#: ../../library/pathlib.rst:1149 +#: ../../library/pathlib.rst:1160 msgid "" "Like :meth:`Path.chmod` but, if the path points to a symbolic link, the " "symbolic link's mode is changed rather than its target's." msgstr "" -#: ../../library/pathlib.rst:1155 +#: ../../library/pathlib.rst:1166 msgid "" "Like :meth:`Path.stat` but, if the path points to a symbolic link, return " "the symbolic link's information rather than its target's." msgstr "" -#: ../../library/pathlib.rst:1161 +#: ../../library/pathlib.rst:1172 msgid "" "Create a new directory at this given path. If *mode* is given, it is " "combined with the process' ``umask`` value to determine the file mode and " "access flags. If the path already exists, :exc:`FileExistsError` is raised." msgstr "" -#: ../../library/pathlib.rst:1166 +#: ../../library/pathlib.rst:1177 msgid "" "If *parents* is true, any missing parents of this path are created as " "needed; they are created with the default permissions without taking *mode* " "into account (mimicking the POSIX ``mkdir -p`` command)." msgstr "" -#: ../../library/pathlib.rst:1170 +#: ../../library/pathlib.rst:1181 msgid "" "If *parents* is false (the default), a missing parent raises :exc:" "`FileNotFoundError`." msgstr "" -#: ../../library/pathlib.rst:1173 +#: ../../library/pathlib.rst:1184 msgid "" "If *exist_ok* is false (the default), :exc:`FileExistsError` is raised if " "the target directory already exists." msgstr "" -#: ../../library/pathlib.rst:1176 +#: ../../library/pathlib.rst:1187 msgid "" -"If *exist_ok* is true, :exc:`FileExistsError` exceptions will be ignored " -"(same behavior as the POSIX ``mkdir -p`` command), but only if the last path " -"component is not an existing non-directory file." +"If *exist_ok* is true, :exc:`FileExistsError` will not be raised unless the " +"given path already exists in the file system and is not a directory (same " +"behavior as the POSIX ``mkdir -p`` command)." msgstr "" +"如果 *exist_ok* 為 true,:exc:`FileExistsError` 例外不會被引發,除非給定路徑" +"已在檔案系統中存在且並不是個目錄(行為與 POSIX ``mkdir -p`` 指令相同)。" -#: ../../library/pathlib.rst:1180 +#: ../../library/pathlib.rst:1191 msgid "The *exist_ok* parameter was added." msgstr "新增 *exist_ok* 參數。" -#: ../../library/pathlib.rst:1186 +#: ../../library/pathlib.rst:1197 msgid "" "Open the file pointed to by the path, like the built-in :func:`open` " "function does::" msgstr "" -#: ../../library/pathlib.rst:1198 +#: ../../library/pathlib.rst:1209 msgid "" "Return the name of the user owning the file. :exc:`KeyError` is raised if " "the file's uid isn't found in the system database." @@ -1012,27 +1027,27 @@ msgstr "" "回傳擁有該檔案的用戶的名稱。如果在系統資料庫中找不到該檔案的 uid ,則會引發 :" "exc:`KeyError`。" -#: ../../library/pathlib.rst:1204 +#: ../../library/pathlib.rst:1215 msgid "Return the binary contents of the pointed-to file as a bytes object::" msgstr "將指向檔案的二進為內容以一個位元組 (bytes) 物件回傳: ::" -#: ../../library/pathlib.rst:1217 +#: ../../library/pathlib.rst:1228 msgid "Return the decoded contents of the pointed-to file as a string::" msgstr "將指向檔案的解碼內容以字串形式回傳: ::" -#: ../../library/pathlib.rst:1225 +#: ../../library/pathlib.rst:1236 msgid "" "The file is opened and then closed. The optional parameters have the same " "meaning as in :func:`open`." msgstr "該檔案被打開並且隨後關閉。選填參數的含義與 :func:`open` 函數中的相同。" -#: ../../library/pathlib.rst:1233 +#: ../../library/pathlib.rst:1244 msgid "" "Return the path to which the symbolic link points (as returned by :func:`os." "readlink`)::" msgstr "回傳符號連結指向的路徑(如 :func:`os.readlink` 的回傳值): ::" -#: ../../library/pathlib.rst:1246 +#: ../../library/pathlib.rst:1257 msgid "" "Rename this file or directory to the given *target*, and return a new Path " "instance pointing to *target*. On Unix, if *target* exists and is a file, " @@ -1045,7 +1060,7 @@ msgstr "" "限,則會在不顯示訊息的情況下進行取代。在 Windows 系統上,若 *target* 存在,則" "會引發 :exc:`FileExistsError` 錯誤。*target* 可以是字串或另一個路徑物件: ::" -#: ../../library/pathlib.rst:1261 ../../library/pathlib.rst:1277 +#: ../../library/pathlib.rst:1272 ../../library/pathlib.rst:1288 msgid "" "The target path may be absolute or relative. Relative paths are interpreted " "relative to the current working directory, *not* the directory of the Path " @@ -1054,17 +1069,17 @@ msgstr "" "目標路徑可以是絕對路徑或相對路徑。相對路徑會相對於當前的工作目錄進行解釋," "*not* 相對於路徑物件所在的目錄。" -#: ../../library/pathlib.rst:1265 +#: ../../library/pathlib.rst:1276 msgid "" "It is implemented in terms of :func:`os.rename` and gives the same " "guarantees." msgstr "此功能是使用 :func:`os.rename` 實現的,並提供相同的保證。" -#: ../../library/pathlib.rst:1267 ../../library/pathlib.rst:1281 +#: ../../library/pathlib.rst:1278 ../../library/pathlib.rst:1292 msgid "Added return value, return the new Path instance." msgstr "新增了回傳值,回傳新的路徑 (Path) 物件。" -#: ../../library/pathlib.rst:1273 +#: ../../library/pathlib.rst:1284 msgid "" "Rename this file or directory to the given *target*, and return a new Path " "instance pointing to *target*. If *target* points to an existing file or " @@ -1073,26 +1088,26 @@ msgstr "" "將此檔案或目錄重新命名為給定的 *target* ,並回傳一個指向 *target* 的新路徑物" "件。如果 *target* 指向一個現有的檔案或空目錄,它將被無條件地取代。" -#: ../../library/pathlib.rst:1287 +#: ../../library/pathlib.rst:1298 msgid "" "Make the path absolute, without normalization or resolving symlinks. Returns " "a new path object::" msgstr "" "使路徑成為絕對路徑,不進行標準化或解析符號連結。 回傳一個新的路徑物件: ::" -#: ../../library/pathlib.rst:1299 +#: ../../library/pathlib.rst:1310 msgid "" "Make the path absolute, resolving any symlinks. A new path object is " "returned::" msgstr "將路徑轉換為絕對路徑,解析所有符號連結。回傳一個新的路徑物件: ::" -#: ../../library/pathlib.rst:1308 +#: ../../library/pathlib.rst:1319 msgid "" "\"``..``\" components are also eliminated (this is the only method to do " "so)::" msgstr "同時也會消除 \"``..``\" 的路徑組件(這是唯一的方法): ::" -#: ../../library/pathlib.rst:1314 +#: ../../library/pathlib.rst:1325 msgid "" "If the path doesn't exist and *strict* is ``True``, :exc:`FileNotFoundError` " "is raised. If *strict* is ``False``, the path is resolved as far as " @@ -1105,11 +1120,11 @@ msgstr "" "中,而不檢查其是否存在。 如果在解析過程中遇到無窮迴圈,則引發 :exc:" "`RuntimeError`。" -#: ../../library/pathlib.rst:1320 +#: ../../library/pathlib.rst:1331 msgid "The *strict* parameter was added (pre-3.6 behavior is strict)." msgstr "新增 *strict* 參數(在 3.6 版本之前的行為是嚴格的)。" -#: ../../library/pathlib.rst:1325 +#: ../../library/pathlib.rst:1336 msgid "" "Glob the given relative *pattern* recursively. This is like calling :func:" "`Path.glob` with \"``**/``\" added in front of the *pattern*, where " @@ -1119,7 +1134,7 @@ msgstr "" "\"``**/``\" 並呼叫 :func:`Path.glob`,其中 *patterns* 和 :mod:`fnmatch` 相" "同: ::" -#: ../../library/pathlib.rst:1341 +#: ../../library/pathlib.rst:1352 msgid "" "Raises an :ref:`auditing event ` ``pathlib.Path.rglob`` with " "arguments ``self``, ``pattern``." @@ -1127,11 +1142,11 @@ msgstr "" "引發一個附帶引數 ``self``、``pattern`` 的\\ :ref:`稽核事件 ` " "``pathlib.Path.rglob``。" -#: ../../library/pathlib.rst:1353 +#: ../../library/pathlib.rst:1364 msgid "Remove this directory. The directory must be empty." msgstr "移除此目錄。該目錄必須為空。" -#: ../../library/pathlib.rst:1358 +#: ../../library/pathlib.rst:1369 msgid "" "Return whether this path points to the same file as *other_path*, which can " "be either a Path object, or a string. The semantics are similar to :func:" @@ -1141,37 +1156,41 @@ msgstr "" "物件或字串。其語義類似於 :func:`os.path.samefile` 和 :func:`os.path." "samestat`。" -#: ../../library/pathlib.rst:1362 +#: ../../library/pathlib.rst:1373 msgid "" "An :exc:`OSError` can be raised if either file cannot be accessed for some " "reason." msgstr "若任何一個檔案因為某些原因無法存取,則引發 :exc:`OSError`。" -#: ../../library/pathlib.rst:1379 +#: ../../library/pathlib.rst:1390 +msgid "Make this path a symbolic link pointing to *target*." +msgstr "使這個路徑成為一個指向 *target* 的符號連結。" + +#: ../../library/pathlib.rst:1392 msgid "" -"Make this path a symbolic link to *target*. Under Windows, " -"*target_is_directory* must be true (default ``False``) if the link's target " -"is a directory. Under POSIX, *target_is_directory*'s value is ignored." +"On Windows, a symlink represents either a file or a directory, and does not " +"morph to the target dynamically. If the target is present, the type of the " +"symlink will be created to match. Otherwise, the symlink will be created as " +"a directory if *target_is_directory* is ``True`` or a file symlink (the " +"default) otherwise. On non-Windows platforms, *target_is_directory* is " +"ignored." msgstr "" -"使這個路徑為一個 *target* 的符號連結。如果在 Windows 的連結目標是資料夾," -"*target_is_directory* 應該為 true(預設為 ``False``\\ )。如果在 POSIX 的連結" -"目標是資料夾,*target_is_directory* 的數值會被省略。" -#: ../../library/pathlib.rst:1395 +#: ../../library/pathlib.rst:1410 msgid "" "The order of arguments (link, target) is the reverse of :func:`os.symlink`'s." msgstr "引數的順序 (link, target) 和 :func:`os.symlink` 相反。" -#: ../../library/pathlib.rst:1400 +#: ../../library/pathlib.rst:1415 msgid "Make this path a hard link to the same file as *target*." msgstr "使這個路徑為與 *target* 相同檔案的一個硬連結 (hard link)。" -#: ../../library/pathlib.rst:1403 +#: ../../library/pathlib.rst:1418 msgid "" "The order of arguments (link, target) is the reverse of :func:`os.link`'s." msgstr "引數的順序 (link, target) 和 :func:`os.link` 相反。" -#: ../../library/pathlib.rst:1411 +#: ../../library/pathlib.rst:1426 msgid "" "Create a file at this given path. If *mode* is given, it is combined with " "the process' ``umask`` value to determine the file mode and access flags. " @@ -1184,14 +1203,14 @@ msgstr "" "不會失敗(其變更時間會被更新為當下時間),否則 :exc:`FileExistsError` 會被引" "發。" -#: ../../library/pathlib.rst:1420 +#: ../../library/pathlib.rst:1435 msgid "" "Remove this file or symbolic link. If the path points to a directory, use :" "func:`Path.rmdir` instead." msgstr "" "移除這個檔案或符號連結。如果路徑指到資料夾,請改用 :func:`Path.rmdir`。" -#: ../../library/pathlib.rst:1423 +#: ../../library/pathlib.rst:1438 msgid "" "If *missing_ok* is false (the default), :exc:`FileNotFoundError` is raised " "if the path does not exist." @@ -1199,7 +1218,7 @@ msgstr "" "如果 *missing_ok* 是 false(預設值), :exc:`FileNotFoundError` 會在路徑不存" "在時被引發。" -#: ../../library/pathlib.rst:1426 +#: ../../library/pathlib.rst:1441 msgid "" "If *missing_ok* is true, :exc:`FileNotFoundError` exceptions will be ignored " "(same behavior as the POSIX ``rm -f`` command)." @@ -1207,27 +1226,27 @@ msgstr "" "如果 *missing_ok* 為 true,:exc:`FileNotFoundError` 例外會被忽略(行為與 " "POSIX ``rm -f`` 指令相同)。" -#: ../../library/pathlib.rst:1429 +#: ../../library/pathlib.rst:1444 msgid "The *missing_ok* parameter was added." msgstr "新增 *missing_ok* 參數。" -#: ../../library/pathlib.rst:1435 +#: ../../library/pathlib.rst:1450 msgid "" "Open the file pointed to in bytes mode, write *data* to it, and close the " "file::" msgstr "以位元組模式開啟指到的檔案,將 *data* 寫到檔案,並關閉檔案:: :" -#: ../../library/pathlib.rst:1444 +#: ../../library/pathlib.rst:1459 msgid "An existing file of the same name is overwritten." msgstr "一個名稱相同的已存在檔案會被覆寫。" -#: ../../library/pathlib.rst:1451 +#: ../../library/pathlib.rst:1466 msgid "" "Open the file pointed to in text mode, write *data* to it, and close the " "file::" msgstr "以文字模式開啟指到的檔案,將 *data* 寫到檔案,並關閉檔案:: :" -#: ../../library/pathlib.rst:1460 +#: ../../library/pathlib.rst:1475 msgid "" "An existing file of the same name is overwritten. The optional parameters " "have the same meaning as in :func:`open`." @@ -1235,21 +1254,21 @@ msgstr "" "一個已經存在、名稱相同的檔案會被覆寫。可選參數和 :func:`open` 的參數有相同意" "義。" -#: ../../library/pathlib.rst:1465 +#: ../../library/pathlib.rst:1480 msgid "The *newline* parameter was added." msgstr "新增 *newline* 參數。" -#: ../../library/pathlib.rst:1469 +#: ../../library/pathlib.rst:1484 msgid "Correspondence to tools in the :mod:`os` module" msgstr "" -#: ../../library/pathlib.rst:1471 +#: ../../library/pathlib.rst:1486 msgid "" "Below is a table mapping various :mod:`os` functions to their corresponding :" "class:`PurePath`/:class:`Path` equivalent." msgstr "" -#: ../../library/pathlib.rst:1476 +#: ../../library/pathlib.rst:1491 msgid "" "Not all pairs of functions/methods below are equivalent. Some of them, " "despite having some overlapping use-cases, have different semantics. They " @@ -1257,245 +1276,245 @@ msgid "" "relpath` and :meth:`PurePath.relative_to`." msgstr "" -#: ../../library/pathlib.rst:1482 +#: ../../library/pathlib.rst:1497 msgid ":mod:`os` and :mod:`os.path`" msgstr ":mod:`os` 和 :mod:`os.path`" -#: ../../library/pathlib.rst:1482 +#: ../../library/pathlib.rst:1497 msgid ":mod:`pathlib`" msgstr ":mod:`pathlib`" -#: ../../library/pathlib.rst:1484 +#: ../../library/pathlib.rst:1499 msgid ":func:`os.path.abspath`" msgstr ":func:`os.path.abspath`" -#: ../../library/pathlib.rst:1484 +#: ../../library/pathlib.rst:1499 msgid ":meth:`Path.absolute` [#]_" msgstr ":meth:`Path.absolute` [#]_" -#: ../../library/pathlib.rst:1485 +#: ../../library/pathlib.rst:1500 msgid ":func:`os.path.realpath`" msgstr ":func:`os.path.realpath`" -#: ../../library/pathlib.rst:1485 +#: ../../library/pathlib.rst:1500 msgid ":meth:`Path.resolve`" msgstr ":meth:`Path.resolve`" -#: ../../library/pathlib.rst:1486 +#: ../../library/pathlib.rst:1501 msgid ":func:`os.chmod`" msgstr ":func:`os.chmod`" -#: ../../library/pathlib.rst:1486 +#: ../../library/pathlib.rst:1501 msgid ":meth:`Path.chmod`" msgstr ":meth:`Path.chmod`" -#: ../../library/pathlib.rst:1487 +#: ../../library/pathlib.rst:1502 msgid ":func:`os.mkdir`" msgstr ":func:`os.mkdir`" -#: ../../library/pathlib.rst:1487 ../../library/pathlib.rst:1488 +#: ../../library/pathlib.rst:1502 ../../library/pathlib.rst:1503 msgid ":meth:`Path.mkdir`" msgstr ":meth:`Path.mkdir`" -#: ../../library/pathlib.rst:1488 +#: ../../library/pathlib.rst:1503 msgid ":func:`os.makedirs`" msgstr ":func:`os.makedirs`" -#: ../../library/pathlib.rst:1489 +#: ../../library/pathlib.rst:1504 msgid ":func:`os.rename`" msgstr ":func:`os.rename`" -#: ../../library/pathlib.rst:1489 +#: ../../library/pathlib.rst:1504 msgid ":meth:`Path.rename`" msgstr ":meth:`Path.rename`" -#: ../../library/pathlib.rst:1490 +#: ../../library/pathlib.rst:1505 msgid ":func:`os.replace`" msgstr ":func:`os.replace`" -#: ../../library/pathlib.rst:1490 +#: ../../library/pathlib.rst:1505 msgid ":meth:`Path.replace`" msgstr ":meth:`Path.replace`" -#: ../../library/pathlib.rst:1491 +#: ../../library/pathlib.rst:1506 msgid ":func:`os.rmdir`" msgstr ":func:`os.rmdir`" -#: ../../library/pathlib.rst:1491 +#: ../../library/pathlib.rst:1506 msgid ":meth:`Path.rmdir`" msgstr ":meth:`Path.rmdir`" -#: ../../library/pathlib.rst:1492 +#: ../../library/pathlib.rst:1507 msgid ":func:`os.remove`, :func:`os.unlink`" msgstr ":func:`os.remove`、:func:`os.unlink`" -#: ../../library/pathlib.rst:1492 +#: ../../library/pathlib.rst:1507 msgid ":meth:`Path.unlink`" msgstr ":meth:`Path.unlink`" -#: ../../library/pathlib.rst:1493 +#: ../../library/pathlib.rst:1508 msgid ":func:`os.getcwd`" msgstr ":func:`os.getcwd`" -#: ../../library/pathlib.rst:1493 +#: ../../library/pathlib.rst:1508 msgid ":func:`Path.cwd`" msgstr ":func:`Path.cwd`" -#: ../../library/pathlib.rst:1494 +#: ../../library/pathlib.rst:1509 msgid ":func:`os.path.exists`" msgstr ":func:`os.path.exists`" -#: ../../library/pathlib.rst:1494 +#: ../../library/pathlib.rst:1509 msgid ":meth:`Path.exists`" msgstr ":meth:`Path.exists`" -#: ../../library/pathlib.rst:1495 +#: ../../library/pathlib.rst:1510 msgid ":func:`os.path.expanduser`" msgstr ":func:`os.path.expanduser`" -#: ../../library/pathlib.rst:1495 +#: ../../library/pathlib.rst:1510 msgid ":meth:`Path.expanduser` and :meth:`Path.home`" msgstr ":meth:`Path.expanduser` 和 :meth:`Path.home`" -#: ../../library/pathlib.rst:1497 +#: ../../library/pathlib.rst:1512 msgid ":func:`os.listdir`" msgstr ":func:`os.listdir`" -#: ../../library/pathlib.rst:1497 +#: ../../library/pathlib.rst:1512 msgid ":meth:`Path.iterdir`" msgstr ":meth:`Path.iterdir`" -#: ../../library/pathlib.rst:1498 +#: ../../library/pathlib.rst:1513 msgid ":func:`os.walk`" msgstr ":func:`os.walk`" -#: ../../library/pathlib.rst:1498 +#: ../../library/pathlib.rst:1513 msgid ":meth:`Path.walk`" msgstr ":meth:`Path.walk`" -#: ../../library/pathlib.rst:1499 +#: ../../library/pathlib.rst:1514 msgid ":func:`os.path.isdir`" msgstr ":func:`os.path.isdir`" -#: ../../library/pathlib.rst:1499 +#: ../../library/pathlib.rst:1514 msgid ":meth:`Path.is_dir`" msgstr ":meth:`Path.is_dir`" -#: ../../library/pathlib.rst:1500 +#: ../../library/pathlib.rst:1515 msgid ":func:`os.path.isfile`" msgstr ":func:`os.path.isfile`" -#: ../../library/pathlib.rst:1500 +#: ../../library/pathlib.rst:1515 msgid ":meth:`Path.is_file`" msgstr ":meth:`Path.is_file`" -#: ../../library/pathlib.rst:1501 +#: ../../library/pathlib.rst:1516 msgid ":func:`os.path.islink`" msgstr ":func:`os.path.islink`" -#: ../../library/pathlib.rst:1501 +#: ../../library/pathlib.rst:1516 msgid ":meth:`Path.is_symlink`" msgstr ":meth:`Path.is_symlink`" -#: ../../library/pathlib.rst:1502 +#: ../../library/pathlib.rst:1517 msgid ":func:`os.link`" msgstr ":func:`os.link`" -#: ../../library/pathlib.rst:1502 +#: ../../library/pathlib.rst:1517 msgid ":meth:`Path.hardlink_to`" msgstr ":meth:`Path.hardlink_to`" -#: ../../library/pathlib.rst:1503 +#: ../../library/pathlib.rst:1518 msgid ":func:`os.symlink`" msgstr ":func:`os.symlink`" -#: ../../library/pathlib.rst:1503 +#: ../../library/pathlib.rst:1518 msgid ":meth:`Path.symlink_to`" msgstr ":meth:`Path.symlink_to`" -#: ../../library/pathlib.rst:1504 +#: ../../library/pathlib.rst:1519 msgid ":func:`os.readlink`" msgstr ":func:`os.readlink`" -#: ../../library/pathlib.rst:1504 +#: ../../library/pathlib.rst:1519 msgid ":meth:`Path.readlink`" msgstr ":meth:`Path.readlink`" -#: ../../library/pathlib.rst:1505 +#: ../../library/pathlib.rst:1520 msgid ":func:`os.path.relpath`" msgstr ":func:`os.path.relpath`" -#: ../../library/pathlib.rst:1505 +#: ../../library/pathlib.rst:1520 msgid ":meth:`PurePath.relative_to` [#]_" msgstr ":meth:`PurePath.relative_to` [#]_" -#: ../../library/pathlib.rst:1506 +#: ../../library/pathlib.rst:1521 msgid ":func:`os.stat`" msgstr ":func:`os.stat`" -#: ../../library/pathlib.rst:1506 +#: ../../library/pathlib.rst:1521 msgid ":meth:`Path.stat`, :meth:`Path.owner`, :meth:`Path.group`" msgstr ":meth:`Path.stat`、:meth:`Path.owner`、:meth:`Path.group`" -#: ../../library/pathlib.rst:1509 +#: ../../library/pathlib.rst:1524 msgid ":func:`os.path.isabs`" msgstr ":func:`os.path.isabs`" -#: ../../library/pathlib.rst:1509 +#: ../../library/pathlib.rst:1524 msgid ":meth:`PurePath.is_absolute`" msgstr ":meth:`PurePath.is_absolute`" -#: ../../library/pathlib.rst:1510 +#: ../../library/pathlib.rst:1525 msgid ":func:`os.path.join`" msgstr ":func:`os.path.join`" -#: ../../library/pathlib.rst:1510 +#: ../../library/pathlib.rst:1525 msgid ":func:`PurePath.joinpath`" msgstr ":func:`PurePath.joinpath`" -#: ../../library/pathlib.rst:1511 +#: ../../library/pathlib.rst:1526 msgid ":func:`os.path.basename`" msgstr ":func:`os.path.basename`" -#: ../../library/pathlib.rst:1511 +#: ../../library/pathlib.rst:1526 msgid ":attr:`PurePath.name`" msgstr ":attr:`PurePath.name`" -#: ../../library/pathlib.rst:1512 +#: ../../library/pathlib.rst:1527 msgid ":func:`os.path.dirname`" msgstr ":func:`os.path.dirname`" -#: ../../library/pathlib.rst:1512 +#: ../../library/pathlib.rst:1527 msgid ":attr:`PurePath.parent`" msgstr ":attr:`PurePath.parent`" -#: ../../library/pathlib.rst:1513 +#: ../../library/pathlib.rst:1528 msgid ":func:`os.path.samefile`" msgstr ":func:`os.path.samefile`" -#: ../../library/pathlib.rst:1513 +#: ../../library/pathlib.rst:1528 msgid ":meth:`Path.samefile`" msgstr ":meth:`Path.samefile`" -#: ../../library/pathlib.rst:1514 +#: ../../library/pathlib.rst:1529 msgid ":func:`os.path.splitext`" msgstr ":func:`os.path.splitext`" -#: ../../library/pathlib.rst:1514 +#: ../../library/pathlib.rst:1529 msgid ":attr:`PurePath.stem` and :attr:`PurePath.suffix`" msgstr ":attr:`PurePath.stem` 和 :attr:`PurePath.suffix`" -#: ../../library/pathlib.rst:1519 +#: ../../library/pathlib.rst:1534 msgid "Footnotes" msgstr "註解" -#: ../../library/pathlib.rst:1520 +#: ../../library/pathlib.rst:1535 msgid "" ":func:`os.path.abspath` normalizes the resulting path, which may change its " "meaning in the presence of symlinks, while :meth:`Path.absolute` does not." msgstr "" -#: ../../library/pathlib.rst:1521 +#: ../../library/pathlib.rst:1536 msgid "" ":meth:`PurePath.relative_to` requires ``self`` to be the subpath of the " "argument, but :func:`os.path.relpath` does not." @@ -1508,3 +1527,13 @@ msgstr "path(路徑)" #: ../../library/pathlib.rst:12 msgid "operations" msgstr "operations(操作)" + +#~ msgid "" +#~ "Make this path a symbolic link to *target*. Under Windows, " +#~ "*target_is_directory* must be true (default ``False``) if the link's " +#~ "target is a directory. Under POSIX, *target_is_directory*'s value is " +#~ "ignored." +#~ msgstr "" +#~ "使這個路徑為一個 *target* 的符號連結。如果在 Windows 的連結目標是資料夾," +#~ "*target_is_directory* 應該為 true(預設為 ``False``\\ )。如果在 POSIX 的" +#~ "連結目標是資料夾,*target_is_directory* 的數值會被省略。" diff --git a/library/pdb.po b/library/pdb.po index 33107bff82..f84d5529ed 100644 --- a/library/pdb.po +++ b/library/pdb.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2024-01-24 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -114,15 +114,15 @@ msgstr "" #: ../../library/pdb.rst:89 msgid "" -"``-c`` option is introduced to execute commands as if given in a :file:`." -"pdbrc` file, see :ref:`debugger-commands`." +"Added the ``-c`` option to execute commands as if given in a :file:`.pdbrc` " +"file; see :ref:`debugger-commands`." msgstr "" #: ../../library/pdb.rst:93 msgid "" -"``-m`` option is introduced to execute modules similar to the way ``python -" -"m`` does. As with a script, the debugger will pause execution just before " -"the first line of the module." +"Added the ``-m`` option to execute modules similar to the way ``python -m`` " +"does. As with a script, the debugger will pause execution just before the " +"first line of the module." msgstr "" #: ../../library/pdb.rst:98 @@ -241,12 +241,13 @@ msgid "" msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``pdb.Pdb``。" #: ../../library/pdb.rst:212 -msgid "The *skip* argument." +msgid "Added the *skip* parameter." msgstr "" #: ../../library/pdb.rst:215 msgid "" -"The *nosigint* argument. Previously, a SIGINT handler was never set by Pdb." +"Added the *nosigint* parameter. Previously, a SIGINT handler was never set " +"by Pdb." msgstr "" #: ../../library/pdb.rst:219 @@ -566,7 +567,7 @@ msgid "" msgstr "" #: ../../library/pdb.rst:466 -msgid "The ``>>`` marker." +msgid "Added the ``>>`` marker." msgstr "" #: ../../library/pdb.rst:471 diff --git a/library/pickletools.po b/library/pickletools.po index 64b9b33574..238409b9e3 100644 --- a/library/pickletools.po +++ b/library/pickletools.po @@ -1,4 +1,4 @@ -# Copyright (C) 2001-2023, Python Software Foundation +# Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-12 00:03+0000\n" +"POT-Creation-Date: 2024-01-24 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -116,8 +116,8 @@ msgstr "" "*annotate* 的值用作為註釋之起始行提示。" #: ../../library/pickletools.rst:97 -msgid "The *annotate* argument." -msgstr "*annotate* 引數。" +msgid "Added the *annotate* parameter." +msgstr "新增 *annotate* 參數。" #: ../../library/pickletools.rst:102 msgid "" diff --git a/library/pyclbr.po b/library/pyclbr.po index b2f92883df..0f0a90dabd 100644 --- a/library/pyclbr.po +++ b/library/pyclbr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2024-01-06 00:03+0000\n" "PO-Revision-Date: 2017-09-22 18:27+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -81,79 +81,87 @@ msgstr "" msgid "Function Objects" msgstr "函式物件" -#: ../../library/pyclbr.rst:61 +#: ../../library/pyclbr.rst:64 msgid "" -"Class :class:`Function` instances describe functions defined by def " +"Class :class:`!Function` instances describe functions defined by def " "statements. They have the following attributes:" msgstr "" -#: ../../library/pyclbr.rst:67 +#: ../../library/pyclbr.rst:70 msgid "Name of the file in which the function is defined." msgstr "" -#: ../../library/pyclbr.rst:72 +#: ../../library/pyclbr.rst:75 msgid "The name of the module defining the function described." msgstr "" -#: ../../library/pyclbr.rst:77 +#: ../../library/pyclbr.rst:80 msgid "The name of the function." msgstr "" -#: ../../library/pyclbr.rst:82 ../../library/pyclbr.rst:132 +#: ../../library/pyclbr.rst:85 ../../library/pyclbr.rst:140 msgid "The line number in the file where the definition starts." msgstr "" -#: ../../library/pyclbr.rst:87 -msgid "For top-level functions, None. For nested functions, the parent." +#: ../../library/pyclbr.rst:90 +msgid "For top-level functions, ``None``. For nested functions, the parent." msgstr "" -#: ../../library/pyclbr.rst:94 ../../library/pyclbr.rst:144 +#: ../../library/pyclbr.rst:97 msgid "" -"A dictionary mapping names to descriptors for nested functions and classes." +"A :class:`dictionary ` mapping names to descriptors for nested " +"functions and classes." msgstr "" -#: ../../library/pyclbr.rst:102 +#: ../../library/pyclbr.rst:105 msgid "" -"``True`` for functions that are defined with the ``async`` prefix, ``False`` " -"otherwise." +"``True`` for functions that are defined with the :keyword:`async ` prefix, ``False`` otherwise." msgstr "" -#: ../../library/pyclbr.rst:110 +#: ../../library/pyclbr.rst:114 msgid "Class Objects" msgstr "" -#: ../../library/pyclbr.rst:111 +#: ../../library/pyclbr.rst:118 msgid "" -"Class :class:`Class` instances describe classes defined by class " -"statements. They have the same attributes as Functions and two more." +"Class :class:`!Class` instances describe classes defined by class " +"statements. They have the same attributes as :class:`Functions ` " +"and two more." msgstr "" -#: ../../library/pyclbr.rst:117 +#: ../../library/pyclbr.rst:125 msgid "Name of the file in which the class is defined." msgstr "" -#: ../../library/pyclbr.rst:122 +#: ../../library/pyclbr.rst:130 msgid "The name of the module defining the class described." msgstr "" -#: ../../library/pyclbr.rst:127 +#: ../../library/pyclbr.rst:135 msgid "The name of the class." msgstr "" -#: ../../library/pyclbr.rst:137 +#: ../../library/pyclbr.rst:145 msgid "For top-level classes, None. For nested classes, the parent." msgstr "" #: ../../library/pyclbr.rst:152 msgid "" -"A list of :class:`Class` objects which describe the immediate base classes " +"A dictionary mapping names to descriptors for nested functions and classes." +msgstr "" + +#: ../../library/pyclbr.rst:160 +msgid "" +"A list of :class:`!Class` objects which describe the immediate base classes " "of the class being described. Classes which are named as superclasses but " "which are not discoverable by :func:`readmodule_ex` are listed as a string " -"with the class name instead of as :class:`Class` objects." +"with the class name instead of as :class:`!Class` objects." msgstr "" -#: ../../library/pyclbr.rst:161 +#: ../../library/pyclbr.rst:169 msgid "" -"A dictionary mapping method names to line numbers. This can be derived from " -"the newer children dictionary, but remains for back-compatibility." +"A :class:`dictionary ` mapping method names to line numbers. This can " +"be derived from the newer :attr:`children` dictionary, but remains for back-" +"compatibility." msgstr "" diff --git a/library/re.po b/library/re.po index 30f305d70d..ce320c5ec8 100644 --- a/library/re.po +++ b/library/re.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2024-01-21 00:03+0000\n" "PO-Revision-Date: 2023-09-16 14:49+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -39,7 +39,7 @@ msgid "" "Both patterns and strings to be searched can be Unicode strings (:class:" "`str`) as well as 8-bit strings (:class:`bytes`). However, Unicode strings " "and 8-bit strings cannot be mixed: that is, you cannot match a Unicode " -"string with a byte pattern or vice-versa; similarly, when asking for a " +"string with a bytes pattern or vice-versa; similarly, when asking for a " "substitution, the replacement string must be of the same type as both the " "pattern and the search string." msgstr "" @@ -169,7 +169,7 @@ msgstr "" msgid "The special characters are:" msgstr "" -#: ../../library/re.rst:104 ../../library/re.rst:1552 +#: ../../library/re.rst:104 ../../library/re.rst:1605 msgid "``.``" msgstr "``.``" @@ -353,7 +353,7 @@ msgid "" "recommended that you use raw strings for all but the simplest expressions." msgstr "" -#: ../../library/re.rst:294 +#: ../../library/re.rst:293 msgid "``[]``" msgstr "``[]``" @@ -387,11 +387,11 @@ msgstr "" #: ../../library/re.rst:259 msgid "" "Character classes such as ``\\w`` or ``\\S`` (defined below) are also " -"accepted inside a set, although the characters they match depends on " -"whether :const:`ASCII` or :const:`LOCALE` mode is in force." +"accepted inside a set, although the characters they match depend on the " +"flags_ used." msgstr "" -#: ../../library/re.rst:265 +#: ../../library/re.rst:264 msgid "" "Characters that are not within a range can be matched by :dfn:" "`complementing` the set. If the first character of the set is ``'^'``, all " @@ -401,7 +401,7 @@ msgid "" "first character in the set." msgstr "" -#: ../../library/re.rst:272 +#: ../../library/re.rst:271 msgid "" "To match a literal ``']'`` inside a set, precede it with a backslash, or " "place it at the beginning of the set. For example, both ``[()[\\]{}]`` and " @@ -409,7 +409,7 @@ msgid "" "and parentheses." msgstr "" -#: ../../library/re.rst:282 +#: ../../library/re.rst:281 msgid "" "Support of nested sets and set operations as in `Unicode Technical Standard " "#18`_ might be added in the future. This would change the syntax, so to " @@ -419,17 +419,17 @@ msgid "" "``'||'``. To avoid a warning escape them with a backslash." msgstr "" -#: ../../library/re.rst:292 +#: ../../library/re.rst:291 msgid "" ":exc:`FutureWarning` is raised if a character set contains constructs that " "will change semantically in the future." msgstr "" -#: ../../library/re.rst:307 +#: ../../library/re.rst:306 msgid "``|``" msgstr "``|``" -#: ../../library/re.rst:299 +#: ../../library/re.rst:298 msgid "" "``A|B``, where *A* and *B* can be arbitrary REs, creates a regular " "expression that will match either *A* or *B*. An arbitrary number of REs " @@ -442,11 +442,11 @@ msgid "" "use ``\\|``, or enclose it inside a character class, as in ``[|]``." msgstr "" -#: ../../library/re.rst:317 +#: ../../library/re.rst:316 msgid "``(...)``" msgstr "``(...)``" -#: ../../library/re.rst:313 +#: ../../library/re.rst:312 msgid "" "Matches whatever regular expression is inside the parentheses, and indicates " "the start and end of a group; the contents of a group can be retrieved after " @@ -456,11 +456,11 @@ msgid "" "character class: ``[(]``, ``[)]``." msgstr "" -#: ../../library/re.rst:326 +#: ../../library/re.rst:325 msgid "``(?...)``" msgstr "``(?...)``" -#: ../../library/re.rst:322 +#: ../../library/re.rst:321 msgid "" "This is an extension notation (a ``'?'`` following a ``'('`` is not " "meaningful otherwise). The first character after the ``'?'`` determines " @@ -469,33 +469,62 @@ msgid "" "rule. Following are the currently supported extensions." msgstr "" -#: ../../library/re.rst:343 +#: ../../library/re.rst:348 msgid "``(?aiLmsux)``" msgstr "``(?aiLmsux)``" -#: ../../library/re.rst:329 +#: ../../library/re.rst:328 msgid "" "(One or more letters from the set ``'a'``, ``'i'``, ``'L'``, ``'m'``, " -"``'s'``, ``'u'``, ``'x'``.) The group matches the empty string; the letters " -"set the corresponding flags: :const:`re.A` (ASCII-only matching), :const:`re." -"I` (ignore case), :const:`re.L` (locale dependent), :const:`re.M` (multi-" -"line), :const:`re.S` (dot matches all), :const:`re.U` (Unicode matching), " -"and :const:`re.X` (verbose), for the entire regular expression. (The flags " -"are described in :ref:`contents-of-module-re`.) This is useful if you wish " -"to include the flags as part of the regular expression, instead of passing a " -"*flag* argument to the :func:`re.compile` function. Flags should be used " -"first in the expression string." -msgstr "" - -#: ../../library/re.rst:342 +"``'s'``, ``'u'``, ``'x'``.) The group matches the empty string; the letters " +"set the corresponding flags for the entire regular expression:" +msgstr "" + +#: ../../library/re.rst:333 ../../library/re.rst:365 +msgid ":const:`re.A` (ASCII-only matching)" +msgstr "" + +#: ../../library/re.rst:334 ../../library/re.rst:366 +msgid ":const:`re.I` (ignore case)" +msgstr "" + +#: ../../library/re.rst:335 ../../library/re.rst:367 +msgid ":const:`re.L` (locale dependent)" +msgstr "" + +#: ../../library/re.rst:336 ../../library/re.rst:368 +msgid ":const:`re.M` (multi-line)" +msgstr "" + +#: ../../library/re.rst:337 ../../library/re.rst:369 +msgid ":const:`re.S` (dot matches all)" +msgstr "" + +#: ../../library/re.rst:338 ../../library/re.rst:370 +msgid ":const:`re.U` (Unicode matching)" +msgstr "" + +#: ../../library/re.rst:339 ../../library/re.rst:371 +msgid ":const:`re.X` (verbose)" +msgstr "" + +#: ../../library/re.rst:341 +msgid "" +"(The flags are described in :ref:`contents-of-module-re`.) This is useful if " +"you wish to include the flags as part of the regular expression, instead of " +"passing a *flag* argument to the :func:`re.compile` function. Flags should " +"be used first in the expression string." +msgstr "" + +#: ../../library/re.rst:347 msgid "This construction can only be used at the start of the expression." msgstr "" -#: ../../library/re.rst:351 +#: ../../library/re.rst:356 msgid "``(?:...)``" msgstr "``(?:...)``" -#: ../../library/re.rst:348 +#: ../../library/re.rst:353 msgid "" "A non-capturing version of regular parentheses. Matches whatever regular " "expression is inside the parentheses, but the substring matched by the group " @@ -503,44 +532,44 @@ msgid "" "pattern." msgstr "" -#: ../../library/re.rst:377 +#: ../../library/re.rst:388 msgid "``(?aiLmsux-imsx:...)``" msgstr "``(?aiLmsux-imsx:...)``" -#: ../../library/re.rst:354 +#: ../../library/re.rst:359 msgid "" "(Zero or more letters from the set ``'a'``, ``'i'``, ``'L'``, ``'m'``, " "``'s'``, ``'u'``, ``'x'``, optionally followed by ``'-'`` followed by one or " "more letters from the ``'i'``, ``'m'``, ``'s'``, ``'x'``.) The letters set " -"or remove the corresponding flags: :const:`re.A` (ASCII-only matching), :" -"const:`re.I` (ignore case), :const:`re.L` (locale dependent), :const:`re.M` " -"(multi-line), :const:`re.S` (dot matches all), :const:`re.U` (Unicode " -"matching), and :const:`re.X` (verbose), for the part of the expression. (The " -"flags are described in :ref:`contents-of-module-re`.)" +"or remove the corresponding flags for the part of the expression:" msgstr "" -#: ../../library/re.rst:364 +#: ../../library/re.rst:373 +msgid "(The flags are described in :ref:`contents-of-module-re`.)" +msgstr "" + +#: ../../library/re.rst:375 msgid "" "The letters ``'a'``, ``'L'`` and ``'u'`` are mutually exclusive when used as " "inline flags, so they can't be combined or follow ``'-'``. Instead, when " "one of them appears in an inline group, it overrides the matching mode in " "the enclosing group. In Unicode patterns ``(?a:...)`` switches to ASCII-" "only matching, and ``(?u:...)`` switches to Unicode matching (default). In " -"byte pattern ``(?L:...)`` switches to locale depending matching, and ``(?" +"bytes patterns ``(?L:...)`` switches to locale dependent matching, and ``(?" "a:...)`` switches to ASCII-only matching (default). This override is only in " "effect for the narrow inline group, and the original matching mode is " "restored outside of the group." msgstr "" -#: ../../library/re.rst:376 +#: ../../library/re.rst:387 msgid "The letters ``'a'``, ``'L'`` and ``'u'`` also can be used in a group." msgstr "" -#: ../../library/re.rst:392 +#: ../../library/re.rst:403 msgid "``(?>...)``" msgstr "``(?>...)``" -#: ../../library/re.rst:380 +#: ../../library/re.rst:391 msgid "" "Attempts to match ``...`` as if it was a separate regular expression, and if " "successful, continues to match the rest of the pattern following it. If the " @@ -554,11 +583,11 @@ msgid "" "thus fail to match." msgstr "" -#: ../../library/re.rst:424 +#: ../../library/re.rst:435 msgid "``(?P...)``" msgstr "``(?P...)``" -#: ../../library/re.rst:397 +#: ../../library/re.rst:408 msgid "" "Similar to regular parentheses, but the substring matched by the group is " "accessible via the symbolic group name *name*. Group names must be valid " @@ -568,108 +597,108 @@ msgid "" "the group were not named." msgstr "" -#: ../../library/re.rst:404 +#: ../../library/re.rst:415 msgid "" "Named groups can be referenced in three contexts. If the pattern is ``(?" "P['\"]).*?(?P=quote)`` (i.e. matching a string quoted with either " "single or double quotes):" msgstr "" -#: ../../library/re.rst:409 +#: ../../library/re.rst:420 msgid "Context of reference to group \"quote\"" msgstr "" -#: ../../library/re.rst:409 +#: ../../library/re.rst:420 msgid "Ways to reference it" msgstr "" -#: ../../library/re.rst:411 +#: ../../library/re.rst:422 msgid "in the same pattern itself" msgstr "" -#: ../../library/re.rst:411 +#: ../../library/re.rst:422 msgid "``(?P=quote)`` (as shown)" msgstr "" -#: ../../library/re.rst:412 ../../library/re.rst:419 +#: ../../library/re.rst:423 ../../library/re.rst:430 msgid "``\\1``" msgstr "``\\1``" -#: ../../library/re.rst:414 +#: ../../library/re.rst:425 msgid "when processing match object *m*" msgstr "" -#: ../../library/re.rst:414 +#: ../../library/re.rst:425 msgid "``m.group('quote')``" msgstr "``m.group('quote')``" -#: ../../library/re.rst:415 +#: ../../library/re.rst:426 msgid "``m.end('quote')`` (etc.)" msgstr "" -#: ../../library/re.rst:417 +#: ../../library/re.rst:428 msgid "in a string passed to the *repl* argument of ``re.sub()``" msgstr "" -#: ../../library/re.rst:417 +#: ../../library/re.rst:428 msgid "``\\g``" msgstr "``\\g``" -#: ../../library/re.rst:418 +#: ../../library/re.rst:429 msgid "``\\g<1>``" msgstr "``\\g<1>``" -#: ../../library/re.rst:422 +#: ../../library/re.rst:433 msgid "" "In :class:`bytes` patterns, group *name* can only contain bytes in the ASCII " "range (``b'\\x00'``-``b'\\x7f'``)." msgstr "" -#: ../../library/re.rst:430 +#: ../../library/re.rst:441 msgid "``(?P=name)``" msgstr "``(?P=name)``" -#: ../../library/re.rst:429 +#: ../../library/re.rst:440 msgid "" "A backreference to a named group; it matches whatever text was matched by " "the earlier group named *name*." msgstr "" -#: ../../library/re.rst:435 +#: ../../library/re.rst:446 msgid "``(?#...)``" msgstr "``(?#...)``" -#: ../../library/re.rst:435 +#: ../../library/re.rst:446 msgid "A comment; the contents of the parentheses are simply ignored." msgstr "" -#: ../../library/re.rst:442 +#: ../../library/re.rst:453 msgid "``(?=...)``" msgstr "``(?=...)``" -#: ../../library/re.rst:440 +#: ../../library/re.rst:451 msgid "" "Matches if ``...`` matches next, but doesn't consume any of the string. " "This is called a :dfn:`lookahead assertion`. For example, ``Isaac (?" "=Asimov)`` will match ``'Isaac '`` only if it's followed by ``'Asimov'``." msgstr "" -#: ../../library/re.rst:449 +#: ../../library/re.rst:460 msgid "``(?!...)``" msgstr "``(?!...)``" -#: ../../library/re.rst:447 +#: ../../library/re.rst:458 msgid "" "Matches if ``...`` doesn't match next. This is a :dfn:`negative lookahead " "assertion`. For example, ``Isaac (?!Asimov)`` will match ``'Isaac '`` only " "if it's *not* followed by ``'Asimov'``." msgstr "" -#: ../../library/re.rst:476 +#: ../../library/re.rst:487 msgid "``(?<=...)``" msgstr "``(?<=...)``" -#: ../../library/re.rst:454 +#: ../../library/re.rst:465 msgid "" "Matches if the current position in the string is preceded by a match for " "``...`` that ends at the current position. This is called a :dfn:`positive " @@ -683,19 +712,19 @@ msgid "" "func:`match` function:" msgstr "" -#: ../../library/re.rst:469 +#: ../../library/re.rst:480 msgid "This example looks for a word following a hyphen:" msgstr "" -#: ../../library/re.rst:475 +#: ../../library/re.rst:486 msgid "Added support for group references of fixed length." msgstr "" -#: ../../library/re.rst:485 +#: ../../library/re.rst:496 msgid "``(?'``." msgstr "" -#: ../../library/re.rst:498 +#: ../../library/re.rst:509 msgid "" "Group *id* can only contain ASCII digits. In :class:`bytes` patterns, group " "*name* can only contain bytes in the ASCII range (``b'\\x00'``-``b'\\x7f'``)." msgstr "" -#: ../../library/re.rst:506 +#: ../../library/re.rst:517 msgid "" "The special sequences consist of ``'\\'`` and a character from the list " "below. If the ordinary character is not an ASCII digit or an ASCII letter, " @@ -732,11 +761,11 @@ msgid "" "matches the character ``'$'``." msgstr "" -#: ../../library/re.rst:521 +#: ../../library/re.rst:532 msgid "``\\number``" msgstr "``\\number``" -#: ../../library/re.rst:514 +#: ../../library/re.rst:525 msgid "" "Matches the contents of the group of the same number. Groups are numbered " "starting from 1. For example, ``(.+) \\1`` matches ``'the the'`` or ``'55 " @@ -748,175 +777,209 @@ msgid "" "escapes are treated as characters." msgstr "" -#: ../../library/re.rst:526 +#: ../../library/re.rst:537 msgid "``\\A``" msgstr "``\\A``" -#: ../../library/re.rst:526 +#: ../../library/re.rst:537 msgid "Matches only at the start of the string." msgstr "" -#: ../../library/re.rst:542 +#: ../../library/re.rst:559 msgid "``\\b``" msgstr "``\\b``" -#: ../../library/re.rst:531 +#: ../../library/re.rst:542 msgid "" "Matches the empty string, but only at the beginning or end of a word. A word " -"is defined as a sequence of word characters. Note that formally, ``\\b`` is " +"is defined as a sequence of word characters. Note that formally, ``\\b`` is " "defined as the boundary between a ``\\w`` and a ``\\W`` character (or vice " -"versa), or between ``\\w`` and the beginning/end of the string. This means " -"that ``r'\\bfoo\\b'`` matches ``'foo'``, ``'foo.'``, ``'(foo)'``, ``'bar foo " -"baz'`` but not ``'foobar'`` or ``'foo3'``." +"versa), or between ``\\w`` and the beginning or end of the string. This " +"means that ``r'\\bat\\b'`` matches ``'at'``, ``'at.'``, ``'(at)'``, and " +"``'as at ay'`` but not ``'attempt'`` or ``'atlas'``." +msgstr "" + +#: ../../library/re.rst:550 +msgid "" +"The default word characters in Unicode (str) patterns are Unicode " +"alphanumerics and the underscore, but this can be changed by using the :py:" +"const:`~re.ASCII` flag. Word boundaries are determined by the current locale " +"if the :py:const:`~re.LOCALE` flag is used." msgstr "" -#: ../../library/re.rst:538 +#: ../../library/re.rst:558 msgid "" -"By default Unicode alphanumerics are the ones used in Unicode patterns, but " -"this can be changed by using the :const:`ASCII` flag. Word boundaries are " -"determined by the current locale if the :const:`LOCALE` flag is used. Inside " -"a character range, ``\\b`` represents the backspace character, for " +"Inside a character range, ``\\b`` represents the backspace character, for " "compatibility with Python's string literals." msgstr "" -#: ../../library/re.rst:553 +#: ../../library/re.rst:573 msgid "``\\B``" msgstr "``\\B``" -#: ../../library/re.rst:547 +#: ../../library/re.rst:564 msgid "" "Matches the empty string, but only when it is *not* at the beginning or end " -"of a word. This means that ``r'py\\B'`` matches ``'python'``, ``'py3'``, " -"``'py2'``, but not ``'py'``, ``'py.'``, or ``'py!'``. ``\\B`` is just the " -"opposite of ``\\b``, so word characters in Unicode patterns are Unicode " -"alphanumerics or the underscore, although this can be changed by using the :" -"const:`ASCII` flag. Word boundaries are determined by the current locale if " -"the :const:`LOCALE` flag is used." +"of a word. This means that ``r'at\\B'`` matches ``'athens'``, ``'atom'``, " +"``'attorney'``, but not ``'at'``, ``'at.'``, or ``'at!'``. ``\\B`` is the " +"opposite of ``\\b``, so word characters in Unicode (str) patterns are " +"Unicode alphanumerics or the underscore, although this can be changed by " +"using the :py:const:`~re.ASCII` flag. Word boundaries are determined by the " +"current locale if the :py:const:`~re.LOCALE` flag is used." msgstr "" -#: ../../library/re.rst:565 +#: ../../library/re.rst:589 msgid "``\\d``" msgstr "``\\d``" -#: ../../library/re.rst:562 ../../library/re.rst:582 ../../library/re.rst:601 +#: ../../library/re.rst:585 ../../library/re.rst:608 ../../library/re.rst:631 msgid "For Unicode (str) patterns:" msgstr "" -#: ../../library/re.rst:559 +#: ../../library/re.rst:579 msgid "" "Matches any Unicode decimal digit (that is, any character in Unicode " -"character category [Nd]). This includes ``[0-9]``, and also many other " -"digit characters. If the :const:`ASCII` flag is used only ``[0-9]`` is " -"matched." +"character category `[Nd]`__). This includes ``[0-9]``, and also many other " +"digit characters." +msgstr "" + +#: ../../library/re.rst:583 +msgid "Matches ``[0-9]`` if the :py:const:`~re.ASCII` flag is used." msgstr "" -#: ../../library/re.rst:565 ../../library/re.rst:586 ../../library/re.rst:607 +#: ../../library/re.rst:589 ../../library/re.rst:612 ../../library/re.rst:637 msgid "For 8-bit (bytes) patterns:" msgstr "" -#: ../../library/re.rst:565 -msgid "Matches any decimal digit; this is equivalent to ``[0-9]``." +#: ../../library/re.rst:588 +msgid "" +"Matches any decimal digit in the ASCII character set; this is equivalent to " +"``[0-9]``." msgstr "" -#: ../../library/re.rst:572 +#: ../../library/re.rst:597 msgid "``\\D``" msgstr "``\\D``" -#: ../../library/re.rst:570 +#: ../../library/re.rst:594 msgid "" "Matches any character which is not a decimal digit. This is the opposite of " -"``\\d``. If the :const:`ASCII` flag is used this becomes the equivalent of " -"``[^0-9]``." +"``\\d``." msgstr "" -#: ../../library/re.rst:586 +#: ../../library/re.rst:597 +msgid "Matches ``[^0-9]`` if the :py:const:`~re.ASCII` flag is used." +msgstr "" + +#: ../../library/re.rst:612 msgid "``\\s``" msgstr "``\\s``" -#: ../../library/re.rst:578 +#: ../../library/re.rst:603 msgid "" "Matches Unicode whitespace characters (which includes " "``[ \\t\\n\\r\\f\\v]``, and also many other characters, for example the non-" -"breaking spaces mandated by typography rules in many languages). If the :" -"const:`ASCII` flag is used, only ``[ \\t\\n\\r\\f\\v]`` is matched." +"breaking spaces mandated by typography rules in many languages)." msgstr "" -#: ../../library/re.rst:585 +#: ../../library/re.rst:608 +msgid "" +"Matches ``[ \\t\\n\\r\\f\\v]`` if the :py:const:`~re.ASCII` flag is used." +msgstr "" + +#: ../../library/re.rst:611 msgid "" "Matches characters considered whitespace in the ASCII character set; this is " "equivalent to ``[ \\t\\n\\r\\f\\v]``." msgstr "" -#: ../../library/re.rst:593 +#: ../../library/re.rst:620 msgid "``\\S``" msgstr "``\\S``" -#: ../../library/re.rst:591 +#: ../../library/re.rst:617 msgid "" "Matches any character which is not a whitespace character. This is the " -"opposite of ``\\s``. If the :const:`ASCII` flag is used this becomes the " -"equivalent of ``[^ \\t\\n\\r\\f\\v]``." +"opposite of ``\\s``." msgstr "" -#: ../../library/re.rst:607 +#: ../../library/re.rst:620 +msgid "" +"Matches ``[^ \\t\\n\\r\\f\\v]`` if the :py:const:`~re.ASCII` flag is used." +msgstr "" + +#: ../../library/re.rst:637 msgid "``\\w``" msgstr "``\\w``" -#: ../../library/re.rst:599 +#: ../../library/re.rst:626 msgid "" -"Matches Unicode word characters; this includes alphanumeric characters (as " -"defined by :meth:`str.isalnum`) as well as the underscore (``_``). If the :" -"const:`ASCII` flag is used, only ``[a-zA-Z0-9_]`` is matched." +"Matches Unicode word characters; this includes all Unicode alphanumeric " +"characters (as defined by :py:meth:`str.isalnum`), as well as the underscore " +"(``_``)." msgstr "" -#: ../../library/re.rst:604 +#: ../../library/re.rst:631 +msgid "Matches ``[a-zA-Z0-9_]`` if the :py:const:`~re.ASCII` flag is used." +msgstr "" + +#: ../../library/re.rst:634 msgid "" "Matches characters considered alphanumeric in the ASCII character set; this " -"is equivalent to ``[a-zA-Z0-9_]``. If the :const:`LOCALE` flag is used, " -"matches characters considered alphanumeric in the current locale and the " -"underscore." +"is equivalent to ``[a-zA-Z0-9_]``. If the :py:const:`~re.LOCALE` flag is " +"used, matches characters considered alphanumeric in the current locale and " +"the underscore." msgstr "" -#: ../../library/re.rst:616 +#: ../../library/re.rst:651 msgid "``\\W``" msgstr "``\\W``" -#: ../../library/re.rst:612 +#: ../../library/re.rst:642 msgid "" "Matches any character which is not a word character. This is the opposite of " -"``\\w``. If the :const:`ASCII` flag is used this becomes the equivalent of " -"``[^a-zA-Z0-9_]``. If the :const:`LOCALE` flag is used, matches characters " -"which are neither alphanumeric in the current locale nor the underscore." +"``\\w``. By default, matches non-underscore (``_``) characters for which :py:" +"meth:`str.isalnum` returns ``False``." msgstr "" -#: ../../library/re.rst:621 +#: ../../library/re.rst:647 +msgid "Matches ``[^a-zA-Z0-9_]`` if the :py:const:`~re.ASCII` flag is used." +msgstr "" + +#: ../../library/re.rst:649 +msgid "" +"If the :py:const:`~re.LOCALE` flag is used, matches characters which are " +"neither alphanumeric in the current locale nor the underscore." +msgstr "" + +#: ../../library/re.rst:656 msgid "``\\Z``" msgstr "``\\Z``" -#: ../../library/re.rst:621 +#: ../../library/re.rst:656 msgid "Matches only at the end of the string." msgstr "" -#: ../../library/re.rst:637 +#: ../../library/re.rst:672 msgid "" "Most of the :ref:`escape sequences ` supported by Python " "string literals are also accepted by the regular expression parser::" msgstr "" -#: ../../library/re.rst:644 +#: ../../library/re.rst:679 msgid "" "(Note that ``\\b`` is used to represent word boundaries, and means " "\"backspace\" only inside character classes.)" msgstr "" -#: ../../library/re.rst:647 +#: ../../library/re.rst:682 msgid "" "``'\\u'``, ``'\\U'``, and ``'\\N'`` escape sequences are only recognized in " -"Unicode patterns. In bytes patterns they are errors. Unknown escapes of " -"ASCII letters are reserved for future use and treated as errors." +"Unicode (str) patterns. In bytes patterns they are errors. Unknown escapes " +"of ASCII letters are reserved for future use and treated as errors." msgstr "" -#: ../../library/re.rst:651 +#: ../../library/re.rst:688 msgid "" "Octal escapes are included in a limited form. If the first digit is a 0, or " "if there are three octal digits, it is considered an octal escape. " @@ -924,27 +987,27 @@ msgid "" "are always at most three digits in length." msgstr "" -#: ../../library/re.rst:656 +#: ../../library/re.rst:693 msgid "The ``'\\u'`` and ``'\\U'`` escape sequences have been added." msgstr "" -#: ../../library/re.rst:659 +#: ../../library/re.rst:696 msgid "" "Unknown escapes consisting of ``'\\'`` and an ASCII letter now are errors." msgstr "" -#: ../../library/re.rst:662 +#: ../../library/re.rst:699 msgid "" "The :samp:`'\\\\N\\\\{{name}\\\\}'` escape sequence has been added. As in " "string literals, it expands to the named Unicode character (e.g. ``'\\N{EM " "DASH}'``)." msgstr "" -#: ../../library/re.rst:670 +#: ../../library/re.rst:707 msgid "Module Contents" msgstr "模組內容" -#: ../../library/re.rst:672 +#: ../../library/re.rst:709 msgid "" "The module defines several functions, constants, and an exception. Some of " "the functions are simplified versions of the full featured methods for " @@ -952,93 +1015,111 @@ msgid "" "compiled form." msgstr "" -#: ../../library/re.rst:679 +#: ../../library/re.rst:716 msgid "Flags" msgstr "" -#: ../../library/re.rst:681 +#: ../../library/re.rst:718 msgid "" "Flag constants are now instances of :class:`RegexFlag`, which is a subclass " "of :class:`enum.IntFlag`." msgstr "" -#: ../../library/re.rst:688 +#: ../../library/re.rst:725 msgid "" "An :class:`enum.IntFlag` class containing the regex options listed below." msgstr "" -#: ../../library/re.rst:690 +#: ../../library/re.rst:727 msgid "- added to ``__all__``" msgstr "" -#: ../../library/re.rst:695 +#: ../../library/re.rst:732 msgid "" "Make ``\\w``, ``\\W``, ``\\b``, ``\\B``, ``\\d``, ``\\D``, ``\\s`` and " "``\\S`` perform ASCII-only matching instead of full Unicode matching. This " -"is only meaningful for Unicode patterns, and is ignored for byte patterns. " -"Corresponds to the inline flag ``(?a)``." +"is only meaningful for Unicode (str) patterns, and is ignored for bytes " +"patterns." msgstr "" -#: ../../library/re.rst:700 -msgid "" -"Note that for backward compatibility, the :const:`re.U` flag still exists " -"(as well as its synonym :const:`re.UNICODE` and its embedded counterpart ``(?" -"u)``), but these are redundant in Python 3 since matches are Unicode by " -"default for strings (and Unicode matching isn't allowed for bytes)." +#: ../../library/re.rst:736 +msgid "Corresponds to the inline flag ``(?a)``." msgstr "" -#: ../../library/re.rst:709 +#: ../../library/re.rst:740 msgid "" -"Display debug information about compiled expression. No corresponding inline " -"flag." +"The :py:const:`~re.U` flag still exists for backward compatibility, but is " +"redundant in Python 3 since matches are Unicode by default for ``str`` " +"patterns, and Unicode matching isn't allowed for bytes patterns. :py:const:" +"`~re.UNICODE` and the inline flag ``(?u)`` are similarly redundant." msgstr "" -#: ../../library/re.rst:716 +#: ../../library/re.rst:749 +msgid "Display debug information about compiled expression." +msgstr "" + +#: ../../library/re.rst:751 +msgid "No corresponding inline flag." +msgstr "" + +#: ../../library/re.rst:757 msgid "" -"Perform case-insensitive matching; expressions like ``[A-Z]`` will also " -"match lowercase letters. Full Unicode matching (such as ``Ü`` matching " -"``ü``) also works unless the :const:`re.ASCII` flag is used to disable non-" -"ASCII matches. The current locale does not change the effect of this flag " -"unless the :const:`re.LOCALE` flag is also used. Corresponds to the inline " -"flag ``(?i)``." +"Perform case-insensitive matching; expressions like ``[A-Z]`` will also " +"match lowercase letters. Full Unicode matching (such as ``Ü`` matching " +"``ü``) also works unless the :py:const:`~re.ASCII` flag is used to disable " +"non-ASCII matches. The current locale does not change the effect of this " +"flag unless the :py:const:`~re.LOCALE` flag is also used." +msgstr "" + +#: ../../library/re.rst:765 +msgid "Corresponds to the inline flag ``(?i)``." msgstr "" -#: ../../library/re.rst:723 +#: ../../library/re.rst:767 msgid "" "Note that when the Unicode patterns ``[a-z]`` or ``[A-Z]`` are used in " "combination with the :const:`IGNORECASE` flag, they will match the 52 ASCII " "letters and 4 additional non-ASCII letters: 'İ' (U+0130, Latin capital " "letter I with dot above), 'ı' (U+0131, Latin small letter dotless i), " "'ſ' (U+017F, Latin small letter long s) and 'K' (U+212A, Kelvin sign). If " -"the :const:`ASCII` flag is used, only letters 'a' to 'z' and 'A' to 'Z' are " -"matched." +"the :py:const:`~re.ASCII` flag is used, only letters 'a' to 'z' and 'A' to " +"'Z' are matched." msgstr "" -#: ../../library/re.rst:734 +#: ../../library/re.rst:778 msgid "" "Make ``\\w``, ``\\W``, ``\\b``, ``\\B`` and case-insensitive matching " -"dependent on the current locale. This flag can be used only with bytes " -"patterns. The use of this flag is discouraged as the locale mechanism is " -"very unreliable, it only handles one \"culture\" at a time, and it only " -"works with 8-bit locales. Unicode matching is already enabled by default in " -"Python 3 for Unicode (str) patterns, and it is able to handle different " -"locales/languages. Corresponds to the inline flag ``(?L)``." +"dependent on the current locale. This flag can be used only with bytes " +"patterns." msgstr "" -#: ../../library/re.rst:743 +#: ../../library/re.rst:782 +msgid "Corresponds to the inline flag ``(?L)``." +msgstr "" + +#: ../../library/re.rst:786 +msgid "" +"This flag is discouraged; consider Unicode matching instead. The locale " +"mechanism is very unreliable as it only handles one \"culture\" at a time " +"and only works with 8-bit locales. Unicode matching is enabled by default " +"for Unicode (str) patterns and it is able to handle different locales and " +"languages." +msgstr "" + +#: ../../library/re.rst:793 msgid "" -":const:`re.LOCALE` can be used only with bytes patterns and is not " -"compatible with :const:`re.ASCII`." +":py:const:`~re.LOCALE` can be used only with bytes patterns and is not " +"compatible with :py:const:`~re.ASCII`." msgstr "" -#: ../../library/re.rst:747 +#: ../../library/re.rst:797 msgid "" -"Compiled regular expression objects with the :const:`re.LOCALE` flag no " -"longer depend on the locale at compile time. Only the locale at matching " +"Compiled regular expression objects with the :py:const:`~re.LOCALE` flag no " +"longer depend on the locale at compile time. Only the locale at matching " "time affects the result of matching." msgstr "" -#: ../../library/re.rst:756 +#: ../../library/re.rst:806 msgid "" "When specified, the pattern character ``'^'`` matches at the beginning of " "the string and at the beginning of each line (immediately following each " @@ -1046,10 +1127,14 @@ msgid "" "and at the end of each line (immediately preceding each newline). By " "default, ``'^'`` matches only at the beginning of the string, and ``'$'`` " "only at the end of the string and immediately before the newline (if any) at " -"the end of the string. Corresponds to the inline flag ``(?m)``." +"the end of the string." +msgstr "" + +#: ../../library/re.rst:813 +msgid "Corresponds to the inline flag ``(?m)``." msgstr "" -#: ../../library/re.rst:766 +#: ../../library/re.rst:817 msgid "" "Indicates no flag being applied, the value is ``0``. This flag may be used " "as a default value for a function keyword argument or as a base value that " @@ -1057,29 +1142,29 @@ msgid "" "value::" msgstr "" -#: ../../library/re.rst:779 +#: ../../library/re.rst:830 msgid "" "Make the ``'.'`` special character match any character at all, including a " -"newline; without this flag, ``'.'`` will match anything *except* a newline. " -"Corresponds to the inline flag ``(?s)``." +"newline; without this flag, ``'.'`` will match anything *except* a newline." msgstr "" -#: ../../library/re.rst:787 -msgid "" -"In Python 2, this flag made :ref:`special sequences ` " -"include Unicode characters in matches. Since Python 3, Unicode characters " -"are matched by default." +#: ../../library/re.rst:833 +msgid "Corresponds to the inline flag ``(?s)``." msgstr "" -#: ../../library/re.rst:791 -msgid "See :const:`A` for restricting matching on ASCII characters instead." +#: ../../library/re.rst:839 +msgid "" +"In Python 3, Unicode characters are matched by default for ``str`` patterns. " +"This flag is therefore redundant with **no effect** and is only kept for " +"backward compatibility." msgstr "" -#: ../../library/re.rst:793 -msgid "This flag is only kept for backward compatibility." +#: ../../library/re.rst:844 +msgid "" +"See :py:const:`~re.ASCII` to restrict matching to ASCII characters instead." msgstr "" -#: ../../library/re.rst:800 +#: ../../library/re.rst:851 msgid "" "This flag allows you to write regular expressions that look nicer and are " "more readable by allowing you to visually separate logical sections of the " @@ -1092,53 +1177,53 @@ msgid "" "ignored." msgstr "" -#: ../../library/re.rst:810 +#: ../../library/re.rst:861 msgid "" "This means that the two following regular expression objects that match a " "decimal number are functionally equal::" msgstr "" -#: ../../library/re.rst:818 +#: ../../library/re.rst:869 msgid "Corresponds to the inline flag ``(?x)``." msgstr "" -#: ../../library/re.rst:822 +#: ../../library/re.rst:873 msgid "Functions" msgstr "" -#: ../../library/re.rst:826 +#: ../../library/re.rst:877 msgid "" "Compile a regular expression pattern into a :ref:`regular expression object " "`, which can be used for matching using its :func:`~Pattern." "match`, :func:`~Pattern.search` and other methods, described below." msgstr "" -#: ../../library/re.rst:831 +#: ../../library/re.rst:882 msgid "" "The expression's behaviour can be modified by specifying a *flags* value. " -"Values can be any of the following variables, combined using bitwise OR (the " +"Values can be any of the `flags`_ variables, combined using bitwise OR (the " "``|`` operator)." msgstr "" -#: ../../library/re.rst:835 +#: ../../library/re.rst:886 msgid "The sequence ::" msgstr "" -#: ../../library/re.rst:840 +#: ../../library/re.rst:891 msgid "is equivalent to ::" msgstr "" "等價於:\n" "\n" "::" -#: ../../library/re.rst:844 +#: ../../library/re.rst:895 msgid "" "but using :func:`re.compile` and saving the resulting regular expression " "object for reuse is more efficient when the expression will be used several " "times in a single program." msgstr "" -#: ../../library/re.rst:850 +#: ../../library/re.rst:901 msgid "" "The compiled versions of the most recent patterns passed to :func:`re." "compile` and the module-level matching functions are cached, so programs " @@ -1146,7 +1231,7 @@ msgid "" "compiling regular expressions." msgstr "" -#: ../../library/re.rst:858 +#: ../../library/re.rst:909 msgid "" "Scan through *string* looking for the first location where the regular " "expression *pattern* produces a match, and return a corresponding :class:" @@ -1155,7 +1240,7 @@ msgid "" "some point in the string." msgstr "" -#: ../../library/re.rst:866 +#: ../../library/re.rst:917 msgid "" "If zero or more characters at the beginning of *string* match the regular " "expression *pattern*, return a corresponding :class:`~re.Match`. Return " @@ -1163,26 +1248,26 @@ msgid "" "different from a zero-length match." msgstr "" -#: ../../library/re.rst:871 +#: ../../library/re.rst:922 msgid "" "Note that even in :const:`MULTILINE` mode, :func:`re.match` will only match " "at the beginning of the string and not at the beginning of each line." msgstr "" -#: ../../library/re.rst:874 +#: ../../library/re.rst:925 msgid "" "If you want to locate a match anywhere in *string*, use :func:`search` " "instead (see also :ref:`search-vs-match`)." msgstr "" -#: ../../library/re.rst:880 +#: ../../library/re.rst:931 msgid "" "If the whole *string* matches the regular expression *pattern*, return a " "corresponding :class:`~re.Match`. Return ``None`` if the string does not " "match the pattern; note that this is different from a zero-length match." msgstr "" -#: ../../library/re.rst:889 +#: ../../library/re.rst:940 msgid "" "Split *string* by the occurrences of *pattern*. If capturing parentheses " "are used in *pattern*, then the text of all groups in the pattern are also " @@ -1191,42 +1276,42 @@ msgid "" "final element of the list. ::" msgstr "" -#: ../../library/re.rst:904 +#: ../../library/re.rst:955 msgid "" "If there are capturing groups in the separator and it matches at the start " "of the string, the result will start with an empty string. The same holds " "for the end of the string::" msgstr "" -#: ../../library/re.rst:911 +#: ../../library/re.rst:962 msgid "" "That way, separator components are always found at the same relative indices " "within the result list." msgstr "" -#: ../../library/re.rst:914 +#: ../../library/re.rst:965 msgid "" "Empty matches for the pattern split the string only when not adjacent to a " "previous empty match." msgstr "" -#: ../../library/re.rst:924 ../../library/re.rst:1015 ../../library/re.rst:1044 +#: ../../library/re.rst:977 ../../library/re.rst:1068 ../../library/re.rst:1097 msgid "Added the optional flags argument." msgstr "新增可選的旗標引數。" -#: ../../library/re.rst:927 +#: ../../library/re.rst:980 msgid "" "Added support of splitting on a pattern that could match an empty string." msgstr "" -#: ../../library/re.rst:933 +#: ../../library/re.rst:986 msgid "" "Return all non-overlapping matches of *pattern* in *string*, as a list of " "strings or tuples. The *string* is scanned left-to-right, and matches are " "returned in the order found. Empty matches are included in the result." msgstr "" -#: ../../library/re.rst:937 +#: ../../library/re.rst:990 msgid "" "The result depends on the number of capturing groups in the pattern. If " "there are no groups, return a list of strings matching the whole pattern. " @@ -1236,11 +1321,11 @@ msgid "" "result." msgstr "" -#: ../../library/re.rst:949 ../../library/re.rst:960 +#: ../../library/re.rst:1002 ../../library/re.rst:1013 msgid "Non-empty matches can now start just after a previous empty match." msgstr "" -#: ../../library/re.rst:955 +#: ../../library/re.rst:1008 msgid "" "Return an :term:`iterator` yielding :class:`~re.Match` objects over all non-" "overlapping matches for the RE *pattern* in *string*. The *string* is " @@ -1248,7 +1333,7 @@ msgid "" "matches are included in the result." msgstr "" -#: ../../library/re.rst:966 +#: ../../library/re.rst:1019 msgid "" "Return the string obtained by replacing the leftmost non-overlapping " "occurrences of *pattern* in *string* by the replacement *repl*. If the " @@ -1262,18 +1347,18 @@ msgid "" "For example::" msgstr "" -#: ../../library/re.rst:982 +#: ../../library/re.rst:1035 msgid "" "If *repl* is a function, it is called for every non-overlapping occurrence " "of *pattern*. The function takes a single :class:`~re.Match` argument, and " "returns the replacement string. For example::" msgstr "" -#: ../../library/re.rst:995 +#: ../../library/re.rst:1048 msgid "The pattern may be a string or a :class:`~re.Pattern`." msgstr "" -#: ../../library/re.rst:997 +#: ../../library/re.rst:1050 msgid "" "The optional argument *count* is the maximum number of pattern occurrences " "to be replaced; *count* must be a non-negative integer. If omitted or zero, " @@ -1282,7 +1367,7 @@ msgid "" "'abxd')`` returns ``'-a-b--d-'``." msgstr "" -#: ../../library/re.rst:1005 +#: ../../library/re.rst:1058 msgid "" "In string-type *repl* arguments, in addition to the character escapes and " "backreferences described above, ``\\g`` will use the substring matched " @@ -1295,60 +1380,60 @@ msgid "" "RE." msgstr "" -#: ../../library/re.rst:1018 ../../library/re.rst:1047 -#: ../../library/re.rst:1290 +#: ../../library/re.rst:1071 ../../library/re.rst:1100 +#: ../../library/re.rst:1343 msgid "Unmatched groups are replaced with an empty string." msgstr "" -#: ../../library/re.rst:1021 +#: ../../library/re.rst:1074 msgid "" "Unknown escapes in *pattern* consisting of ``'\\'`` and an ASCII letter now " "are errors." msgstr "" -#: ../../library/re.rst:1025 +#: ../../library/re.rst:1078 msgid "" "Unknown escapes in *repl* consisting of ``'\\'`` and an ASCII letter now are " "errors." msgstr "" -#: ../../library/re.rst:1029 +#: ../../library/re.rst:1082 msgid "" "Empty matches for the pattern are replaced when adjacent to a previous non-" "empty match." msgstr "" -#: ../../library/re.rst:1033 +#: ../../library/re.rst:1086 msgid "" "Group *id* can only contain ASCII digits. In :class:`bytes` replacement " "strings, group *name* can only contain bytes in the ASCII range " "(``b'\\x00'``-``b'\\x7f'``)." msgstr "" -#: ../../library/re.rst:1041 +#: ../../library/re.rst:1094 msgid "" "Perform the same operation as :func:`sub`, but return a tuple ``(new_string, " "number_of_subs_made)``." msgstr "" -#: ../../library/re.rst:1053 +#: ../../library/re.rst:1106 msgid "" "Escape special characters in *pattern*. This is useful if you want to match " "an arbitrary literal string that may have regular expression metacharacters " "in it. For example::" msgstr "" -#: ../../library/re.rst:1068 +#: ../../library/re.rst:1121 msgid "" "This function must not be used for the replacement string in :func:`sub` " "and :func:`subn`, only backslashes should be escaped. For example::" msgstr "" -#: ../../library/re.rst:1076 +#: ../../library/re.rst:1129 msgid "The ``'_'`` character is no longer escaped." msgstr "" -#: ../../library/re.rst:1079 +#: ../../library/re.rst:1132 msgid "" "Only characters that can have special meaning in a regular expression are " "escaped. As a result, ``'!'``, ``'\"'``, ``'%'``, ``\"'\"``, ``','``, " @@ -1356,15 +1441,15 @@ msgid "" "are no longer escaped." msgstr "" -#: ../../library/re.rst:1088 +#: ../../library/re.rst:1141 msgid "Clear the regular expression cache." msgstr "" -#: ../../library/re.rst:1092 +#: ../../library/re.rst:1145 msgid "Exceptions" msgstr "" -#: ../../library/re.rst:1096 +#: ../../library/re.rst:1149 msgid "" "Exception raised when a string passed to one of the functions here is not a " "valid regular expression (for example, it might contain unmatched " @@ -1373,45 +1458,45 @@ msgid "" "pattern. The error instance has the following additional attributes:" msgstr "" -#: ../../library/re.rst:1104 +#: ../../library/re.rst:1157 msgid "The unformatted error message." msgstr "" -#: ../../library/re.rst:1108 +#: ../../library/re.rst:1161 msgid "The regular expression pattern." msgstr "" -#: ../../library/re.rst:1112 +#: ../../library/re.rst:1165 msgid "The index in *pattern* where compilation failed (may be ``None``)." msgstr "" -#: ../../library/re.rst:1116 +#: ../../library/re.rst:1169 msgid "The line corresponding to *pos* (may be ``None``)." msgstr "" -#: ../../library/re.rst:1120 +#: ../../library/re.rst:1173 msgid "The column corresponding to *pos* (may be ``None``)." msgstr "" -#: ../../library/re.rst:1122 +#: ../../library/re.rst:1175 msgid "Added additional attributes." msgstr "新增額外屬性。" -#: ../../library/re.rst:1128 +#: ../../library/re.rst:1181 msgid "Regular Expression Objects" msgstr "" -#: ../../library/re.rst:1132 +#: ../../library/re.rst:1185 msgid "Compiled regular expression object returned by :func:`re.compile`." msgstr "" -#: ../../library/re.rst:1134 +#: ../../library/re.rst:1187 msgid "" ":py:class:`re.Pattern` supports ``[]`` to indicate a Unicode (str) or bytes " "pattern. See :ref:`types-genericalias`." msgstr "" -#: ../../library/re.rst:1140 +#: ../../library/re.rst:1193 msgid "" "Scan through *string* looking for the first location where this regular " "expression produces a match, and return a corresponding :class:`~re.Match`. " @@ -1420,7 +1505,7 @@ msgid "" "string." msgstr "" -#: ../../library/re.rst:1145 +#: ../../library/re.rst:1198 msgid "" "The optional second parameter *pos* gives an index in the string where the " "search is to start; it defaults to ``0``. This is not completely equivalent " @@ -1429,7 +1514,7 @@ msgid "" "necessarily at the index where the search is to start." msgstr "" -#: ../../library/re.rst:1151 +#: ../../library/re.rst:1204 msgid "" "The optional parameter *endpos* limits how far the string will be searched; " "it will be as if the string is *endpos* characters long, so only the " @@ -1439,7 +1524,7 @@ msgid "" "equivalent to ``rx.search(string[:50], 0)``. ::" msgstr "" -#: ../../library/re.rst:1166 +#: ../../library/re.rst:1219 msgid "" "If zero or more characters at the *beginning* of *string* match this regular " "expression, return a corresponding :class:`~re.Match`. Return ``None`` if " @@ -1447,101 +1532,101 @@ msgid "" "zero-length match." msgstr "" -#: ../../library/re.rst:1171 ../../library/re.rst:1189 +#: ../../library/re.rst:1224 ../../library/re.rst:1242 msgid "" "The optional *pos* and *endpos* parameters have the same meaning as for the :" "meth:`~Pattern.search` method. ::" msgstr "" -#: ../../library/re.rst:1179 +#: ../../library/re.rst:1232 msgid "" "If you want to locate a match anywhere in *string*, use :meth:`~Pattern." "search` instead (see also :ref:`search-vs-match`)." msgstr "" -#: ../../library/re.rst:1185 +#: ../../library/re.rst:1238 msgid "" "If the whole *string* matches this regular expression, return a " "corresponding :class:`~re.Match`. Return ``None`` if the string does not " "match the pattern; note that this is different from a zero-length match." msgstr "" -#: ../../library/re.rst:1203 +#: ../../library/re.rst:1256 msgid "Identical to the :func:`split` function, using the compiled pattern." msgstr "" -#: ../../library/re.rst:1208 +#: ../../library/re.rst:1261 msgid "" "Similar to the :func:`findall` function, using the compiled pattern, but " "also accepts optional *pos* and *endpos* parameters that limit the search " "region like for :meth:`search`." msgstr "" -#: ../../library/re.rst:1215 +#: ../../library/re.rst:1268 msgid "" "Similar to the :func:`finditer` function, using the compiled pattern, but " "also accepts optional *pos* and *endpos* parameters that limit the search " "region like for :meth:`search`." msgstr "" -#: ../../library/re.rst:1222 +#: ../../library/re.rst:1275 msgid "Identical to the :func:`sub` function, using the compiled pattern." msgstr "" -#: ../../library/re.rst:1227 +#: ../../library/re.rst:1280 msgid "Identical to the :func:`subn` function, using the compiled pattern." msgstr "" -#: ../../library/re.rst:1232 +#: ../../library/re.rst:1285 msgid "" "The regex matching flags. This is a combination of the flags given to :func:" "`.compile`, any ``(?...)`` inline flags in the pattern, and implicit flags " -"such as :data:`UNICODE` if the pattern is a Unicode string." +"such as :py:const:`~re.UNICODE` if the pattern is a Unicode string." msgstr "" -#: ../../library/re.rst:1239 +#: ../../library/re.rst:1292 msgid "The number of capturing groups in the pattern." msgstr "" -#: ../../library/re.rst:1244 +#: ../../library/re.rst:1297 msgid "" "A dictionary mapping any symbolic group names defined by ``(?P)`` to " "group numbers. The dictionary is empty if no symbolic groups were used in " "the pattern." msgstr "" -#: ../../library/re.rst:1251 +#: ../../library/re.rst:1304 msgid "The pattern string from which the pattern object was compiled." msgstr "" -#: ../../library/re.rst:1254 +#: ../../library/re.rst:1307 msgid "" "Added support of :func:`copy.copy` and :func:`copy.deepcopy`. Compiled " "regular expression objects are considered atomic." msgstr "" -#: ../../library/re.rst:1262 +#: ../../library/re.rst:1315 msgid "Match Objects" msgstr "" -#: ../../library/re.rst:1264 +#: ../../library/re.rst:1317 msgid "" "Match objects always have a boolean value of ``True``. Since :meth:`~Pattern." "match` and :meth:`~Pattern.search` return ``None`` when there is no match, " "you can test whether there was a match with a simple ``if`` statement::" msgstr "" -#: ../../library/re.rst:1275 +#: ../../library/re.rst:1328 msgid "Match object returned by successful ``match``\\ es and ``search``\\ es." msgstr "" -#: ../../library/re.rst:1277 +#: ../../library/re.rst:1330 msgid "" ":py:class:`re.Match` supports ``[]`` to indicate a Unicode (str) or bytes " "match. See :ref:`types-genericalias`." msgstr "" -#: ../../library/re.rst:1283 +#: ../../library/re.rst:1336 msgid "" "Return the string obtained by doing backslash substitution on the template " "string *template*, as done by the :meth:`~Pattern.sub` method. Escapes such " @@ -1550,7 +1635,7 @@ msgid "" "``\\g``) are replaced by the contents of the corresponding group." msgstr "" -#: ../../library/re.rst:1295 +#: ../../library/re.rst:1348 msgid "" "Returns one or more subgroups of the match. If there is a single argument, " "the result is a single string; if there are multiple arguments, the result " @@ -1565,7 +1650,7 @@ msgid "" "the pattern that matched multiple times, the last match is returned. ::" msgstr "" -#: ../../library/re.rst:1317 +#: ../../library/re.rst:1370 msgid "" "If the regular expression uses the ``(?P...)`` syntax, the *groupN* " "arguments may also be strings identifying groups by their group name. If a " @@ -1573,57 +1658,57 @@ msgid "" "`IndexError` exception is raised." msgstr "" -#: ../../library/re.rst:1322 +#: ../../library/re.rst:1375 msgid "A moderately complicated example::" msgstr "" -#: ../../library/re.rst:1330 +#: ../../library/re.rst:1383 msgid "Named groups can also be referred to by their index::" msgstr "" -#: ../../library/re.rst:1337 +#: ../../library/re.rst:1390 msgid "If a group matches multiple times, only the last match is accessible::" msgstr "" -#: ../../library/re.rst:1346 +#: ../../library/re.rst:1399 msgid "" "This is identical to ``m.group(g)``. This allows easier access to an " "individual group from a match::" msgstr "" -#: ../../library/re.rst:1357 +#: ../../library/re.rst:1410 msgid "Named groups are supported as well::" msgstr "" -#: ../../library/re.rst:1370 +#: ../../library/re.rst:1423 msgid "" "Return a tuple containing all the subgroups of the match, from 1 up to " "however many groups are in the pattern. The *default* argument is used for " "groups that did not participate in the match; it defaults to ``None``." msgstr "" -#: ../../library/re.rst:1374 ../../library/re.rst:1599 +#: ../../library/re.rst:1427 ../../library/re.rst:1652 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/re.rst:1380 +#: ../../library/re.rst:1433 msgid "" "If we make the decimal place and everything after it optional, not all " "groups might participate in the match. These groups will default to " "``None`` unless the *default* argument is given::" msgstr "" -#: ../../library/re.rst:1393 +#: ../../library/re.rst:1446 msgid "" "Return a dictionary containing all the *named* subgroups of the match, keyed " "by the subgroup name. The *default* argument is used for groups that did " "not participate in the match; it defaults to ``None``. For example::" msgstr "" -#: ../../library/re.rst:1405 +#: ../../library/re.rst:1458 msgid "" "Return the indices of the start and end of the substring matched by *group*; " "*group* defaults to zero (meaning the whole matched substring). Return " @@ -1632,7 +1717,7 @@ msgid "" "matched by group *g* (equivalent to ``m.group(g)``) is ::" msgstr "" -#: ../../library/re.rst:1413 +#: ../../library/re.rst:1466 msgid "" "Note that ``m.start(group)`` will equal ``m.end(group)`` if *group* matched " "a null string. For example, after ``m = re.search('b(c?)', 'cba')``, ``m." @@ -1640,32 +1725,32 @@ msgid "" "2, and ``m.start(2)`` raises an :exc:`IndexError` exception." msgstr "" -#: ../../library/re.rst:1418 +#: ../../library/re.rst:1471 msgid "An example that will remove *remove_this* from email addresses::" msgstr "" -#: ../../library/re.rst:1428 +#: ../../library/re.rst:1481 msgid "" "For a match *m*, return the 2-tuple ``(m.start(group), m.end(group))``. Note " "that if *group* did not contribute to the match, this is ``(-1, -1)``. " "*group* defaults to zero, the entire match." msgstr "" -#: ../../library/re.rst:1435 +#: ../../library/re.rst:1488 msgid "" "The value of *pos* which was passed to the :meth:`~Pattern.search` or :meth:" "`~Pattern.match` method of a :ref:`regex object `. This is the " "index into the string at which the RE engine started looking for a match." msgstr "" -#: ../../library/re.rst:1442 +#: ../../library/re.rst:1495 msgid "" "The value of *endpos* which was passed to the :meth:`~Pattern.search` or :" "meth:`~Pattern.match` method of a :ref:`regex object `. This is " "the index into the string beyond which the RE engine will not go." msgstr "" -#: ../../library/re.rst:1449 +#: ../../library/re.rst:1502 msgid "" "The integer index of the last matched capturing group, or ``None`` if no " "group was matched at all. For example, the expressions ``(a)b``, ``((a)" @@ -1674,43 +1759,43 @@ msgid "" "applied to the same string." msgstr "" -#: ../../library/re.rst:1458 +#: ../../library/re.rst:1511 msgid "" "The name of the last matched capturing group, or ``None`` if the group " "didn't have a name, or if no group was matched at all." msgstr "" -#: ../../library/re.rst:1464 +#: ../../library/re.rst:1517 msgid "" "The :ref:`regular expression object ` whose :meth:`~Pattern." "match` or :meth:`~Pattern.search` method produced this match instance." msgstr "" -#: ../../library/re.rst:1470 +#: ../../library/re.rst:1523 msgid "The string passed to :meth:`~Pattern.match` or :meth:`~Pattern.search`." msgstr "" -#: ../../library/re.rst:1473 +#: ../../library/re.rst:1526 msgid "" "Added support of :func:`copy.copy` and :func:`copy.deepcopy`. Match objects " "are considered atomic." msgstr "" -#: ../../library/re.rst:1481 +#: ../../library/re.rst:1534 msgid "Regular Expression Examples" msgstr "" -#: ../../library/re.rst:1485 +#: ../../library/re.rst:1538 msgid "Checking for a Pair" msgstr "" -#: ../../library/re.rst:1487 +#: ../../library/re.rst:1540 msgid "" "In this example, we'll use the following helper function to display match " "objects a little more gracefully::" msgstr "" -#: ../../library/re.rst:1495 +#: ../../library/re.rst:1548 msgid "" "Suppose you are writing a poker program where a player's hand is represented " "as a 5-character string with each character representing a card, \"a\" for " @@ -1718,28 +1803,28 @@ msgid "" "\"2\" through \"9\" representing the card with that value." msgstr "" -#: ../../library/re.rst:1500 +#: ../../library/re.rst:1553 msgid "To see if a given string is a valid hand, one could do the following::" msgstr "" -#: ../../library/re.rst:1510 +#: ../../library/re.rst:1563 msgid "" "That last hand, ``\"727ak\"``, contained a pair, or two of the same valued " "cards. To match this with a regular expression, one could use backreferences " "as such::" msgstr "" -#: ../../library/re.rst:1520 +#: ../../library/re.rst:1573 msgid "" "To find out what card the pair consists of, one could use the :meth:`~Match." "group` method of the match object in the following manner::" msgstr "" -#: ../../library/re.rst:1539 +#: ../../library/re.rst:1592 msgid "Simulating scanf()" msgstr "" -#: ../../library/re.rst:1543 +#: ../../library/re.rst:1596 msgid "" "Python does not currently have an equivalent to :c:func:`!scanf`. Regular " "expressions are generally more powerful, though also more verbose, than :c:" @@ -1748,124 +1833,124 @@ msgid "" "expressions." msgstr "" -#: ../../library/re.rst:1550 +#: ../../library/re.rst:1603 msgid ":c:func:`!scanf` Token" msgstr "" -#: ../../library/re.rst:1550 +#: ../../library/re.rst:1603 msgid "Regular Expression" msgstr "" -#: ../../library/re.rst:1552 +#: ../../library/re.rst:1605 msgid "``%c``" msgstr "``%c``" -#: ../../library/re.rst:1554 +#: ../../library/re.rst:1607 msgid "``%5c``" msgstr "``%5c``" -#: ../../library/re.rst:1554 +#: ../../library/re.rst:1607 msgid "``.{5}``" msgstr "``.{5}``" -#: ../../library/re.rst:1556 +#: ../../library/re.rst:1609 msgid "``%d``" msgstr "``%d``" -#: ../../library/re.rst:1556 +#: ../../library/re.rst:1609 msgid "``[-+]?\\d+``" msgstr "``[-+]?\\d+``" -#: ../../library/re.rst:1558 +#: ../../library/re.rst:1611 msgid "``%e``, ``%E``, ``%f``, ``%g``" msgstr "``%e``, ``%E``, ``%f``, ``%g``" -#: ../../library/re.rst:1558 +#: ../../library/re.rst:1611 msgid "``[-+]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?``" msgstr "``[-+]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?``" -#: ../../library/re.rst:1560 +#: ../../library/re.rst:1613 msgid "``%i``" msgstr "``%i``" -#: ../../library/re.rst:1560 +#: ../../library/re.rst:1613 msgid "``[-+]?(0[xX][\\dA-Fa-f]+|0[0-7]*|\\d+)``" msgstr "``[-+]?(0[xX][\\dA-Fa-f]+|0[0-7]*|\\d+)``" -#: ../../library/re.rst:1562 +#: ../../library/re.rst:1615 msgid "``%o``" msgstr "``%o``" -#: ../../library/re.rst:1562 +#: ../../library/re.rst:1615 msgid "``[-+]?[0-7]+``" msgstr "``[-+]?[0-7]+``" -#: ../../library/re.rst:1564 +#: ../../library/re.rst:1617 msgid "``%s``" msgstr "``%s``" -#: ../../library/re.rst:1564 +#: ../../library/re.rst:1617 msgid "``\\S+``" msgstr "``\\S+``" -#: ../../library/re.rst:1566 +#: ../../library/re.rst:1619 msgid "``%u``" msgstr "``%u``" -#: ../../library/re.rst:1566 +#: ../../library/re.rst:1619 msgid "``\\d+``" msgstr "``\\d+``" -#: ../../library/re.rst:1568 +#: ../../library/re.rst:1621 msgid "``%x``, ``%X``" msgstr "``%x``\\ 、\\ ``%X``" -#: ../../library/re.rst:1568 +#: ../../library/re.rst:1621 msgid "``[-+]?(0[xX])?[\\dA-Fa-f]+``" msgstr "``[-+]?(0[xX])?[\\dA-Fa-f]+``" -#: ../../library/re.rst:1571 +#: ../../library/re.rst:1624 msgid "To extract the filename and numbers from a string like ::" msgstr "" -#: ../../library/re.rst:1575 +#: ../../library/re.rst:1628 msgid "you would use a :c:func:`!scanf` format like ::" msgstr "" -#: ../../library/re.rst:1579 +#: ../../library/re.rst:1632 msgid "The equivalent regular expression would be ::" msgstr "" -#: ../../library/re.rst:1587 +#: ../../library/re.rst:1640 msgid "search() vs. match()" msgstr "" -#: ../../library/re.rst:1591 +#: ../../library/re.rst:1644 msgid "" "Python offers different primitive operations based on regular expressions:" msgstr "" -#: ../../library/re.rst:1593 +#: ../../library/re.rst:1646 msgid ":func:`re.match` checks for a match only at the beginning of the string" msgstr "" -#: ../../library/re.rst:1594 +#: ../../library/re.rst:1647 msgid "" ":func:`re.search` checks for a match anywhere in the string (this is what " "Perl does by default)" msgstr "" -#: ../../library/re.rst:1596 +#: ../../library/re.rst:1649 msgid ":func:`re.fullmatch` checks for entire string to be a match" msgstr "" -#: ../../library/re.rst:1608 +#: ../../library/re.rst:1661 msgid "" "Regular expressions beginning with ``'^'`` can be used with :func:`search` " "to restrict the match at the beginning of the string::" msgstr "" -#: ../../library/re.rst:1616 +#: ../../library/re.rst:1669 msgid "" "Note however that in :const:`MULTILINE` mode :func:`match` only matches at " "the beginning of the string, whereas using :func:`search` with a regular " @@ -1873,11 +1958,11 @@ msgid "" "line. ::" msgstr "" -#: ../../library/re.rst:1626 +#: ../../library/re.rst:1679 msgid "Making a Phonebook" msgstr "" -#: ../../library/re.rst:1628 +#: ../../library/re.rst:1681 msgid "" ":func:`split` splits a string into a list delimited by the passed pattern. " "The method is invaluable for converting textual data into data structures " @@ -1885,37 +1970,37 @@ msgid "" "following example that creates a phonebook." msgstr "" -#: ../../library/re.rst:1633 +#: ../../library/re.rst:1686 msgid "" "First, here is the input. Normally it may come from a file, here we are " "using triple-quoted string syntax" msgstr "" -#: ../../library/re.rst:1646 +#: ../../library/re.rst:1699 msgid "" "The entries are separated by one or more newlines. Now we convert the string " "into a list with each nonempty line having its own entry:" msgstr "" -#: ../../library/re.rst:1659 +#: ../../library/re.rst:1712 msgid "" "Finally, split each entry into a list with first name, last name, telephone " "number, and address. We use the ``maxsplit`` parameter of :func:`split` " "because the address has spaces, our splitting pattern, in it:" msgstr "" -#: ../../library/re.rst:1672 +#: ../../library/re.rst:1725 msgid "" "The ``:?`` pattern matches the colon after the last name, so that it does " "not occur in the result list. With a ``maxsplit`` of ``4``, we could " "separate the house number from the street name:" msgstr "" -#: ../../library/re.rst:1687 +#: ../../library/re.rst:1740 msgid "Text Munging" msgstr "" -#: ../../library/re.rst:1689 +#: ../../library/re.rst:1742 msgid "" ":func:`sub` replaces every occurrence of a pattern with a string or the " "result of a function. This example demonstrates using :func:`sub` with a " @@ -1923,11 +2008,11 @@ msgid "" "each word of a sentence except for the first and last characters::" msgstr "" -#: ../../library/re.rst:1707 +#: ../../library/re.rst:1760 msgid "Finding all Adverbs" msgstr "" -#: ../../library/re.rst:1709 +#: ../../library/re.rst:1762 msgid "" ":func:`findall` matches *all* occurrences of a pattern, not just the first " "one as :func:`search` does. For example, if a writer wanted to find all of " @@ -1935,11 +2020,11 @@ msgid "" "manner::" msgstr "" -#: ../../library/re.rst:1720 +#: ../../library/re.rst:1773 msgid "Finding all Adverbs and their Positions" msgstr "" -#: ../../library/re.rst:1722 +#: ../../library/re.rst:1775 msgid "" "If one wants more information about all matches of a pattern than the " "matched text, :func:`finditer` is useful as it provides :class:`~re.Match` " @@ -1948,11 +2033,11 @@ msgid "" "they would use :func:`finditer` in the following manner::" msgstr "" -#: ../../library/re.rst:1736 +#: ../../library/re.rst:1789 msgid "Raw String Notation" msgstr "" -#: ../../library/re.rst:1738 +#: ../../library/re.rst:1791 msgid "" "Raw string notation (``r\"text\"``) keeps regular expressions sane. Without " "it, every backslash (``'\\'``) in a regular expression would have to be " @@ -1960,7 +2045,7 @@ msgid "" "lines of code are functionally identical::" msgstr "" -#: ../../library/re.rst:1748 +#: ../../library/re.rst:1801 msgid "" "When one wants to match a literal backslash, it must be escaped in the " "regular expression. With raw string notation, this means ``r\"\\\\\"``. " @@ -1968,29 +2053,29 @@ msgid "" "following lines of code functionally identical::" msgstr "" -#: ../../library/re.rst:1760 +#: ../../library/re.rst:1813 msgid "Writing a Tokenizer" msgstr "" -#: ../../library/re.rst:1762 +#: ../../library/re.rst:1815 msgid "" "A `tokenizer or scanner `_ " "analyzes a string to categorize groups of characters. This is a useful " "first step in writing a compiler or interpreter." msgstr "" -#: ../../library/re.rst:1766 +#: ../../library/re.rst:1819 msgid "" "The text categories are specified with regular expressions. The technique " "is to combine those into a single master regular expression and to loop over " "successive matches::" msgstr "" -#: ../../library/re.rst:1822 +#: ../../library/re.rst:1875 msgid "The tokenizer produces the following output::" msgstr "" -#: ../../library/re.rst:1845 +#: ../../library/re.rst:1898 msgid "" "Friedl, Jeffrey. Mastering Regular Expressions. 3rd ed., O'Reilly Media, " "2009. The third edition of the book no longer covers Python at all, but the " @@ -2006,20 +2091,20 @@ msgstr ". (點)" #: ../../library/re.rst:123 ../../library/re.rst:130 ../../library/re.rst:137 #: ../../library/re.rst:143 ../../library/re.rst:157 ../../library/re.rst:181 #: ../../library/re.rst:220 ../../library/re.rst:235 ../../library/re.rst:244 -#: ../../library/re.rst:257 ../../library/re.rst:263 ../../library/re.rst:296 -#: ../../library/re.rst:309 ../../library/re.rst:319 ../../library/re.rst:345 -#: ../../library/re.rst:394 ../../library/re.rst:426 ../../library/re.rst:432 -#: ../../library/re.rst:437 ../../library/re.rst:444 ../../library/re.rst:451 -#: ../../library/re.rst:478 ../../library/re.rst:488 ../../library/re.rst:511 -#: ../../library/re.rst:523 ../../library/re.rst:528 ../../library/re.rst:544 -#: ../../library/re.rst:555 ../../library/re.rst:567 ../../library/re.rst:574 -#: ../../library/re.rst:588 ../../library/re.rst:595 ../../library/re.rst:609 -#: ../../library/re.rst:618 ../../library/re.rst:623 ../../library/re.rst:798 -#: ../../library/re.rst:1003 +#: ../../library/re.rst:257 ../../library/re.rst:262 ../../library/re.rst:295 +#: ../../library/re.rst:308 ../../library/re.rst:318 ../../library/re.rst:350 +#: ../../library/re.rst:405 ../../library/re.rst:437 ../../library/re.rst:443 +#: ../../library/re.rst:448 ../../library/re.rst:455 ../../library/re.rst:462 +#: ../../library/re.rst:489 ../../library/re.rst:499 ../../library/re.rst:522 +#: ../../library/re.rst:534 ../../library/re.rst:539 ../../library/re.rst:561 +#: ../../library/re.rst:575 ../../library/re.rst:591 ../../library/re.rst:599 +#: ../../library/re.rst:614 ../../library/re.rst:622 ../../library/re.rst:639 +#: ../../library/re.rst:653 ../../library/re.rst:658 ../../library/re.rst:849 +#: ../../library/re.rst:1056 msgid "in regular expressions" msgstr "於正規表示式中" -#: ../../library/re.rst:106 ../../library/re.rst:263 +#: ../../library/re.rst:106 ../../library/re.rst:262 msgid "^ (caret)" msgstr "^ (插入符號)" @@ -2067,7 +2152,7 @@ msgstr "?+" msgid "{} (curly brackets)" msgstr "{} (花括號)" -#: ../../library/re.rst:220 ../../library/re.rst:257 ../../library/re.rst:511 +#: ../../library/re.rst:220 ../../library/re.rst:257 ../../library/re.rst:522 msgid "\\ (backslash)" msgstr "\\ (反斜線)" @@ -2079,146 +2164,146 @@ msgstr "[] (方括號)" msgid "- (minus)" msgstr "- (減號)" -#: ../../library/re.rst:296 +#: ../../library/re.rst:295 msgid "| (vertical bar)" msgstr "| (垂直線)" -#: ../../library/re.rst:309 +#: ../../library/re.rst:308 msgid "() (parentheses)" msgstr "() (圓括號)" -#: ../../library/re.rst:319 +#: ../../library/re.rst:318 msgid "(?" msgstr "(?" -#: ../../library/re.rst:345 +#: ../../library/re.rst:350 msgid "(?:" msgstr "(?:" -#: ../../library/re.rst:394 +#: ../../library/re.rst:405 msgid "(?P<" msgstr "(?P<" -#: ../../library/re.rst:426 +#: ../../library/re.rst:437 msgid "(?P=" msgstr "(?P=" -#: ../../library/re.rst:432 +#: ../../library/re.rst:443 msgid "(?#" msgstr "(?#" -#: ../../library/re.rst:437 +#: ../../library/re.rst:448 msgid "(?=" msgstr "(?=" -#: ../../library/re.rst:444 +#: ../../library/re.rst:455 msgid "(?!" msgstr "(?!" -#: ../../library/re.rst:451 +#: ../../library/re.rst:462 msgid "(?<=" msgstr "(?<=" -#: ../../library/re.rst:478 +#: ../../library/re.rst:489 msgid "(?\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -248,9 +248,9 @@ msgstr "" #: ../../library/select.rst:187 msgid "" -"Solaris and derivatives have ``/dev/poll``. While :c:func:`!select` is " -"O(highest file descriptor) and :c:func:`!poll` is O(number of file " -"descriptors), ``/dev/poll`` is O(active file descriptors)." +"Solaris and derivatives have ``/dev/poll``. While :c:func:`!select` is *O*\\ " +"(*highest file descriptor*) and :c:func:`!poll` is *O*\\ (*number of file " +"descriptors*), ``/dev/poll`` is *O*\\ (*active file descriptors*)." msgstr "" #: ../../library/select.rst:191 @@ -524,8 +524,8 @@ msgid "" "requires listing the file descriptors of interest, while :c:func:`!select` " "builds a bitmap, turns on bits for the fds of interest, and then afterward " "the whole bitmap has to be linearly scanned again. :c:func:`!select` is " -"O(highest file descriptor), while :c:func:`!poll` is O(number of file " -"descriptors)." +"*O*\\ (*highest file descriptor*), while :c:func:`!poll` is *O*\\ (*number " +"of file descriptors*)." msgstr "" #: ../../library/select.rst:396 diff --git a/library/shutil.po b/library/shutil.po index 252cdd980b..347bc8c48a 100644 --- a/library/shutil.po +++ b/library/shutil.po @@ -1,5 +1,4 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -7,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2024-01-24 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -20,7 +19,7 @@ msgstr "" #: ../../library/shutil.rst:2 msgid ":mod:`shutil` --- High-level file operations" -msgstr "" +msgstr ":mod:`shutil` — 高階檔案操作" #: ../../library/shutil.rst:10 msgid "**Source code:** :source:`Lib/shutil.py`" @@ -370,8 +369,8 @@ msgid "" msgstr "" #: ../../library/shutil.rst:292 -msgid "The *dirs_exist_ok* parameter." -msgstr "*dirs_exist_ok* 參數。" +msgid "Added the *dirs_exist_ok* parameter." +msgstr "新增 *dirs_exist_ok* 參數。" #: ../../library/shutil.rst:299 msgid "" diff --git a/library/signal.po b/library/signal.po index cf457f2349..fa28cb5100 100644 --- a/library/signal.po +++ b/library/signal.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-12-31 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -154,19 +154,19 @@ msgstr "" #: ../../library/signal.rst:103 ../../library/signal.rst:136 #: ../../library/signal.rst:148 ../../library/signal.rst:154 -#: ../../library/signal.rst:164 ../../library/signal.rst:178 -#: ../../library/signal.rst:196 ../../library/signal.rst:204 -#: ../../library/signal.rst:230 ../../library/signal.rst:236 -#: ../../library/signal.rst:242 ../../library/signal.rst:349 -#: ../../library/signal.rst:388 ../../library/signal.rst:435 -#: ../../library/signal.rst:469 ../../library/signal.rst:499 -#: ../../library/signal.rst:506 ../../library/signal.rst:559 -#: ../../library/signal.rst:601 ../../library/signal.rst:616 -#: ../../library/signal.rst:642 ../../library/signal.rst:662 +#: ../../library/signal.rst:166 ../../library/signal.rst:180 +#: ../../library/signal.rst:198 ../../library/signal.rst:206 +#: ../../library/signal.rst:232 ../../library/signal.rst:238 +#: ../../library/signal.rst:244 ../../library/signal.rst:351 +#: ../../library/signal.rst:390 ../../library/signal.rst:437 +#: ../../library/signal.rst:471 ../../library/signal.rst:501 +#: ../../library/signal.rst:508 ../../library/signal.rst:561 +#: ../../library/signal.rst:603 ../../library/signal.rst:618 +#: ../../library/signal.rst:644 ../../library/signal.rst:664 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" -#: ../../library/signal.rst:105 ../../library/signal.rst:471 +#: ../../library/signal.rst:105 ../../library/signal.rst:473 msgid "" "See the man page :manpage:`sigprocmask(2)` and :manpage:`pthread_sigmask(3)` " "for further information." @@ -204,8 +204,8 @@ msgstr "" msgid "Interrupt from keyboard (CTRL + BREAK)." msgstr "" -#: ../../library/signal.rst:142 ../../library/signal.rst:260 -#: ../../library/signal.rst:270 +#: ../../library/signal.rst:142 ../../library/signal.rst:262 +#: ../../library/signal.rst:272 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" @@ -219,92 +219,96 @@ msgstr "" #: ../../library/signal.rst:158 msgid "Alias to :data:`SIGCHLD`." -msgstr "" +msgstr ":data:`SIGCHLD` 的別名。" + +#: ../../library/signal.rst:160 +msgid ":ref:`Availability `: not macOS." +msgstr ":ref:`適用 `:非 macOS。" -#: ../../library/signal.rst:162 +#: ../../library/signal.rst:164 msgid "Continue the process if it is currently stopped" msgstr "" -#: ../../library/signal.rst:168 +#: ../../library/signal.rst:170 msgid "Floating-point exception. For example, division by zero." msgstr "" -#: ../../library/signal.rst:171 +#: ../../library/signal.rst:173 msgid "" ":exc:`ZeroDivisionError` is raised when the second argument of a division or " "modulo operation is zero." msgstr "" -#: ../../library/signal.rst:176 +#: ../../library/signal.rst:178 msgid "" "Hangup detected on controlling terminal or death of controlling process." msgstr "" -#: ../../library/signal.rst:182 +#: ../../library/signal.rst:184 msgid "Illegal instruction." msgstr "" -#: ../../library/signal.rst:186 +#: ../../library/signal.rst:188 msgid "Interrupt from keyboard (CTRL + C)." msgstr "" -#: ../../library/signal.rst:188 +#: ../../library/signal.rst:190 msgid "Default action is to raise :exc:`KeyboardInterrupt`." msgstr "" -#: ../../library/signal.rst:192 +#: ../../library/signal.rst:194 msgid "Kill signal." msgstr "" -#: ../../library/signal.rst:194 +#: ../../library/signal.rst:196 msgid "It cannot be caught, blocked, or ignored." msgstr "" -#: ../../library/signal.rst:200 +#: ../../library/signal.rst:202 msgid "Broken pipe: write to pipe with no readers." msgstr "" -#: ../../library/signal.rst:202 +#: ../../library/signal.rst:204 msgid "Default action is to ignore the signal." msgstr "" -#: ../../library/signal.rst:208 +#: ../../library/signal.rst:210 msgid "Segmentation fault: invalid memory reference." msgstr "" -#: ../../library/signal.rst:212 +#: ../../library/signal.rst:214 msgid "" "Stack fault on coprocessor. The Linux kernel does not raise this signal: it " "can only be raised in user space." msgstr "" -#: ../../library/signal.rst:215 +#: ../../library/signal.rst:217 msgid ":ref:`Availability `: Linux." msgstr ":ref:`適用 `:Linux。" -#: ../../library/signal.rst:217 +#: ../../library/signal.rst:219 msgid "" "On architectures where the signal is available. See the man page :manpage:" "`signal(7)` for further information." msgstr "" -#: ../../library/signal.rst:224 +#: ../../library/signal.rst:226 msgid "Termination signal." msgstr "" -#: ../../library/signal.rst:228 +#: ../../library/signal.rst:230 msgid "User-defined signal 1." msgstr "" -#: ../../library/signal.rst:234 +#: ../../library/signal.rst:236 msgid "User-defined signal 2." msgstr "" -#: ../../library/signal.rst:240 +#: ../../library/signal.rst:242 msgid "Window resize signal." msgstr "" -#: ../../library/signal.rst:246 +#: ../../library/signal.rst:248 msgid "" "All the signal numbers are defined symbolically. For example, the hangup " "signal is defined as :const:`signal.SIGHUP`; the variable names are " @@ -315,37 +319,37 @@ msgid "" "only those names defined by the system are defined by this module." msgstr "" -#: ../../library/signal.rst:257 +#: ../../library/signal.rst:259 msgid "" "The signal corresponding to the :kbd:`Ctrl+C` keystroke event. This signal " "can only be used with :func:`os.kill`." msgstr "" -#: ../../library/signal.rst:267 +#: ../../library/signal.rst:269 msgid "" "The signal corresponding to the :kbd:`Ctrl+Break` keystroke event. This " "signal can only be used with :func:`os.kill`." msgstr "" -#: ../../library/signal.rst:277 +#: ../../library/signal.rst:279 msgid "" "One more than the number of the highest signal number. Use :func:" "`valid_signals` to get valid signal numbers." msgstr "" -#: ../../library/signal.rst:283 +#: ../../library/signal.rst:285 msgid "" "Decrements interval timer in real time, and delivers :const:`SIGALRM` upon " "expiration." msgstr "" -#: ../../library/signal.rst:289 +#: ../../library/signal.rst:291 msgid "" "Decrements interval timer only when the process is executing, and delivers " "SIGVTALRM upon expiration." msgstr "" -#: ../../library/signal.rst:295 +#: ../../library/signal.rst:297 msgid "" "Decrements interval timer both when the process executes and when the system " "is executing on behalf of the process. Coupled with ITIMER_VIRTUAL, this " @@ -353,29 +357,29 @@ msgid "" "and kernel space. SIGPROF is delivered upon expiration." msgstr "" -#: ../../library/signal.rst:303 +#: ../../library/signal.rst:305 msgid "" "A possible value for the *how* parameter to :func:`pthread_sigmask` " "indicating that signals are to be blocked." msgstr "" -#: ../../library/signal.rst:310 +#: ../../library/signal.rst:312 msgid "" "A possible value for the *how* parameter to :func:`pthread_sigmask` " "indicating that signals are to be unblocked." msgstr "" -#: ../../library/signal.rst:317 +#: ../../library/signal.rst:319 msgid "" "A possible value for the *how* parameter to :func:`pthread_sigmask` " "indicating that the signal mask is to be replaced." msgstr "" -#: ../../library/signal.rst:323 +#: ../../library/signal.rst:325 msgid "The :mod:`signal` module defines one exception:" msgstr "" -#: ../../library/signal.rst:327 +#: ../../library/signal.rst:329 msgid "" "Raised to signal an error from the underlying :func:`setitimer` or :func:" "`getitimer` implementation. Expect this error if an invalid interval timer " @@ -383,17 +387,17 @@ msgid "" "of :exc:`OSError`." msgstr "" -#: ../../library/signal.rst:332 +#: ../../library/signal.rst:334 msgid "" "This error used to be a subtype of :exc:`IOError`, which is now an alias of :" "exc:`OSError`." msgstr "" -#: ../../library/signal.rst:337 +#: ../../library/signal.rst:339 msgid "The :mod:`signal` module defines the following functions:" msgstr "" -#: ../../library/signal.rst:342 +#: ../../library/signal.rst:344 msgid "" "If *time* is non-zero, this function requests that a :const:`SIGALRM` signal " "be sent to the process in *time* seconds. Any previously scheduled alarm is " @@ -404,11 +408,11 @@ msgid "" "scheduled." msgstr "" -#: ../../library/signal.rst:351 +#: ../../library/signal.rst:353 msgid "See the man page :manpage:`alarm(2)` for further information." msgstr "更多資訊請見 :manpage:`alarm(2)` 手冊頁。" -#: ../../library/signal.rst:356 +#: ../../library/signal.rst:358 msgid "" "Return the current signal handler for the signal *signalnum*. The returned " "value may be a callable Python object, or one of the special values :const:" @@ -419,41 +423,41 @@ msgid "" "not installed from Python." msgstr "" -#: ../../library/signal.rst:367 +#: ../../library/signal.rst:369 msgid "" "Returns the description of signal *signalnum*, such as \"Interrupt\" for :" "const:`SIGINT`. Returns :const:`None` if *signalnum* has no description. " "Raises :exc:`ValueError` if *signalnum* is invalid." msgstr "" -#: ../../library/signal.rst:376 +#: ../../library/signal.rst:378 msgid "" "Return the set of valid signal numbers on this platform. This can be less " "than ``range(1, NSIG)`` if some signals are reserved by the system for " "internal use." msgstr "" -#: ../../library/signal.rst:385 +#: ../../library/signal.rst:387 msgid "" "Cause the process to sleep until a signal is received; the appropriate " "handler will then be called. Returns nothing." msgstr "" -#: ../../library/signal.rst:390 +#: ../../library/signal.rst:392 msgid "See the man page :manpage:`signal(2)` for further information." msgstr "更多資訊請見 :manpage:`signal(2)` 手冊頁。" -#: ../../library/signal.rst:392 +#: ../../library/signal.rst:394 msgid "" "See also :func:`sigwait`, :func:`sigwaitinfo`, :func:`sigtimedwait` and :" "func:`sigpending`." msgstr "" -#: ../../library/signal.rst:398 +#: ../../library/signal.rst:400 msgid "Sends a signal to the calling process. Returns nothing." msgstr "" -#: ../../library/signal.rst:405 +#: ../../library/signal.rst:407 msgid "" "Send signal *sig* to the process referred to by file descriptor *pidfd*. " "Python does not currently support the *siginfo* parameter; it must be " @@ -461,15 +465,15 @@ msgid "" "values are currently defined." msgstr "" -#: ../../library/signal.rst:410 +#: ../../library/signal.rst:412 msgid "See the :manpage:`pidfd_send_signal(2)` man page for more information." msgstr "更多資訊請見 :manpage:`pidfd_send_signal(2)` 手冊頁。" -#: ../../library/signal.rst:412 +#: ../../library/signal.rst:414 msgid ":ref:`Availability `: Linux >= 5.1" msgstr ":ref:`適用 `:Linux 5.1 以上" -#: ../../library/signal.rst:418 +#: ../../library/signal.rst:420 msgid "" "Send the signal *signalnum* to the thread *thread_id*, another thread in the " "same process as the caller. The target thread can be executing any code " @@ -480,20 +484,20 @@ msgid "" "running system call to fail with :exc:`InterruptedError`." msgstr "" -#: ../../library/signal.rst:426 +#: ../../library/signal.rst:428 msgid "" "Use :func:`threading.get_ident()` or the :attr:`~threading.Thread.ident` " "attribute of :class:`threading.Thread` objects to get a suitable value for " "*thread_id*." msgstr "" -#: ../../library/signal.rst:430 +#: ../../library/signal.rst:432 msgid "" "If *signalnum* is 0, then no signal is sent, but error checking is still " "performed; this can be used to check if the target thread is still running." msgstr "" -#: ../../library/signal.rst:433 +#: ../../library/signal.rst:435 msgid "" "Raises an :ref:`auditing event ` ``signal.pthread_kill`` with " "arguments ``thread_id``, ``signalnum``." @@ -501,67 +505,67 @@ msgstr "" "引發一個附帶引數 ``thread_id``、``signalnum`` 的\\ :ref:`稽核事件 " "` ``signal.pthread_kill``。" -#: ../../library/signal.rst:437 +#: ../../library/signal.rst:439 msgid "See the man page :manpage:`pthread_kill(3)` for further information." msgstr "更多資訊請見 :manpage:`pthread_kill(3)` 手冊頁。" -#: ../../library/signal.rst:439 +#: ../../library/signal.rst:441 msgid "See also :func:`os.kill`." msgstr "另請參閱 :func:`os.kill`\\ 。" -#: ../../library/signal.rst:446 +#: ../../library/signal.rst:448 msgid "" "Fetch and/or change the signal mask of the calling thread. The signal mask " "is the set of signals whose delivery is currently blocked for the caller. " "Return the old signal mask as a set of signals." msgstr "" -#: ../../library/signal.rst:450 +#: ../../library/signal.rst:452 msgid "" "The behavior of the call is dependent on the value of *how*, as follows." msgstr "" -#: ../../library/signal.rst:452 +#: ../../library/signal.rst:454 msgid "" ":data:`SIG_BLOCK`: The set of blocked signals is the union of the current " "set and the *mask* argument." msgstr "" -#: ../../library/signal.rst:454 +#: ../../library/signal.rst:456 msgid "" ":data:`SIG_UNBLOCK`: The signals in *mask* are removed from the current set " "of blocked signals. It is permissible to attempt to unblock a signal which " "is not blocked." msgstr "" -#: ../../library/signal.rst:457 +#: ../../library/signal.rst:459 msgid "" ":data:`SIG_SETMASK`: The set of blocked signals is set to the *mask* " "argument." msgstr "" -#: ../../library/signal.rst:460 +#: ../../library/signal.rst:462 msgid "" "*mask* is a set of signal numbers (e.g. {:const:`signal.SIGINT`, :const:" "`signal.SIGTERM`}). Use :func:`~signal.valid_signals` for a full mask " "including all signals." msgstr "" -#: ../../library/signal.rst:464 +#: ../../library/signal.rst:466 msgid "" "For example, ``signal.pthread_sigmask(signal.SIG_BLOCK, [])`` reads the " "signal mask of the calling thread." msgstr "" -#: ../../library/signal.rst:467 +#: ../../library/signal.rst:469 msgid ":data:`SIGKILL` and :data:`SIGSTOP` cannot be blocked." msgstr "" -#: ../../library/signal.rst:474 +#: ../../library/signal.rst:476 msgid "See also :func:`pause`, :func:`sigpending` and :func:`sigwait`." msgstr "另請參閱 :func:`pause`\\ 、\\ :func:`sigpending` 與 :func:`sigwait`。" -#: ../../library/signal.rst:481 +#: ../../library/signal.rst:483 msgid "" "Sets given interval timer (one of :const:`signal.ITIMER_REAL`, :const:" "`signal.ITIMER_VIRTUAL` or :const:`signal.ITIMER_PROF`) specified by *which* " @@ -571,7 +575,7 @@ msgid "" "zero." msgstr "" -#: ../../library/signal.rst:488 +#: ../../library/signal.rst:490 msgid "" "When an interval timer fires, a signal is sent to the process. The signal " "sent is dependent on the timer being used; :const:`signal.ITIMER_REAL` will " @@ -579,21 +583,21 @@ msgid "" "`SIGVTALRM`, and :const:`signal.ITIMER_PROF` will deliver :const:`SIGPROF`." msgstr "" -#: ../../library/signal.rst:494 +#: ../../library/signal.rst:496 msgid "The old values are returned as a tuple: (delay, interval)." msgstr "" -#: ../../library/signal.rst:496 +#: ../../library/signal.rst:498 msgid "" "Attempting to pass an invalid interval timer will cause an :exc:" "`ItimerError`." msgstr "" -#: ../../library/signal.rst:504 +#: ../../library/signal.rst:506 msgid "Returns current value of a given interval timer specified by *which*." msgstr "" -#: ../../library/signal.rst:511 +#: ../../library/signal.rst:513 msgid "" "Set the wakeup file descriptor to *fd*. When a signal is received, the " "signal number is written as a single byte into the fd. This can be used by " @@ -601,7 +605,7 @@ msgid "" "processed." msgstr "" -#: ../../library/signal.rst:516 +#: ../../library/signal.rst:518 msgid "" "The old wakeup fd is returned (or -1 if file descriptor wakeup was not " "enabled). If *fd* is -1, file descriptor wakeup is disabled. If not -1, " @@ -609,7 +613,7 @@ msgid "" "*fd* before calling poll or select again." msgstr "" -#: ../../library/signal.rst:521 ../../library/signal.rst:576 +#: ../../library/signal.rst:523 ../../library/signal.rst:578 msgid "" "When threads are enabled, this function can only be called from :ref:`the " "main thread of the main interpreter `; attempting to " @@ -617,14 +621,14 @@ msgid "" "raised." msgstr "" -#: ../../library/signal.rst:526 +#: ../../library/signal.rst:528 msgid "" "There are two common ways to use this function. In both approaches, you use " "the fd to wake up when a signal arrives, but then they differ in how they " "determine *which* signal or signals have arrived." msgstr "" -#: ../../library/signal.rst:531 +#: ../../library/signal.rst:533 msgid "" "In the first approach, we read the data out of the fd's buffer, and the byte " "values give you the signal numbers. This is simple, but in rare cases it can " @@ -635,7 +639,7 @@ msgid "" "warning to be printed to stderr when signals are lost." msgstr "" -#: ../../library/signal.rst:540 +#: ../../library/signal.rst:542 msgid "" "In the second approach, we use the wakeup fd *only* for wakeups, and ignore " "the actual byte values. In this case, all we care about is whether the fd's " @@ -645,33 +649,33 @@ msgid "" "spurious warning messages." msgstr "" -#: ../../library/signal.rst:547 +#: ../../library/signal.rst:549 msgid "On Windows, the function now also supports socket handles." msgstr "" -#: ../../library/signal.rst:550 +#: ../../library/signal.rst:552 msgid "Added ``warn_on_full_buffer`` parameter." msgstr "新增 ``warn_on_full_buffer`` 參數。" -#: ../../library/signal.rst:555 +#: ../../library/signal.rst:557 msgid "" "Change system call restart behaviour: if *flag* is :const:`False`, system " "calls will be restarted when interrupted by signal *signalnum*, otherwise " "system calls will be interrupted. Returns nothing." msgstr "" -#: ../../library/signal.rst:561 +#: ../../library/signal.rst:563 msgid "See the man page :manpage:`siginterrupt(3)` for further information." msgstr "更多資訊請見 :manpage:`siginterrupt(3)` 手冊頁。" -#: ../../library/signal.rst:563 +#: ../../library/signal.rst:565 msgid "" "Note that installing a signal handler with :func:`signal` will reset the " "restart behaviour to interruptible by implicitly calling :c:func:`!" "siginterrupt` with a true *flag* value for the given signal." msgstr "" -#: ../../library/signal.rst:570 +#: ../../library/signal.rst:572 msgid "" "Set the handler for signal *signalnum* to the function *handler*. *handler* " "can be a callable Python object taking two arguments (see below), or one of " @@ -681,7 +685,7 @@ msgid "" "information.)" msgstr "" -#: ../../library/signal.rst:581 +#: ../../library/signal.rst:583 msgid "" "The *handler* is called with two arguments: the signal number and the " "current stack frame (``None`` or a frame object; for a description of frame " @@ -689,7 +693,7 @@ msgid "" "see the attribute descriptions in the :mod:`inspect` module)." msgstr "" -#: ../../library/signal.rst:586 +#: ../../library/signal.rst:588 msgid "" "On Windows, :func:`signal` can only be called with :const:`SIGABRT`, :const:" "`SIGFPE`, :const:`SIGILL`, :const:`SIGINT`, :const:`SIGSEGV`, :const:" @@ -699,23 +703,23 @@ msgid "" "``SIG*`` module level constant." msgstr "" -#: ../../library/signal.rst:597 +#: ../../library/signal.rst:599 msgid "" "Examine the set of signals that are pending for delivery to the calling " "thread (i.e., the signals which have been raised while blocked). Return the " "set of the pending signals." msgstr "" -#: ../../library/signal.rst:603 +#: ../../library/signal.rst:605 msgid "See the man page :manpage:`sigpending(2)` for further information." msgstr "更多資訊請見 :manpage:`sigpending(2)` 手冊頁。" -#: ../../library/signal.rst:605 +#: ../../library/signal.rst:607 msgid "See also :func:`pause`, :func:`pthread_sigmask` and :func:`sigwait`." msgstr "" "另請參閱 :func:`pause`\\ 、\\ :func:`pthread_sigmask` 與 :func:`sigwait`。" -#: ../../library/signal.rst:612 +#: ../../library/signal.rst:614 msgid "" "Suspend execution of the calling thread until the delivery of one of the " "signals specified in the signal set *sigset*. The function accepts the " @@ -723,17 +727,17 @@ msgid "" "number." msgstr "" -#: ../../library/signal.rst:618 +#: ../../library/signal.rst:620 msgid "See the man page :manpage:`sigwait(3)` for further information." msgstr "更多資訊請見 :manpage:`sigwait(3)` 手冊頁。" -#: ../../library/signal.rst:620 +#: ../../library/signal.rst:622 msgid "" "See also :func:`pause`, :func:`pthread_sigmask`, :func:`sigpending`, :func:" "`sigwaitinfo` and :func:`sigtimedwait`." msgstr "" -#: ../../library/signal.rst:628 +#: ../../library/signal.rst:630 msgid "" "Suspend execution of the calling thread until the delivery of one of the " "signals specified in the signal set *sigset*. The function accepts the " @@ -744,7 +748,7 @@ msgid "" "`InterruptedError` if it is interrupted by a signal that is not in *sigset*." msgstr "" -#: ../../library/signal.rst:637 +#: ../../library/signal.rst:639 msgid "" "The return value is an object representing the data contained in the :c:type:" "`siginfo_t` structure, namely: :attr:`si_signo`, :attr:`si_code`, :attr:" @@ -752,49 +756,49 @@ msgid "" "`si_band`." msgstr "" -#: ../../library/signal.rst:644 +#: ../../library/signal.rst:646 msgid "See the man page :manpage:`sigwaitinfo(2)` for further information." msgstr "更多資訊請見 :manpage:`sigwaitinfo(2)` 手冊頁。" -#: ../../library/signal.rst:646 +#: ../../library/signal.rst:648 msgid "See also :func:`pause`, :func:`sigwait` and :func:`sigtimedwait`." msgstr "" "另請參閱 :func:`pause`\\ 、\\ :func:`sigwait` 與 :func:`sigtimedwait`。" -#: ../../library/signal.rst:650 +#: ../../library/signal.rst:652 msgid "" "The function is now retried if interrupted by a signal not in *sigset* and " "the signal handler does not raise an exception (see :pep:`475` for the " "rationale)." msgstr "" -#: ../../library/signal.rst:658 +#: ../../library/signal.rst:660 msgid "" "Like :func:`sigwaitinfo`, but takes an additional *timeout* argument " "specifying a timeout. If *timeout* is specified as ``0``, a poll is " "performed. Returns :const:`None` if a timeout occurs." msgstr "" -#: ../../library/signal.rst:664 +#: ../../library/signal.rst:666 msgid "See the man page :manpage:`sigtimedwait(2)` for further information." msgstr "更多資訊請見 :manpage:`sigtimedwait(2)` 手冊頁。" -#: ../../library/signal.rst:666 +#: ../../library/signal.rst:668 msgid "See also :func:`pause`, :func:`sigwait` and :func:`sigwaitinfo`." msgstr "另請參閱 :func:`pause`\\ 、\\ :func:`sigwait` 與 :func:`sigwaitinfo`。" -#: ../../library/signal.rst:670 +#: ../../library/signal.rst:672 msgid "" "The function is now retried with the recomputed *timeout* if interrupted by " "a signal not in *sigset* and the signal handler does not raise an exception " "(see :pep:`475` for the rationale)." msgstr "" -#: ../../library/signal.rst:679 +#: ../../library/signal.rst:681 msgid "Examples" msgstr "範例" -#: ../../library/signal.rst:681 +#: ../../library/signal.rst:683 msgid "" "Here is a minimal example program. It uses the :func:`alarm` function to " "limit the time spent waiting to open a file; this is useful if the file is " @@ -804,11 +808,11 @@ msgid "" "signal will be sent, and the handler raises an exception. ::" msgstr "" -#: ../../library/signal.rst:705 +#: ../../library/signal.rst:707 msgid "Note on SIGPIPE" msgstr "" -#: ../../library/signal.rst:707 +#: ../../library/signal.rst:709 msgid "" "Piping output of your program to tools like :manpage:`head(1)` will cause a :" "const:`SIGPIPE` signal to be sent to your process when the receiver of its " @@ -817,7 +821,7 @@ msgid "" "entry point to catch this exception as follows::" msgstr "" -#: ../../library/signal.rst:734 +#: ../../library/signal.rst:736 msgid "" "Do not set :const:`SIGPIPE`'s disposition to :const:`SIG_DFL` in order to " "avoid :exc:`BrokenPipeError`. Doing that would cause your program to exit " @@ -825,11 +829,11 @@ msgid "" "program is still writing to it." msgstr "" -#: ../../library/signal.rst:743 +#: ../../library/signal.rst:745 msgid "Note on Signal Handlers and Exceptions" msgstr "" -#: ../../library/signal.rst:745 +#: ../../library/signal.rst:747 msgid "" "If a signal handler raises an exception, the exception will be propagated to " "the main thread and may be raised after any :term:`bytecode` instruction. " @@ -840,11 +844,11 @@ msgid "" "program in an unexpected state." msgstr "" -#: ../../library/signal.rst:752 +#: ../../library/signal.rst:754 msgid "To illustrate this issue, consider the following code::" msgstr "" -#: ../../library/signal.rst:769 +#: ../../library/signal.rst:771 msgid "" "For many programs, especially those that merely want to exit on :exc:" "`KeyboardInterrupt`, this is not a problem, but applications that are " diff --git a/library/sqlite3.po b/library/sqlite3.po index baf000f431..3dd99120c4 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-11-28 00:03+0000\n" +"POT-Creation-Date: 2024-01-22 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -362,8 +362,8 @@ msgstr "" "``sqlite3.connect/handle``。" #: ../../library/sqlite3.rst:346 -msgid "The *uri* parameter." -msgstr "*uri* 參數。" +msgid "Added the *uri* parameter." +msgstr "新增 *uri* 參數。" #: ../../library/sqlite3.rst:349 msgid "" @@ -371,12 +371,12 @@ msgid "" msgstr "" #: ../../library/sqlite3.rst:352 -msgid "The ``sqlite3.connect/handle`` auditing event." -msgstr "``sqlite3.connect/handle`` 稽核事件。" +msgid "Added the ``sqlite3.connect/handle`` auditing event." +msgstr "新增 ``sqlite3.connect/handle`` 稽核事件。" #: ../../library/sqlite3.rst:355 -msgid "The *autocommit* parameter." -msgstr "*autocommit* 參數。" +msgid "Added the *autocommit* parameter." +msgstr "新增 *autocommit* 參數。" #: ../../library/sqlite3.rst:360 msgid "" @@ -807,7 +807,7 @@ msgid "If *deterministic* is used with SQLite versions older than 3.8.3." msgstr "" #: ../../library/sqlite3.rst:741 -msgid "The *deterministic* parameter." +msgid "Added the *deterministic* parameter." msgstr "新增 *deterministic* 參數。" #: ../../library/sqlite3.rst:744 ../../library/sqlite3.rst:782 @@ -1104,8 +1104,8 @@ msgid "Added the ``sqlite3.load_extension`` auditing event." msgstr "加入 ``sqlite3.load_extension`` 稽核事件。" #: ../../library/sqlite3.rst:1104 -msgid "The *entrypoint* parameter." -msgstr "*entrypoint* 參數。" +msgid "Added the *entrypoint* parameter." +msgstr "新增 *entrypoint* 參數。" #: ../../library/sqlite3.rst:1111 msgid "" diff --git a/library/ssl.po b/library/ssl.po index 3682350343..b4d8d8ea2d 100644 --- a/library/ssl.po +++ b/library/ssl.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-21 18:18+0000\n" +"POT-Creation-Date: 2024-01-25 06:20+0000\n" "PO-Revision-Date: 2024-01-09 10:47+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -495,7 +495,7 @@ msgid "" "parameter." msgstr "" "輸入使用 SSL 保護的伺服器的地址 ``addr``,輸入形式為一個 pair (*hostname*, " -"*port-number*),獲取該伺服器的憑證,並以 PEM 編碼字串的形式回傳。如果指定了" +"*port-number*),獲取該伺服器的憑證,並以 PEM 編碼字串的形式回傳。如果指定了 " "``ssl_version``,則使用指定的 SSL 協議來嘗試與伺服器連線。如果指定 " "*ca_certs*,則它應該是一個包含根憑證列表的檔案,並與 :meth:`SSLContext." "load_verify_locations` 中的參數 *cafile* 所使用的格式相同。此呼叫將嘗試使用該" @@ -2848,83 +2848,76 @@ msgstr "" #: ../../library/ssl.rst:2456 msgid "" -"There is no module-level ``wrap_bio()`` call like there is for :meth:" -"`~SSLContext.wrap_socket`. An :class:`SSLObject` is always created via an :" -"class:`SSLContext`." -msgstr "" - -#: ../../library/ssl.rst:2460 -msgid "" -":class:`SSLObject` instances must to created with :meth:`~SSLContext." +":class:`SSLObject` instances must be created with :meth:`~SSLContext." "wrap_bio`. In earlier versions, it was possible to create instances " "directly. This was never documented or officially supported." msgstr "" -#: ../../library/ssl.rst:2466 +#: ../../library/ssl.rst:2462 msgid "" "An SSLObject communicates with the outside world using memory buffers. The " "class :class:`MemoryBIO` provides a memory buffer that can be used for this " "purpose. It wraps an OpenSSL memory BIO (Basic IO) object:" msgstr "" -#: ../../library/ssl.rst:2472 +#: ../../library/ssl.rst:2468 msgid "" "A memory buffer that can be used to pass data between Python and an SSL " "protocol instance." msgstr "" -#: ../../library/ssl.rst:2477 +#: ../../library/ssl.rst:2473 msgid "Return the number of bytes currently in the memory buffer." msgstr "" -#: ../../library/ssl.rst:2481 +#: ../../library/ssl.rst:2477 msgid "" "A boolean indicating whether the memory BIO is current at the end-of-file " "position." msgstr "" -#: ../../library/ssl.rst:2486 +#: ../../library/ssl.rst:2482 msgid "" "Read up to *n* bytes from the memory buffer. If *n* is not specified or " "negative, all bytes are returned." msgstr "" -#: ../../library/ssl.rst:2491 +#: ../../library/ssl.rst:2487 msgid "" "Write the bytes from *buf* to the memory BIO. The *buf* argument must be an " "object supporting the buffer protocol." msgstr "" -#: ../../library/ssl.rst:2494 +#: ../../library/ssl.rst:2490 msgid "" "The return value is the number of bytes written, which is always equal to " "the length of *buf*." msgstr "" -#: ../../library/ssl.rst:2499 +#: ../../library/ssl.rst:2495 msgid "" "Write an EOF marker to the memory BIO. After this method has been called, it " "is illegal to call :meth:`~MemoryBIO.write`. The attribute :attr:`eof` will " "become true after all data currently in the buffer has been read." msgstr "" -#: ../../library/ssl.rst:2505 +#: ../../library/ssl.rst:2501 msgid "SSL session" msgstr "" -#: ../../library/ssl.rst:2511 +#: ../../library/ssl.rst:2507 msgid "Session object used by :attr:`~SSLSocket.session`." msgstr "" -#: ../../library/ssl.rst:2523 +#: ../../library/ssl.rst:2519 msgid "Security considerations" msgstr "" -#: ../../library/ssl.rst:2526 +#: ../../library/ssl.rst:2522 msgid "Best defaults" msgstr "" -#: ../../library/ssl.rst:2528 +#: ../../library/ssl.rst:2524 msgid "" "For **client use**, if you don't have any special requirements for your " "security policy, it is highly recommended that you use the :func:" @@ -2934,19 +2927,19 @@ msgid "" "settings." msgstr "" -#: ../../library/ssl.rst:2535 +#: ../../library/ssl.rst:2531 msgid "" "For example, here is how you would use the :class:`smtplib.SMTP` class to " "create a trusted, secure connection to a SMTP server::" msgstr "" -#: ../../library/ssl.rst:2544 +#: ../../library/ssl.rst:2540 msgid "" "If a client certificate is needed for the connection, it can be added with :" "meth:`SSLContext.load_cert_chain`." msgstr "" -#: ../../library/ssl.rst:2547 +#: ../../library/ssl.rst:2543 msgid "" "By contrast, if you create the SSL context by calling the :class:" "`SSLContext` constructor yourself, it will not have certificate validation " @@ -2954,15 +2947,15 @@ msgid "" "paragraphs below to achieve a good security level." msgstr "" -#: ../../library/ssl.rst:2553 +#: ../../library/ssl.rst:2549 msgid "Manual settings" msgstr "手動設定" -#: ../../library/ssl.rst:2556 +#: ../../library/ssl.rst:2552 msgid "Verifying certificates" msgstr "驗證憑證" -#: ../../library/ssl.rst:2558 +#: ../../library/ssl.rst:2554 msgid "" "When calling the :class:`SSLContext` constructor directly, :const:" "`CERT_NONE` is the default. Since it does not authenticate the other peer, " @@ -2977,13 +2970,13 @@ msgid "" "enabled." msgstr "" -#: ../../library/ssl.rst:2570 +#: ../../library/ssl.rst:2566 msgid "" "Hostname matchings is now performed by OpenSSL. Python no longer uses :func:" "`match_hostname`." msgstr "" -#: ../../library/ssl.rst:2574 +#: ../../library/ssl.rst:2570 msgid "" "In server mode, if you want to authenticate your clients using the SSL layer " "(rather than using a higher-level authentication mechanism), you'll also " @@ -2991,11 +2984,11 @@ msgid "" "certificate." msgstr "" -#: ../../library/ssl.rst:2580 +#: ../../library/ssl.rst:2576 msgid "Protocol versions" msgstr "協定版本" -#: ../../library/ssl.rst:2582 +#: ../../library/ssl.rst:2578 msgid "" "SSL versions 2 and 3 are considered insecure and are therefore dangerous to " "use. If you want maximum compatibility between clients and servers, it is " @@ -3004,7 +2997,7 @@ msgid "" "by default." msgstr "" -#: ../../library/ssl.rst:2595 +#: ../../library/ssl.rst:2591 msgid "" "The SSL context created above will only allow TLSv1.3 and later (if " "supported by your system) connections to a server. :const:" @@ -3012,11 +3005,11 @@ msgid "" "default. You have to load certificates into the context." msgstr "" -#: ../../library/ssl.rst:2602 +#: ../../library/ssl.rst:2598 msgid "Cipher selection" msgstr "" -#: ../../library/ssl.rst:2604 +#: ../../library/ssl.rst:2600 msgid "" "If you have advanced security requirements, fine-tuning of the ciphers " "enabled when negotiating a SSL session is possible through the :meth:" @@ -3029,11 +3022,11 @@ msgid "" "ciphers`` command on your system." msgstr "" -#: ../../library/ssl.rst:2615 +#: ../../library/ssl.rst:2611 msgid "Multi-processing" msgstr "" -#: ../../library/ssl.rst:2617 +#: ../../library/ssl.rst:2613 msgid "" "If using this module as part of a multi-processed application (using, for " "example the :mod:`multiprocessing` or :mod:`concurrent.futures` modules), be " @@ -3044,17 +3037,17 @@ msgid "" "sufficient." msgstr "" -#: ../../library/ssl.rst:2629 +#: ../../library/ssl.rst:2625 msgid "TLS 1.3" msgstr "TLS 1.3" -#: ../../library/ssl.rst:2633 +#: ../../library/ssl.rst:2629 msgid "" "The TLS 1.3 protocol behaves slightly differently than previous version of " "TLS/SSL. Some new TLS 1.3 features are not yet available." msgstr "" -#: ../../library/ssl.rst:2636 +#: ../../library/ssl.rst:2632 msgid "" "TLS 1.3 uses a disjunct set of cipher suites. All AES-GCM and ChaCha20 " "cipher suites are enabled by default. The method :meth:`SSLContext." @@ -3062,14 +3055,14 @@ msgid "" "`SSLContext.get_ciphers` returns them." msgstr "" -#: ../../library/ssl.rst:2640 +#: ../../library/ssl.rst:2636 msgid "" "Session tickets are no longer sent as part of the initial handshake and are " "handled differently. :attr:`SSLSocket.session` and :class:`SSLSession` are " "not compatible with TLS 1.3." msgstr "" -#: ../../library/ssl.rst:2643 +#: ../../library/ssl.rst:2639 msgid "" "Client-side certificates are also no longer verified during the initial " "handshake. A server can request a certificate at any time. Clients process " @@ -3077,21 +3070,21 @@ msgid "" "server." msgstr "" -#: ../../library/ssl.rst:2647 +#: ../../library/ssl.rst:2643 msgid "" "TLS 1.3 features like early data, deferred TLS client cert request, " "signature algorithm configuration, and rekeying are not supported yet." msgstr "" -#: ../../library/ssl.rst:2654 +#: ../../library/ssl.rst:2650 msgid "Class :class:`socket.socket`" msgstr ":class:`socket.socket` 類別" -#: ../../library/ssl.rst:2654 +#: ../../library/ssl.rst:2650 msgid "Documentation of underlying :mod:`socket` class" msgstr "底層 :mod:`socket` 類別的文件" -#: ../../library/ssl.rst:2657 +#: ../../library/ssl.rst:2653 msgid "" "`SSL/TLS Strong Encryption: An Introduction `_" @@ -3099,11 +3092,11 @@ msgstr "" "`SSL/TLS Strong Encryption: An Introduction `_" -#: ../../library/ssl.rst:2657 +#: ../../library/ssl.rst:2653 msgid "Intro from the Apache HTTP Server documentation" msgstr "Apache HTTP Server 文件的介紹" -#: ../../library/ssl.rst:2660 +#: ../../library/ssl.rst:2656 msgid "" ":rfc:`RFC 1422: Privacy Enhancement for Internet Electronic Mail: Part II: " "Certificate-Based Key Management <1422>`" @@ -3111,19 +3104,19 @@ msgstr "" ":rfc:`RFC 1422: Privacy Enhancement for Internet Electronic Mail: Part II: " "Certificate-Based Key Management <1422>`" -#: ../../library/ssl.rst:2660 +#: ../../library/ssl.rst:2656 msgid "Steve Kent" msgstr "Steve Kent" -#: ../../library/ssl.rst:2663 +#: ../../library/ssl.rst:2659 msgid ":rfc:`RFC 4086: Randomness Requirements for Security <4086>`" msgstr ":rfc:`RFC 4086: Randomness Requirements for Security <4086>`" -#: ../../library/ssl.rst:2663 +#: ../../library/ssl.rst:2659 msgid "Donald E., Jeffrey I. Schiller" msgstr "Donald E., Jeffrey I. Schiller" -#: ../../library/ssl.rst:2666 +#: ../../library/ssl.rst:2662 msgid "" ":rfc:`RFC 5280: Internet X.509 Public Key Infrastructure Certificate and " "Certificate Revocation List (CRL) Profile <5280>`" @@ -3131,11 +3124,11 @@ msgstr "" ":rfc:`RFC 5280: Internet X.509 Public Key Infrastructure Certificate and " "Certificate Revocation List (CRL) Profile <5280>`" -#: ../../library/ssl.rst:2666 +#: ../../library/ssl.rst:2662 msgid "D. Cooper" msgstr "D. Cooper" -#: ../../library/ssl.rst:2669 +#: ../../library/ssl.rst:2665 msgid "" ":rfc:`RFC 5246: The Transport Layer Security (TLS) Protocol Version 1.2 " "<5246>`" @@ -3143,19 +3136,19 @@ msgstr "" ":rfc:`RFC 5246: The Transport Layer Security (TLS) Protocol Version 1.2 " "<5246>`" -#: ../../library/ssl.rst:2669 +#: ../../library/ssl.rst:2665 msgid "T. Dierks et. al." msgstr "T. Dierks et. al." -#: ../../library/ssl.rst:2672 +#: ../../library/ssl.rst:2668 msgid ":rfc:`RFC 6066: Transport Layer Security (TLS) Extensions <6066>`" msgstr ":rfc:`RFC 6066: Transport Layer Security (TLS) Extensions <6066>`" -#: ../../library/ssl.rst:2672 +#: ../../library/ssl.rst:2668 msgid "D. Eastlake" msgstr "D. Eastlake" -#: ../../library/ssl.rst:2675 +#: ../../library/ssl.rst:2671 msgid "" "`IANA TLS: Transport Layer Security (TLS) Parameters `_" @@ -3163,11 +3156,11 @@ msgstr "" "`IANA TLS: Transport Layer Security (TLS) Parameters `_" -#: ../../library/ssl.rst:2675 +#: ../../library/ssl.rst:2671 msgid "IANA" msgstr "IANA" -#: ../../library/ssl.rst:2678 +#: ../../library/ssl.rst:2674 msgid "" ":rfc:`RFC 7525: Recommendations for Secure Use of Transport Layer Security " "(TLS) and Datagram Transport Layer Security (DTLS) <7525>`" @@ -3175,11 +3168,11 @@ msgstr "" ":rfc:`RFC 7525: Recommendations for Secure Use of Transport Layer Security " "(TLS) and Datagram Transport Layer Security (DTLS) <7525>`" -#: ../../library/ssl.rst:2678 +#: ../../library/ssl.rst:2674 msgid "IETF" msgstr "IETF" -#: ../../library/ssl.rst:2680 +#: ../../library/ssl.rst:2676 msgid "" "`Mozilla's Server Side TLS recommendations `_" @@ -3187,7 +3180,7 @@ msgstr "" "`Mozilla's Server Side TLS recommendations `_" -#: ../../library/ssl.rst:2681 +#: ../../library/ssl.rst:2677 msgid "Mozilla" msgstr "Mozilla" diff --git a/library/statistics.po b/library/statistics.po index 2d029804b0..0b81304d16 100644 --- a/library/statistics.po +++ b/library/statistics.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2024-01-17 00:03+0000\n" "PO-Revision-Date: 2023-07-22 21:15+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1024,6 +1024,8 @@ msgid "" "model based on major planets can predict the orbital distances for dwarf " "planets:" msgstr "" +"繼續 :func:`correlation` 中的範例,我們看看基於主要行星的模型可以如何很好地預" +"測矮行星的軌道距離:" #: ../../library/statistics.rst:765 msgid "Added support for *proportional*." @@ -1351,15 +1353,15 @@ msgstr "" "向參與 Python 講座。假設參與者的偏好沒有改變,那麼 Python 會議室未超過自身容" "量限制的機率是?" -#: ../../library/statistics.rst:1035 +#: ../../library/statistics.rst:1032 msgid "Naive bayesian classifier" msgstr "單純貝氏分類器 (Naive bayesian classifier)" -#: ../../library/statistics.rst:1037 +#: ../../library/statistics.rst:1034 msgid "Normal distributions commonly arise in machine learning problems." msgstr "常態分布常在機器學習問題中出現。" -#: ../../library/statistics.rst:1039 +#: ../../library/statistics.rst:1036 msgid "" "Wikipedia has a `nice example of a Naive Bayesian Classifier `_. The " @@ -1370,7 +1372,7 @@ msgstr "" "wiki/Naive_Bayes_classifier#Person_classification>`_。課題為從身高、體重與鞋" "子尺寸等符合常態分布的特徵量測值中判斷一個人的性別。" -#: ../../library/statistics.rst:1044 +#: ../../library/statistics.rst:1041 msgid "" "We're given a training dataset with measurements for eight people. The " "measurements are assumed to be normally distributed, so we summarize the " @@ -1379,13 +1381,13 @@ msgstr "" "給定一組包含八個人的量測值的訓練資料集。假設這些量測值服從常態分布,我們可以" "利用 :class:`NormalDist` 來總結資料:" -#: ../../library/statistics.rst:1057 +#: ../../library/statistics.rst:1054 msgid "" "Next, we encounter a new person whose feature measurements are known but " "whose gender is unknown:" msgstr "接著,我們遇到一個新的人,他的特徵量測值已知,但性別未知:" -#: ../../library/statistics.rst:1066 +#: ../../library/statistics.rst:1063 msgid "" "Starting with a 50% `prior probability `_ of being male or female, we compute the posterior as " @@ -1396,7 +1398,7 @@ msgstr "" "org/wiki/Prior_probability>`_ 為開端,我們將後驗機率 (posterior probability) " "計算為先驗機率乘以給定性別下,各特徵量測值的概度乘積:" -#: ../../library/statistics.rst:1081 +#: ../../library/statistics.rst:1078 msgid "" "The final prediction goes to the largest posterior. This is known as the " "`maximum a posteriori `_ 或者 MAP:" -#: ../../library/statistics.rst:1092 +#: ../../library/statistics.rst:1089 msgid "Kernel density estimation" msgstr "核密度估計 (Kernel density estimation)" -#: ../../library/statistics.rst:1094 +#: ../../library/statistics.rst:1091 msgid "" "It is possible to estimate a continuous probability density function from a " "fixed number of discrete samples." msgstr "可以從固定數量的離散樣本估計出連續機率密度函式。" -#: ../../library/statistics.rst:1097 +#: ../../library/statistics.rst:1094 msgid "" "The basic idea is to smooth the data using `a kernel function such as a " "normal distribution, triangular distribution, or uniform distribution " "`_. The degree of " -"smoothing is controlled by a single parameter, ``h``, representing the " -"variance of the kernel function." +"smoothing is controlled by a scaling parameter, ``h``, which is called the " +"*bandwidth*." msgstr "" "基本想法是使用\\ `一個核函式如常態分布、三角分布或均勻分布 `_\\ 來" -"使資料更加平滑。平滑程度由單個參數 ``h`` 控制,代表核函數的變異數。" +"使資料更加平滑。平滑程度由一個縮放參數 ``h`` 控制,被稱為 *bandwidth*。" -#: ../../library/statistics.rst:1116 +#: ../../library/statistics.rst:1111 msgid "" "`Wikipedia has an example `_ where we can use the ``kde_normal()`` " @@ -1440,7 +1442,7 @@ msgstr "" "Kernel_density_estimation#Example>`_,我們可以使用 ``kde_normal()`` 這個錦囊" "妙計來生成並繪製從小樣本估計的機率密度函式:" -#: ../../library/statistics.rst:1128 +#: ../../library/statistics.rst:1123 msgid "The points in ``xarr`` and ``yarr`` can be used to make a PDF plot:" msgstr "``xarr`` 和 ``yarr`` 中的點可用於繪製 PDF 圖:" diff --git a/library/subprocess.po b/library/subprocess.po index 1dcabdc919..b9fc04dbae 100644 --- a/library/subprocess.po +++ b/library/subprocess.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-26 00:03+0000\n" +"POT-Creation-Date: 2024-01-24 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:11+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -359,8 +359,9 @@ msgid "" "binary streams. No encoding or line ending conversion is performed." msgstr "" -#: ../../library/subprocess.rst:311 -msgid "Added *encoding* and *errors* parameters." +#: ../../library/subprocess.rst:311 ../../library/subprocess.rst:1541 +#: ../../library/subprocess.rst:1559 +msgid "Added the *encoding* and *errors* parameters." msgstr "新增 *encoding* 與 *errors* 參數。" #: ../../library/subprocess.rst:314 @@ -867,7 +868,7 @@ msgid "" msgstr "" #: ../../library/subprocess.rst:687 -msgid "The ``pipesize`` parameter was added." +msgid "Added the *pipesize* parameter." msgstr "新增 ``pipesize`` 參數。" #: ../../library/subprocess.rst:690 @@ -1627,7 +1628,7 @@ msgid "Return code handling translates as follows::" msgstr "" #: ../../library/subprocess.rst:1465 -msgid "Replacing functions from the :mod:`popen2` module" +msgid "Replacing functions from the :mod:`!popen2` module" msgstr "" #: ../../library/subprocess.rst:1469 @@ -1706,10 +1707,6 @@ msgid "" "`~Popen.returncode`." msgstr "" -#: ../../library/subprocess.rst:1541 ../../library/subprocess.rst:1559 -msgid "Added *encoding* and *errors* arguments." -msgstr "新增 *encoding* 與 *errors* 引數。" - #: ../../library/subprocess.rst:1546 msgid "Return output (stdout and stderr) of executing *cmd* in a shell." msgstr "" @@ -1835,3 +1832,6 @@ msgstr "universal newlines" #: ../../library/subprocess.rst:293 msgid "subprocess module" msgstr "subprocess 模組" + +#~ msgid "Added *encoding* and *errors* arguments." +#~ msgstr "新增 *encoding* 與 *errors* 引數。" diff --git a/library/sys.po b/library/sys.po index 911070ff26..4840c16553 100644 --- a/library/sys.po +++ b/library/sys.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-06 00:03+0000\n" +"POT-Creation-Date: 2024-01-12 00:03+0000\n" "PO-Revision-Date: 2023-04-26 02:54+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -375,7 +375,7 @@ msgid "Integer specifying the handle of the Python DLL." msgstr "" #: ../../library/sys.rst:286 ../../library/sys.rst:976 -#: ../../library/sys.rst:1731 ../../library/sys.rst:1967 +#: ../../library/sys.rst:1734 ../../library/sys.rst:1970 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" @@ -975,7 +975,7 @@ msgid "" "module (:samp:`RTLD_{xxx}` constants, e.g. :const:`os.RTLD_LAZY`)." msgstr "" -#: ../../library/sys.rst:763 ../../library/sys.rst:1451 +#: ../../library/sys.rst:763 ../../library/sys.rst:1454 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" @@ -1263,7 +1263,7 @@ msgstr "" msgid "See :pep:`525` for more details." msgstr "更多細節請見 :pep:`525`\\ 。" -#: ../../library/sys.rst:999 ../../library/sys.rst:1663 +#: ../../library/sys.rst:999 ../../library/sys.rst:1666 msgid "" "This function has been added on a provisional basis (see :pep:`411` for " "details.)" @@ -1275,7 +1275,7 @@ msgid "" "`set_coroutine_origin_tracking_depth`." msgstr "" -#: ../../library/sys.rst:1011 ../../library/sys.rst:1684 +#: ../../library/sys.rst:1011 ../../library/sys.rst:1687 msgid "" "This function has been added on a provisional basis (see :pep:`411` for " "details.) Use it only for debugging purposes." @@ -1557,12 +1557,17 @@ msgstr "" #: ../../library/sys.rst:1256 msgid "" ":term:`Module specs ` were introduced in Python 3.4, by :pep:" -"`451`. Earlier versions of Python looked for a method called :meth:`!" -"find_module`. This is still called as a fallback if a :data:`meta_path` " -"entry doesn't have a :meth:`~importlib.abc.MetaPathFinder.find_spec` method." +"`451`." msgstr "" -#: ../../library/sys.rst:1264 +#: ../../library/sys.rst:1261 +msgid "" +"Removed the fallback that looked for a :meth:`!find_module` method if a :" +"data:`meta_path` entry didn't have a :meth:`~importlib.abc.MetaPathFinder." +"find_spec` method." +msgstr "" + +#: ../../library/sys.rst:1267 msgid "" "This is a dictionary that maps module names to modules which have already " "been loaded. This can be manipulated to force reloading of modules and " @@ -1574,78 +1579,78 @@ msgid "" "other threads." msgstr "" -#: ../../library/sys.rst:1276 +#: ../../library/sys.rst:1279 msgid "" "The list of the original command line arguments passed to the Python " "executable." msgstr "" -#: ../../library/sys.rst:1279 +#: ../../library/sys.rst:1282 msgid "See also :data:`sys.argv`." msgstr "另請參閱 :data:`sys.argv`\\ 。" -#: ../../library/sys.rst:1288 +#: ../../library/sys.rst:1291 msgid "" "A list of strings that specifies the search path for modules. Initialized " "from the environment variable :envvar:`PYTHONPATH`, plus an installation-" "dependent default." msgstr "" -#: ../../library/sys.rst:1292 +#: ../../library/sys.rst:1295 msgid "" "By default, as initialized upon program startup, a potentially unsafe path " "is prepended to :data:`sys.path` (*before* the entries inserted as a result " "of :envvar:`PYTHONPATH`):" msgstr "" -#: ../../library/sys.rst:1296 +#: ../../library/sys.rst:1299 msgid "" "``python -m module`` command line: prepend the current working directory." msgstr "" -#: ../../library/sys.rst:1298 +#: ../../library/sys.rst:1301 msgid "" "``python script.py`` command line: prepend the script's directory. If it's a " "symbolic link, resolve symbolic links." msgstr "" -#: ../../library/sys.rst:1300 +#: ../../library/sys.rst:1303 msgid "" "``python -c code`` and ``python`` (REPL) command lines: prepend an empty " "string, which means the current working directory." msgstr "" -#: ../../library/sys.rst:1303 +#: ../../library/sys.rst:1306 msgid "" "To not prepend this potentially unsafe path, use the :option:`-P` command " "line option or the :envvar:`PYTHONSAFEPATH` environment variable." msgstr "" -#: ../../library/sys.rst:1306 +#: ../../library/sys.rst:1309 msgid "" "A program is free to modify this list for its own purposes. Only strings " "should be added to :data:`sys.path`; all other data types are ignored during " "import." msgstr "" -#: ../../library/sys.rst:1312 +#: ../../library/sys.rst:1315 msgid "" "Module :mod:`site` This describes how to use .pth files to extend :data:`sys." "path`." msgstr "" -#: ../../library/sys.rst:1317 +#: ../../library/sys.rst:1320 msgid "" "A list of callables that take a path argument to try to create a :term:" "`finder` for the path. If a finder can be created, it is to be returned by " "the callable, else raise :exc:`ImportError`." msgstr "" -#: ../../library/sys.rst:1321 ../../library/sys.rst:1332 +#: ../../library/sys.rst:1324 ../../library/sys.rst:1335 msgid "Originally specified in :pep:`302`." msgstr "" -#: ../../library/sys.rst:1326 +#: ../../library/sys.rst:1329 msgid "" "A dictionary acting as a cache for :term:`finder` objects. The keys are " "paths that have been passed to :data:`sys.path_hooks` and the values are the " @@ -1653,13 +1658,13 @@ msgid "" "is found on :data:`sys.path_hooks` then ``None`` is stored." msgstr "" -#: ../../library/sys.rst:1337 +#: ../../library/sys.rst:1340 msgid "" "This string contains a platform identifier that can be used to append " "platform-specific components to :data:`sys.path`, for instance." msgstr "" -#: ../../library/sys.rst:1340 +#: ../../library/sys.rst:1343 msgid "" "For Unix systems, except on Linux and AIX, this is the lowercased OS name as " "returned by ``uname -s`` with the first part of the version as returned by " @@ -1668,75 +1673,75 @@ msgid "" "version, it is therefore recommended to use the following idiom::" msgstr "" -#: ../../library/sys.rst:1353 +#: ../../library/sys.rst:1356 msgid "For other systems, the values are:" msgstr "" -#: ../../library/sys.rst:1356 +#: ../../library/sys.rst:1359 msgid "System" msgstr "" -#: ../../library/sys.rst:1356 +#: ../../library/sys.rst:1359 msgid "``platform`` value" msgstr "" -#: ../../library/sys.rst:1358 +#: ../../library/sys.rst:1361 msgid "AIX" msgstr "AIX" -#: ../../library/sys.rst:1358 +#: ../../library/sys.rst:1361 msgid "``'aix'``" msgstr "``'aix'``" -#: ../../library/sys.rst:1359 +#: ../../library/sys.rst:1362 msgid "Emscripten" msgstr "Emscripten" -#: ../../library/sys.rst:1359 +#: ../../library/sys.rst:1362 msgid "``'emscripten'``" msgstr "``'emscripten'``" -#: ../../library/sys.rst:1360 +#: ../../library/sys.rst:1363 msgid "Linux" msgstr "Linux" -#: ../../library/sys.rst:1360 +#: ../../library/sys.rst:1363 msgid "``'linux'``" msgstr "``'linux'``" -#: ../../library/sys.rst:1361 +#: ../../library/sys.rst:1364 msgid "WASI" msgstr "WASI" -#: ../../library/sys.rst:1361 +#: ../../library/sys.rst:1364 msgid "``'wasi'``" msgstr "``'wasi'``" -#: ../../library/sys.rst:1362 +#: ../../library/sys.rst:1365 msgid "Windows" msgstr "Windows" -#: ../../library/sys.rst:1362 +#: ../../library/sys.rst:1365 msgid "``'win32'``" msgstr "``'win32'``" -#: ../../library/sys.rst:1363 +#: ../../library/sys.rst:1366 msgid "Windows/Cygwin" msgstr "Windows/Cygwin" -#: ../../library/sys.rst:1363 +#: ../../library/sys.rst:1366 msgid "``'cygwin'``" msgstr "``'cygwin'``" -#: ../../library/sys.rst:1364 +#: ../../library/sys.rst:1367 msgid "macOS" msgstr "macOS" -#: ../../library/sys.rst:1364 +#: ../../library/sys.rst:1367 msgid "``'darwin'``" msgstr "``'darwin'``" -#: ../../library/sys.rst:1367 +#: ../../library/sys.rst:1370 msgid "" "On Linux, :data:`sys.platform` doesn't contain the major version anymore. It " "is always ``'linux'``, instead of ``'linux2'`` or ``'linux3'``. Since older " @@ -1744,7 +1749,7 @@ msgid "" "the ``startswith`` idiom presented above." msgstr "" -#: ../../library/sys.rst:1373 +#: ../../library/sys.rst:1376 msgid "" "On AIX, :data:`sys.platform` doesn't contain the major version anymore. It " "is always ``'aix'``, instead of ``'aix5'`` or ``'aix7'``. Since older " @@ -1752,57 +1757,57 @@ msgid "" "the ``startswith`` idiom presented above." msgstr "" -#: ../../library/sys.rst:1381 +#: ../../library/sys.rst:1384 msgid "" ":data:`os.name` has a coarser granularity. :func:`os.uname` gives system-" "dependent version information." msgstr "" -#: ../../library/sys.rst:1384 +#: ../../library/sys.rst:1387 msgid "" "The :mod:`platform` module provides detailed checks for the system's " "identity." msgstr "" -#: ../../library/sys.rst:1390 +#: ../../library/sys.rst:1393 msgid "" "Name of the platform-specific library directory. It is used to build the " "path of standard library and the paths of installed extension modules." msgstr "" -#: ../../library/sys.rst:1393 +#: ../../library/sys.rst:1396 msgid "" "It is equal to ``\"lib\"`` on most platforms. On Fedora and SuSE, it is " "equal to ``\"lib64\"`` on 64-bit platforms which gives the following ``sys." "path`` paths (where ``X.Y`` is the Python ``major.minor`` version):" msgstr "" -#: ../../library/sys.rst:1397 +#: ../../library/sys.rst:1400 msgid "" "``/usr/lib64/pythonX.Y/``: Standard library (like ``os.py`` of the :mod:`os` " "module)" msgstr "" -#: ../../library/sys.rst:1399 +#: ../../library/sys.rst:1402 msgid "" "``/usr/lib64/pythonX.Y/lib-dynload/``: C extension modules of the standard " "library (like the :mod:`errno` module, the exact filename is platform " "specific)" msgstr "" -#: ../../library/sys.rst:1402 +#: ../../library/sys.rst:1405 msgid "" "``/usr/lib/pythonX.Y/site-packages/`` (always use ``lib``, not :data:`sys." "platlibdir`): Third-party modules" msgstr "" -#: ../../library/sys.rst:1404 +#: ../../library/sys.rst:1407 msgid "" "``/usr/lib64/pythonX.Y/site-packages/``: C extension modules of third-party " "packages" msgstr "" -#: ../../library/sys.rst:1412 +#: ../../library/sys.rst:1415 msgid "" "A string giving the site-specific directory prefix where the platform " "independent Python files are installed; on Unix, the default is :file:`/usr/" @@ -1811,14 +1816,14 @@ msgid "" "derived paths." msgstr "" -#: ../../library/sys.rst:1418 +#: ../../library/sys.rst:1421 msgid "" "If a :ref:`virtual environment ` is in effect, this value will be " "changed in ``site.py`` to point to the virtual environment. The value for " "the Python installation will still be available, via :data:`base_prefix`." msgstr "" -#: ../../library/sys.rst:1433 +#: ../../library/sys.rst:1436 msgid "" "Strings specifying the primary and secondary prompt of the interpreter. " "These are only defined if the interpreter is in interactive mode. Their " @@ -1828,7 +1833,7 @@ msgid "" "used to implement a dynamic prompt." msgstr "" -#: ../../library/sys.rst:1443 +#: ../../library/sys.rst:1446 msgid "" "Set the flags used by the interpreter for :c:func:`dlopen` calls, such as " "when the interpreter loads extension modules. Among other things, this will " @@ -1839,14 +1844,14 @@ msgid "" "g. :const:`os.RTLD_LAZY`)." msgstr "" -#: ../../library/sys.rst:1455 +#: ../../library/sys.rst:1458 msgid "" "Set the :ref:`integer string conversion length limitation " "` used by this interpreter. See also :func:" "`get_int_max_str_digits`." msgstr "" -#: ../../library/sys.rst:1467 +#: ../../library/sys.rst:1470 msgid "" "Set the system's profile function, which allows you to implement a Python " "source code profiler in Python. See chapter :ref:`profile` for more " @@ -1861,14 +1866,14 @@ msgid "" "in the profile function will cause itself unset." msgstr "" -#: ../../library/sys.rst:1479 +#: ../../library/sys.rst:1482 msgid "" "The same tracing mechanism is used for :func:`!setprofile` as :func:" "`settrace`. To trace calls with :func:`!setprofile` inside a tracing " "function (e.g. in a debugger breakpoint), see :func:`call_tracing`." msgstr "" -#: ../../library/sys.rst:1483 +#: ../../library/sys.rst:1486 msgid "" "Profile functions should have three arguments: *frame*, *event*, and *arg*. " "*frame* is the current stack frame. *event* is a string: ``'call'``, " @@ -1876,71 +1881,71 @@ msgid "" "depends on the event type." msgstr "" -#: ../../library/sys.rst:1488 ../../library/sys.rst:1575 +#: ../../library/sys.rst:1491 ../../library/sys.rst:1578 msgid "The events have the following meaning:" msgstr "" -#: ../../library/sys.rst:1492 ../../library/sys.rst:1580 +#: ../../library/sys.rst:1495 ../../library/sys.rst:1583 msgid "``'call'``" msgstr "``'call'``" -#: ../../library/sys.rst:1491 +#: ../../library/sys.rst:1494 msgid "" "A function is called (or some other code block entered). The profile " "function is called; *arg* is ``None``." msgstr "" -#: ../../library/sys.rst:1497 ../../library/sys.rst:1596 +#: ../../library/sys.rst:1500 ../../library/sys.rst:1599 msgid "``'return'``" msgstr "``'return'``" -#: ../../library/sys.rst:1495 +#: ../../library/sys.rst:1498 msgid "" "A function (or other code block) is about to return. The profile function " "is called; *arg* is the value that will be returned, or ``None`` if the " "event is caused by an exception being raised." msgstr "" -#: ../../library/sys.rst:1501 +#: ../../library/sys.rst:1504 msgid "``'c_call'``" msgstr "``'c_call'``" -#: ../../library/sys.rst:1500 +#: ../../library/sys.rst:1503 msgid "" "A C function is about to be called. This may be an extension function or a " "built-in. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1504 +#: ../../library/sys.rst:1507 msgid "``'c_return'``" msgstr "``'c_return'``" -#: ../../library/sys.rst:1504 +#: ../../library/sys.rst:1507 msgid "A C function has returned. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1507 +#: ../../library/sys.rst:1510 msgid "``'c_exception'``" msgstr "``'c_exception'``" -#: ../../library/sys.rst:1507 +#: ../../library/sys.rst:1510 msgid "A C function has raised an exception. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1509 +#: ../../library/sys.rst:1512 msgid "" "Raises an :ref:`auditing event ` ``sys.setprofile`` with no " "arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys.setprofile``。" -#: ../../library/sys.rst:1514 +#: ../../library/sys.rst:1517 msgid "" "Set the maximum depth of the Python interpreter stack to *limit*. This " "limit prevents infinite recursion from causing an overflow of the C stack " "and crashing Python." msgstr "" -#: ../../library/sys.rst:1518 +#: ../../library/sys.rst:1521 msgid "" "The highest possible limit is platform-dependent. A user may need to set " "the limit higher when they have a program that requires deep recursion and a " @@ -1948,19 +1953,19 @@ msgid "" "because a too-high limit can lead to a crash." msgstr "" -#: ../../library/sys.rst:1523 +#: ../../library/sys.rst:1526 msgid "" "If the new limit is too low at the current recursion depth, a :exc:" "`RecursionError` exception is raised." msgstr "" -#: ../../library/sys.rst:1526 +#: ../../library/sys.rst:1529 msgid "" "A :exc:`RecursionError` exception is now raised if the new limit is too low " "at the current recursion depth." msgstr "" -#: ../../library/sys.rst:1533 +#: ../../library/sys.rst:1536 msgid "" "Set the interpreter's thread switch interval (in seconds). This floating-" "point value determines the ideal duration of the \"timeslices\" allocated to " @@ -1971,7 +1976,7 @@ msgid "" "scheduler." msgstr "" -#: ../../library/sys.rst:1550 +#: ../../library/sys.rst:1553 msgid "" "Set the system's trace function, which allows you to implement a Python " "source code debugger in Python. The function is thread-specific; for a " @@ -1980,7 +1985,7 @@ msgid "" "`threading.settrace`." msgstr "" -#: ../../library/sys.rst:1555 +#: ../../library/sys.rst:1558 msgid "" "Trace functions should have three arguments: *frame*, *event*, and *arg*. " "*frame* is the current stack frame. *event* is a string: ``'call'``, " @@ -1988,7 +1993,7 @@ msgid "" "the event type." msgstr "" -#: ../../library/sys.rst:1560 +#: ../../library/sys.rst:1563 msgid "" "The trace function is invoked (with *event* set to ``'call'``) whenever a " "new local scope is entered; it should return a reference to a local trace " @@ -1996,36 +2001,36 @@ msgid "" "traced." msgstr "" -#: ../../library/sys.rst:1565 +#: ../../library/sys.rst:1568 msgid "" "The local trace function should return a reference to itself, or to another " "function which would then be used as the local trace function for the scope." msgstr "" -#: ../../library/sys.rst:1568 +#: ../../library/sys.rst:1571 msgid "" "If there is any error occurred in the trace function, it will be unset, just " "like ``settrace(None)`` is called." msgstr "" -#: ../../library/sys.rst:1572 +#: ../../library/sys.rst:1575 msgid "" "Tracing is disabled while calling the trace function (e.g. a function set " "by :func:`!settrace`). For recursive tracing see :func:`call_tracing`." msgstr "" -#: ../../library/sys.rst:1578 +#: ../../library/sys.rst:1581 msgid "" "A function is called (or some other code block entered). The global trace " "function is called; *arg* is ``None``; the return value specifies the local " "trace function." msgstr "" -#: ../../library/sys.rst:1590 +#: ../../library/sys.rst:1593 msgid "``'line'``" msgstr "``'line'``" -#: ../../library/sys.rst:1583 +#: ../../library/sys.rst:1586 msgid "" "The interpreter is about to execute a new line of code or re-execute the " "condition of a loop. The local trace function is called; *arg* is ``None``; " @@ -2035,7 +2040,7 @@ msgid "" "to :const:`False` on that :ref:`frame `." msgstr "" -#: ../../library/sys.rst:1593 +#: ../../library/sys.rst:1596 msgid "" "A function (or other code block) is about to return. The local trace " "function is called; *arg* is the value that will be returned, or ``None`` if " @@ -2043,22 +2048,22 @@ msgid "" "return value is ignored." msgstr "" -#: ../../library/sys.rst:1601 +#: ../../library/sys.rst:1604 msgid "``'exception'``" msgstr "``'exception'``" -#: ../../library/sys.rst:1599 +#: ../../library/sys.rst:1602 msgid "" "An exception has occurred. The local trace function is called; *arg* is a " "tuple ``(exception, value, traceback)``; the return value specifies the new " "local trace function." msgstr "" -#: ../../library/sys.rst:1609 +#: ../../library/sys.rst:1612 msgid "``'opcode'``" msgstr "``'opcode'``" -#: ../../library/sys.rst:1604 +#: ../../library/sys.rst:1607 msgid "" "The interpreter is about to execute a new opcode (see :mod:`dis` for opcode " "details). The local trace function is called; *arg* is ``None``; the return " @@ -2068,13 +2073,13 @@ msgid "" "objects>`." msgstr "" -#: ../../library/sys.rst:1611 +#: ../../library/sys.rst:1614 msgid "" "Note that as an exception is propagated down the chain of callers, an " "``'exception'`` event is generated at each level." msgstr "" -#: ../../library/sys.rst:1614 +#: ../../library/sys.rst:1617 msgid "" "For more fine-grained usage, it's possible to set a trace function by " "assigning ``frame.f_trace = tracefunc`` explicitly, rather than relying on " @@ -2088,17 +2093,17 @@ msgid "" "on each frame)." msgstr "" -#: ../../library/sys.rst:1625 +#: ../../library/sys.rst:1628 msgid "For more information on code and frame objects, refer to :ref:`types`." msgstr "" -#: ../../library/sys.rst:1627 +#: ../../library/sys.rst:1630 msgid "" "Raises an :ref:`auditing event ` ``sys.settrace`` with no " "arguments." msgstr "" -#: ../../library/sys.rst:1631 +#: ../../library/sys.rst:1634 msgid "" "The :func:`settrace` function is intended only for implementing debuggers, " "profilers, coverage tools and the like. Its behavior is part of the " @@ -2106,13 +2111,13 @@ msgid "" "thus may not be available in all Python implementations." msgstr "" -#: ../../library/sys.rst:1638 +#: ../../library/sys.rst:1641 msgid "" "``'opcode'`` event type added; :attr:`~frame.f_trace_lines` and :attr:" "`~frame.f_trace_opcodes` attributes added to frames" msgstr "" -#: ../../library/sys.rst:1643 +#: ../../library/sys.rst:1646 msgid "" "Accepts two optional keyword arguments which are callables that accept an :" "term:`asynchronous generator iterator` as an argument. The *firstiter* " @@ -2121,7 +2126,7 @@ msgid "" "about to be garbage collected." msgstr "" -#: ../../library/sys.rst:1649 +#: ../../library/sys.rst:1652 msgid "" "Raises an :ref:`auditing event ` ``sys." "set_asyncgen_hooks_firstiter`` with no arguments." @@ -2129,7 +2134,7 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys." "set_asyncgen_hooks_firstiter``。" -#: ../../library/sys.rst:1651 +#: ../../library/sys.rst:1654 msgid "" "Raises an :ref:`auditing event ` ``sys." "set_asyncgen_hooks_finalizer`` with no arguments." @@ -2137,20 +2142,20 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys." "set_asyncgen_hooks_finalizer``。" -#: ../../library/sys.rst:1653 +#: ../../library/sys.rst:1656 msgid "" "Two auditing events are raised because the underlying API consists of two " "calls, each of which must raise its own event." msgstr "" -#: ../../library/sys.rst:1656 +#: ../../library/sys.rst:1659 msgid "" "See :pep:`525` for more details, and for a reference example of a " "*finalizer* method see the implementation of ``asyncio.Loop." "shutdown_asyncgens`` in :source:`Lib/asyncio/base_events.py`" msgstr "" -#: ../../library/sys.rst:1668 +#: ../../library/sys.rst:1671 msgid "" "Allows enabling or disabling coroutine origin tracking. When enabled, the " "``cr_origin`` attribute on coroutine objects will contain a tuple of " @@ -2159,105 +2164,105 @@ msgid "" "disabled, ``cr_origin`` will be None." msgstr "" -#: ../../library/sys.rst:1675 +#: ../../library/sys.rst:1678 msgid "" "To enable, pass a *depth* value greater than zero; this sets the number of " "frames whose information will be captured. To disable, pass set *depth* to " "zero." msgstr "" -#: ../../library/sys.rst:1679 +#: ../../library/sys.rst:1682 msgid "This setting is thread-specific." msgstr "" -#: ../../library/sys.rst:1689 +#: ../../library/sys.rst:1692 msgid "" "Activate the stack profiler trampoline *backend*. The only supported backend " "is ``\"perf\"``." msgstr "" -#: ../../library/sys.rst:1692 ../../library/sys.rst:1707 -#: ../../library/sys.rst:1715 +#: ../../library/sys.rst:1695 ../../library/sys.rst:1710 +#: ../../library/sys.rst:1718 msgid ":ref:`Availability `: Linux." msgstr ":ref:`適用 `:Linux。" -#: ../../library/sys.rst:1698 +#: ../../library/sys.rst:1701 msgid ":ref:`perf_profiling`" msgstr "" -#: ../../library/sys.rst:1699 +#: ../../library/sys.rst:1702 msgid "https://perf.wiki.kernel.org" msgstr "" -#: ../../library/sys.rst:1703 +#: ../../library/sys.rst:1706 msgid "Deactivate the current stack profiler trampoline backend." msgstr "" -#: ../../library/sys.rst:1705 +#: ../../library/sys.rst:1708 msgid "If no stack profiler is activated, this function has no effect." msgstr "" -#: ../../library/sys.rst:1713 +#: ../../library/sys.rst:1716 msgid "Return ``True`` if a stack profiler trampoline is active." msgstr "" -#: ../../library/sys.rst:1721 +#: ../../library/sys.rst:1724 msgid "" "Changes the :term:`filesystem encoding and error handler` to 'mbcs' and " "'replace' respectively, for consistency with versions of Python prior to 3.6." msgstr "" -#: ../../library/sys.rst:1725 +#: ../../library/sys.rst:1728 msgid "" "This is equivalent to defining the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` " "environment variable before launching Python." msgstr "" -#: ../../library/sys.rst:1728 +#: ../../library/sys.rst:1731 msgid "" "See also :func:`sys.getfilesystemencoding` and :func:`sys." "getfilesystemencodeerrors`." msgstr "" -#: ../../library/sys.rst:1733 +#: ../../library/sys.rst:1736 msgid "See :pep:`529` for more details." msgstr "更多細節請見 :pep:`529`\\ 。" -#: ../../library/sys.rst:1740 +#: ../../library/sys.rst:1743 msgid "" ":term:`File objects ` used by the interpreter for standard " "input, output and errors:" msgstr "" -#: ../../library/sys.rst:1743 +#: ../../library/sys.rst:1746 msgid "" "``stdin`` is used for all interactive input (including calls to :func:" "`input`);" msgstr "" -#: ../../library/sys.rst:1745 +#: ../../library/sys.rst:1748 msgid "" "``stdout`` is used for the output of :func:`print` and :term:`expression` " "statements and for the prompts of :func:`input`;" msgstr "" -#: ../../library/sys.rst:1747 +#: ../../library/sys.rst:1750 msgid "The interpreter's own prompts and its error messages go to ``stderr``." msgstr "" -#: ../../library/sys.rst:1749 +#: ../../library/sys.rst:1752 msgid "" "These streams are regular :term:`text files ` like those returned " "by the :func:`open` function. Their parameters are chosen as follows:" msgstr "" -#: ../../library/sys.rst:1753 +#: ../../library/sys.rst:1756 msgid "" "The encoding and error handling are is initialized from :c:member:`PyConfig." "stdio_encoding` and :c:member:`PyConfig.stdio_errors`." msgstr "" -#: ../../library/sys.rst:1756 +#: ../../library/sys.rst:1759 msgid "" "On Windows, UTF-8 is used for the console device. Non-character devices " "such as disk files and pipes use the system locale encoding (i.e. the ANSI " @@ -2268,14 +2273,14 @@ msgid "" "initially attached to a console." msgstr "" -#: ../../library/sys.rst:1765 +#: ../../library/sys.rst:1768 msgid "" "The special behaviour of the console can be overridden by setting the " "environment variable PYTHONLEGACYWINDOWSSTDIO before starting Python. In " "that case, the console codepages are used as for any other character device." msgstr "" -#: ../../library/sys.rst:1770 +#: ../../library/sys.rst:1773 msgid "" "Under all platforms, you can override the character encoding by setting the :" "envvar:`PYTHONIOENCODING` environment variable before starting Python or by " @@ -2284,7 +2289,7 @@ msgid "" "only applies when :envvar:`PYTHONLEGACYWINDOWSSTDIO` is also set." msgstr "" -#: ../../library/sys.rst:1777 +#: ../../library/sys.rst:1780 msgid "" "When interactive, the ``stdout`` stream is line-buffered. Otherwise, it is " "block-buffered like regular text files. The ``stderr`` stream is line-" @@ -2293,19 +2298,19 @@ msgid "" "`PYTHONUNBUFFERED` environment variable." msgstr "" -#: ../../library/sys.rst:1783 +#: ../../library/sys.rst:1786 msgid "" "Non-interactive ``stderr`` is now line-buffered instead of fully buffered." msgstr "" -#: ../../library/sys.rst:1789 +#: ../../library/sys.rst:1792 msgid "" "To write or read binary data from/to the standard streams, use the " "underlying binary :data:`~io.TextIOBase.buffer` object. For example, to " "write bytes to :data:`stdout`, use ``sys.stdout.buffer.write(b'abc')``." msgstr "" -#: ../../library/sys.rst:1793 +#: ../../library/sys.rst:1796 msgid "" "However, if you are writing a library (and do not control in which context " "its code will be executed), be aware that the standard streams may be " @@ -2313,7 +2318,7 @@ msgid "" "support the :attr:`!buffer` attribute." msgstr "" -#: ../../library/sys.rst:1803 +#: ../../library/sys.rst:1806 msgid "" "These objects contain the original values of ``stdin``, ``stderr`` and " "``stdout`` at the start of the program. They are used during finalization, " @@ -2321,7 +2326,7 @@ msgid "" "``sys.std*`` object has been redirected." msgstr "" -#: ../../library/sys.rst:1808 +#: ../../library/sys.rst:1811 msgid "" "It can also be used to restore the actual files to known working file " "objects in case they have been overwritten with a broken object. However, " @@ -2329,7 +2334,7 @@ msgid "" "before replacing it, and restore the saved object." msgstr "" -#: ../../library/sys.rst:1814 +#: ../../library/sys.rst:1817 msgid "" "Under some conditions ``stdin``, ``stdout`` and ``stderr`` as well as the " "original values ``__stdin__``, ``__stdout__`` and ``__stderr__`` can be " @@ -2337,12 +2342,12 @@ msgid "" "to a console and Python apps started with :program:`pythonw`." msgstr "" -#: ../../library/sys.rst:1822 +#: ../../library/sys.rst:1825 msgid "" "A frozenset of strings containing the names of standard library modules." msgstr "" -#: ../../library/sys.rst:1824 +#: ../../library/sys.rst:1827 msgid "" "It is the same on all platforms. Modules which are not available on some " "platforms and modules disabled at Python build are also listed. All module " @@ -2350,7 +2355,7 @@ msgid "" "modules are excluded." msgstr "" -#: ../../library/sys.rst:1829 +#: ../../library/sys.rst:1832 msgid "" "For packages, only the main package is listed: sub-packages and sub-modules " "are not listed. For example, the ``email`` package is listed, but the " @@ -2358,60 +2363,60 @@ msgid "" "listed." msgstr "" -#: ../../library/sys.rst:1834 +#: ../../library/sys.rst:1837 msgid "See also the :data:`sys.builtin_module_names` list." msgstr "另請參閱 :attr:`sys.builtin_module_names` 清單。" -#: ../../library/sys.rst:1841 +#: ../../library/sys.rst:1844 msgid "" "A :term:`named tuple` holding information about the thread implementation." msgstr "" -#: ../../library/sys.rst:1846 +#: ../../library/sys.rst:1849 msgid "The name of the thread implementation:" msgstr "" -#: ../../library/sys.rst:1848 +#: ../../library/sys.rst:1851 msgid "``\"nt\"``: Windows threads" msgstr "``\"nt\"``: Windows 執行緒" -#: ../../library/sys.rst:1849 +#: ../../library/sys.rst:1852 msgid "``\"pthread\"``: POSIX threads" msgstr "``\"pthread\"``: POSIX 執行緒" -#: ../../library/sys.rst:1850 +#: ../../library/sys.rst:1853 msgid "" "``\"pthread-stubs\"``: stub POSIX threads (on WebAssembly platforms without " "threading support)" msgstr "" -#: ../../library/sys.rst:1852 +#: ../../library/sys.rst:1855 msgid "``\"solaris\"``: Solaris threads" msgstr "" -#: ../../library/sys.rst:1856 +#: ../../library/sys.rst:1859 msgid "The name of the lock implementation:" msgstr "" -#: ../../library/sys.rst:1858 +#: ../../library/sys.rst:1861 msgid "``\"semaphore\"``: a lock uses a semaphore" msgstr "" -#: ../../library/sys.rst:1859 +#: ../../library/sys.rst:1862 msgid "``\"mutex+cond\"``: a lock uses a mutex and a condition variable" msgstr "" -#: ../../library/sys.rst:1860 +#: ../../library/sys.rst:1863 msgid "``None`` if this information is unknown" msgstr "為 ``None`` 表示此資訊未知" -#: ../../library/sys.rst:1864 +#: ../../library/sys.rst:1867 msgid "" "The name and version of the thread library. It is a string, or ``None`` if " "this information is unknown." msgstr "" -#: ../../library/sys.rst:1872 +#: ../../library/sys.rst:1875 msgid "" "When this variable is set to an integer value, it determines the maximum " "number of levels of traceback information printed when an unhandled " @@ -2420,73 +2425,73 @@ msgid "" "are printed." msgstr "" -#: ../../library/sys.rst:1880 +#: ../../library/sys.rst:1883 msgid "Handle an unraisable exception." msgstr "處理一個不可被引發的例外。" -#: ../../library/sys.rst:1882 +#: ../../library/sys.rst:1885 msgid "" "Called when an exception has occurred but there is no way for Python to " "handle it. For example, when a destructor raises an exception or during " "garbage collection (:func:`gc.collect`)." msgstr "" -#: ../../library/sys.rst:1886 +#: ../../library/sys.rst:1889 msgid "The *unraisable* argument has the following attributes:" msgstr "" -#: ../../library/sys.rst:1888 +#: ../../library/sys.rst:1891 msgid ":attr:`!exc_type`: Exception type." msgstr ":attr:`!exc_type`: 例外型別。" -#: ../../library/sys.rst:1889 +#: ../../library/sys.rst:1892 msgid ":attr:`!exc_value`: Exception value, can be ``None``." msgstr ":attr:`!exc_value`: 例外值,可以為 ``None``。" -#: ../../library/sys.rst:1890 +#: ../../library/sys.rst:1893 msgid ":attr:`!exc_traceback`: Exception traceback, can be ``None``." msgstr ":attr:`!exc_traceback`: 例外追蹤,可以為 ``None``。" -#: ../../library/sys.rst:1891 +#: ../../library/sys.rst:1894 msgid ":attr:`!err_msg`: Error message, can be ``None``." msgstr ":attr:`!err_msg`: 錯誤訊息,可以為 ``None``。" -#: ../../library/sys.rst:1892 +#: ../../library/sys.rst:1895 msgid ":attr:`!object`: Object causing the exception, can be ``None``." msgstr ":attr:`!object`: 導致例外的物件,可以為 ``None``。" -#: ../../library/sys.rst:1894 +#: ../../library/sys.rst:1897 msgid "" "The default hook formats :attr:`!err_msg` and :attr:`!object` as: " "``f'{err_msg}: {object!r}'``; use \"Exception ignored in\" error message if :" "attr:`!err_msg` is ``None``." msgstr "" -#: ../../library/sys.rst:1898 +#: ../../library/sys.rst:1901 msgid "" ":func:`sys.unraisablehook` can be overridden to control how unraisable " "exceptions are handled." msgstr "" -#: ../../library/sys.rst:1903 +#: ../../library/sys.rst:1906 msgid ":func:`excepthook` which handles uncaught exceptions." msgstr "處理未被捕捉到例外的 :func:`excepthook`。" -#: ../../library/sys.rst:1907 +#: ../../library/sys.rst:1910 msgid "" "Storing :attr:`!exc_value` using a custom hook can create a reference cycle. " "It should be cleared explicitly to break the reference cycle when the " "exception is no longer needed." msgstr "" -#: ../../library/sys.rst:1911 +#: ../../library/sys.rst:1914 msgid "" "Storing :attr:`!object` using a custom hook can resurrect it if it is set to " "an object which is being finalized. Avoid storing :attr:`!object` after the " "custom hook completes to avoid resurrecting objects." msgstr "" -#: ../../library/sys.rst:1915 +#: ../../library/sys.rst:1918 #, fuzzy msgid "" "Raises an :ref:`auditing event ` ``sys.unraisablehook`` with " @@ -2495,7 +2500,7 @@ msgstr "" "引發一個附帶引數 ``hook``、``unraisable`` 的\\ :ref:`稽核事件 ` " "``sys.unraisablehook``。" -#: ../../library/sys.rst:1917 +#: ../../library/sys.rst:1920 msgid "" "Raise an auditing event ``sys.unraisablehook`` with arguments *hook*, " "*unraisable* when an exception that cannot be handled occurs. The " @@ -2503,7 +2508,7 @@ msgid "" "hook has been set, *hook* may be ``None``." msgstr "" -#: ../../library/sys.rst:1926 +#: ../../library/sys.rst:1929 msgid "" "A string containing the version number of the Python interpreter plus " "additional information on the build number and compiler used. This string " @@ -2512,13 +2517,13 @@ msgid "" "functions provided by the :mod:`platform` module." msgstr "" -#: ../../library/sys.rst:1935 +#: ../../library/sys.rst:1938 msgid "" "The C API version for this interpreter. Programmers may find this useful " "when debugging version conflicts between Python and extension modules." msgstr "" -#: ../../library/sys.rst:1941 +#: ../../library/sys.rst:1944 msgid "" "A tuple containing the five components of the version number: *major*, " "*minor*, *micro*, *releaselevel*, and *serial*. All values except " @@ -2529,18 +2534,18 @@ msgid "" "version_info.major`` and so on." msgstr "" -#: ../../library/sys.rst:1949 +#: ../../library/sys.rst:1952 msgid "Added named component attributes." msgstr "新增了附名的元件屬性。" -#: ../../library/sys.rst:1954 +#: ../../library/sys.rst:1957 msgid "" "This is an implementation detail of the warnings framework; do not modify " "this value. Refer to the :mod:`warnings` module for more information on the " "warnings framework." msgstr "" -#: ../../library/sys.rst:1961 +#: ../../library/sys.rst:1964 msgid "" "The version number used to form registry keys on Windows platforms. This is " "stored as string resource 1000 in the Python DLL. The value is normally the " @@ -2549,31 +2554,31 @@ msgid "" "has no effect on the registry keys used by Python." msgstr "" -#: ../../library/sys.rst:1973 +#: ../../library/sys.rst:1976 msgid "" "Namespace containing functions and constants for register callbacks and " "controlling monitoring events. See :mod:`sys.monitoring` for details." msgstr "" -#: ../../library/sys.rst:1979 +#: ../../library/sys.rst:1982 msgid "" "A dictionary of the various implementation-specific flags passed through " "the :option:`-X` command-line option. Option names are either mapped to " "their values, if given explicitly, or to :const:`True`. Example:" msgstr "" -#: ../../library/sys.rst:1995 +#: ../../library/sys.rst:1998 msgid "" "This is a CPython-specific way of accessing options passed through :option:`-" "X`. Other implementations may export them through other means, or not at " "all." msgstr "" -#: ../../library/sys.rst:2003 +#: ../../library/sys.rst:2006 msgid "Citations" msgstr "引用" -#: ../../library/sys.rst:2004 +#: ../../library/sys.rst:2007 msgid "" "ISO/IEC 9899:1999. \"Programming languages -- C.\" A public draft of this " "standard is available at https://www.open-std.org/jtc1/sc22/wg14/www/docs/" @@ -2594,51 +2599,51 @@ msgstr "object(物件)" msgid "traceback" msgstr "traceback" -#: ../../library/sys.rst:910 ../../library/sys.rst:1463 +#: ../../library/sys.rst:910 ../../library/sys.rst:1466 msgid "profile function" msgstr "" -#: ../../library/sys.rst:910 ../../library/sys.rst:1463 +#: ../../library/sys.rst:910 ../../library/sys.rst:1466 msgid "profiler" msgstr "" -#: ../../library/sys.rst:919 ../../library/sys.rst:1546 +#: ../../library/sys.rst:919 ../../library/sys.rst:1549 msgid "trace function" msgstr "" -#: ../../library/sys.rst:919 ../../library/sys.rst:1546 +#: ../../library/sys.rst:919 ../../library/sys.rst:1549 msgid "debugger" msgstr "debugger(除錯器)" -#: ../../library/sys.rst:1286 +#: ../../library/sys.rst:1289 msgid "module" msgstr "module(模組)" -#: ../../library/sys.rst:1286 +#: ../../library/sys.rst:1289 msgid "search" msgstr "search(搜尋)" -#: ../../library/sys.rst:1286 +#: ../../library/sys.rst:1289 msgid "path" msgstr "path(路徑)" -#: ../../library/sys.rst:1427 +#: ../../library/sys.rst:1430 msgid "interpreter prompts" msgstr "interpreter prompts(直譯器提示)" -#: ../../library/sys.rst:1427 +#: ../../library/sys.rst:1430 msgid "prompts, interpreter" msgstr "prompts, interpreter(提示、直譯器)" -#: ../../library/sys.rst:1427 +#: ../../library/sys.rst:1430 msgid ">>>" msgstr ">>>" -#: ../../library/sys.rst:1427 +#: ../../library/sys.rst:1430 msgid "interpreter prompt" msgstr "interpreter prompt(直譯器提示)" -#: ../../library/sys.rst:1427 +#: ../../library/sys.rst:1430 msgid "..." msgstr "..." diff --git a/library/tarfile.po b/library/tarfile.po index e0119be62d..ff6104e5b7 100644 --- a/library/tarfile.po +++ b/library/tarfile.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-28 00:03+0000\n" +"POT-Creation-Date: 2024-01-13 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:12+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1081,71 +1081,95 @@ msgstr "" msgid "Group name." msgstr "" -#: ../../library/tarfile.rst:838 +#: ../../library/tarfile.rst:837 +msgid "Header checksum." +msgstr "" + +#: ../../library/tarfile.rst:842 +msgid "Device major number." +msgstr "" + +#: ../../library/tarfile.rst:847 +msgid "Device minor number." +msgstr "" + +#: ../../library/tarfile.rst:852 +msgid "The tar header starts here." +msgstr "" + +#: ../../library/tarfile.rst:857 +msgid "The file's data starts here." +msgstr "" + +#: ../../library/tarfile.rst:862 +msgid "Sparse member information." +msgstr "" + +#: ../../library/tarfile.rst:868 msgid "" "A dictionary containing key-value pairs of an associated pax extended header." msgstr "" -#: ../../library/tarfile.rst:846 +#: ../../library/tarfile.rst:876 msgid "" "Return a *new* copy of the :class:`!TarInfo` object with the given " "attributes changed. For example, to return a ``TarInfo`` with the group name " "set to ``'staff'``, use::" msgstr "" -#: ../../library/tarfile.rst:852 +#: ../../library/tarfile.rst:882 msgid "" "By default, a deep copy is made. If *deep* is false, the copy is shallow, i." "e. ``pax_headers`` and any custom attributes are shared with the original " "``TarInfo`` object." msgstr "" -#: ../../library/tarfile.rst:856 +#: ../../library/tarfile.rst:886 msgid "A :class:`TarInfo` object also provides some convenient query methods:" msgstr "" -#: ../../library/tarfile.rst:861 +#: ../../library/tarfile.rst:891 msgid "Return :const:`True` if the :class:`TarInfo` object is a regular file." msgstr "" -#: ../../library/tarfile.rst:866 +#: ../../library/tarfile.rst:896 msgid "Same as :meth:`isfile`." msgstr "" -#: ../../library/tarfile.rst:871 +#: ../../library/tarfile.rst:901 msgid "Return :const:`True` if it is a directory." msgstr "" -#: ../../library/tarfile.rst:876 +#: ../../library/tarfile.rst:906 msgid "Return :const:`True` if it is a symbolic link." msgstr "" -#: ../../library/tarfile.rst:881 +#: ../../library/tarfile.rst:911 msgid "Return :const:`True` if it is a hard link." msgstr "" -#: ../../library/tarfile.rst:886 +#: ../../library/tarfile.rst:916 msgid "Return :const:`True` if it is a character device." msgstr "" -#: ../../library/tarfile.rst:891 +#: ../../library/tarfile.rst:921 msgid "Return :const:`True` if it is a block device." msgstr "" -#: ../../library/tarfile.rst:896 +#: ../../library/tarfile.rst:926 msgid "Return :const:`True` if it is a FIFO." msgstr "" -#: ../../library/tarfile.rst:901 +#: ../../library/tarfile.rst:931 msgid "" "Return :const:`True` if it is one of character device, block device or FIFO." msgstr "" -#: ../../library/tarfile.rst:907 +#: ../../library/tarfile.rst:937 msgid "Extraction filters" msgstr "" -#: ../../library/tarfile.rst:911 +#: ../../library/tarfile.rst:941 msgid "" "The *tar* format is designed to capture all details of a UNIX-like " "filesystem, which makes it very powerful. Unfortunately, the features make " @@ -1155,66 +1179,66 @@ msgid "" "components, or symlinks that affect later members)." msgstr "" -#: ../../library/tarfile.rst:919 +#: ../../library/tarfile.rst:949 msgid "" "In most cases, the full functionality is not needed. Therefore, *tarfile* " "supports extraction filters: a mechanism to limit functionality, and thus " "mitigate some of the security issues." msgstr "" -#: ../../library/tarfile.rst:925 +#: ../../library/tarfile.rst:955 msgid ":pep:`706`" msgstr "" -#: ../../library/tarfile.rst:926 +#: ../../library/tarfile.rst:956 msgid "Contains further motivation and rationale behind the design." msgstr "" -#: ../../library/tarfile.rst:928 +#: ../../library/tarfile.rst:958 msgid "" "The *filter* argument to :meth:`TarFile.extract` or :meth:`~TarFile." "extractall` can be:" msgstr "" -#: ../../library/tarfile.rst:931 +#: ../../library/tarfile.rst:961 msgid "" "the string ``'fully_trusted'``: Honor all metadata as specified in the " "archive. Should be used if the user trusts the archive completely, or " "implements their own complex verification." msgstr "" -#: ../../library/tarfile.rst:936 +#: ../../library/tarfile.rst:966 msgid "" "the string ``'tar'``: Honor most *tar*-specific features (i.e. features of " "UNIX-like filesystems), but block features that are very likely to be " "surprising or malicious. See :func:`tar_filter` for details." msgstr "" -#: ../../library/tarfile.rst:940 +#: ../../library/tarfile.rst:970 msgid "" "the string ``'data'``: Ignore or block most features specific to UNIX-like " "filesystems. Intended for extracting cross-platform data archives. See :func:" "`data_filter` for details." msgstr "" -#: ../../library/tarfile.rst:944 +#: ../../library/tarfile.rst:974 msgid "``None`` (default): Use :attr:`TarFile.extraction_filter`." msgstr "" -#: ../../library/tarfile.rst:946 +#: ../../library/tarfile.rst:976 msgid "" "If that is also ``None`` (the default), raise a ``DeprecationWarning``, and " "fall back to the ``'fully_trusted'`` filter, whose dangerous behavior " "matches previous versions of Python." msgstr "" -#: ../../library/tarfile.rst:950 +#: ../../library/tarfile.rst:980 msgid "" "In Python 3.14, the ``'data'`` filter will become the default instead. It's " "possible to switch earlier; see :attr:`TarFile.extraction_filter`." msgstr "" -#: ../../library/tarfile.rst:953 +#: ../../library/tarfile.rst:983 msgid "" "A callable which will be called for each extracted member with a :ref:" "`TarInfo ` describing the member and the destination path " @@ -1222,23 +1246,23 @@ msgid "" "members)::" msgstr "" -#: ../../library/tarfile.rst:960 +#: ../../library/tarfile.rst:990 msgid "" "The callable is called just before each member is extracted, so it can take " "the current state of the disk into account. It can:" msgstr "" -#: ../../library/tarfile.rst:964 +#: ../../library/tarfile.rst:994 msgid "" "return a :class:`TarInfo` object which will be used instead of the metadata " "in the archive, or" msgstr "" -#: ../../library/tarfile.rst:966 +#: ../../library/tarfile.rst:996 msgid "return ``None``, in which case the member will be skipped, or" msgstr "" -#: ../../library/tarfile.rst:967 +#: ../../library/tarfile.rst:997 msgid "" "raise an exception to abort the operation or skip the member, depending on :" "attr:`~TarFile.errorlevel`. Note that when extraction is aborted, :meth:" @@ -1246,118 +1270,118 @@ msgid "" "attempt to clean up." msgstr "" -#: ../../library/tarfile.rst:973 +#: ../../library/tarfile.rst:1003 msgid "Default named filters" msgstr "" -#: ../../library/tarfile.rst:975 +#: ../../library/tarfile.rst:1005 msgid "" "The pre-defined, named filters are available as functions, so they can be " "reused in custom filters:" msgstr "" -#: ../../library/tarfile.rst:980 +#: ../../library/tarfile.rst:1010 msgid "Return *member* unchanged." msgstr "" -#: ../../library/tarfile.rst:982 +#: ../../library/tarfile.rst:1012 msgid "This implements the ``'fully_trusted'`` filter." msgstr "" -#: ../../library/tarfile.rst:986 +#: ../../library/tarfile.rst:1016 msgid "Implements the ``'tar'`` filter." msgstr "" -#: ../../library/tarfile.rst:988 +#: ../../library/tarfile.rst:1018 msgid "Strip leading slashes (``/`` and :data:`os.sep`) from filenames." msgstr "" -#: ../../library/tarfile.rst:989 +#: ../../library/tarfile.rst:1019 msgid "" ":ref:`Refuse ` to extract files with absolute " "paths (in case the name is absolute even after stripping slashes, e.g. ``C:/" "foo`` on Windows). This raises :class:`~tarfile.AbsolutePathError`." msgstr "" -#: ../../library/tarfile.rst:993 +#: ../../library/tarfile.rst:1023 msgid "" ":ref:`Refuse ` to extract files whose absolute " "path (after following symlinks) would end up outside the destination. This " "raises :class:`~tarfile.OutsideDestinationError`." msgstr "" -#: ../../library/tarfile.rst:996 +#: ../../library/tarfile.rst:1026 msgid "" "Clear high mode bits (setuid, setgid, sticky) and group/other write bits (:" "const:`~stat.S_IWGRP` | :const:`~stat.S_IWOTH`)." msgstr "" -#: ../../library/tarfile.rst:999 ../../library/tarfile.rst:1032 +#: ../../library/tarfile.rst:1029 ../../library/tarfile.rst:1062 msgid "Return the modified ``TarInfo`` member." msgstr "" -#: ../../library/tarfile.rst:1003 +#: ../../library/tarfile.rst:1033 msgid "" "Implements the ``'data'`` filter. In addition to what ``tar_filter`` does:" msgstr "" -#: ../../library/tarfile.rst:1006 +#: ../../library/tarfile.rst:1036 msgid "" ":ref:`Refuse ` to extract links (hard or soft) " "that link to absolute paths, or ones that link outside the destination." msgstr "" -#: ../../library/tarfile.rst:1009 +#: ../../library/tarfile.rst:1039 msgid "" "This raises :class:`~tarfile.AbsoluteLinkError` or :class:`~tarfile." "LinkOutsideDestinationError`." msgstr "" -#: ../../library/tarfile.rst:1012 +#: ../../library/tarfile.rst:1042 msgid "" "Note that such files are refused even on platforms that do not support " "symbolic links." msgstr "" -#: ../../library/tarfile.rst:1015 +#: ../../library/tarfile.rst:1045 msgid "" ":ref:`Refuse ` to extract device files (including " "pipes). This raises :class:`~tarfile.SpecialFileError`." msgstr "" -#: ../../library/tarfile.rst:1019 +#: ../../library/tarfile.rst:1049 msgid "For regular files, including hard links:" msgstr "" -#: ../../library/tarfile.rst:1021 +#: ../../library/tarfile.rst:1051 msgid "" "Set the owner read and write permissions (:const:`~stat.S_IRUSR` | :const:" "`~stat.S_IWUSR`)." msgstr "" -#: ../../library/tarfile.rst:1023 +#: ../../library/tarfile.rst:1053 msgid "" "Remove the group & other executable permission (:const:`~stat.S_IXGRP` | :" "const:`~stat.S_IXOTH`) if the owner doesn’t have it (:const:`~stat.S_IXUSR`)." msgstr "" -#: ../../library/tarfile.rst:1027 +#: ../../library/tarfile.rst:1057 msgid "" "For other files (directories), set ``mode`` to ``None``, so that extraction " "methods skip applying permission bits." msgstr "" -#: ../../library/tarfile.rst:1029 +#: ../../library/tarfile.rst:1059 msgid "" "Set user and group info (``uid``, ``gid``, ``uname``, ``gname``) to " "``None``, so that extraction methods skip setting it." msgstr "" -#: ../../library/tarfile.rst:1038 +#: ../../library/tarfile.rst:1068 msgid "Filter errors" msgstr "" -#: ../../library/tarfile.rst:1040 +#: ../../library/tarfile.rst:1070 msgid "" "When a filter refuses to extract a file, it will raise an appropriate " "exception, a subclass of :class:`~tarfile.FilterError`. This will abort the " @@ -1366,11 +1390,11 @@ msgid "" "continue." msgstr "" -#: ../../library/tarfile.rst:1048 +#: ../../library/tarfile.rst:1078 msgid "Hints for further verification" msgstr "" -#: ../../library/tarfile.rst:1050 +#: ../../library/tarfile.rst:1080 msgid "" "Even with ``filter='data'``, *tarfile* is not suited for extracting " "untrusted files without prior inspection. Among other issues, the pre-" @@ -1378,69 +1402,69 @@ msgid "" "additional checks." msgstr "" -#: ../../library/tarfile.rst:1055 +#: ../../library/tarfile.rst:1085 msgid "Here is an incomplete list of things to consider:" msgstr "" -#: ../../library/tarfile.rst:1057 +#: ../../library/tarfile.rst:1087 msgid "" "Extract to a :func:`new temporary directory ` to prevent e." "g. exploiting pre-existing links, and to make it easier to clean up after a " "failed extraction." msgstr "" -#: ../../library/tarfile.rst:1060 +#: ../../library/tarfile.rst:1090 msgid "" "When working with untrusted data, use external (e.g. OS-level) limits on " "disk, memory and CPU usage." msgstr "" -#: ../../library/tarfile.rst:1062 +#: ../../library/tarfile.rst:1092 msgid "" "Check filenames against an allow-list of characters (to filter out control " "characters, confusables, foreign path separators, etc.)." msgstr "" -#: ../../library/tarfile.rst:1065 +#: ../../library/tarfile.rst:1095 msgid "" "Check that filenames have expected extensions (discouraging files that " "execute when you “click on them”, or extension-less files like Windows " "special device names)." msgstr "" -#: ../../library/tarfile.rst:1067 +#: ../../library/tarfile.rst:1097 msgid "" "Limit the number of extracted files, total size of extracted data, filename " "length (including symlink length), and size of individual files." msgstr "" -#: ../../library/tarfile.rst:1069 +#: ../../library/tarfile.rst:1099 msgid "Check for files that would be shadowed on case-insensitive filesystems." msgstr "" -#: ../../library/tarfile.rst:1071 +#: ../../library/tarfile.rst:1101 msgid "Also note that:" msgstr "" -#: ../../library/tarfile.rst:1073 +#: ../../library/tarfile.rst:1103 msgid "" "Tar files may contain multiple versions of the same file. Later ones are " "expected to overwrite any earlier ones. This feature is crucial to allow " "updating tape archives, but can be abused maliciously." msgstr "" -#: ../../library/tarfile.rst:1077 +#: ../../library/tarfile.rst:1107 msgid "" "*tarfile* does not protect against issues with “live” data, e.g. an attacker " "tinkering with the destination (or source) directory while extraction (or " "archiving) is in progress." msgstr "" -#: ../../library/tarfile.rst:1083 +#: ../../library/tarfile.rst:1113 msgid "Supporting older Python versions" msgstr "" -#: ../../library/tarfile.rst:1085 +#: ../../library/tarfile.rst:1115 msgid "" "Extraction filters were added to Python 3.12, but may be backported to older " "versions as security updates. To check whether the feature is available, use " @@ -1448,163 +1472,163 @@ msgid "" "version." msgstr "" -#: ../../library/tarfile.rst:1090 +#: ../../library/tarfile.rst:1120 msgid "" "The following examples show how to support Python versions with and without " "the feature. Note that setting ``extraction_filter`` will affect any " "subsequent operations." msgstr "" -#: ../../library/tarfile.rst:1094 +#: ../../library/tarfile.rst:1124 msgid "Fully trusted archive::" msgstr "" -#: ../../library/tarfile.rst:1099 +#: ../../library/tarfile.rst:1129 msgid "" "Use the ``'data'`` filter if available, but revert to Python 3.11 behavior " "(``'fully_trusted'``) if this feature is not available::" msgstr "" -#: ../../library/tarfile.rst:1106 +#: ../../library/tarfile.rst:1136 msgid "Use the ``'data'`` filter; *fail* if it is not available::" msgstr "" -#: ../../library/tarfile.rst:1110 +#: ../../library/tarfile.rst:1140 msgid "or::" msgstr "" -#: ../../library/tarfile.rst:1115 +#: ../../library/tarfile.rst:1145 msgid "Use the ``'data'`` filter; *warn* if it is not available::" msgstr "" -#: ../../library/tarfile.rst:1126 +#: ../../library/tarfile.rst:1156 msgid "Stateful extraction filter example" msgstr "" -#: ../../library/tarfile.rst:1128 +#: ../../library/tarfile.rst:1158 msgid "" "While *tarfile*'s extraction methods take a simple *filter* callable, custom " "filters may be more complex objects with an internal state. It may be useful " "to write these as context managers, to be used like this::" msgstr "" -#: ../../library/tarfile.rst:1135 +#: ../../library/tarfile.rst:1165 msgid "Such a filter can be written as, for example::" msgstr "" -#: ../../library/tarfile.rst:1157 +#: ../../library/tarfile.rst:1187 msgid "Command-Line Interface" msgstr "" -#: ../../library/tarfile.rst:1161 +#: ../../library/tarfile.rst:1191 msgid "" "The :mod:`tarfile` module provides a simple command-line interface to " "interact with tar archives." msgstr "" -#: ../../library/tarfile.rst:1164 +#: ../../library/tarfile.rst:1194 msgid "" "If you want to create a new tar archive, specify its name after the :option:" "`-c` option and then list the filename(s) that should be included:" msgstr "" -#: ../../library/tarfile.rst:1171 +#: ../../library/tarfile.rst:1201 msgid "Passing a directory is also acceptable:" msgstr "" -#: ../../library/tarfile.rst:1177 +#: ../../library/tarfile.rst:1207 msgid "" "If you want to extract a tar archive into the current directory, use the :" "option:`-e` option:" msgstr "" -#: ../../library/tarfile.rst:1184 +#: ../../library/tarfile.rst:1214 msgid "" "You can also extract a tar archive into a different directory by passing the " "directory's name:" msgstr "" -#: ../../library/tarfile.rst:1191 +#: ../../library/tarfile.rst:1221 msgid "For a list of the files in a tar archive, use the :option:`-l` option:" msgstr "" -#: ../../library/tarfile.rst:1199 +#: ../../library/tarfile.rst:1229 msgid "Command-line options" msgstr "" -#: ../../library/tarfile.rst:1204 +#: ../../library/tarfile.rst:1234 msgid "List files in a tarfile." msgstr "" -#: ../../library/tarfile.rst:1209 +#: ../../library/tarfile.rst:1239 msgid "Create tarfile from source files." msgstr "" -#: ../../library/tarfile.rst:1214 +#: ../../library/tarfile.rst:1244 msgid "" "Extract tarfile into the current directory if *output_dir* is not specified." msgstr "" -#: ../../library/tarfile.rst:1219 +#: ../../library/tarfile.rst:1249 msgid "Test whether the tarfile is valid or not." msgstr "" -#: ../../library/tarfile.rst:1223 +#: ../../library/tarfile.rst:1253 msgid "Verbose output." msgstr "" -#: ../../library/tarfile.rst:1227 +#: ../../library/tarfile.rst:1257 msgid "" "Specifies the *filter* for ``--extract``. See :ref:`tarfile-extraction-" "filter` for details. Only string names are accepted (that is, " "``fully_trusted``, ``tar``, and ``data``)." msgstr "" -#: ../../library/tarfile.rst:1235 +#: ../../library/tarfile.rst:1265 msgid "Examples" msgstr "範例" -#: ../../library/tarfile.rst:1237 +#: ../../library/tarfile.rst:1267 msgid "How to extract an entire tar archive to the current working directory::" msgstr "" -#: ../../library/tarfile.rst:1244 +#: ../../library/tarfile.rst:1274 msgid "" "How to extract a subset of a tar archive with :meth:`TarFile.extractall` " "using a generator function instead of a list::" msgstr "" -#: ../../library/tarfile.rst:1259 +#: ../../library/tarfile.rst:1289 msgid "How to create an uncompressed tar archive from a list of filenames::" msgstr "" -#: ../../library/tarfile.rst:1267 +#: ../../library/tarfile.rst:1297 msgid "The same example using the :keyword:`with` statement::" msgstr "" -#: ../../library/tarfile.rst:1274 +#: ../../library/tarfile.rst:1304 msgid "" "How to read a gzip compressed tar archive and display some member " "information::" msgstr "" -#: ../../library/tarfile.rst:1288 +#: ../../library/tarfile.rst:1318 msgid "" "How to create an archive and reset the user information using the *filter* " "parameter in :meth:`TarFile.add`::" msgstr "" -#: ../../library/tarfile.rst:1304 +#: ../../library/tarfile.rst:1334 msgid "Supported tar formats" msgstr "" -#: ../../library/tarfile.rst:1306 +#: ../../library/tarfile.rst:1336 msgid "" "There are three tar formats that can be created with the :mod:`tarfile` " "module:" msgstr "" -#: ../../library/tarfile.rst:1308 +#: ../../library/tarfile.rst:1338 msgid "" "The POSIX.1-1988 ustar format (:const:`USTAR_FORMAT`). It supports filenames " "up to a length of at best 256 characters and linknames up to 100 characters. " @@ -1612,7 +1636,7 @@ msgid "" "supported format." msgstr "" -#: ../../library/tarfile.rst:1313 +#: ../../library/tarfile.rst:1343 msgid "" "The GNU tar format (:const:`GNU_FORMAT`). It supports long filenames and " "linknames, files bigger than 8 GiB and sparse files. It is the de facto " @@ -1620,7 +1644,7 @@ msgid "" "extensions for long names, sparse file support is read-only." msgstr "" -#: ../../library/tarfile.rst:1318 +#: ../../library/tarfile.rst:1348 msgid "" "The POSIX.1-2001 pax format (:const:`PAX_FORMAT`). It is the most flexible " "format with virtually no limits. It supports long filenames and linknames, " @@ -1631,7 +1655,7 @@ msgid "" "*ustar* format. It is the current default format for new archives." msgstr "" -#: ../../library/tarfile.rst:1326 +#: ../../library/tarfile.rst:1356 msgid "" "It extends the existing *ustar* format with extra headers for information " "that cannot be stored otherwise. There are two flavours of pax headers: " @@ -1640,13 +1664,13 @@ msgid "" "in a pax header is encoded in *UTF-8* for portability reasons." msgstr "" -#: ../../library/tarfile.rst:1332 +#: ../../library/tarfile.rst:1362 msgid "" "There are some more variants of the tar format which can be read, but not " "created:" msgstr "" -#: ../../library/tarfile.rst:1335 +#: ../../library/tarfile.rst:1365 msgid "" "The ancient V7 format. This is the first tar format from Unix Seventh " "Edition, storing only regular files and directories. Names must not be " @@ -1655,17 +1679,17 @@ msgid "" "ASCII characters." msgstr "" -#: ../../library/tarfile.rst:1340 +#: ../../library/tarfile.rst:1370 msgid "" "The SunOS tar extended format. This format is a variant of the POSIX.1-2001 " "pax format, but is not compatible." msgstr "" -#: ../../library/tarfile.rst:1346 +#: ../../library/tarfile.rst:1376 msgid "Unicode issues" msgstr "" -#: ../../library/tarfile.rst:1348 +#: ../../library/tarfile.rst:1378 msgid "" "The tar format was originally conceived to make backups on tape drives with " "the main focus on preserving file system information. Nowadays tar archives " @@ -1680,13 +1704,13 @@ msgid "" "It stores non-ASCII metadata using the universal character encoding *UTF-8*." msgstr "" -#: ../../library/tarfile.rst:1360 +#: ../../library/tarfile.rst:1390 msgid "" "The details of character conversion in :mod:`tarfile` are controlled by the " "*encoding* and *errors* keyword arguments of the :class:`TarFile` class." msgstr "" -#: ../../library/tarfile.rst:1363 +#: ../../library/tarfile.rst:1393 msgid "" "*encoding* defines the character encoding to use for the metadata in the " "archive. The default value is :func:`sys.getfilesystemencoding` or " @@ -1695,7 +1719,7 @@ msgid "" "not set appropriately, this conversion may fail." msgstr "" -#: ../../library/tarfile.rst:1369 +#: ../../library/tarfile.rst:1399 msgid "" "The *errors* argument defines how characters are treated that cannot be " "converted. Possible values are listed in section :ref:`error-handlers`. The " @@ -1703,7 +1727,7 @@ msgid "" "system calls, see :ref:`os-filenames`." msgstr "" -#: ../../library/tarfile.rst:1374 +#: ../../library/tarfile.rst:1404 msgid "" "For :const:`PAX_FORMAT` archives (the default), *encoding* is generally not " "needed because all the metadata is stored using *UTF-8*. *encoding* is only " diff --git a/library/tkinter.ttk.po b/library/tkinter.ttk.po index 12c07872d3..2c4f870eb0 100644 --- a/library/tkinter.ttk.po +++ b/library/tkinter.ttk.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-16 00:03+0000\n" +"POT-Creation-Date: 2024-01-18 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -52,7 +52,7 @@ msgstr "" #: ../../library/tkinter.ttk.rst:32 msgid "Using Ttk" -msgstr "" +msgstr "使用 Ttk" #: ../../library/tkinter.ttk.rst:34 msgid "To start using Ttk, import its module::" @@ -141,7 +141,7 @@ msgstr "" #: ../../library/tkinter.ttk.rst:103 msgid "Standard Options" -msgstr "" +msgstr "標準選項" #: ../../library/tkinter.ttk.rst:105 msgid "All the :mod:`ttk` Widgets accept the following options:" @@ -348,7 +348,7 @@ msgstr "" #: ../../library/tkinter.ttk.rst:209 msgid "Compatibility Options" -msgstr "" +msgstr "相容性選項" #: ../../library/tkinter.ttk.rst:216 ../../library/tkinter.ttk.rst:332 #: ../../library/tkinter.ttk.rst:507 @@ -892,7 +892,7 @@ msgstr "" #: ../../library/tkinter.ttk.rst:570 ../../library/tkinter.ttk.rst:608 msgid "See `Tab Options`_ for the list of available options." -msgstr "可用的選項清單請見 `Tab Options`_\\ 。" +msgstr "可用的選項清單請見 `Tab Options`_。" #: ../../library/tkinter.ttk.rst:575 msgid "" @@ -1735,8 +1735,8 @@ msgid "" msgstr "" #: ../../library/tkinter.ttk.rst:1121 -msgid "See `Item Options`_ for the list of available points." -msgstr "" +msgid "See `Item Options`_ for the list of available options." +msgstr "可用的選項清單請見 `Item Options`_。" #: ../../library/tkinter.ttk.rst:1126 msgid "Query or modify the options for the specified *item*." diff --git a/library/tty.po b/library/tty.po index 8b5d6b2845..bb82f857ca 100644 --- a/library/tty.po +++ b/library/tty.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-11-01 00:03+0000\n" +"POT-Creation-Date: 2024-01-22 00:03+0000\n" "PO-Revision-Date: 2021-12-17 17:00+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -60,8 +60,20 @@ msgid "" "by :func:`termios.tcgetattr`, to that of a tty in cbreak mode." msgstr "" +#: ../../library/tty.rst:38 +msgid "" +"This clears the ``ECHO`` and ``ICANON`` local mode flags in *mode* as well " +"as setting the minimum input to 1 byte with no delay." +msgstr "" + #: ../../library/tty.rst:43 msgid "" +"The ``ICRNL`` flag is no longer cleared. This matches Linux and macOS ``stty " +"cbreak`` behavior and what :func:`setcbreak` historically did." +msgstr "" + +#: ../../library/tty.rst:50 +msgid "" "Change the mode of the file descriptor *fd* to raw. If *when* is omitted, it " "defaults to :const:`termios.TCSAFLUSH`, and is passed to :func:`termios." "tcsetattr`. The return value of :func:`termios.tcgetattr` is saved before " @@ -72,11 +84,11 @@ msgstr "" "tcgetattr` 的回傳值會在設定 *fd* 模式為 raw 之前先儲存起來。此函數回傳這個" "值。" -#: ../../library/tty.rst:48 ../../library/tty.rst:59 +#: ../../library/tty.rst:55 ../../library/tty.rst:69 msgid "The return value is now the original tty attributes, instead of None." msgstr "現在的回傳值為原本的 tty 屬性,而不是 None。" -#: ../../library/tty.rst:54 +#: ../../library/tty.rst:61 msgid "" "Change the mode of file descriptor *fd* to cbreak. If *when* is omitted, it " "defaults to :const:`termios.TCSAFLUSH`, and is passed to :func:`termios." @@ -88,10 +100,23 @@ msgstr "" "tcgetattr` 的回傳值會在設定 *fd* 模式為 raw 之前先儲存起來。此函數回傳這個" "值。" -#: ../../library/tty.rst:65 +#: ../../library/tty.rst:66 +msgid "" +"This clears the ``ECHO`` and ``ICANON`` local mode flags as well as setting " +"the minimum input to 1 byte with no delay." +msgstr "" + +#: ../../library/tty.rst:72 +msgid "" +"The ``ICRNL`` flag is no longer cleared. This restores the behavior of " +"Python 3.11 and earlier as well as matching what Linux, macOS, & BSDs " +"describe in their ``stty(1)`` man pages regarding cbreak mode." +msgstr "" + +#: ../../library/tty.rst:80 msgid "Module :mod:`termios`" msgstr ":mod:`termios` 模組" -#: ../../library/tty.rst:66 +#: ../../library/tty.rst:81 msgid "Low-level terminal control interface." msgstr "低階終端機控制介面。" diff --git a/library/types.po b/library/types.po index c9c72684d0..88b403ea70 100644 --- a/library/types.po +++ b/library/types.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-10 00:03+0000\n" +"POT-Creation-Date: 2024-01-25 06:20+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -442,117 +442,125 @@ msgid "" "modules." msgstr "" -#: ../../library/types.rst:401 +#: ../../library/types.rst:399 +msgid "" +"In addition, when a class is defined with a :attr:`~object.__slots__` " +"attribute, then for each slot, an instance of :class:`!MemberDescriptorType` " +"will be added as an attribute on the class. This allows the slot to appear " +"in the class's :attr:`~object.__dict__`." +msgstr "" + +#: ../../library/types.rst:405 msgid "" "In other implementations of Python, this type may be identical to " "``GetSetDescriptorType``." msgstr "" -#: ../../library/types.rst:406 +#: ../../library/types.rst:410 msgid "" "Read-only proxy of a mapping. It provides a dynamic view on the mapping's " "entries, which means that when the mapping changes, the view reflects these " "changes." msgstr "" -#: ../../library/types.rst:414 +#: ../../library/types.rst:418 msgid "" "Updated to support the new union (``|``) operator from :pep:`584`, which " "simply delegates to the underlying mapping." msgstr "" -#: ../../library/types.rst:419 +#: ../../library/types.rst:423 msgid "" "Return ``True`` if the underlying mapping has a key *key*, else ``False``." msgstr "" -#: ../../library/types.rst:424 +#: ../../library/types.rst:428 msgid "" "Return the item of the underlying mapping with key *key*. Raises a :exc:" "`KeyError` if *key* is not in the underlying mapping." msgstr "" -#: ../../library/types.rst:429 +#: ../../library/types.rst:433 msgid "" "Return an iterator over the keys of the underlying mapping. This is a " "shortcut for ``iter(proxy.keys())``." msgstr "" -#: ../../library/types.rst:434 +#: ../../library/types.rst:438 msgid "Return the number of items in the underlying mapping." msgstr "" -#: ../../library/types.rst:438 +#: ../../library/types.rst:442 msgid "Return a shallow copy of the underlying mapping." msgstr "" -#: ../../library/types.rst:442 +#: ../../library/types.rst:446 msgid "" "Return the value for *key* if *key* is in the underlying mapping, else " "*default*. If *default* is not given, it defaults to ``None``, so that this " "method never raises a :exc:`KeyError`." msgstr "" -#: ../../library/types.rst:448 +#: ../../library/types.rst:452 msgid "" "Return a new view of the underlying mapping's items (``(key, value)`` pairs)." msgstr "" -#: ../../library/types.rst:453 +#: ../../library/types.rst:457 msgid "Return a new view of the underlying mapping's keys." msgstr "" -#: ../../library/types.rst:457 +#: ../../library/types.rst:461 msgid "Return a new view of the underlying mapping's values." msgstr "" -#: ../../library/types.rst:461 +#: ../../library/types.rst:465 msgid "Return a reverse iterator over the keys of the underlying mapping." msgstr "" -#: ../../library/types.rst:467 +#: ../../library/types.rst:471 msgid "Return a hash of the underlying mapping." msgstr "" -#: ../../library/types.rst:473 +#: ../../library/types.rst:477 msgid "Additional Utility Classes and Functions" msgstr "" -#: ../../library/types.rst:477 +#: ../../library/types.rst:481 msgid "" "A simple :class:`object` subclass that provides attribute access to its " "namespace, as well as a meaningful repr." msgstr "" -#: ../../library/types.rst:480 +#: ../../library/types.rst:484 msgid "" "Unlike :class:`object`, with ``SimpleNamespace`` you can add and remove " "attributes. If a ``SimpleNamespace`` object is initialized with keyword " "arguments, those are directly added to the underlying namespace." msgstr "" -#: ../../library/types.rst:484 +#: ../../library/types.rst:488 msgid "The type is roughly equivalent to the following code::" msgstr "" -#: ../../library/types.rst:499 +#: ../../library/types.rst:503 msgid "" "``SimpleNamespace`` may be useful as a replacement for ``class NS: pass``. " "However, for a structured record type use :func:`~collections.namedtuple` " "instead." msgstr "" -#: ../../library/types.rst:505 +#: ../../library/types.rst:509 msgid "" "Attribute order in the repr changed from alphabetical to insertion (like " "``dict``)." msgstr "" -#: ../../library/types.rst:511 +#: ../../library/types.rst:515 msgid "Route attribute access on a class to __getattr__." msgstr "" -#: ../../library/types.rst:513 +#: ../../library/types.rst:517 msgid "" "This is a descriptor, used to define attributes that act differently when " "accessed through an instance and through a class. Instance access remains " @@ -560,18 +568,18 @@ msgid "" "class's __getattr__ method; this is done by raising AttributeError." msgstr "" -#: ../../library/types.rst:518 +#: ../../library/types.rst:522 msgid "" "This allows one to have properties active on an instance, and have virtual " "attributes on the class with the same name (see :class:`enum.Enum` for an " "example)." msgstr "" -#: ../../library/types.rst:525 +#: ../../library/types.rst:529 msgid "Coroutine Utility Functions" msgstr "" -#: ../../library/types.rst:529 +#: ../../library/types.rst:533 msgid "" "This function transforms a :term:`generator` function into a :term:" "`coroutine function` which returns a generator-based coroutine. The " @@ -581,11 +589,11 @@ msgid "" "method." msgstr "" -#: ../../library/types.rst:536 +#: ../../library/types.rst:540 msgid "If *gen_func* is a generator function, it will be modified in-place." msgstr "" -#: ../../library/types.rst:538 +#: ../../library/types.rst:542 msgid "" "If *gen_func* is not a generator function, it will be wrapped. If it returns " "an instance of :class:`collections.abc.Generator`, the instance will be " diff --git a/library/unittest.mock.po b/library/unittest.mock.po index 132e1a924f..11966b7545 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -1910,9 +1910,9 @@ msgstr "" #: ../../library/unittest.mock.rst:1962 msgid "" -":class:`Mock` supports mocking the Python protocol methods, also known as " -"\"magic methods\". This allows mock objects to replace containers or other " -"objects that implement Python protocols." +":class:`Mock` supports mocking the Python protocol methods, also known as :" +"term:`\"magic methods\" `. This allows mock objects to replace " +"containers or other objects that implement Python protocols." msgstr "" #: ../../library/unittest.mock.rst:1966 @@ -2062,8 +2062,8 @@ msgstr "" #: ../../library/unittest.mock.rst:2061 msgid "" "``MagicMock`` is a subclass of :class:`Mock` with default implementations of " -"most of the magic methods. You can use ``MagicMock`` without having to " -"configure the magic methods yourself." +"most of the :term:`magic methods `. You can use ``MagicMock`` " +"without having to configure the magic methods yourself." msgstr "" #: ../../library/unittest.mock.rst:2065 diff --git a/library/unittest.po b/library/unittest.po index 7c72d0789e..b14166b8cd 100644 --- a/library/unittest.po +++ b/library/unittest.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-18 00:03+0000\n" +"POT-Creation-Date: 2024-01-24 00:03+0000\n" "PO-Revision-Date: 2022-10-16 06:03+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2617,8 +2617,8 @@ msgid "" msgstr "" #: ../../library/unittest.rst:2191 -msgid "Added *durations* keyword argument." -msgstr "新增 *durations* 關鍵字引數。" +msgid "Added the *durations* keyword parameter." +msgstr "新增 *durations* 關鍵字參數。" #: ../../library/unittest.rst:2196 msgid "" @@ -2723,7 +2723,7 @@ msgid "" "The *testRunner* argument can either be a test runner class or an already " "created instance of it. By default ``main`` calls :func:`sys.exit` with an " "exit code indicating success (0) or failure (1) of the tests run. An exit " -"code of 5 indicates that no tests were run." +"code of 5 indicates that no tests were run or skipped." msgstr "" #: ../../library/unittest.rst:2287 @@ -3061,78 +3061,3 @@ msgid "" "it has been installed. This function can also be used as a test decorator to " "temporarily remove the handler while the test is being executed::" msgstr "" - -#~ msgid ":meth:`.assertEqual`" -#~ msgstr ":meth:`.assertEqual`" - -#~ msgid "failUnlessEqual" -#~ msgstr "failUnlessEqual" - -#~ msgid "assertEquals" -#~ msgstr "assertEquals" - -#~ msgid ":meth:`.assertNotEqual`" -#~ msgstr ":meth:`.assertNotEqual`" - -#~ msgid "failIfEqual" -#~ msgstr "failIfEqual" - -#~ msgid "assertNotEquals" -#~ msgstr "assertNotEquals" - -#~ msgid ":meth:`.assertTrue`" -#~ msgstr ":meth:`.assertTrue`" - -#~ msgid "failUnless" -#~ msgstr "failUnless" - -#~ msgid "assert\\_" -#~ msgstr "assert\\_" - -#~ msgid ":meth:`.assertFalse`" -#~ msgstr ":meth:`.assertFalse`" - -#~ msgid "failIf" -#~ msgstr "failIf" - -#~ msgid ":meth:`.assertRaises`" -#~ msgstr ":meth:`.assertRaises`" - -#~ msgid "failUnlessRaises" -#~ msgstr "failUnlessRaises" - -#~ msgid ":meth:`.assertAlmostEqual`" -#~ msgstr ":meth:`.assertAlmostEqual`" - -#~ msgid "failUnlessAlmostEqual" -#~ msgstr "failUnlessAlmostEqual" - -#~ msgid "assertAlmostEquals" -#~ msgstr "assertAlmostEquals" - -#~ msgid ":meth:`.assertNotAlmostEqual`" -#~ msgstr ":meth:`.assertNotAlmostEqual`" - -#~ msgid "failIfAlmostEqual" -#~ msgstr "failIfAlmostEqual" - -#~ msgid "assertNotAlmostEquals" -#~ msgstr "assertNotAlmostEquals" - -#~ msgid ":meth:`.assertRegex`" -#~ msgstr ":meth:`.assertRegex`" - -#~ msgid "assertRegexpMatches" -#~ msgstr "assertRegexpMatches" - -#~ msgid ":meth:`.assertNotRegex`" -#~ msgstr ":meth:`.assertNotRegex`" - -#~ msgid "assertNotRegexpMatches" -#~ msgstr "assertNotRegexpMatches" - -#~ msgid ":meth:`.assertRaisesRegex`" -#~ msgstr ":meth:`.assertRaisesRegex`" - -#~ msgid "assertRaisesRegexp" -#~ msgstr "assertRaisesRegexp" diff --git a/library/urllib.parse.po b/library/urllib.parse.po index 633427da03..782e24688f 100644 --- a/library/urllib.parse.po +++ b/library/urllib.parse.po @@ -1,5 +1,4 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -7,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2024-01-24 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -876,8 +875,8 @@ msgid "*query* supports bytes and string objects." msgstr "" #: ../../library/urllib.parse.rst:732 -msgid "*quote_via* parameter." -msgstr "" +msgid "Added the *quote_via* parameter." +msgstr "新增 *quote_via* 參數。" #: ../../library/urllib.parse.rst:740 msgid "`WHATWG`_ - URL Living standard" diff --git a/library/urllib.request.po b/library/urllib.request.po index c644428463..0937803bc7 100644 --- a/library/urllib.request.po +++ b/library/urllib.request.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-17 00:04+0000\n" +"POT-Creation-Date: 2024-01-15 00:03+0000\n" "PO-Revision-Date: 2022-04-21 17:59+0800\n" "Last-Translator: Jordan Su \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -185,12 +185,12 @@ msgstr "" #: ../../library/urllib.request.rst:88 msgid "" "In addition, if proxy settings are detected (for example, when a ``*_proxy`` " -"environment variable like :envvar:`http_proxy` is set), :class:" +"environment variable like :envvar:`!http_proxy` is set), :class:" "`ProxyHandler` is default installed and makes sure the requests are handled " "through the proxy." msgstr "" -"另外,若有偵測到代理服務的設定(例如當 ``*_proxy`` 環境變數像是:\\ :envvar:" -"`http_proxy` 有被設置時),:class:`ProxyHandler` 會被預設使用以確保請求有透過" +"另外,若有偵測到代理服務的設定(例如當 ``*_proxy`` 環境變數像是::envvar:!" +"http_proxy` 有被設置時),:class:`ProxyHandler` 會被預設使用以確保請求有透過" "代理服務來處理。" #: ../../library/urllib.request.rst:93 @@ -251,11 +251,11 @@ msgstr "*context* 被新增。" msgid "" "HTTPS connection now send an ALPN extension with protocol indicator " "``http/1.1`` when no *context* is given. Custom *context* should set ALPN " -"protocols with :meth:`~ssl.SSLContext.set_alpn_protocol`." +"protocols with :meth:`~ssl.SSLContext.set_alpn_protocols`." msgstr "" "當 *context* 沒有被指定時,HTTPS 連線現在會傳送一個帶有協定指示器 " "``http/1.1`` 的 ALPN 擴充 (extension)。自訂的 *context* 應該利用 :meth:`~ssl." -"SSLContext.set_alpn_protocol` 來自行設定 ALPN 協定。" +"SSLContext.set_alpn_protocols` 來自行設定 ALPN 協定。" #: ../../library/urllib.request.rst:128 msgid "" @@ -880,7 +880,7 @@ msgstr "" #: ../../library/urllib.request.rst:632 msgid "" -":meth:`_open` --- signal that the handler knows how to open " +":meth:`!_open` --- signal that the handler knows how to open " "*protocol* URLs." msgstr "" @@ -890,7 +890,7 @@ msgstr "更多資訊請見 |protocol_open|_\\ 。" #: ../../library/urllib.request.rst:637 msgid "" -":meth:`http_error_\\` --- signal that the handler knows how to " +":meth:`!http_error_\\` --- signal that the handler knows how to " "handle HTTP errors with HTTP error code *type*." msgstr "" @@ -900,13 +900,13 @@ msgstr "更多資訊請見 |http_error_nnn|_\\ 。" #: ../../library/urllib.request.rst:642 msgid "" -":meth:`_error` --- signal that the handler knows how to handle " +":meth:`!_error` --- signal that the handler knows how to handle " "errors from (non-\\ ``http``) *protocol*." msgstr "" #: ../../library/urllib.request.rst:645 msgid "" -":meth:`_request` --- signal that the handler knows how to pre-" +":meth:`!_request` --- signal that the handler knows how to pre-" "process *protocol* requests." msgstr "" @@ -916,7 +916,7 @@ msgstr "更多資訊請見 |protocol_request|_\\ 。" #: ../../library/urllib.request.rst:650 msgid "" -":meth:`_response` --- signal that the handler knows how to post-" +":meth:`!_response` --- signal that the handler knows how to post-" "process *protocol* responses." msgstr "" @@ -941,8 +941,8 @@ msgid "" "Handle an error of the given protocol. This will call the registered error " "handlers for the given protocol with the given arguments (which are protocol " "specific). The HTTP protocol is a special case which uses the HTTP response " -"code to determine the specific error handler; refer to the :meth:" -"`http_error_\\` methods of the handler classes." +"code to determine the specific error handler; refer to the :meth:`!" +"http_error_\\` methods of the handler classes." msgstr "" #: ../../library/urllib.request.rst:680 @@ -962,13 +962,13 @@ msgstr "" #: ../../library/urllib.request.rst:687 msgid "" -"Every handler with a method named like :meth:`_request` has that " +"Every handler with a method named like :meth:`!_request` has that " "method called to pre-process the request." msgstr "" #: ../../library/urllib.request.rst:690 msgid "" -"Handlers with a method named like :meth:`_open` are called to " +"Handlers with a method named like :meth:`!_open` are called to " "handle the request. This stage ends when a handler either returns a non-\\ :" "const:`None` value (ie. a response), or raises an exception (usually :exc:" "`~urllib.error.URLError`). Exceptions are allowed to propagate." @@ -977,10 +977,10 @@ msgstr "" #: ../../library/urllib.request.rst:695 msgid "" "In fact, the above algorithm is first tried for methods named :meth:" -"`default_open`. If all such methods return :const:`None`, the algorithm is " -"repeated for methods named like :meth:`_open`. If all such " -"methods return :const:`None`, the algorithm is repeated for methods named :" -"meth:`unknown_open`." +"`~BaseHandler.default_open`. If all such methods return :const:`None`, the " +"algorithm is repeated for methods named like :meth:`!_open`. If " +"all such methods return :const:`None`, the algorithm is repeated for methods " +"named :meth:`~BaseHandler.unknown_open`." msgstr "" #: ../../library/urllib.request.rst:701 @@ -992,7 +992,7 @@ msgstr "" #: ../../library/urllib.request.rst:705 msgid "" -"Every handler with a method named like :meth:`_response` has that " +"Every handler with a method named like :meth:`!_response` has that " "method called to post-process the response." msgstr "" @@ -1047,7 +1047,7 @@ msgid "" "return value of the :meth:`~OpenerDirector.open` method of :class:" "`OpenerDirector`, or ``None``. It should raise :exc:`~urllib.error." "URLError`, unless a truly exceptional thing happens (for example, :exc:" -"`MemoryError` should not be mapped to :exc:`URLError`)." +"`MemoryError` should not be mapped to :exc:`~urllib.error.URLError`)." msgstr "" #: ../../library/urllib.request.rst:756 @@ -1064,7 +1064,7 @@ msgstr "" msgid "" "This method, if defined, will be called by the parent :class:" "`OpenerDirector`. Return values should be the same as for :meth:" -"`default_open`." +"`~BaseHandler.default_open`." msgstr "" #: ../../library/urllib.request.rst:772 @@ -1118,7 +1118,7 @@ msgstr "" #: ../../library/urllib.request.rst:806 msgid "" "Arguments, return values and exceptions raised should be the same as for :" -"meth:`http_error_default`." +"meth:`~BaseHandler.http_error_default`." msgstr "" #: ../../library/urllib.request.rst:814 @@ -1162,9 +1162,9 @@ msgstr "" #: ../../library/urllib.request.rst:847 msgid "" -"An :class:`HTTPError` exception raised as a security consideration if the " -"HTTPRedirectHandler is presented with a redirected URL which is not an HTTP, " -"HTTPS or FTP URL." +"An :exc:`~urllib.error.HTTPError` exception raised as a security " +"consideration if the HTTPRedirectHandler is presented with a redirected URL " +"which is not an HTTP, HTTPS or FTP URL." msgstr "" #: ../../library/urllib.request.rst:854 @@ -1236,7 +1236,7 @@ msgstr "ProxyHandler 物件" #: ../../library/urllib.request.rst:924 msgid "" -"The :class:`ProxyHandler` will have a method :meth:`_open` for " +"The :class:`ProxyHandler` will have a method :meth:`!_open` for " "every *protocol* which has a proxy in the *proxies* dictionary given in the " "constructor. The method will modify requests to go through the proxy, by " "calling ``request.set_proxy()``, and call the next handler in the chain to " @@ -1456,8 +1456,8 @@ msgstr "" #: ../../library/urllib.request.rst:1179 msgid "" -"For non-200 error codes, this simply passes the job on to the :meth:" -"`http_error_\\` handler methods, via :meth:`OpenerDirector.error`. " +"For non-200 error codes, this simply passes the job on to the :meth:`!" +"http_error_\\` handler methods, via :meth:`OpenerDirector.error`. " "Eventually, :class:`HTTPDefaultErrorHandler` will raise an :exc:`~urllib." "error.HTTPError` if no other handler handles the error." msgstr "" @@ -1538,7 +1538,7 @@ msgid "" ":func:`build_opener` provides many handlers by default, including a :class:" "`ProxyHandler`. By default, :class:`ProxyHandler` uses the environment " "variables named ``_proxy``, where ```` is the URL scheme " -"involved. For example, the :envvar:`http_proxy` environment variable is " +"involved. For example, the :envvar:`!http_proxy` environment variable is " "read to obtain the HTTP proxy's URL." msgstr "" @@ -1612,8 +1612,8 @@ msgid "" "a local file, the object will not be copied unless filename is supplied. " "Return a tuple ``(filename, headers)`` where *filename* is the local file " "name under which the object can be found, and *headers* is whatever the :" -"meth:`info` method of the object returned by :func:`urlopen` returned (for a " -"remote object). Exceptions are the same as for :func:`urlopen`." +"meth:`!info` method of the object returned by :func:`urlopen` returned (for " +"a remote object). Exceptions are the same as for :func:`urlopen`." msgstr "" #: ../../library/urllib.request.rst:1385 @@ -1643,10 +1643,10 @@ msgstr "" #: ../../library/urllib.request.rst:1407 msgid "" -":func:`urlretrieve` will raise :exc:`ContentTooShortError` when it detects " -"that the amount of data available was less than the expected amount (which " -"is the size reported by a *Content-Length* header). This can occur, for " -"example, when the download is interrupted." +":func:`urlretrieve` will raise :exc:`~urllib.error.ContentTooShortError` " +"when it detects that the amount of data available was less than the " +"expected amount (which is the size reported by a *Content-Length* header). " +"This can occur, for example, when the download is interrupted." msgstr "" #: ../../library/urllib.request.rst:1412 @@ -1658,8 +1658,8 @@ msgstr "" #: ../../library/urllib.request.rst:1416 msgid "" -"You can still retrieve the downloaded data in this case, it is stored in " -"the :attr:`content` attribute of the exception instance." +"You can still retrieve the downloaded data in this case, it is stored in " +"the :attr:`!content` attribute of the exception instance." msgstr "" #: ../../library/urllib.request.rst:1419 @@ -1778,9 +1778,9 @@ msgstr "" #: ../../library/urllib.request.rst:1511 msgid "" -"For all other response codes, the method :meth:`http_error_default` is " -"called which you can override in subclasses to handle the error " -"appropriately." +"For all other response codes, the method :meth:`~BaseHandler." +"http_error_default` is called which you can override in subclasses to handle " +"the error appropriately." msgstr "" #: ../../library/urllib.request.rst:1516 diff --git a/library/xml.etree.elementtree.po b/library/xml.etree.elementtree.po index 6985eb992d..b39b496430 100644 --- a/library/xml.etree.elementtree.po +++ b/library/xml.etree.elementtree.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-11-01 00:03+0000\n" +"POT-Creation-Date: 2024-01-24 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:16+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -746,13 +746,13 @@ msgstr "" #: ../../library/xml.etree.elementtree.rst:708 #: ../../library/xml.etree.elementtree.rst:735 #: ../../library/xml.etree.elementtree.rst:1192 -msgid "The *short_empty_elements* parameter." -msgstr "*short_empty_elements* 參數。" +msgid "Added the *short_empty_elements* parameter." +msgstr "新增 *short_empty_elements* 參數。" #: ../../library/xml.etree.elementtree.rst:711 #: ../../library/xml.etree.elementtree.rst:738 -msgid "The *xml_declaration* and *default_namespace* parameters." -msgstr "" +msgid "Added the *xml_declaration* and *default_namespace* parameters." +msgstr "新增 *xml_declaration* 與 *default_namespace* 參數。" #: ../../library/xml.etree.elementtree.rst:714 msgid "" @@ -883,12 +883,12 @@ msgid "" msgstr "" #: ../../library/xml.etree.elementtree.rst:861 -msgid "The *base_url* and *max_depth* parameters." -msgstr "" +msgid "Added the *base_url* and *max_depth* parameters." +msgstr "新增 *base_url* 與 *max_depth* 參數。" #: ../../library/xml.etree.elementtree.rst:868 msgid "Element Objects" -msgstr "" +msgstr "Element 物件" #: ../../library/xml.etree.elementtree.rst:875 msgid "" diff --git a/library/xml.sax.utils.po b/library/xml.sax.utils.po index 8e0656a690..8f823a553e 100644 --- a/library/xml.sax.utils.po +++ b/library/xml.sax.utils.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 10:36+0000\n" +"POT-Creation-Date: 2024-01-24 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:16+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -97,8 +97,8 @@ msgid "" msgstr "" #: ../../library/xml.sax.utils.rst:74 -msgid "The *short_empty_elements* parameter." -msgstr "*short_empty_elements* 參數。" +msgid "Added the *short_empty_elements* parameter." +msgstr "新增 *short_empty_elements* 參數。" #: ../../library/xml.sax.utils.rst:80 msgid "" diff --git a/library/zipapp.po b/library/zipapp.po index ca5c1d6912..464f10471a 100644 --- a/library/zipapp.po +++ b/library/zipapp.po @@ -1,5 +1,4 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -7,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-09-13 00:03+0000\n" +"POT-Creation-Date: 2024-01-24 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:16+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -20,7 +19,7 @@ msgstr "" #: ../../library/zipapp.rst:2 msgid ":mod:`zipapp` --- Manage executable Python zip archives" -msgstr "" +msgstr ":mod:`zipapp` — 管理可執行的 Python zip 封存檔案" #: ../../library/zipapp.rst:9 msgid "**Source code:** :source:`Lib/zipapp.py`" @@ -234,8 +233,8 @@ msgid "" msgstr "" #: ../../library/zipapp.rst:174 -msgid "Added the *filter* and *compressed* arguments." -msgstr "新增 *filter* 與 *compressed* 引數。" +msgid "Added the *filter* and *compressed* parameters." +msgstr "新增 *filter* 與 *compressed* 參數。" #: ../../library/zipapp.rst:179 msgid "" diff --git a/library/zipfile.po b/library/zipfile.po index 311b00b85b..0f4385d4a1 100644 --- a/library/zipfile.po +++ b/library/zipfile.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2024-01-24 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:16+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -283,8 +283,8 @@ msgstr "" msgid "Add the *compresslevel* parameter." msgstr "" -#: ../../library/zipfile.rst:239 ../../library/zipfile.rst:746 -msgid "The *strict_timestamps* keyword-only argument" +#: ../../library/zipfile.rst:239 +msgid "The *strict_timestamps* keyword-only parameter." msgstr "" #: ../../library/zipfile.rst:242 @@ -735,8 +735,8 @@ msgid "" msgstr "" #: ../../library/zipfile.rst:645 -msgid "The *optimize* parameter." -msgstr "*optimize* 參數。" +msgid "Added the *optimize* parameter." +msgstr "新增 *optimize* 參數。" #: ../../library/zipfile.rst:651 msgid "" @@ -795,8 +795,8 @@ msgid "The :meth:`writepy` method makes archives with file names like this::" msgstr "" #: ../../library/zipfile.rst:701 -msgid "The *filterfunc* parameter." -msgstr "*filterfunc* 參數。" +msgid "Added the *filterfunc* parameter." +msgstr "新增 *filterfunc* 參數。" #: ../../library/zipfile.rst:704 msgid "The *pathname* parameter accepts a :term:`path-like object`." @@ -844,6 +844,10 @@ msgstr "" msgid "The *filename* parameter accepts a :term:`path-like object`." msgstr "" +#: ../../library/zipfile.rst:746 +msgid "Added the *strict_timestamps* keyword-only parameter." +msgstr "新增 *strict_timestamps* 僅限關鍵字參數。" + #: ../../library/zipfile.rst:750 msgid "Instances have the following methods and attributes:" msgstr "" diff --git a/license.po b/license.po index 25935edd95..e8401347d3 100644 --- a/license.po +++ b/license.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-20 15:45+0000\n" +"POT-Creation-Date: 2024-01-15 00:03+0000\n" "PO-Revision-Date: 2022-06-27 09:40+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -240,8 +240,7 @@ msgstr "關於存取或以其他方式使用 Python 的合約條款" msgid "" "Python software and documentation are licensed under the :ref:`PSF License " "Agreement `." -msgstr "" -"Python 軟體和說明文件的授權是基於 :ref:`PSF 授權合約 `\\ 。" +msgstr "Python 軟體和說明文件的授權是基於 :ref:`PSF 授權合約 `。" #: ../../license.rst:78 msgid "" @@ -250,7 +249,7 @@ msgid "" "`Zero-Clause BSD license `." msgstr "" "從 Python 3.8.6 開始,說明文件中的範例、程式庫和其他程式碼,是被雙重授權 " -"(dual licensed) 於 PSF 授權合約以及 :ref:`Zero-Clause BSD 授權 `\\ 。" +"(dual licensed) 於 PSF 授權合約以及 :ref:`Zero-Clause BSD 授權 `。" #: ../../license.rst:82 msgid "" @@ -259,7 +258,7 @@ msgid "" "`OtherLicenses` for an incomplete list of these licenses." msgstr "" "有些被納入 Python 中的軟體是基於不同的授權。這些授權將會與其授權之程式碼一起" -"被列出。關於這些授權的不完整清單,請參閱\\ :ref:`OtherLicenses`\\ 。" +"被列出。關於這些授權的不完整清單,請參閱\\ :ref:`OtherLicenses`。" #: ../../license.rst:90 msgid "PSF LICENSE AGREEMENT FOR PYTHON |release|" @@ -311,9 +310,7 @@ msgid "" msgstr "" ":mod:`random` 模組底下的 :mod:`!_random` C 擴充程式包含了以 http://www.math." "sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/emt19937ar.html 的下載內容為基礎的程式" -"碼。以下是原始程式碼的完整聲明:\n" -"\n" -"::" +"碼。以下是原始程式碼的完整聲明: ::" #: ../../license.rst:353 msgid "Sockets" @@ -327,9 +324,7 @@ msgid "" msgstr "" ":mod:`socket` 模組使用 :c:func:`!getaddrinfo` 和 :c:func:`!getnameinfo` 函" "式,它們在 WIDE 專案(https://www.wide.ad.jp/)內,於不同的原始檔案中被編" -"碼:\n" -"\n" -"::" +"碼: ::" #: ../../license.rst:388 msgid "Asynchronous socket services" @@ -341,9 +336,7 @@ msgid "" "contain the following notice::" msgstr "" ":mod:`!test.support.asynchat` 和 :mod:`!test.support.asyncore` 模組包含以下聲" -"明:\n" -"\n" -"::" +"明: ::" #: ../../license.rst:416 msgid "Cookie management" @@ -351,10 +344,7 @@ msgstr "Cookie 管理" #: ../../license.rst:418 msgid "The :mod:`http.cookies` module contains the following notice::" -msgstr "" -":mod:`http.cookies` 模組包含以下聲明:\n" -"\n" -"::" +msgstr ":mod:`http.cookies` 模組包含以下聲明: ::" #: ../../license.rst:444 msgid "Execution tracing" @@ -362,10 +352,7 @@ msgstr "執行追蹤" #: ../../license.rst:446 msgid "The :mod:`trace` module contains the following notice::" -msgstr "" -":mod:`trace` 模組包含以下聲明:\n" -"\n" -"::" +msgstr ":mod:`trace` 模組包含以下聲明: ::" #: ../../license.rst:477 msgid "UUencode and UUdecode functions" @@ -373,10 +360,7 @@ msgstr "UUencode 與 UUdecode 函式" #: ../../license.rst:479 msgid "The :mod:`uu` module contains the following notice::" -msgstr "" -":mod:`uu` 模組包含以下聲明:\n" -"\n" -"::" +msgstr ":mod:`uu` 模組包含以下聲明: ::" #: ../../license.rst:507 msgid "XML Remote Procedure Calls" @@ -384,10 +368,7 @@ msgstr "XML 遠端程序呼叫" #: ../../license.rst:509 msgid "The :mod:`xmlrpc.client` module contains the following notice::" -msgstr "" -":mod:`xmlrpc.client` 模組包含以下聲明:\n" -"\n" -"::" +msgstr ":mod:`xmlrpc.client` 模組包含以下聲明: ::" #: ../../license.rst:540 msgid "test_epoll" @@ -395,10 +376,7 @@ msgstr "test_epoll" #: ../../license.rst:542 msgid "The :mod:`!test.test_epoll` module contains the following notice::" -msgstr "" -":mod:`!test.test_epoll` 模組包含以下聲明:\n" -"\n" -"::" +msgstr ":mod:`!test.test_epoll` 模組包含以下聲明: ::" #: ../../license.rst:566 msgid "Select kqueue" @@ -408,10 +386,7 @@ msgstr "Select kqueue" msgid "" "The :mod:`select` module contains the following notice for the kqueue " "interface::" -msgstr "" -":mod:`select` 模組對於 kqueue 介面包含以下聲明:\n" -"\n" -"::" +msgstr ":mod:`select` 模組對於 kqueue 介面包含以下聲明: ::" #: ../../license.rst:597 msgid "SipHash24" @@ -423,9 +398,7 @@ msgid "" "Dan Bernstein's SipHash24 algorithm. It contains the following note::" msgstr "" ":file:`Python/pyhash.c` 檔案包含 Marek Majkowski' 基於 Dan Bernstein 的 " -"SipHash24 演算法的實作。它包含以下聲明:\n" -"\n" -"::" +"SipHash24 演算法的實作。它包含以下聲明: ::" #: ../../license.rst:626 msgid "strtod and dtoa" @@ -443,9 +416,7 @@ msgstr "" ":file:`Python/dtoa.c` 檔案提供了 C 的 dtoa 和 strtod 函式,用於將 C 的雙精度" "浮點數和字串互相轉換。該檔案是衍生自 David M. Gay 建立的同名檔案,後者現在可" "以從 https://web.archive.org/web/20220517033456/http://www.netlib.org/fp/" -"dtoa.c 下載。於 2009 年 3 月 16 日所檢索的原始檔案包含以下版權與授權聲明:\n" -"\n" -"::" +"dtoa.c 下載。於 2009 年 3 月 16 日所檢索的原始檔案包含以下版權與授權聲明: ::" #: ../../license.rst:656 msgid "OpenSSL" @@ -464,9 +435,7 @@ msgstr "" "`ssl`、:mod:`crypt` 模組會使用它來提升效能。此外,因為 Windows 和 macOS 的 " "Python 安裝程式可能包含 OpenSSL 函式庫的副本,所以我們也在此收錄 OpenSSL 授權" "的副本。對於 OpenSSL 3.0 版本以及由此衍生的更新版本則適用 Apache 許可證 " -"v2:\n" -"\n" -"::" +"v2: ::" #: ../../license.rst:845 msgid "expat" @@ -479,9 +448,7 @@ msgid "" "expat``::" msgstr "" "除非在建置 :mod:`pyexpat ` 擴充時設定為 ``--with-system-" -"expat``\\ ,否則該擴充會用一個內含 expat 原始碼的副本來建置:\n" -"\n" -"::" +"expat``,否則該擴充會用一個內含 expat 原始碼的副本來建置: ::" #: ../../license.rst:874 msgid "libffi" @@ -494,9 +461,7 @@ msgid "" "``--with-system-libffi``::" msgstr "" "除非在建置 :mod:`_ctypes` 模組底下 :mod:`!_ctypes` 擴充程式時設定為 ``--with-" -"system-libffi``\\ ,否則該擴充會用一個內含 libffi 原始碼的副本來建置:\n" -"\n" -"::" +"system-libffi``,否則該擴充會用一個內含 libffi 原始碼的副本來建置: ::" #: ../../license.rst:904 msgid "zlib" @@ -509,9 +474,7 @@ msgid "" "the build::" msgstr "" "如果在系統上找到的 zlib 版本太舊以致於無法用於建置 :mod:`zlib` 擴充,則該擴充" -"會用一個內含 zlib 原始碼的副本來建置:\n" -"\n" -"::" +"會用一個內含 zlib 原始碼的副本來建置: ::" #: ../../license.rst:935 msgid "cfuhash" @@ -523,9 +486,7 @@ msgid "" "on the cfuhash project::" msgstr "" ":mod:`tracemalloc` 使用的雜湊表 (hash table) 實作,是以 cfuhash 專案為基" -"礎:\n" -"\n" -"::" +"礎: ::" #: ../../license.rst:976 msgid "libmpdec" @@ -538,10 +499,8 @@ msgid "" "configured ``--with-system-libmpdec``::" msgstr "" "除非在建置 :mod:`decimal` 模組底下 :mod:`!_decimal` C 擴充程式時設定為 ``--" -"with-system-libmpdec``\\ ,否則該模組會用一個內含 libmpdec 函式庫的副本來建" -"置:\n" -"\n" -"::" +"with-system-libmpdec``,否則該模組會用一個內含 libmpdec 函式庫的副本來建" +"置: ::" #: ../../license.rst:1009 msgid "W3C C14N test suite" @@ -555,9 +514,7 @@ msgid "" msgstr "" ":mod:`test` 程式包中的 C14N 2.0 測試套件 (``Lib/test/xmltestdata/c14n-20/``) " "是從 W3C 網站 https://www.w3.org/TR/xml-c14n2-testcases/ 被檢索,且是基於 3-" -"clause BSD 授權被發佈:\n" -"\n" -"::" +"clause BSD 授權被發佈: ::" #: ../../license.rst:1046 msgid "Audioop" @@ -567,3 +524,16 @@ msgstr "Audioop" msgid "" "The audioop module uses the code base in g771.c file of the SoX project::" msgstr "audioop 模組使用 SoX 專案的 g771.c 檔案中的程式碼: ::" + +#: ../../license.rst:1074 +msgid "asyncio" +msgstr "asyncio" + +#: ../../license.rst:1076 +msgid "" +"Parts of the :mod:`asyncio` module are incorporated from `uvloop 0.16 " +"`_, which is distributed " +"under the MIT license::" +msgstr "" +":mod:`asyncio` 模組的部分內容是從 `uvloop 0.16 `_ 中收錄過來,其基於 MIT 授權來發佈: ::" diff --git a/reference/compound_stmts.po b/reference/compound_stmts.po index 394ae3f469..39e86f9f9a 100644 --- a/reference/compound_stmts.po +++ b/reference/compound_stmts.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-13 00:03+0000\n" +"POT-Creation-Date: 2024-01-03 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -450,14 +450,14 @@ msgid "" msgstr "" #: ../../reference/compound_stmts.rst:525 -#: ../../reference/compound_stmts.rst:1537 -#: ../../reference/compound_stmts.rst:1578 +#: ../../reference/compound_stmts.rst:1540 +#: ../../reference/compound_stmts.rst:1581 msgid "The following code::" msgstr "" #: ../../reference/compound_stmts.rst:530 #: ../../reference/compound_stmts.rst:555 -#: ../../reference/compound_stmts.rst:1583 +#: ../../reference/compound_stmts.rst:1586 msgid "is semantically equivalent to::" msgstr "" @@ -1291,7 +1291,7 @@ msgid ":class:`int`" msgstr ":class:`int`" #: ../../reference/compound_stmts.rst:1159 -#: ../../reference/compound_stmts.rst:1853 +#: ../../reference/compound_stmts.rst:1856 msgid ":class:`list`" msgstr ":class:`list`" @@ -1304,7 +1304,7 @@ msgid ":class:`str`" msgstr ":class:`str`" #: ../../reference/compound_stmts.rst:1162 -#: ../../reference/compound_stmts.rst:1856 +#: ../../reference/compound_stmts.rst:1859 msgid ":class:`tuple`" msgstr ":class:`tuple`" @@ -1381,7 +1381,7 @@ msgid "" msgstr "" #: ../../reference/compound_stmts.rst:1249 -#: ../../reference/compound_stmts.rst:1436 +#: ../../reference/compound_stmts.rst:1439 msgid "is roughly equivalent to ::" msgstr "" "大致等價於:\n" @@ -1412,7 +1412,7 @@ msgid "" msgstr "" #: ../../reference/compound_stmts.rst:1268 -#: ../../reference/compound_stmts.rst:1455 +#: ../../reference/compound_stmts.rst:1458 msgid "Type parameter lists are new in Python 3.12." msgstr "" @@ -1523,10 +1523,10 @@ msgstr "" #: ../../reference/compound_stmts.rst:1364 msgid "" "Ability to type hint variable declarations, including class variables and " -"instance variables" +"instance variables." msgstr "" -#: ../../reference/compound_stmts.rst:1368 +#: ../../reference/compound_stmts.rst:1369 msgid ":pep:`563` - Postponed Evaluation of Annotations" msgstr "" @@ -1536,15 +1536,25 @@ msgid "" "in a string form at runtime instead of eager evaluation." msgstr "" -#: ../../reference/compound_stmts.rst:1375 +#: ../../reference/compound_stmts.rst:1372 +msgid ":pep:`318` - Decorators for Functions and Methods" +msgstr "" + +#: ../../reference/compound_stmts.rst:1372 +msgid "" +"Function and method decorators were introduced. Class decorators were " +"introduced in :pep:`3129`." +msgstr "" + +#: ../../reference/compound_stmts.rst:1378 msgid "Class definitions" msgstr "" -#: ../../reference/compound_stmts.rst:1390 +#: ../../reference/compound_stmts.rst:1393 msgid "A class definition defines a class object (see section :ref:`types`):" msgstr "" -#: ../../reference/compound_stmts.rst:1397 +#: ../../reference/compound_stmts.rst:1400 msgid "" "A class definition is an executable statement. The inheritance list usually " "gives a list of base classes (see :ref:`metaclasses` for more advanced " @@ -1553,11 +1563,11 @@ msgid "" "default, from the base class :class:`object`; hence, ::" msgstr "" -#: ../../reference/compound_stmts.rst:1406 +#: ../../reference/compound_stmts.rst:1409 msgid "is equivalent to ::" msgstr "" -#: ../../reference/compound_stmts.rst:1411 +#: ../../reference/compound_stmts.rst:1414 msgid "" "The class's suite is then executed in a new execution frame (see :ref:" "`naming`), using a newly created local namespace and the original global " @@ -1569,7 +1579,7 @@ msgid "" "original local namespace." msgstr "" -#: ../../reference/compound_stmts.rst:1420 +#: ../../reference/compound_stmts.rst:1423 msgid "" "The order in which attributes are defined in the class body is preserved in " "the new class's ``__dict__``. Note that this is reliable only right after " @@ -1577,30 +1587,30 @@ msgid "" "definition syntax." msgstr "" -#: ../../reference/compound_stmts.rst:1425 +#: ../../reference/compound_stmts.rst:1428 msgid "" "Class creation can be customized heavily using :ref:`metaclasses " "`." msgstr "" -#: ../../reference/compound_stmts.rst:1430 +#: ../../reference/compound_stmts.rst:1433 msgid "Classes can also be decorated: just like when decorating functions, ::" msgstr "" -#: ../../reference/compound_stmts.rst:1441 +#: ../../reference/compound_stmts.rst:1444 msgid "" "The evaluation rules for the decorator expressions are the same as for " "function decorators. The result is then bound to the class name." msgstr "" -#: ../../reference/compound_stmts.rst:1444 +#: ../../reference/compound_stmts.rst:1447 msgid "" "Classes may be decorated with any valid :token:`~python-grammar:" "assignment_expression`. Previously, the grammar was much more restrictive; " "see :pep:`614` for details." msgstr "" -#: ../../reference/compound_stmts.rst:1449 +#: ../../reference/compound_stmts.rst:1452 msgid "" "A list of :ref:`type parameters ` may be given in square " "brackets immediately after the class's name. This indicates to static type " @@ -1609,7 +1619,7 @@ msgid "" "classes` for more." msgstr "" -#: ../../reference/compound_stmts.rst:1458 +#: ../../reference/compound_stmts.rst:1461 msgid "" "**Programmer's note:** Variables defined in the class definition are class " "attributes; they are shared by instances. Instance attributes can be set in " @@ -1622,35 +1632,35 @@ msgid "" "implementation details." msgstr "" -#: ../../reference/compound_stmts.rst:1473 +#: ../../reference/compound_stmts.rst:1476 msgid ":pep:`3115` - Metaclasses in Python 3000" msgstr "" -#: ../../reference/compound_stmts.rst:1471 +#: ../../reference/compound_stmts.rst:1474 msgid "" "The proposal that changed the declaration of metaclasses to the current " "syntax, and the semantics for how classes with metaclasses are constructed." msgstr "" -#: ../../reference/compound_stmts.rst:1476 +#: ../../reference/compound_stmts.rst:1479 msgid ":pep:`3129` - Class Decorators" msgstr "" -#: ../../reference/compound_stmts.rst:1476 +#: ../../reference/compound_stmts.rst:1479 msgid "" "The proposal that added class decorators. Function and method decorators " "were introduced in :pep:`318`." msgstr "" -#: ../../reference/compound_stmts.rst:1483 +#: ../../reference/compound_stmts.rst:1486 msgid "Coroutines" msgstr "協程" -#: ../../reference/compound_stmts.rst:1491 +#: ../../reference/compound_stmts.rst:1494 msgid "Coroutine function definition" msgstr "" -#: ../../reference/compound_stmts.rst:1501 +#: ../../reference/compound_stmts.rst:1504 msgid "" "Execution of Python coroutines can be suspended and resumed at many points " "(see :term:`coroutine`). :keyword:`await` expressions, :keyword:`async for` " @@ -1658,109 +1668,109 @@ msgid "" "function." msgstr "" -#: ../../reference/compound_stmts.rst:1505 +#: ../../reference/compound_stmts.rst:1508 msgid "" "Functions defined with ``async def`` syntax are always coroutine functions, " "even if they do not contain ``await`` or ``async`` keywords." msgstr "" -#: ../../reference/compound_stmts.rst:1508 +#: ../../reference/compound_stmts.rst:1511 msgid "" "It is a :exc:`SyntaxError` to use a ``yield from`` expression inside the " "body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1511 +#: ../../reference/compound_stmts.rst:1514 msgid "An example of a coroutine function::" msgstr "" "一個協程韓式函式範例:\n" "\n" "::" -#: ../../reference/compound_stmts.rst:1517 +#: ../../reference/compound_stmts.rst:1520 msgid "" "``await`` and ``async`` are now keywords; previously they were only treated " "as such inside the body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1525 +#: ../../reference/compound_stmts.rst:1528 msgid "The :keyword:`!async for` statement" msgstr "" -#: ../../reference/compound_stmts.rst:1530 +#: ../../reference/compound_stmts.rst:1533 msgid "" "An :term:`asynchronous iterable` provides an ``__aiter__`` method that " "directly returns an :term:`asynchronous iterator`, which can call " "asynchronous code in its ``__anext__`` method." msgstr "" -#: ../../reference/compound_stmts.rst:1534 +#: ../../reference/compound_stmts.rst:1537 msgid "" "The ``async for`` statement allows convenient iteration over asynchronous " "iterables." msgstr "" -#: ../../reference/compound_stmts.rst:1544 +#: ../../reference/compound_stmts.rst:1547 msgid "Is semantically equivalent to::" msgstr "" -#: ../../reference/compound_stmts.rst:1560 +#: ../../reference/compound_stmts.rst:1563 msgid "" "See also :meth:`~object.__aiter__` and :meth:`~object.__anext__` for details." msgstr "" "更多細節請見 :meth:`~object.__aiter__` 與 :meth:`~object.__anext__`\\ 。" -#: ../../reference/compound_stmts.rst:1562 +#: ../../reference/compound_stmts.rst:1565 msgid "" "It is a :exc:`SyntaxError` to use an ``async for`` statement outside the " "body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1570 +#: ../../reference/compound_stmts.rst:1573 msgid "The :keyword:`!async with` statement" msgstr "" -#: ../../reference/compound_stmts.rst:1575 +#: ../../reference/compound_stmts.rst:1578 msgid "" "An :term:`asynchronous context manager` is a :term:`context manager` that is " "able to suspend execution in its *enter* and *exit* methods." msgstr "" -#: ../../reference/compound_stmts.rst:1602 +#: ../../reference/compound_stmts.rst:1605 msgid "" "See also :meth:`~object.__aenter__` and :meth:`~object.__aexit__` for " "details." msgstr "" "更多細節請見 :meth:`~object.__aenter__` 與 :meth:`~object.__aexit__`\\ 。" -#: ../../reference/compound_stmts.rst:1604 +#: ../../reference/compound_stmts.rst:1607 msgid "" "It is a :exc:`SyntaxError` to use an ``async with`` statement outside the " "body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1610 +#: ../../reference/compound_stmts.rst:1613 msgid ":pep:`492` - Coroutines with async and await syntax" msgstr "" -#: ../../reference/compound_stmts.rst:1610 +#: ../../reference/compound_stmts.rst:1613 msgid "" "The proposal that made coroutines a proper standalone concept in Python, and " "added supporting syntax." msgstr "" -#: ../../reference/compound_stmts.rst:1616 +#: ../../reference/compound_stmts.rst:1619 msgid "Type parameter lists" msgstr "" -#: ../../reference/compound_stmts.rst:1630 +#: ../../reference/compound_stmts.rst:1633 msgid "" ":ref:`Functions ` (including :ref:`coroutines `), :ref:" "`classes ` and :ref:`type aliases ` may contain a type " "parameter list::" msgstr "" -#: ../../reference/compound_stmts.rst:1649 +#: ../../reference/compound_stmts.rst:1652 msgid "" "Semantically, this indicates that the function, class, or type alias is " "generic over a type variable. This information is primarily used by static " @@ -1768,7 +1778,7 @@ msgid "" "generic counterparts." msgstr "" -#: ../../reference/compound_stmts.rst:1654 +#: ../../reference/compound_stmts.rst:1657 msgid "" "Type parameters are declared in square brackets (``[]``) immediately after " "the name of the function, class, or type alias. The type parameters are " @@ -1780,36 +1790,36 @@ msgid "" "wraps the creation of the generic object." msgstr "" -#: ../../reference/compound_stmts.rst:1663 +#: ../../reference/compound_stmts.rst:1666 msgid "" "Generic functions, classes, and type aliases have a :attr:`!__type_params__` " "attribute listing their type parameters." msgstr "" -#: ../../reference/compound_stmts.rst:1666 +#: ../../reference/compound_stmts.rst:1669 msgid "Type parameters come in three kinds:" msgstr "" -#: ../../reference/compound_stmts.rst:1668 +#: ../../reference/compound_stmts.rst:1671 msgid "" ":data:`typing.TypeVar`, introduced by a plain name (e.g., ``T``). " "Semantically, this represents a single type to a type checker." msgstr "" -#: ../../reference/compound_stmts.rst:1670 +#: ../../reference/compound_stmts.rst:1673 msgid "" ":data:`typing.TypeVarTuple`, introduced by a name prefixed with a single " "asterisk (e.g., ``*Ts``). Semantically, this stands for a tuple of any " "number of types." msgstr "" -#: ../../reference/compound_stmts.rst:1673 +#: ../../reference/compound_stmts.rst:1676 msgid "" ":data:`typing.ParamSpec`, introduced by a name prefixed with two asterisks " "(e.g., ``**P``). Semantically, this stands for the parameters of a callable." msgstr "" -#: ../../reference/compound_stmts.rst:1676 +#: ../../reference/compound_stmts.rst:1679 msgid "" ":data:`typing.TypeVar` declarations can define *bounds* and *constraints* " "with a colon (``:``) followed by an expression. A single expression after " @@ -1821,7 +1831,7 @@ msgid "" "variables can only take on one of the types in the list of constraints." msgstr "" -#: ../../reference/compound_stmts.rst:1685 +#: ../../reference/compound_stmts.rst:1688 msgid "" "For :data:`!typing.TypeVar`\\ s declared using the type parameter list " "syntax, the bound and constraints are not evaluated when the generic object " @@ -1831,35 +1841,35 @@ msgid "" "`." msgstr "" -#: ../../reference/compound_stmts.rst:1691 +#: ../../reference/compound_stmts.rst:1694 msgid "" ":data:`typing.TypeVarTuple`\\ s and :data:`typing.ParamSpec`\\ s cannot have " "bounds or constraints." msgstr "" -#: ../../reference/compound_stmts.rst:1694 +#: ../../reference/compound_stmts.rst:1697 msgid "" "The following example indicates the full set of allowed type parameter " "declarations::" msgstr "" -#: ../../reference/compound_stmts.rst:1712 +#: ../../reference/compound_stmts.rst:1715 msgid "Generic functions" msgstr "" -#: ../../reference/compound_stmts.rst:1714 +#: ../../reference/compound_stmts.rst:1717 msgid "Generic functions are declared as follows::" msgstr "" -#: ../../reference/compound_stmts.rst:1718 -#: ../../reference/compound_stmts.rst:1778 +#: ../../reference/compound_stmts.rst:1721 +#: ../../reference/compound_stmts.rst:1781 msgid "This syntax is equivalent to::" msgstr "" "語法大致等價於:\n" "\n" "::" -#: ../../reference/compound_stmts.rst:1727 +#: ../../reference/compound_stmts.rst:1730 msgid "" "Here ``annotation-def`` indicates an :ref:`annotation scope `, which is not actually bound to any name at runtime. (One other " @@ -1868,47 +1878,47 @@ msgid "" "data:`typing.TypeVar` directly.)" msgstr "" -#: ../../reference/compound_stmts.rst:1733 +#: ../../reference/compound_stmts.rst:1736 msgid "" "The annotations of generic functions are evaluated within the annotation " "scope used for declaring the type parameters, but the function's defaults " "and decorators are not." msgstr "" -#: ../../reference/compound_stmts.rst:1737 +#: ../../reference/compound_stmts.rst:1740 msgid "" "The following example illustrates the scoping rules for these cases, as well " "as for additional flavors of type parameters::" msgstr "" -#: ../../reference/compound_stmts.rst:1744 +#: ../../reference/compound_stmts.rst:1747 msgid "" "Except for the :ref:`lazy evaluation ` of the :class:" "`~typing.TypeVar` bound, this is equivalent to::" msgstr "" -#: ../../reference/compound_stmts.rst:1766 +#: ../../reference/compound_stmts.rst:1769 msgid "" "The capitalized names like ``DEFAULT_OF_arg`` are not actually bound at " "runtime." msgstr "" -#: ../../reference/compound_stmts.rst:1772 +#: ../../reference/compound_stmts.rst:1775 msgid "Generic classes" msgstr "" -#: ../../reference/compound_stmts.rst:1774 +#: ../../reference/compound_stmts.rst:1777 msgid "Generic classes are declared as follows::" msgstr "" -#: ../../reference/compound_stmts.rst:1788 +#: ../../reference/compound_stmts.rst:1791 msgid "" "Here again ``annotation-def`` (not a real keyword) indicates an :ref:" "`annotation scope `, and the name ``TYPE_PARAMS_OF_Bag`` " "is not actually bound at runtime." msgstr "" -#: ../../reference/compound_stmts.rst:1792 +#: ../../reference/compound_stmts.rst:1795 msgid "" "Generic classes implicitly inherit from :data:`typing.Generic`. The base " "classes and keyword arguments of generic classes are evaluated within the " @@ -1916,128 +1926,128 @@ msgid "" "that scope. This is illustrated by this example::" msgstr "" -#: ../../reference/compound_stmts.rst:1801 +#: ../../reference/compound_stmts.rst:1804 msgid "This is equivalent to::" msgstr "" "這等價於:\n" "\n" "::" -#: ../../reference/compound_stmts.rst:1814 +#: ../../reference/compound_stmts.rst:1817 msgid "Generic type aliases" msgstr "" -#: ../../reference/compound_stmts.rst:1816 +#: ../../reference/compound_stmts.rst:1819 msgid "" "The :keyword:`type` statement can also be used to create a generic type " "alias::" msgstr "" -#: ../../reference/compound_stmts.rst:1820 +#: ../../reference/compound_stmts.rst:1823 msgid "" "Except for the :ref:`lazy evaluation ` of the value, this " "is equivalent to::" msgstr "" -#: ../../reference/compound_stmts.rst:1832 +#: ../../reference/compound_stmts.rst:1835 msgid "" "Here, ``annotation-def`` (not a real keyword) indicates an :ref:`annotation " "scope `. The capitalized names like " "``TYPE_PARAMS_OF_ListOrSet`` are not actually bound at runtime." msgstr "" -#: ../../reference/compound_stmts.rst:1837 +#: ../../reference/compound_stmts.rst:1840 msgid "Footnotes" msgstr "註解" -#: ../../reference/compound_stmts.rst:1838 +#: ../../reference/compound_stmts.rst:1841 msgid "" "The exception is propagated to the invocation stack unless there is a :" "keyword:`finally` clause which happens to raise another exception. That new " "exception causes the old one to be lost." msgstr "" -#: ../../reference/compound_stmts.rst:1842 +#: ../../reference/compound_stmts.rst:1845 msgid "In pattern matching, a sequence is defined as one of the following:" msgstr "" -#: ../../reference/compound_stmts.rst:1844 +#: ../../reference/compound_stmts.rst:1847 msgid "a class that inherits from :class:`collections.abc.Sequence`" msgstr "" -#: ../../reference/compound_stmts.rst:1845 +#: ../../reference/compound_stmts.rst:1848 msgid "" "a Python class that has been registered as :class:`collections.abc.Sequence`" msgstr "" -#: ../../reference/compound_stmts.rst:1846 +#: ../../reference/compound_stmts.rst:1849 msgid "" "a builtin class that has its (CPython) :c:macro:`Py_TPFLAGS_SEQUENCE` bit set" msgstr "" -#: ../../reference/compound_stmts.rst:1847 -#: ../../reference/compound_stmts.rst:1866 +#: ../../reference/compound_stmts.rst:1850 +#: ../../reference/compound_stmts.rst:1869 msgid "a class that inherits from any of the above" msgstr "" -#: ../../reference/compound_stmts.rst:1849 +#: ../../reference/compound_stmts.rst:1852 msgid "The following standard library classes are sequences:" msgstr "" -#: ../../reference/compound_stmts.rst:1851 +#: ../../reference/compound_stmts.rst:1854 msgid ":class:`array.array`" msgstr ":class:`array.array`" -#: ../../reference/compound_stmts.rst:1852 +#: ../../reference/compound_stmts.rst:1855 msgid ":class:`collections.deque`" msgstr ":class:`collections.deque`" -#: ../../reference/compound_stmts.rst:1854 +#: ../../reference/compound_stmts.rst:1857 msgid ":class:`memoryview`" msgstr ":class:`memoryview`" -#: ../../reference/compound_stmts.rst:1855 +#: ../../reference/compound_stmts.rst:1858 msgid ":class:`range`" msgstr ":class:`range`" -#: ../../reference/compound_stmts.rst:1858 +#: ../../reference/compound_stmts.rst:1861 msgid "" "Subject values of type ``str``, ``bytes``, and ``bytearray`` do not match " "sequence patterns." msgstr "" -#: ../../reference/compound_stmts.rst:1861 +#: ../../reference/compound_stmts.rst:1864 msgid "In pattern matching, a mapping is defined as one of the following:" msgstr "" -#: ../../reference/compound_stmts.rst:1863 +#: ../../reference/compound_stmts.rst:1866 msgid "a class that inherits from :class:`collections.abc.Mapping`" msgstr "" -#: ../../reference/compound_stmts.rst:1864 +#: ../../reference/compound_stmts.rst:1867 msgid "" "a Python class that has been registered as :class:`collections.abc.Mapping`" msgstr "" -#: ../../reference/compound_stmts.rst:1865 +#: ../../reference/compound_stmts.rst:1868 msgid "" "a builtin class that has its (CPython) :c:macro:`Py_TPFLAGS_MAPPING` bit set" msgstr "" -#: ../../reference/compound_stmts.rst:1868 +#: ../../reference/compound_stmts.rst:1871 msgid "" "The standard library classes :class:`dict` and :class:`types." "MappingProxyType` are mappings." msgstr "" -#: ../../reference/compound_stmts.rst:1871 +#: ../../reference/compound_stmts.rst:1874 msgid "" "A string literal appearing as the first statement in the function body is " "transformed into the function's :attr:`~function.__doc__` attribute and " "therefore the function's :term:`docstring`." msgstr "" -#: ../../reference/compound_stmts.rst:1875 +#: ../../reference/compound_stmts.rst:1878 msgid "" "A string literal appearing as the first statement in the class body is " "transformed into the namespace's ``__doc__`` item and therefore the class's :" @@ -2059,10 +2069,10 @@ msgstr "compound(複合)" #: ../../reference/compound_stmts.rst:470 #: ../../reference/compound_stmts.rst:587 #: ../../reference/compound_stmts.rst:1194 -#: ../../reference/compound_stmts.rst:1377 -#: ../../reference/compound_stmts.rst:1487 -#: ../../reference/compound_stmts.rst:1521 -#: ../../reference/compound_stmts.rst:1566 +#: ../../reference/compound_stmts.rst:1380 +#: ../../reference/compound_stmts.rst:1490 +#: ../../reference/compound_stmts.rst:1524 +#: ../../reference/compound_stmts.rst:1569 msgid "statement" msgstr "statement(陳述式)" @@ -2110,7 +2120,7 @@ msgstr "if" #: ../../reference/compound_stmts.rst:407 #: ../../reference/compound_stmts.rst:470 #: ../../reference/compound_stmts.rst:587 -#: ../../reference/compound_stmts.rst:1497 +#: ../../reference/compound_stmts.rst:1500 msgid "keyword" msgstr "keyword(關鍵字)" @@ -2125,7 +2135,7 @@ msgstr "elif" #: ../../reference/compound_stmts.rst:587 #: ../../reference/compound_stmts.rst:1194 #: ../../reference/compound_stmts.rst:1321 -#: ../../reference/compound_stmts.rst:1377 +#: ../../reference/compound_stmts.rst:1380 msgid ": (colon)" msgstr ": (冒號)" @@ -2135,7 +2145,7 @@ msgstr ": (冒號)" #: ../../reference/compound_stmts.rst:470 #: ../../reference/compound_stmts.rst:587 #: ../../reference/compound_stmts.rst:1194 -#: ../../reference/compound_stmts.rst:1377 +#: ../../reference/compound_stmts.rst:1380 msgid "compound statement" msgstr "compound statement(複合陳述式)" @@ -2181,7 +2191,7 @@ msgstr "list(串列)" #: ../../reference/compound_stmts.rst:144 #: ../../reference/compound_stmts.rst:299 #: ../../reference/compound_stmts.rst:1194 -#: ../../reference/compound_stmts.rst:1377 +#: ../../reference/compound_stmts.rst:1380 msgid "object" msgstr "object(物件)" @@ -2252,7 +2262,7 @@ msgstr "with statement(with 陳述式)" #: ../../reference/compound_stmts.rst:470 #: ../../reference/compound_stmts.rst:1194 -#: ../../reference/compound_stmts.rst:1377 +#: ../../reference/compound_stmts.rst:1380 msgid ", (comma)" msgstr ", (逗號)" @@ -2315,17 +2325,17 @@ msgid "function" msgstr "function (函式)" #: ../../reference/compound_stmts.rst:1194 -#: ../../reference/compound_stmts.rst:1377 +#: ../../reference/compound_stmts.rst:1380 msgid "definition" msgstr "definition(定義)" #: ../../reference/compound_stmts.rst:1194 -#: ../../reference/compound_stmts.rst:1377 +#: ../../reference/compound_stmts.rst:1380 msgid "name" msgstr "name(名稱)" #: ../../reference/compound_stmts.rst:1194 -#: ../../reference/compound_stmts.rst:1377 +#: ../../reference/compound_stmts.rst:1380 msgid "binding" msgstr "binding(綁定)" @@ -2334,7 +2344,7 @@ msgid "user-defined function" msgstr "user-defined function(使用者定義函式)" #: ../../reference/compound_stmts.rst:1194 -#: ../../reference/compound_stmts.rst:1377 +#: ../../reference/compound_stmts.rst:1380 msgid "() (parentheses)" msgstr "() (圓括號)" @@ -2343,7 +2353,7 @@ msgid "parameter list" msgstr "parameter list(參數列表)" #: ../../reference/compound_stmts.rst:1235 -#: ../../reference/compound_stmts.rst:1427 +#: ../../reference/compound_stmts.rst:1430 msgid "@ (at)" msgstr "@ (在)" @@ -2395,55 +2405,55 @@ msgstr "lambda" msgid "expression" msgstr "expression(運算式)" -#: ../../reference/compound_stmts.rst:1377 +#: ../../reference/compound_stmts.rst:1380 msgid "class" msgstr "class(類別)" -#: ../../reference/compound_stmts.rst:1377 +#: ../../reference/compound_stmts.rst:1380 msgid "execution" msgstr "execution(執行)" -#: ../../reference/compound_stmts.rst:1377 +#: ../../reference/compound_stmts.rst:1380 msgid "frame" msgstr "frame" -#: ../../reference/compound_stmts.rst:1377 +#: ../../reference/compound_stmts.rst:1380 msgid "inheritance" msgstr "inheritance(繼承)" -#: ../../reference/compound_stmts.rst:1377 +#: ../../reference/compound_stmts.rst:1380 msgid "docstring" msgstr "docstring(說明字串)" -#: ../../reference/compound_stmts.rst:1377 -#: ../../reference/compound_stmts.rst:1427 +#: ../../reference/compound_stmts.rst:1380 +#: ../../reference/compound_stmts.rst:1430 msgid "class definition" msgstr "class definition(類別定義)" -#: ../../reference/compound_stmts.rst:1377 +#: ../../reference/compound_stmts.rst:1380 msgid "expression list" msgstr "expression list(表達式列表)" -#: ../../reference/compound_stmts.rst:1487 +#: ../../reference/compound_stmts.rst:1490 msgid "async def" msgstr "async def" -#: ../../reference/compound_stmts.rst:1497 +#: ../../reference/compound_stmts.rst:1500 msgid "async" msgstr "async" -#: ../../reference/compound_stmts.rst:1497 +#: ../../reference/compound_stmts.rst:1500 msgid "await" msgstr "await" -#: ../../reference/compound_stmts.rst:1521 +#: ../../reference/compound_stmts.rst:1524 msgid "async for" msgstr "async for" -#: ../../reference/compound_stmts.rst:1566 +#: ../../reference/compound_stmts.rst:1569 msgid "async with" msgstr "async with" -#: ../../reference/compound_stmts.rst:1620 +#: ../../reference/compound_stmts.rst:1623 msgid "type parameters" msgstr "type parameter(型別參數)" diff --git a/reference/datamodel.po b/reference/datamodel.po index acb7624569..748152f356 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -1,5 +1,4 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -7,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-22 00:03+0000\n" +"POT-Creation-Date: 2024-01-22 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -20,7 +19,7 @@ msgstr "" #: ../../reference/datamodel.rst:6 msgid "Data model" -msgstr "" +msgstr "資料模型" #: ../../reference/datamodel.rst:12 msgid "Objects, values and types" @@ -589,7 +588,7 @@ msgstr "" #: ../../reference/datamodel.rst:525 msgid "User-defined functions" -msgstr "" +msgstr "自訂函式" #: ../../reference/datamodel.rst:532 msgid "" @@ -599,9 +598,9 @@ msgid "" msgstr "" #: ../../reference/datamodel.rst:538 ../../reference/datamodel.rst:1127 -#: ../../reference/datamodel.rst:1279 +#: ../../reference/datamodel.rst:1314 msgid "Special read-only attributes" -msgstr "" +msgstr "特殊唯讀屬性" #: ../../reference/datamodel.rst:548 ../../reference/datamodel.rst:582 msgid "Attribute" @@ -630,7 +629,7 @@ msgid "" "the value of the cell, as well as set the value." msgstr "" -#: ../../reference/datamodel.rst:564 ../../reference/datamodel.rst:1316 +#: ../../reference/datamodel.rst:564 ../../reference/datamodel.rst:1351 msgid "Special writable attributes" msgstr "特殊可寫屬性" @@ -673,7 +672,7 @@ msgstr "" msgid "" "The :ref:`code object ` representing the compiled function " "body." -msgstr "" +msgstr "代表編譯函式主體的\\ :ref:`程式碼物件 `。" #: ../../reference/datamodel.rst:613 msgid "" @@ -732,7 +731,7 @@ msgid "" "callable object (normally a user-defined function)." msgstr "" -#: ../../reference/datamodel.rst:669 ../../reference/datamodel.rst:1407 +#: ../../reference/datamodel.rst:669 ../../reference/datamodel.rst:1442 msgid "Special read-only attributes:" msgstr "特殊唯讀屬性:" @@ -898,11 +897,13 @@ msgid "" ":attr:`!__doc__` is the function's documentation string, or ``None`` if " "unavailable. See :attr:`function.__doc__`." msgstr "" +":attr:`!__doc__` 是函式的文件字串,若不可用則為 ``None``。請見 :attr:" +"`function.__doc__`。" #: ../../reference/datamodel.rst:811 msgid "" ":attr:`!__name__` is the function's name. See :attr:`function.__name__`." -msgstr "" +msgstr ":attr:`!__name__` 是函式的名稱。請見 :attr:`function.__name__`。" #: ../../reference/datamodel.rst:812 msgid ":attr:`!__self__` is set to ``None`` (but see the next item)." @@ -1355,8 +1356,8 @@ msgid "" msgstr "" #: ../../reference/datamodel.rst:1223 -msgid "The :meth:`!co_positions` method" -msgstr "" +msgid "Methods on code objects" +msgstr "用於程式碼物件的方法" #: ../../reference/datamodel.rst:1227 msgid "" @@ -1412,24 +1413,90 @@ msgid "" "environment variable can be used." msgstr "" -#: ../../reference/datamodel.rst:1262 -msgid "Frame objects" +#: ../../reference/datamodel.rst:1260 +msgid "" +"Returns an iterator that yields information about successive ranges of :term:" +"`bytecode`\\s. Each item yielded is a ``(start, end, lineno)`` :class:" +"`tuple`:" +msgstr "" + +#: ../../reference/datamodel.rst:1264 +msgid "" +"``start`` (an :class:`int`) represents the offset (inclusive) of the start " +"of the :term:`bytecode` range" msgstr "" #: ../../reference/datamodel.rst:1266 msgid "" +"``end`` (an :class:`int`) represents the offset (exclusive) of the end of " +"the :term:`bytecode` range" +msgstr "" + +#: ../../reference/datamodel.rst:1268 +msgid "" +"``lineno`` is an :class:`int` representing the line number of the :term:" +"`bytecode` range, or ``None`` if the bytecodes in the given range have no " +"line number" +msgstr "" + +#: ../../reference/datamodel.rst:1272 +msgid "The items yielded will have the following properties:" +msgstr "" + +#: ../../reference/datamodel.rst:1274 +msgid "The first range yielded will have a ``start`` of 0." +msgstr "" + +#: ../../reference/datamodel.rst:1275 +msgid "" +"The ``(start, end)`` ranges will be non-decreasing and consecutive. That is, " +"for any pair of :class:`tuple`\\s, the ``start`` of the second will be equal " +"to the ``end`` of the first." +msgstr "" + +#: ../../reference/datamodel.rst:1278 +msgid "No range will be backwards: ``end >= start`` for all triples." +msgstr "" + +#: ../../reference/datamodel.rst:1279 +msgid "" +"The last :class:`tuple` yielded will have ``end`` equal to the size of the :" +"term:`bytecode`." +msgstr "" + +#: ../../reference/datamodel.rst:1282 +msgid "" +"Zero-width ranges, where ``start == end``, are allowed. Zero-width ranges " +"are used for lines that are present in the source code, but have been " +"eliminated by the :term:`bytecode` compiler." +msgstr "" + +#: ../../reference/datamodel.rst:1290 +msgid ":pep:`626` - Precise line numbers for debugging and other tools." +msgstr "" + +#: ../../reference/datamodel.rst:1291 +msgid "The PEP that introduced the :meth:`!co_lines` method." +msgstr "" + +#: ../../reference/datamodel.rst:1297 +msgid "Frame objects" +msgstr "" + +#: ../../reference/datamodel.rst:1301 +msgid "" "Frame objects represent execution frames. They may occur in :ref:`traceback " "objects `, and are also passed to registered trace " "functions." msgstr "" -#: ../../reference/datamodel.rst:1284 +#: ../../reference/datamodel.rst:1319 msgid "" "Points to the previous stack frame (towards the caller), or ``None`` if this " "is the bottom stack frame" msgstr "" -#: ../../reference/datamodel.rst:1288 +#: ../../reference/datamodel.rst:1323 msgid "" "The :ref:`code object ` being executed in this frame. " "Accessing this attribute raises an :ref:`auditing event ` ``object." @@ -1439,49 +1506,49 @@ msgstr "" "這個屬性會引發一個附帶引數 ``obj`` 與 ``\"f_code\"`` 的\\ :ref:`稽核事件 " "` ``object.__getattr__``。" -#: ../../reference/datamodel.rst:1293 +#: ../../reference/datamodel.rst:1328 msgid "" "The dictionary used by the frame to look up :ref:`local variables `" msgstr "" -#: ../../reference/datamodel.rst:1297 +#: ../../reference/datamodel.rst:1332 msgid "" "The dictionary used by the frame to look up :ref:`global variables `" msgstr "" -#: ../../reference/datamodel.rst:1301 +#: ../../reference/datamodel.rst:1336 msgid "" "The dictionary used by the frame to look up :ref:`built-in (intrinsic) names " "`" msgstr "" -#: ../../reference/datamodel.rst:1305 +#: ../../reference/datamodel.rst:1340 msgid "" "The \"precise instruction\" of the frame object (this is an index into the :" "term:`bytecode` string of the :ref:`code object `)" msgstr "" -#: ../../reference/datamodel.rst:1321 +#: ../../reference/datamodel.rst:1356 msgid "" "If not ``None``, this is a function called for various events during code " "execution (this is used by debuggers). Normally an event is triggered for " "each new source line (see :attr:`~frame.f_trace_lines`)." msgstr "" -#: ../../reference/datamodel.rst:1326 +#: ../../reference/datamodel.rst:1361 msgid "" "Set this attribute to :const:`False` to disable triggering a tracing event " "for each source line." msgstr "" -#: ../../reference/datamodel.rst:1330 +#: ../../reference/datamodel.rst:1365 msgid "" "Set this attribute to :const:`True` to allow per-opcode events to be " "requested. Note that this may lead to undefined interpreter behaviour if " "exceptions raised by the trace function escape to the function being traced." msgstr "" -#: ../../reference/datamodel.rst:1336 +#: ../../reference/datamodel.rst:1371 msgid "" "The current line number of the frame -- writing to this from within a trace " "function jumps to the given line (only for the bottom-most frame). A " @@ -1489,15 +1556,15 @@ msgid "" "this attribute." msgstr "" -#: ../../reference/datamodel.rst:1342 +#: ../../reference/datamodel.rst:1377 msgid "Frame object methods" msgstr "" -#: ../../reference/datamodel.rst:1344 +#: ../../reference/datamodel.rst:1379 msgid "Frame objects support one method:" msgstr "" -#: ../../reference/datamodel.rst:1348 +#: ../../reference/datamodel.rst:1383 msgid "" "This method clears all references to :ref:`local variables ` held by " "the frame. Also, if the frame belonged to a :term:`generator`, the " @@ -1506,26 +1573,26 @@ msgid "" "and storing its :ref:`traceback ` for later use)." msgstr "" -#: ../../reference/datamodel.rst:1354 +#: ../../reference/datamodel.rst:1389 msgid ":exc:`RuntimeError` is raised if the frame is currently executing." msgstr "" -#: ../../reference/datamodel.rst:1362 +#: ../../reference/datamodel.rst:1397 msgid "Traceback objects" msgstr "" -#: ../../reference/datamodel.rst:1375 +#: ../../reference/datamodel.rst:1410 msgid "" "Traceback objects represent the stack trace of an :ref:`exception `. A traceback object is implicitly created when an exception occurs, " "and may also be explicitly created by calling :class:`types.TracebackType`." msgstr "" -#: ../../reference/datamodel.rst:1380 +#: ../../reference/datamodel.rst:1415 msgid "Traceback objects can now be explicitly instantiated from Python code." msgstr "" -#: ../../reference/datamodel.rst:1383 +#: ../../reference/datamodel.rst:1418 msgid "" "For implicitly created tracebacks, when the search for an exception handler " "unwinds the execution stack, at each unwound level a traceback object is " @@ -1536,7 +1603,7 @@ msgid "" "the caught exception." msgstr "" -#: ../../reference/datamodel.rst:1392 +#: ../../reference/datamodel.rst:1427 msgid "" "When the program contains no suitable handler, the stack trace is written " "(nicely formatted) to the standard error stream; if the interpreter is " @@ -1544,19 +1611,19 @@ msgid "" "last_traceback`." msgstr "" -#: ../../reference/datamodel.rst:1397 +#: ../../reference/datamodel.rst:1432 msgid "" "For explicitly created tracebacks, it is up to the creator of the traceback " "to determine how the :attr:`~traceback.tb_next` attributes should be linked " "to form a full stack trace." msgstr "" -#: ../../reference/datamodel.rst:1412 +#: ../../reference/datamodel.rst:1447 msgid "" "Points to the execution :ref:`frame ` of the current level." msgstr "" -#: ../../reference/datamodel.rst:1415 +#: ../../reference/datamodel.rst:1450 msgid "" "Accessing this attribute raises an :ref:`auditing event ` ``object." "__getattr__`` with arguments ``obj`` and ``\"tb_frame\"``." @@ -1564,15 +1631,15 @@ msgstr "" "存取此屬性會引發一個附帶引數 ``obj`` 與 ``\"tb_frame\"`` 的\\ :ref:`稽核事件 " "` ``object.__getattr__``。" -#: ../../reference/datamodel.rst:1420 +#: ../../reference/datamodel.rst:1455 msgid "Gives the line number where the exception occurred" msgstr "" -#: ../../reference/datamodel.rst:1423 +#: ../../reference/datamodel.rst:1458 msgid "Indicates the \"precise instruction\"." msgstr "" -#: ../../reference/datamodel.rst:1425 +#: ../../reference/datamodel.rst:1460 msgid "" "The line number and last instruction in the traceback may differ from the " "line number of its :ref:`frame object ` if the exception " @@ -1580,39 +1647,39 @@ msgid "" "with a :keyword:`finally` clause." msgstr "" -#: ../../reference/datamodel.rst:1436 +#: ../../reference/datamodel.rst:1471 msgid "" "The special writable attribute :attr:`!tb_next` is the next level in the " "stack trace (towards the frame where the exception occurred), or ``None`` if " "there is no next level." msgstr "" -#: ../../reference/datamodel.rst:1440 +#: ../../reference/datamodel.rst:1475 msgid "This attribute is now writable" msgstr "" -#: ../../reference/datamodel.rst:1445 +#: ../../reference/datamodel.rst:1480 msgid "Slice objects" msgstr "" -#: ../../reference/datamodel.rst:1449 +#: ../../reference/datamodel.rst:1484 msgid "" "Slice objects are used to represent slices for :meth:`~object.__getitem__` " "methods. They are also created by the built-in :func:`slice` function." msgstr "" -#: ../../reference/datamodel.rst:1458 +#: ../../reference/datamodel.rst:1493 msgid "" "Special read-only attributes: :attr:`~slice.start` is the lower bound; :attr:" "`~slice.stop` is the upper bound; :attr:`~slice.step` is the step value; " "each is ``None`` if omitted. These attributes can have any type." msgstr "" -#: ../../reference/datamodel.rst:1462 +#: ../../reference/datamodel.rst:1497 msgid "Slice objects support one method:" msgstr "" -#: ../../reference/datamodel.rst:1466 +#: ../../reference/datamodel.rst:1501 msgid "" "This method takes a single integer argument *length* and computes " "information about the slice that the slice object would describe if applied " @@ -1622,11 +1689,11 @@ msgid "" "a manner consistent with regular slices." msgstr "" -#: ../../reference/datamodel.rst:1475 +#: ../../reference/datamodel.rst:1510 msgid "Static method objects" msgstr "" -#: ../../reference/datamodel.rst:1477 +#: ../../reference/datamodel.rst:1512 msgid "" "Static method objects provide a way of defeating the transformation of " "function objects to method objects described above. A static method object " @@ -1637,24 +1704,25 @@ msgid "" "method objects are created by the built-in :func:`staticmethod` constructor." msgstr "" -#: ../../reference/datamodel.rst:1487 +#: ../../reference/datamodel.rst:1522 msgid "Class method objects" msgstr "" -#: ../../reference/datamodel.rst:1489 +#: ../../reference/datamodel.rst:1524 msgid "" "A class method object, like a static method object, is a wrapper around " "another object that alters the way in which that object is retrieved from " "classes and class instances. The behaviour of class method objects upon such " -"retrieval is described above, under \"User-defined methods\". Class method " -"objects are created by the built-in :func:`classmethod` constructor." +"retrieval is described above, under :ref:`\"instance methods\" `. Class method objects are created by the built-in :func:" +"`classmethod` constructor." msgstr "" -#: ../../reference/datamodel.rst:1499 +#: ../../reference/datamodel.rst:1534 msgid "Special method names" msgstr "" -#: ../../reference/datamodel.rst:1505 +#: ../../reference/datamodel.rst:1540 msgid "" "A class can implement certain operations that are invoked by special syntax " "(such as arithmetic operations or subscripting and slicing) by defining " @@ -1668,7 +1736,7 @@ msgid "" "`TypeError`)." msgstr "" -#: ../../reference/datamodel.rst:1516 +#: ../../reference/datamodel.rst:1551 msgid "" "Setting a special method to ``None`` indicates that the corresponding " "operation is not available. For example, if a class sets :meth:`~object." @@ -1677,7 +1745,7 @@ msgid "" "`~object.__getitem__`). [#]_" msgstr "" -#: ../../reference/datamodel.rst:1522 +#: ../../reference/datamodel.rst:1557 msgid "" "When implementing a class that emulates any built-in type, it is important " "that the emulation only be implemented to the degree that it makes sense for " @@ -1687,11 +1755,11 @@ msgid "" "the W3C's Document Object Model.)" msgstr "" -#: ../../reference/datamodel.rst:1533 +#: ../../reference/datamodel.rst:1568 msgid "Basic customization" msgstr "" -#: ../../reference/datamodel.rst:1539 +#: ../../reference/datamodel.rst:1574 msgid "" "Called to create a new instance of class *cls*. :meth:`__new__` is a static " "method (special-cased so you need not declare it as such) that takes the " @@ -1701,7 +1769,7 @@ msgid "" "new object instance (usually an instance of *cls*)." msgstr "" -#: ../../reference/datamodel.rst:1546 +#: ../../reference/datamodel.rst:1581 msgid "" "Typical implementations create a new instance of the class by invoking the " "superclass's :meth:`__new__` method using ``super().__new__(cls[, ...])`` " @@ -1709,7 +1777,7 @@ msgid "" "necessary before returning it." msgstr "" -#: ../../reference/datamodel.rst:1551 +#: ../../reference/datamodel.rst:1586 msgid "" "If :meth:`__new__` is invoked during object construction and it returns an " "instance of *cls*, then the new instance’s :meth:`__init__` method will be " @@ -1718,13 +1786,13 @@ msgid "" "constructor." msgstr "" -#: ../../reference/datamodel.rst:1556 +#: ../../reference/datamodel.rst:1591 msgid "" "If :meth:`__new__` does not return an instance of *cls*, then the new " "instance's :meth:`__init__` method will not be invoked." msgstr "" -#: ../../reference/datamodel.rst:1559 +#: ../../reference/datamodel.rst:1594 msgid "" ":meth:`__new__` is intended mainly to allow subclasses of immutable types " "(like int, str, or tuple) to customize instance creation. It is also " @@ -1732,7 +1800,7 @@ msgid "" "creation." msgstr "" -#: ../../reference/datamodel.rst:1568 +#: ../../reference/datamodel.rst:1603 msgid "" "Called after the instance has been created (by :meth:`__new__`), but before " "it is returned to the caller. The arguments are those passed to the class " @@ -1742,7 +1810,7 @@ msgid "" "example: ``super().__init__([args...])``." msgstr "" -#: ../../reference/datamodel.rst:1575 +#: ../../reference/datamodel.rst:1610 msgid "" "Because :meth:`__new__` and :meth:`__init__` work together in constructing " "objects (:meth:`__new__` to create it, and :meth:`__init__` to customize " @@ -1750,7 +1818,7 @@ msgid "" "will cause a :exc:`TypeError` to be raised at runtime." msgstr "" -#: ../../reference/datamodel.rst:1588 +#: ../../reference/datamodel.rst:1623 msgid "" "Called when the instance is about to be destroyed. This is also called a " "finalizer or (improperly) a destructor. If a base class has a :meth:" @@ -1759,7 +1827,7 @@ msgid "" "instance." msgstr "" -#: ../../reference/datamodel.rst:1594 +#: ../../reference/datamodel.rst:1629 msgid "" "It is possible (though not recommended!) for the :meth:`__del__` method to " "postpone destruction of the instance by creating a new reference to it. " @@ -1769,20 +1837,20 @@ msgid "" "it once." msgstr "" -#: ../../reference/datamodel.rst:1601 +#: ../../reference/datamodel.rst:1636 msgid "" "It is not guaranteed that :meth:`__del__` methods are called for objects " "that still exist when the interpreter exits." msgstr "" -#: ../../reference/datamodel.rst:1606 +#: ../../reference/datamodel.rst:1641 msgid "" "``del x`` doesn't directly call ``x.__del__()`` --- the former decrements " "the reference count for ``x`` by one, and the latter is only called when " "``x``'s reference count reaches zero." msgstr "" -#: ../../reference/datamodel.rst:1611 +#: ../../reference/datamodel.rst:1646 msgid "" "It is possible for a reference cycle to prevent the reference count of an " "object from going to zero. In this case, the cycle will be later detected " @@ -1793,18 +1861,18 @@ msgid "" "caught in the traceback." msgstr "" -#: ../../reference/datamodel.rst:1621 +#: ../../reference/datamodel.rst:1656 msgid "Documentation for the :mod:`gc` module." msgstr "" -#: ../../reference/datamodel.rst:1625 +#: ../../reference/datamodel.rst:1660 msgid "" "Due to the precarious circumstances under which :meth:`__del__` methods are " "invoked, exceptions that occur during their execution are ignored, and a " "warning is printed to ``sys.stderr`` instead. In particular:" msgstr "" -#: ../../reference/datamodel.rst:1629 +#: ../../reference/datamodel.rst:1664 msgid "" ":meth:`__del__` can be invoked when arbitrary code is being executed, " "including from any arbitrary thread. If :meth:`__del__` needs to take a " @@ -1813,7 +1881,7 @@ msgid "" "`__del__`." msgstr "" -#: ../../reference/datamodel.rst:1635 +#: ../../reference/datamodel.rst:1670 msgid "" ":meth:`__del__` can be executed during interpreter shutdown. As a " "consequence, the global variables it needs to access (including other " @@ -1824,7 +1892,7 @@ msgid "" "still available at the time when the :meth:`__del__` method is called." msgstr "" -#: ../../reference/datamodel.rst:1650 +#: ../../reference/datamodel.rst:1685 msgid "" "Called by the :func:`repr` built-in function to compute the \"official\" " "string representation of an object. If at all possible, this should look " @@ -1836,13 +1904,13 @@ msgid "" "an \"informal\" string representation of instances of that class is required." msgstr "" -#: ../../reference/datamodel.rst:1659 +#: ../../reference/datamodel.rst:1694 msgid "" "This is typically used for debugging, so it is important that the " "representation is information-rich and unambiguous." msgstr "" -#: ../../reference/datamodel.rst:1670 +#: ../../reference/datamodel.rst:1705 msgid "" "Called by :func:`str(object) ` and the built-in functions :func:" "`format` and :func:`print` to compute the \"informal\" or nicely printable " @@ -1850,26 +1918,26 @@ msgid "" "` object." msgstr "" -#: ../../reference/datamodel.rst:1675 +#: ../../reference/datamodel.rst:1710 msgid "" "This method differs from :meth:`object.__repr__` in that there is no " "expectation that :meth:`__str__` return a valid Python expression: a more " "convenient or concise representation can be used." msgstr "" -#: ../../reference/datamodel.rst:1679 +#: ../../reference/datamodel.rst:1714 msgid "" "The default implementation defined by the built-in type :class:`object` " "calls :meth:`object.__repr__`." msgstr "" -#: ../../reference/datamodel.rst:1689 +#: ../../reference/datamodel.rst:1724 msgid "" "Called by :ref:`bytes ` to compute a byte-string representation " "of an object. This should return a :class:`bytes` object." msgstr "" -#: ../../reference/datamodel.rst:1700 +#: ../../reference/datamodel.rst:1735 msgid "" "Called by the :func:`format` built-in function, and by extension, evaluation " "of :ref:`formatted string literals ` and the :meth:`str.format` " @@ -1881,28 +1949,28 @@ msgid "" "formatting option syntax." msgstr "" -#: ../../reference/datamodel.rst:1710 +#: ../../reference/datamodel.rst:1745 msgid "" "See :ref:`formatspec` for a description of the standard formatting syntax." msgstr "" -#: ../../reference/datamodel.rst:1712 +#: ../../reference/datamodel.rst:1747 msgid "The return value must be a string object." msgstr "" -#: ../../reference/datamodel.rst:1714 +#: ../../reference/datamodel.rst:1749 msgid "" "The __format__ method of ``object`` itself raises a :exc:`TypeError` if " "passed any non-empty string." msgstr "" -#: ../../reference/datamodel.rst:1718 +#: ../../reference/datamodel.rst:1753 msgid "" "``object.__format__(x, '')`` is now equivalent to ``str(x)`` rather than " "``format(str(x), '')``." msgstr "" -#: ../../reference/datamodel.rst:1734 +#: ../../reference/datamodel.rst:1769 msgid "" "These are the so-called \"rich comparison\" methods. The correspondence " "between operator symbols and method names is as follows: ``x.__hash__``." msgstr "" -#: ../../reference/datamodel.rst:1823 +#: ../../reference/datamodel.rst:1858 msgid "" "If a class that does not override :meth:`__eq__` wishes to suppress hash " "support, it should include ``__hash__ = None`` in the class definition. A " @@ -2021,7 +2089,7 @@ msgid "" "``isinstance(obj, collections.abc.Hashable)`` call." msgstr "" -#: ../../reference/datamodel.rst:1832 +#: ../../reference/datamodel.rst:1867 msgid "" "By default, the :meth:`__hash__` values of str and bytes objects are " "\"salted\" with an unpredictable random value. Although they remain " @@ -2029,30 +2097,30 @@ msgid "" "between repeated invocations of Python." msgstr "" -#: ../../reference/datamodel.rst:1837 +#: ../../reference/datamodel.rst:1872 msgid "" "This is intended to provide protection against a denial-of-service caused by " "carefully chosen inputs that exploit the worst case performance of a dict " -"insertion, O(n\\ :sup:`2`) complexity. See http://ocert.org/advisories/" -"ocert-2011-003.html for details." +"insertion, *O*\\ (*n*\\ :sup:`2`) complexity. See http://ocert.org/" +"advisories/ocert-2011-003.html for details." msgstr "" -#: ../../reference/datamodel.rst:1842 +#: ../../reference/datamodel.rst:1877 msgid "" "Changing hash values affects the iteration order of sets. Python has never " "made guarantees about this ordering (and it typically varies between 32-bit " "and 64-bit builds)." msgstr "" -#: ../../reference/datamodel.rst:1846 +#: ../../reference/datamodel.rst:1881 msgid "See also :envvar:`PYTHONHASHSEED`." msgstr "另請參閱 :envvar:`PYTHONHASHSEED`\\ 。" -#: ../../reference/datamodel.rst:1848 +#: ../../reference/datamodel.rst:1883 msgid "Hash randomization is enabled by default." msgstr "" -#: ../../reference/datamodel.rst:1856 +#: ../../reference/datamodel.rst:1891 msgid "" "Called to implement truth value testing and the built-in operation " "``bool()``; should return ``False`` or ``True``. When this method is not " @@ -2061,18 +2129,18 @@ msgid "" "meth:`!__len__` nor :meth:`!__bool__`, all its instances are considered true." msgstr "" -#: ../../reference/datamodel.rst:1867 +#: ../../reference/datamodel.rst:1902 msgid "Customizing attribute access" msgstr "" -#: ../../reference/datamodel.rst:1869 +#: ../../reference/datamodel.rst:1904 msgid "" "The following methods can be defined to customize the meaning of attribute " "access (use of, assignment to, or deletion of ``x.name``) for class " "instances." msgstr "" -#: ../../reference/datamodel.rst:1877 +#: ../../reference/datamodel.rst:1912 msgid "" "Called when the default attribute access fails with an :exc:`AttributeError` " "(either :meth:`__getattribute__` raises an :exc:`AttributeError` because " @@ -2082,7 +2150,7 @@ msgid "" "attribute value or raise an :exc:`AttributeError` exception." msgstr "" -#: ../../reference/datamodel.rst:1884 +#: ../../reference/datamodel.rst:1919 msgid "" "Note that if the attribute is found through the normal mechanism, :meth:" "`__getattr__` is not called. (This is an intentional asymmetry between :" @@ -2095,7 +2163,7 @@ msgid "" "actually get total control over attribute access." msgstr "" -#: ../../reference/datamodel.rst:1897 +#: ../../reference/datamodel.rst:1932 msgid "" "Called unconditionally to implement attribute accesses for instances of the " "class. If the class also defines :meth:`__getattr__`, the latter will not be " @@ -2107,14 +2175,14 @@ msgid "" "example, ``object.__getattribute__(self, name)``." msgstr "" -#: ../../reference/datamodel.rst:1908 +#: ../../reference/datamodel.rst:1943 msgid "" "This method may still be bypassed when looking up special methods as the " "result of implicit invocation via language syntax or :ref:`built-in " "functions `. See :ref:`special-lookup`." msgstr "" -#: ../../reference/datamodel.rst:1913 +#: ../../reference/datamodel.rst:1948 msgid "" "Raises an :ref:`auditing event ` ``object.__getattr__`` with " "arguments ``obj``, ``name``." @@ -2122,27 +2190,27 @@ msgstr "" "引發一個附帶引數 ``obj``、``name`` 的\\ :ref:`稽核事件 ` ``object." "__getattr__``。" -#: ../../reference/datamodel.rst:1915 +#: ../../reference/datamodel.rst:1950 msgid "" "For certain sensitive attribute accesses, raises an :ref:`auditing event " "` ``object.__getattr__`` with arguments ``obj`` and ``name``." msgstr "" -#: ../../reference/datamodel.rst:1922 +#: ../../reference/datamodel.rst:1957 msgid "" "Called when an attribute assignment is attempted. This is called instead of " "the normal mechanism (i.e. store the value in the instance dictionary). " "*name* is the attribute name, *value* is the value to be assigned to it." msgstr "" -#: ../../reference/datamodel.rst:1926 +#: ../../reference/datamodel.rst:1961 msgid "" "If :meth:`__setattr__` wants to assign to an instance attribute, it should " "call the base class method with the same name, for example, ``object." "__setattr__(self, name, value)``." msgstr "" -#: ../../reference/datamodel.rst:1930 +#: ../../reference/datamodel.rst:1965 msgid "" "Raises an :ref:`auditing event ` ``object.__setattr__`` with " "arguments ``obj``, ``name``, ``value``." @@ -2150,21 +2218,21 @@ msgstr "" "引發一個附帶引數 ``obj``、``name``、``value`` 的\\ :ref:`稽核事件 " "` ``object.__setattr__``。" -#: ../../reference/datamodel.rst:1932 +#: ../../reference/datamodel.rst:1967 msgid "" "For certain sensitive attribute assignments, raises an :ref:`auditing event " "` ``object.__setattr__`` with arguments ``obj``, ``name``, " "``value``." msgstr "" -#: ../../reference/datamodel.rst:1939 +#: ../../reference/datamodel.rst:1974 msgid "" "Like :meth:`__setattr__` but for attribute deletion instead of assignment. " "This should only be implemented if ``del obj.name`` is meaningful for the " "object." msgstr "" -#: ../../reference/datamodel.rst:1942 +#: ../../reference/datamodel.rst:1977 msgid "" "Raises an :ref:`auditing event ` ``object.__delattr__`` with " "arguments ``obj``, ``name``." @@ -2172,23 +2240,23 @@ msgstr "" "引發一個附帶引數 ``obj``、``name`` 的\\ :ref:`稽核事件 ` ``object." "__delattr__``。" -#: ../../reference/datamodel.rst:1944 +#: ../../reference/datamodel.rst:1979 msgid "" "For certain sensitive attribute deletions, raises an :ref:`auditing event " "` ``object.__delattr__`` with arguments ``obj`` and ``name``." msgstr "" -#: ../../reference/datamodel.rst:1951 +#: ../../reference/datamodel.rst:1986 msgid "" "Called when :func:`dir` is called on the object. A sequence must be " "returned. :func:`dir` converts the returned sequence to a list and sorts it." msgstr "" -#: ../../reference/datamodel.rst:1956 +#: ../../reference/datamodel.rst:1991 msgid "Customizing module attribute access" msgstr "" -#: ../../reference/datamodel.rst:1963 +#: ../../reference/datamodel.rst:1998 msgid "" "Special names ``__getattr__`` and ``__dir__`` can be also used to customize " "access to module attributes. The ``__getattr__`` function at the module " @@ -2200,21 +2268,21 @@ msgid "" "with the attribute name and the result is returned." msgstr "" -#: ../../reference/datamodel.rst:1972 +#: ../../reference/datamodel.rst:2007 msgid "" "The ``__dir__`` function should accept no arguments, and return a sequence " "of strings that represents the names accessible on module. If present, this " "function overrides the standard :func:`dir` search on a module." msgstr "" -#: ../../reference/datamodel.rst:1976 +#: ../../reference/datamodel.rst:2011 msgid "" "For a more fine grained customization of the module behavior (setting " "attributes, properties, etc.), one can set the ``__class__`` attribute of a " "module object to a subclass of :class:`types.ModuleType`. For example::" msgstr "" -#: ../../reference/datamodel.rst:1994 +#: ../../reference/datamodel.rst:2029 msgid "" "Defining module ``__getattr__`` and setting module ``__class__`` only affect " "lookups made using the attribute access syntax -- directly accessing the " @@ -2222,27 +2290,27 @@ msgid "" "module's globals dictionary) is unaffected." msgstr "" -#: ../../reference/datamodel.rst:1999 +#: ../../reference/datamodel.rst:2034 msgid "``__class__`` module attribute is now writable." msgstr "" -#: ../../reference/datamodel.rst:2002 +#: ../../reference/datamodel.rst:2037 msgid "``__getattr__`` and ``__dir__`` module attributes." msgstr "" -#: ../../reference/datamodel.rst:2007 +#: ../../reference/datamodel.rst:2042 msgid ":pep:`562` - Module __getattr__ and __dir__" msgstr ":pep:`562` - 模組 __getattr__ 和 __dir__" -#: ../../reference/datamodel.rst:2008 +#: ../../reference/datamodel.rst:2043 msgid "Describes the ``__getattr__`` and ``__dir__`` functions on modules." msgstr "" -#: ../../reference/datamodel.rst:2014 +#: ../../reference/datamodel.rst:2049 msgid "Implementing Descriptors" msgstr "" -#: ../../reference/datamodel.rst:2016 +#: ../../reference/datamodel.rst:2051 msgid "" "The following methods only apply when an instance of the class containing " "the method (a so-called *descriptor* class) appears in an *owner* class (the " @@ -2252,7 +2320,7 @@ msgid "" "the owner class' :attr:`~object.__dict__`." msgstr "" -#: ../../reference/datamodel.rst:2026 +#: ../../reference/datamodel.rst:2061 msgid "" "Called to get the attribute of the owner class (class attribute access) or " "of an instance of that class (instance attribute access). The optional " @@ -2261,13 +2329,13 @@ msgid "" "accessed through the *owner*." msgstr "" -#: ../../reference/datamodel.rst:2032 +#: ../../reference/datamodel.rst:2067 msgid "" "This method should return the computed attribute value or raise an :exc:" "`AttributeError` exception." msgstr "" -#: ../../reference/datamodel.rst:2035 +#: ../../reference/datamodel.rst:2070 msgid "" ":PEP:`252` specifies that :meth:`__get__` is callable with one or two " "arguments. Python's own built-in descriptors support this specification; " @@ -2277,31 +2345,31 @@ msgid "" "not." msgstr "" -#: ../../reference/datamodel.rst:2044 +#: ../../reference/datamodel.rst:2079 msgid "" "Called to set the attribute on an instance *instance* of the owner class to " "a new value, *value*." msgstr "" -#: ../../reference/datamodel.rst:2047 +#: ../../reference/datamodel.rst:2082 msgid "" "Note, adding :meth:`__set__` or :meth:`__delete__` changes the kind of " "descriptor to a \"data descriptor\". See :ref:`descriptor-invocation` for " "more details." msgstr "" -#: ../../reference/datamodel.rst:2053 +#: ../../reference/datamodel.rst:2088 msgid "" "Called to delete the attribute on an instance *instance* of the owner class." msgstr "" -#: ../../reference/datamodel.rst:2055 +#: ../../reference/datamodel.rst:2090 msgid "" "Instances of descriptors may also have the :attr:`!__objclass__` attribute " "present:" msgstr "" -#: ../../reference/datamodel.rst:2060 +#: ../../reference/datamodel.rst:2095 msgid "" "The attribute :attr:`!__objclass__` is interpreted by the :mod:`inspect` " "module as specifying the class where this object was defined (setting this " @@ -2312,11 +2380,11 @@ msgid "" "are implemented in C)." msgstr "" -#: ../../reference/datamodel.rst:2071 +#: ../../reference/datamodel.rst:2106 msgid "Invoking Descriptors" msgstr "" -#: ../../reference/datamodel.rst:2073 +#: ../../reference/datamodel.rst:2108 msgid "" "In general, a descriptor is an object attribute with \"binding behavior\", " "one whose attribute access has been overridden by methods in the descriptor " @@ -2325,7 +2393,7 @@ msgid "" "is said to be a descriptor." msgstr "" -#: ../../reference/datamodel.rst:2079 +#: ../../reference/datamodel.rst:2114 msgid "" "The default behavior for attribute access is to get, set, or delete the " "attribute from an object's dictionary. For instance, ``a.x`` has a lookup " @@ -2333,7 +2401,7 @@ msgid "" "continuing through the base classes of ``type(a)`` excluding metaclasses." msgstr "" -#: ../../reference/datamodel.rst:2084 +#: ../../reference/datamodel.rst:2119 msgid "" "However, if the looked-up value is an object defining one of the descriptor " "methods, then Python may override the default behavior and invoke the " @@ -2341,54 +2409,54 @@ msgid "" "depends on which descriptor methods were defined and how they were called." msgstr "" -#: ../../reference/datamodel.rst:2089 +#: ../../reference/datamodel.rst:2124 msgid "" "The starting point for descriptor invocation is a binding, ``a.x``. How the " "arguments are assembled depends on ``a``:" msgstr "" -#: ../../reference/datamodel.rst:2094 +#: ../../reference/datamodel.rst:2129 msgid "Direct Call" msgstr "" -#: ../../reference/datamodel.rst:2093 +#: ../../reference/datamodel.rst:2128 msgid "" "The simplest and least common call is when user code directly invokes a " "descriptor method: ``x.__get__(a)``." msgstr "" -#: ../../reference/datamodel.rst:2098 +#: ../../reference/datamodel.rst:2133 msgid "Instance Binding" msgstr "" -#: ../../reference/datamodel.rst:2097 +#: ../../reference/datamodel.rst:2132 msgid "" "If binding to an object instance, ``a.x`` is transformed into the call: " "``type(a).__dict__['x'].__get__(a, type(a))``." msgstr "" -#: ../../reference/datamodel.rst:2102 +#: ../../reference/datamodel.rst:2137 msgid "Class Binding" msgstr "" -#: ../../reference/datamodel.rst:2101 +#: ../../reference/datamodel.rst:2136 msgid "" "If binding to a class, ``A.x`` is transformed into the call: ``A." "__dict__['x'].__get__(None, A)``." msgstr "" -#: ../../reference/datamodel.rst:2108 +#: ../../reference/datamodel.rst:2143 msgid "Super Binding" msgstr "" -#: ../../reference/datamodel.rst:2105 +#: ../../reference/datamodel.rst:2140 msgid "" "A dotted lookup such as ``super(A, a).x`` searches ``a.__class__.__mro__`` " "for a base class ``B`` following ``A`` and then returns ``B.__dict__['x']." "__get__(a, A)``. If not a descriptor, ``x`` is returned unchanged." msgstr "" -#: ../../reference/datamodel.rst:2142 +#: ../../reference/datamodel.rst:2177 msgid "" "For instance bindings, the precedence of descriptor invocation depends on " "which descriptor methods are defined. A descriptor can define any " @@ -2406,7 +2474,7 @@ msgid "" "instances." msgstr "" -#: ../../reference/datamodel.rst:2157 +#: ../../reference/datamodel.rst:2192 msgid "" "Python methods (including those decorated with :func:`@staticmethod " "` and :func:`@classmethod `) are implemented as " @@ -2415,30 +2483,30 @@ msgid "" "from other instances of the same class." msgstr "" -#: ../../reference/datamodel.rst:2163 +#: ../../reference/datamodel.rst:2198 msgid "" "The :func:`property` function is implemented as a data descriptor. " "Accordingly, instances cannot override the behavior of a property." msgstr "" -#: ../../reference/datamodel.rst:2170 +#: ../../reference/datamodel.rst:2205 msgid "__slots__" msgstr "__slots__" -#: ../../reference/datamodel.rst:2172 +#: ../../reference/datamodel.rst:2207 msgid "" "*__slots__* allow us to explicitly declare data members (like properties) " "and deny the creation of :attr:`~object.__dict__` and *__weakref__* (unless " "explicitly declared in *__slots__* or available in a parent.)" msgstr "" -#: ../../reference/datamodel.rst:2176 +#: ../../reference/datamodel.rst:2211 msgid "" "The space saved over using :attr:`~object.__dict__` can be significant. " "Attribute lookup speed can be significantly improved as well." msgstr "" -#: ../../reference/datamodel.rst:2181 +#: ../../reference/datamodel.rst:2216 msgid "" "This class variable can be assigned a string, iterable, or sequence of " "strings with variable names used by instances. *__slots__* reserves space " @@ -2446,18 +2514,18 @@ msgid "" "`~object.__dict__` and *__weakref__* for each instance." msgstr "" -#: ../../reference/datamodel.rst:2190 +#: ../../reference/datamodel.rst:2225 msgid "Notes on using *__slots__*:" msgstr "" -#: ../../reference/datamodel.rst:2192 +#: ../../reference/datamodel.rst:2227 msgid "" "When inheriting from a class without *__slots__*, the :attr:`~object." "__dict__` and *__weakref__* attribute of the instances will always be " "accessible." msgstr "" -#: ../../reference/datamodel.rst:2196 +#: ../../reference/datamodel.rst:2231 msgid "" "Without a :attr:`~object.__dict__` variable, instances cannot be assigned " "new variables not listed in the *__slots__* definition. Attempts to assign " @@ -2466,7 +2534,7 @@ msgid "" "sequence of strings in the *__slots__* declaration." msgstr "" -#: ../../reference/datamodel.rst:2203 +#: ../../reference/datamodel.rst:2238 msgid "" "Without a *__weakref__* variable for each instance, classes defining " "*__slots__* do not support :mod:`weak references ` to its " @@ -2474,7 +2542,7 @@ msgid "" "to the sequence of strings in the *__slots__* declaration." msgstr "" -#: ../../reference/datamodel.rst:2209 +#: ../../reference/datamodel.rst:2244 msgid "" "*__slots__* are implemented at the class level by creating :ref:`descriptors " "` for each variable name. As a result, class attributes cannot " @@ -2482,7 +2550,7 @@ msgid "" "otherwise, the class attribute would overwrite the descriptor assignment." msgstr "" -#: ../../reference/datamodel.rst:2215 +#: ../../reference/datamodel.rst:2250 msgid "" "The action of a *__slots__* declaration is not limited to the class where it " "is defined. *__slots__* declared in parents are available in child classes. " @@ -2491,7 +2559,7 @@ msgid "" "names of any *additional* slots)." msgstr "" -#: ../../reference/datamodel.rst:2221 +#: ../../reference/datamodel.rst:2256 msgid "" "If a class defines a slot also defined in a base class, the instance " "variable defined by the base class slot is inaccessible (except by " @@ -2500,7 +2568,7 @@ msgid "" "prevent this." msgstr "" -#: ../../reference/datamodel.rst:2226 +#: ../../reference/datamodel.rst:2261 msgid "" ":exc:`TypeError` will be raised if nonempty *__slots__* are defined for a " "class derived from a :c:member:`\"variable-length\" built-in type " @@ -2508,11 +2576,11 @@ msgid "" "`tuple`." msgstr "" -#: ../../reference/datamodel.rst:2231 +#: ../../reference/datamodel.rst:2266 msgid "Any non-string :term:`iterable` may be assigned to *__slots__*." msgstr "" -#: ../../reference/datamodel.rst:2233 +#: ../../reference/datamodel.rst:2268 msgid "" "If a :class:`dictionary ` is used to assign *__slots__*, the " "dictionary keys will be used as the slot names. The values of the dictionary " @@ -2520,13 +2588,13 @@ msgid "" "func:`inspect.getdoc` and displayed in the output of :func:`help`." msgstr "" -#: ../../reference/datamodel.rst:2238 +#: ../../reference/datamodel.rst:2273 msgid "" ":attr:`~instance.__class__` assignment works only if both classes have the " "same *__slots__*." msgstr "" -#: ../../reference/datamodel.rst:2241 +#: ../../reference/datamodel.rst:2276 msgid "" ":ref:`Multiple inheritance ` with multiple slotted parent " "classes can be used, but only one parent is allowed to have attributes " @@ -2534,18 +2602,18 @@ msgid "" "raise :exc:`TypeError`." msgstr "" -#: ../../reference/datamodel.rst:2247 +#: ../../reference/datamodel.rst:2282 msgid "" "If an :term:`iterator` is used for *__slots__* then a :term:`descriptor` is " "created for each of the iterator's values. However, the *__slots__* " "attribute will be an empty iterator." msgstr "" -#: ../../reference/datamodel.rst:2255 +#: ../../reference/datamodel.rst:2290 msgid "Customizing class creation" msgstr "" -#: ../../reference/datamodel.rst:2257 +#: ../../reference/datamodel.rst:2292 msgid "" "Whenever a class inherits from another class, :meth:`~object." "__init_subclass__` is called on the parent class. This way, it is possible " @@ -2555,28 +2623,28 @@ msgid "" "future subclasses of the class defining the method." msgstr "" -#: ../../reference/datamodel.rst:2266 +#: ../../reference/datamodel.rst:2301 msgid "" "This method is called whenever the containing class is subclassed. *cls* is " "then the new subclass. If defined as a normal instance method, this method " "is implicitly converted to a class method." msgstr "" -#: ../../reference/datamodel.rst:2270 +#: ../../reference/datamodel.rst:2305 msgid "" -"Keyword arguments which are given to a new class are passed to the parent's " -"class ``__init_subclass__``. For compatibility with other classes using " +"Keyword arguments which are given to a new class are passed to the parent " +"class's ``__init_subclass__``. For compatibility with other classes using " "``__init_subclass__``, one should take out the needed keyword arguments and " "pass the others over to the base class, as in::" msgstr "" -#: ../../reference/datamodel.rst:2284 +#: ../../reference/datamodel.rst:2319 msgid "" "The default implementation ``object.__init_subclass__`` does nothing, but " "raises an error if it is called with any arguments." msgstr "" -#: ../../reference/datamodel.rst:2289 +#: ../../reference/datamodel.rst:2324 msgid "" "The metaclass hint ``metaclass`` is consumed by the rest of the type " "machinery, and is never passed to ``__init_subclass__`` implementations. The " @@ -2584,41 +2652,41 @@ msgid "" "``type(cls)``." msgstr "" -#: ../../reference/datamodel.rst:2297 +#: ../../reference/datamodel.rst:2332 msgid "" "When a class is created, :meth:`type.__new__` scans the class variables and " "makes callbacks to those with a :meth:`~object.__set_name__` hook." msgstr "" -#: ../../reference/datamodel.rst:2302 +#: ../../reference/datamodel.rst:2337 msgid "" "Automatically called at the time the owning class *owner* is created. The " "object has been assigned to *name* in that class::" msgstr "" -#: ../../reference/datamodel.rst:2308 +#: ../../reference/datamodel.rst:2343 msgid "" "If the class variable is assigned after the class is created, :meth:" "`__set_name__` will not be called automatically. If needed, :meth:" "`__set_name__` can be called directly::" msgstr "" -#: ../../reference/datamodel.rst:2319 +#: ../../reference/datamodel.rst:2354 msgid "See :ref:`class-object-creation` for more details." msgstr "更多細節請見 :ref:`class-object-creation`\\ 。" -#: ../../reference/datamodel.rst:2327 +#: ../../reference/datamodel.rst:2362 msgid "Metaclasses" msgstr "" -#: ../../reference/datamodel.rst:2334 +#: ../../reference/datamodel.rst:2369 msgid "" "By default, classes are constructed using :func:`type`. The class body is " "executed in a new namespace and the class name is bound locally to the " "result of ``type(name, bases, namespace)``." msgstr "" -#: ../../reference/datamodel.rst:2338 +#: ../../reference/datamodel.rst:2373 msgid "" "The class creation process can be customized by passing the ``metaclass`` " "keyword argument in the class definition line, or by inheriting from an " @@ -2626,41 +2694,41 @@ msgid "" "both ``MyClass`` and ``MySubclass`` are instances of ``Meta``::" msgstr "" -#: ../../reference/datamodel.rst:2352 +#: ../../reference/datamodel.rst:2387 msgid "" "Any other keyword arguments that are specified in the class definition are " "passed through to all metaclass operations described below." msgstr "" -#: ../../reference/datamodel.rst:2355 +#: ../../reference/datamodel.rst:2390 msgid "When a class definition is executed, the following steps occur:" msgstr "" -#: ../../reference/datamodel.rst:2357 +#: ../../reference/datamodel.rst:2392 msgid "MRO entries are resolved;" msgstr "" -#: ../../reference/datamodel.rst:2358 +#: ../../reference/datamodel.rst:2393 msgid "the appropriate metaclass is determined;" msgstr "" -#: ../../reference/datamodel.rst:2359 +#: ../../reference/datamodel.rst:2394 msgid "the class namespace is prepared;" msgstr "" -#: ../../reference/datamodel.rst:2360 +#: ../../reference/datamodel.rst:2395 msgid "the class body is executed;" msgstr "" -#: ../../reference/datamodel.rst:2361 +#: ../../reference/datamodel.rst:2396 msgid "the class object is created." msgstr "" -#: ../../reference/datamodel.rst:2365 +#: ../../reference/datamodel.rst:2400 msgid "Resolving MRO entries" msgstr "" -#: ../../reference/datamodel.rst:2369 +#: ../../reference/datamodel.rst:2404 msgid "" "If a base that appears in a class definition is not an instance of :class:" "`type`, then an :meth:`!__mro_entries__` method is searched on the base. If " @@ -2672,59 +2740,59 @@ msgid "" "is ignored." msgstr "" -#: ../../reference/datamodel.rst:2381 +#: ../../reference/datamodel.rst:2416 msgid ":func:`types.resolve_bases`" msgstr ":func:`types.resolve_bases`" -#: ../../reference/datamodel.rst:2381 +#: ../../reference/datamodel.rst:2416 msgid "Dynamically resolve bases that are not instances of :class:`type`." msgstr "" -#: ../../reference/datamodel.rst:2385 +#: ../../reference/datamodel.rst:2420 msgid ":func:`types.get_original_bases`" msgstr ":func:`types.get_original_bases`" -#: ../../reference/datamodel.rst:2384 +#: ../../reference/datamodel.rst:2419 msgid "" "Retrieve a class's \"original bases\" prior to modifications by :meth:" "`~object.__mro_entries__`." msgstr "" -#: ../../reference/datamodel.rst:2387 +#: ../../reference/datamodel.rst:2422 msgid ":pep:`560`" msgstr ":pep:`560`" -#: ../../reference/datamodel.rst:2388 +#: ../../reference/datamodel.rst:2423 msgid "Core support for typing module and generic types." msgstr "" -#: ../../reference/datamodel.rst:2392 +#: ../../reference/datamodel.rst:2427 msgid "Determining the appropriate metaclass" msgstr "" -#: ../../reference/datamodel.rst:2396 +#: ../../reference/datamodel.rst:2431 msgid "" "The appropriate metaclass for a class definition is determined as follows:" msgstr "" -#: ../../reference/datamodel.rst:2398 +#: ../../reference/datamodel.rst:2433 msgid "" "if no bases and no explicit metaclass are given, then :func:`type` is used;" msgstr "" -#: ../../reference/datamodel.rst:2399 +#: ../../reference/datamodel.rst:2434 msgid "" "if an explicit metaclass is given and it is *not* an instance of :func:" "`type`, then it is used directly as the metaclass;" msgstr "" -#: ../../reference/datamodel.rst:2401 +#: ../../reference/datamodel.rst:2436 msgid "" "if an instance of :func:`type` is given as the explicit metaclass, or bases " "are defined, then the most derived metaclass is used." msgstr "" -#: ../../reference/datamodel.rst:2404 +#: ../../reference/datamodel.rst:2439 msgid "" "The most derived metaclass is selected from the explicitly specified " "metaclass (if any) and the metaclasses (i.e. ``type(cls)``) of all specified " @@ -2733,11 +2801,11 @@ msgid "" "that criterion, then the class definition will fail with ``TypeError``." msgstr "" -#: ../../reference/datamodel.rst:2414 +#: ../../reference/datamodel.rst:2449 msgid "Preparing the class namespace" msgstr "" -#: ../../reference/datamodel.rst:2419 +#: ../../reference/datamodel.rst:2454 msgid "" "Once the appropriate metaclass has been identified, then the class namespace " "is prepared. If the metaclass has a ``__prepare__`` attribute, it is called " @@ -2749,25 +2817,25 @@ msgid "" "copied into a new ``dict``." msgstr "" -#: ../../reference/datamodel.rst:2428 +#: ../../reference/datamodel.rst:2463 msgid "" "If the metaclass has no ``__prepare__`` attribute, then the class namespace " "is initialised as an empty ordered mapping." msgstr "" -#: ../../reference/datamodel.rst:2433 +#: ../../reference/datamodel.rst:2468 msgid ":pep:`3115` - Metaclasses in Python 3000" msgstr "" -#: ../../reference/datamodel.rst:2434 +#: ../../reference/datamodel.rst:2469 msgid "Introduced the ``__prepare__`` namespace hook" msgstr "" -#: ../../reference/datamodel.rst:2438 +#: ../../reference/datamodel.rst:2473 msgid "Executing the class body" msgstr "" -#: ../../reference/datamodel.rst:2443 +#: ../../reference/datamodel.rst:2478 msgid "" "The class body is executed (approximately) as ``exec(body, globals(), " "namespace)``. The key difference from a normal call to :func:`exec` is that " @@ -2776,7 +2844,7 @@ msgid "" "inside a function." msgstr "" -#: ../../reference/datamodel.rst:2449 +#: ../../reference/datamodel.rst:2484 msgid "" "However, even when the class definition occurs inside the function, methods " "defined inside the class still cannot see names defined at the class scope. " @@ -2785,11 +2853,11 @@ msgid "" "reference described in the next section." msgstr "" -#: ../../reference/datamodel.rst:2458 +#: ../../reference/datamodel.rst:2493 msgid "Creating the class object" msgstr "" -#: ../../reference/datamodel.rst:2465 +#: ../../reference/datamodel.rst:2500 msgid "" "Once the class namespace has been populated by executing the class body, the " "class object is created by calling ``metaclass(name, bases, namespace, " @@ -2797,7 +2865,7 @@ msgid "" "to ``__prepare__``)." msgstr "" -#: ../../reference/datamodel.rst:2470 +#: ../../reference/datamodel.rst:2505 msgid "" "This class object is the one that will be referenced by the zero-argument " "form of :func:`super`. ``__class__`` is an implicit closure reference " @@ -2808,7 +2876,7 @@ msgid "" "is identified based on the first argument passed to the method." msgstr "" -#: ../../reference/datamodel.rst:2480 +#: ../../reference/datamodel.rst:2515 msgid "" "In CPython 3.6 and later, the ``__class__`` cell is passed to the metaclass " "as a ``__classcell__`` entry in the class namespace. If present, this must " @@ -2817,39 +2885,39 @@ msgid "" "in Python 3.8." msgstr "" -#: ../../reference/datamodel.rst:2486 +#: ../../reference/datamodel.rst:2521 msgid "" "When using the default metaclass :class:`type`, or any metaclass that " "ultimately calls ``type.__new__``, the following additional customization " "steps are invoked after creating the class object:" msgstr "" -#: ../../reference/datamodel.rst:2490 +#: ../../reference/datamodel.rst:2525 msgid "" "The ``type.__new__`` method collects all of the attributes in the class " "namespace that define a :meth:`~object.__set_name__` method;" msgstr "" -#: ../../reference/datamodel.rst:2492 +#: ../../reference/datamodel.rst:2527 msgid "" "Those ``__set_name__`` methods are called with the class being defined and " "the assigned name of that particular attribute;" msgstr "" -#: ../../reference/datamodel.rst:2494 +#: ../../reference/datamodel.rst:2529 msgid "" "The :meth:`~object.__init_subclass__` hook is called on the immediate parent " "of the new class in its method resolution order." msgstr "" -#: ../../reference/datamodel.rst:2497 +#: ../../reference/datamodel.rst:2532 msgid "" "After the class object is created, it is passed to the class decorators " "included in the class definition (if any) and the resulting object is bound " "in the local namespace as the defined class." msgstr "" -#: ../../reference/datamodel.rst:2501 +#: ../../reference/datamodel.rst:2536 msgid "" "When a new class is created by ``type.__new__``, the object provided as the " "namespace parameter is copied to a new ordered mapping and the original " @@ -2857,19 +2925,19 @@ msgid "" "becomes the :attr:`~object.__dict__` attribute of the class object." msgstr "" -#: ../../reference/datamodel.rst:2508 +#: ../../reference/datamodel.rst:2543 msgid ":pep:`3135` - New super" msgstr "" -#: ../../reference/datamodel.rst:2509 +#: ../../reference/datamodel.rst:2544 msgid "Describes the implicit ``__class__`` closure reference" msgstr "" -#: ../../reference/datamodel.rst:2513 +#: ../../reference/datamodel.rst:2548 msgid "Uses for metaclasses" msgstr "" -#: ../../reference/datamodel.rst:2515 +#: ../../reference/datamodel.rst:2550 msgid "" "The potential uses for metaclasses are boundless. Some ideas that have been " "explored include enum, logging, interface checking, automatic delegation, " @@ -2877,17 +2945,17 @@ msgid "" "locking/synchronization." msgstr "" -#: ../../reference/datamodel.rst:2522 +#: ../../reference/datamodel.rst:2557 msgid "Customizing instance and subclass checks" msgstr "" -#: ../../reference/datamodel.rst:2524 +#: ../../reference/datamodel.rst:2559 msgid "" "The following methods are used to override the default behavior of the :func:" "`isinstance` and :func:`issubclass` built-in functions." msgstr "" -#: ../../reference/datamodel.rst:2527 +#: ../../reference/datamodel.rst:2562 msgid "" "In particular, the metaclass :class:`abc.ABCMeta` implements these methods " "in order to allow the addition of Abstract Base Classes (ABCs) as \"virtual " @@ -2895,21 +2963,21 @@ msgid "" "other ABCs." msgstr "" -#: ../../reference/datamodel.rst:2534 +#: ../../reference/datamodel.rst:2569 msgid "" "Return true if *instance* should be considered a (direct or indirect) " "instance of *class*. If defined, called to implement ``isinstance(instance, " "class)``." msgstr "" -#: ../../reference/datamodel.rst:2541 +#: ../../reference/datamodel.rst:2576 msgid "" "Return true if *subclass* should be considered a (direct or indirect) " "subclass of *class*. If defined, called to implement ``issubclass(subclass, " "class)``." msgstr "" -#: ../../reference/datamodel.rst:2546 +#: ../../reference/datamodel.rst:2581 msgid "" "Note that these methods are looked up on the type (metaclass) of a class. " "They cannot be defined as class methods in the actual class. This is " @@ -2917,11 +2985,11 @@ msgid "" "only in this case the instance is itself a class." msgstr "" -#: ../../reference/datamodel.rst:2557 +#: ../../reference/datamodel.rst:2592 msgid ":pep:`3119` - Introducing Abstract Base Classes" msgstr "" -#: ../../reference/datamodel.rst:2554 +#: ../../reference/datamodel.rst:2589 msgid "" "Includes the specification for customizing :func:`isinstance` and :func:" "`issubclass` behavior through :meth:`~class.__instancecheck__` and :meth:" @@ -2930,11 +2998,11 @@ msgid "" "language." msgstr "" -#: ../../reference/datamodel.rst:2562 +#: ../../reference/datamodel.rst:2597 msgid "Emulating generic types" msgstr "" -#: ../../reference/datamodel.rst:2564 +#: ../../reference/datamodel.rst:2599 msgid "" "When using :term:`type annotations`, it is often useful to " "*parameterize* a :term:`generic type` using Python's square-brackets " @@ -2942,65 +3010,65 @@ msgid "" "a :class:`list` in which all the elements are of type :class:`int`." msgstr "" -#: ../../reference/datamodel.rst:2572 +#: ../../reference/datamodel.rst:2607 msgid ":pep:`484` - Type Hints" msgstr "" -#: ../../reference/datamodel.rst:2572 +#: ../../reference/datamodel.rst:2607 msgid "Introducing Python's framework for type annotations" msgstr "" -#: ../../reference/datamodel.rst:2575 +#: ../../reference/datamodel.rst:2610 msgid ":ref:`Generic Alias Types`" msgstr "" -#: ../../reference/datamodel.rst:2575 +#: ../../reference/datamodel.rst:2610 msgid "Documentation for objects representing parameterized generic classes" msgstr "" -#: ../../reference/datamodel.rst:2578 +#: ../../reference/datamodel.rst:2613 msgid "" ":ref:`Generics`, :ref:`user-defined generics` and :" "class:`typing.Generic`" msgstr "" -#: ../../reference/datamodel.rst:2578 +#: ../../reference/datamodel.rst:2613 msgid "" "Documentation on how to implement generic classes that can be parameterized " "at runtime and understood by static type-checkers." msgstr "" -#: ../../reference/datamodel.rst:2581 +#: ../../reference/datamodel.rst:2616 msgid "" "A class can *generally* only be parameterized if it defines the special " "class method ``__class_getitem__()``." msgstr "" -#: ../../reference/datamodel.rst:2586 +#: ../../reference/datamodel.rst:2621 msgid "" "Return an object representing the specialization of a generic class by type " "arguments found in *key*." msgstr "" -#: ../../reference/datamodel.rst:2589 +#: ../../reference/datamodel.rst:2624 msgid "" "When defined on a class, ``__class_getitem__()`` is automatically a class " "method. As such, there is no need for it to be decorated with :func:" "`@classmethod` when it is defined." msgstr "" -#: ../../reference/datamodel.rst:2595 +#: ../../reference/datamodel.rst:2630 msgid "The purpose of *__class_getitem__*" msgstr "" -#: ../../reference/datamodel.rst:2597 +#: ../../reference/datamodel.rst:2632 msgid "" "The purpose of :meth:`~object.__class_getitem__` is to allow runtime " "parameterization of standard-library generic classes in order to more easily " "apply :term:`type hints` to these classes." msgstr "" -#: ../../reference/datamodel.rst:2601 +#: ../../reference/datamodel.rst:2636 msgid "" "To implement custom generic classes that can be parameterized at runtime and " "understood by static type-checkers, users should either inherit from a " @@ -3009,7 +3077,7 @@ msgid "" "own implementation of ``__class_getitem__()``." msgstr "" -#: ../../reference/datamodel.rst:2607 +#: ../../reference/datamodel.rst:2642 msgid "" "Custom implementations of :meth:`~object.__class_getitem__` on classes " "defined outside of the standard library may not be understood by third-party " @@ -3017,11 +3085,11 @@ msgid "" "purposes other than type hinting is discouraged." msgstr "" -#: ../../reference/datamodel.rst:2617 +#: ../../reference/datamodel.rst:2652 msgid "*__class_getitem__* versus *__getitem__*" msgstr "" -#: ../../reference/datamodel.rst:2619 +#: ../../reference/datamodel.rst:2654 msgid "" "Usually, the :ref:`subscription` of an object using square " "brackets will call the :meth:`~object.__getitem__` instance method defined " @@ -3031,14 +3099,14 @@ msgid "" "genericalias>` object if it is properly defined." msgstr "" -#: ../../reference/datamodel.rst:2626 +#: ../../reference/datamodel.rst:2661 msgid "" "Presented with the :term:`expression` ``obj[x]``, the Python interpreter " "follows something like the following process to decide whether :meth:" "`~object.__getitem__` or :meth:`~object.__class_getitem__` should be called::" msgstr "" -#: ../../reference/datamodel.rst:2654 +#: ../../reference/datamodel.rst:2689 msgid "" "In Python, all classes are themselves instances of other classes. The class " "of a class is known as that class's :term:`metaclass`, and most classes have " @@ -3048,40 +3116,40 @@ msgid "" "__class_getitem__` being called::" msgstr "" -#: ../../reference/datamodel.rst:2673 +#: ../../reference/datamodel.rst:2708 msgid "" "However, if a class has a custom metaclass that defines :meth:`~object." "__getitem__`, subscribing the class may result in different behaviour. An " "example of this can be found in the :mod:`enum` module::" msgstr "" -#: ../../reference/datamodel.rst:2698 +#: ../../reference/datamodel.rst:2733 msgid ":pep:`560` - Core Support for typing module and generic types" msgstr "" -#: ../../reference/datamodel.rst:2697 +#: ../../reference/datamodel.rst:2732 msgid "" "Introducing :meth:`~object.__class_getitem__`, and outlining when a :ref:" "`subscription` results in ``__class_getitem__()`` being " "called instead of :meth:`~object.__getitem__`" msgstr "" -#: ../../reference/datamodel.rst:2705 +#: ../../reference/datamodel.rst:2740 msgid "Emulating callable objects" msgstr "" -#: ../../reference/datamodel.rst:2712 +#: ../../reference/datamodel.rst:2747 msgid "" "Called when the instance is \"called\" as a function; if this method is " "defined, ``x(arg1, arg2, ...)`` roughly translates to ``type(x).__call__(x, " "arg1, ...)``." msgstr "" -#: ../../reference/datamodel.rst:2719 +#: ../../reference/datamodel.rst:2754 msgid "Emulating container types" msgstr "" -#: ../../reference/datamodel.rst:2721 +#: ../../reference/datamodel.rst:2756 msgid "" "The following methods can be defined to implement container objects. " "Containers usually are :term:`sequences ` (such as :class:`lists " @@ -3117,7 +3185,7 @@ msgid "" "should iterate through the values." msgstr "" -#: ../../reference/datamodel.rst:2762 +#: ../../reference/datamodel.rst:2797 msgid "" "Called to implement the built-in function :func:`len`. Should return the " "length of the object, an integer ``>=`` 0. Also, an object that doesn't " @@ -3125,7 +3193,7 @@ msgid "" "returns zero is considered to be false in a Boolean context." msgstr "" -#: ../../reference/datamodel.rst:2769 +#: ../../reference/datamodel.rst:2804 msgid "" "In CPython, the length is required to be at most :data:`sys.maxsize`. If the " "length is larger than :data:`!sys.maxsize` some features (such as :func:" @@ -3134,7 +3202,7 @@ msgid "" "`~object.__bool__` method." msgstr "" -#: ../../reference/datamodel.rst:2778 +#: ../../reference/datamodel.rst:2813 msgid "" "Called to implement :func:`operator.length_hint`. Should return an estimated " "length for the object (which may be greater or less than the actual length). " @@ -3144,20 +3212,20 @@ msgid "" "never required for correctness." msgstr "" -#: ../../reference/datamodel.rst:2792 +#: ../../reference/datamodel.rst:2827 msgid "" "Slicing is done exclusively with the following three methods. A call like ::" msgstr "" -#: ../../reference/datamodel.rst:2796 +#: ../../reference/datamodel.rst:2831 msgid "is translated to ::" msgstr "" -#: ../../reference/datamodel.rst:2800 +#: ../../reference/datamodel.rst:2835 msgid "and so forth. Missing slice items are always filled in with ``None``." msgstr "" -#: ../../reference/datamodel.rst:2805 +#: ../../reference/datamodel.rst:2840 msgid "" "Called to implement evaluation of ``self[key]``. For :term:`sequence` types, " "the accepted keys should be integers. Optionally, they may support :class:" @@ -3169,20 +3237,20 @@ msgid "" "`KeyError` should be raised." msgstr "" -#: ../../reference/datamodel.rst:2817 +#: ../../reference/datamodel.rst:2852 msgid "" ":keyword:`for` loops expect that an :exc:`IndexError` will be raised for " "illegal indexes to allow proper detection of the end of the sequence." msgstr "" -#: ../../reference/datamodel.rst:2822 +#: ../../reference/datamodel.rst:2857 msgid "" "When :ref:`subscripting` a *class*, the special class method :" "meth:`~object.__class_getitem__` may be called instead of ``__getitem__()``. " "See :ref:`classgetitem-versus-getitem` for more details." msgstr "" -#: ../../reference/datamodel.rst:2830 +#: ../../reference/datamodel.rst:2865 msgid "" "Called to implement assignment to ``self[key]``. Same note as for :meth:" "`__getitem__`. This should only be implemented for mappings if the objects " @@ -3191,7 +3259,7 @@ msgid "" "for improper *key* values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:2839 +#: ../../reference/datamodel.rst:2874 msgid "" "Called to implement deletion of ``self[key]``. Same note as for :meth:" "`__getitem__`. This should only be implemented for mappings if the objects " @@ -3200,13 +3268,13 @@ msgid "" "values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:2848 +#: ../../reference/datamodel.rst:2883 msgid "" "Called by :class:`dict`\\ .\\ :meth:`__getitem__` to implement ``self[key]`` " "for dict subclasses when key is not in the dictionary." msgstr "" -#: ../../reference/datamodel.rst:2854 +#: ../../reference/datamodel.rst:2889 msgid "" "This method is called when an :term:`iterator` is required for a container. " "This method should return a new iterator object that can iterate over all " @@ -3214,14 +3282,14 @@ msgid "" "of the container." msgstr "" -#: ../../reference/datamodel.rst:2862 +#: ../../reference/datamodel.rst:2897 msgid "" "Called (if present) by the :func:`reversed` built-in to implement reverse " "iteration. It should return a new iterator object that iterates over all " "the objects in the container in reverse order." msgstr "" -#: ../../reference/datamodel.rst:2866 +#: ../../reference/datamodel.rst:2901 msgid "" "If the :meth:`__reversed__` method is not provided, the :func:`reversed` " "built-in will fall back to using the sequence protocol (:meth:`__len__` and :" @@ -3230,7 +3298,7 @@ msgid "" "more efficient than the one provided by :func:`reversed`." msgstr "" -#: ../../reference/datamodel.rst:2873 +#: ../../reference/datamodel.rst:2908 msgid "" "The membership test operators (:keyword:`in` and :keyword:`not in`) are " "normally implemented as an iteration through a container. However, container " @@ -3238,14 +3306,14 @@ msgid "" "implementation, which also does not require the object be iterable." msgstr "" -#: ../../reference/datamodel.rst:2880 +#: ../../reference/datamodel.rst:2915 msgid "" "Called to implement membership test operators. Should return true if *item* " "is in *self*, false otherwise. For mapping objects, this should consider " "the keys of the mapping rather than the values or the key-item pairs." msgstr "" -#: ../../reference/datamodel.rst:2884 +#: ../../reference/datamodel.rst:2919 msgid "" "For objects that don't define :meth:`__contains__`, the membership test " "first tries iteration via :meth:`__iter__`, then the old sequence iteration " @@ -3253,11 +3321,11 @@ msgid "" "reference `." msgstr "" -#: ../../reference/datamodel.rst:2893 +#: ../../reference/datamodel.rst:2928 msgid "Emulating numeric types" msgstr "" -#: ../../reference/datamodel.rst:2895 +#: ../../reference/datamodel.rst:2930 msgid "" "The following methods can be defined to emulate numeric objects. Methods " "corresponding to operations that are not supported by the particular kind of " @@ -3265,7 +3333,7 @@ msgid "" "should be left undefined." msgstr "" -#: ../../reference/datamodel.rst:2921 +#: ../../reference/datamodel.rst:2956 msgid "" "These methods are called to implement the binary arithmetic operations " "(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" @@ -3279,13 +3347,13 @@ msgid "" "function is to be supported." msgstr "" -#: ../../reference/datamodel.rst:2932 +#: ../../reference/datamodel.rst:2967 msgid "" "If one of those methods does not support the operation with the supplied " "arguments, it should return ``NotImplemented``." msgstr "" -#: ../../reference/datamodel.rst:2955 +#: ../../reference/datamodel.rst:2990 msgid "" "These methods are called to implement the binary arithmetic operations " "(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" @@ -3298,13 +3366,13 @@ msgid "" "*NotImplemented*." msgstr "" -#: ../../reference/datamodel.rst:2967 +#: ../../reference/datamodel.rst:3002 msgid "" "Note that ternary :func:`pow` will not try calling :meth:`__rpow__` (the " "coercion rules would become too complicated)." msgstr "" -#: ../../reference/datamodel.rst:2972 +#: ../../reference/datamodel.rst:3007 msgid "" "If the right operand's type is a subclass of the left operand's type and " "that subclass provides a different implementation of the reflected method " @@ -3313,7 +3381,7 @@ msgid "" "ancestors' operations." msgstr "" -#: ../../reference/datamodel.rst:2993 +#: ../../reference/datamodel.rst:3028 msgid "" "These methods are called to implement the augmented arithmetic assignments " "(``+=``, ``-=``, ``*=``, ``@=``, ``/=``, ``//=``, ``%=``, ``**=``, ``<<=``, " @@ -3329,19 +3397,19 @@ msgid "" "fact part of the data model." msgstr "" -#: ../../reference/datamodel.rst:3014 +#: ../../reference/datamodel.rst:3049 msgid "" "Called to implement the unary arithmetic operations (``-``, ``+``, :func:" "`abs` and ``~``)." msgstr "" -#: ../../reference/datamodel.rst:3027 +#: ../../reference/datamodel.rst:3062 msgid "" "Called to implement the built-in functions :func:`complex`, :func:`int` and :" "func:`float`. Should return a value of the appropriate type." msgstr "" -#: ../../reference/datamodel.rst:3034 +#: ../../reference/datamodel.rst:3069 msgid "" "Called to implement :func:`operator.index`, and whenever Python needs to " "losslessly convert the numeric object to an integer object (such as in " @@ -3350,14 +3418,14 @@ msgid "" "integer type. Must return an integer." msgstr "" -#: ../../reference/datamodel.rst:3040 +#: ../../reference/datamodel.rst:3075 msgid "" "If :meth:`__int__`, :meth:`__float__` and :meth:`__complex__` are not " "defined then corresponding built-in functions :func:`int`, :func:`float` " "and :func:`complex` fall back to :meth:`__index__`." msgstr "" -#: ../../reference/datamodel.rst:3052 +#: ../../reference/datamodel.rst:3087 msgid "" "Called to implement the built-in function :func:`round` and :mod:`math` " "functions :func:`~math.trunc`, :func:`~math.floor` and :func:`~math.ceil`. " @@ -3366,21 +3434,21 @@ msgid "" "(typically an :class:`int`)." msgstr "" -#: ../../reference/datamodel.rst:3058 +#: ../../reference/datamodel.rst:3093 msgid "" "The built-in function :func:`int` falls back to :meth:`__trunc__` if " "neither :meth:`__int__` nor :meth:`__index__` is defined." msgstr "" -#: ../../reference/datamodel.rst:3061 +#: ../../reference/datamodel.rst:3096 msgid "The delegation of :func:`int` to :meth:`__trunc__` is deprecated." msgstr "" -#: ../../reference/datamodel.rst:3068 +#: ../../reference/datamodel.rst:3103 msgid "With Statement Context Managers" msgstr "" -#: ../../reference/datamodel.rst:3070 +#: ../../reference/datamodel.rst:3105 msgid "" "A :dfn:`context manager` is an object that defines the runtime context to be " "established when executing a :keyword:`with` statement. The context manager " @@ -3390,32 +3458,32 @@ msgid "" "can also be used by directly invoking their methods." msgstr "" -#: ../../reference/datamodel.rst:3081 +#: ../../reference/datamodel.rst:3116 msgid "" "Typical uses of context managers include saving and restoring various kinds " "of global state, locking and unlocking resources, closing opened files, etc." msgstr "" -#: ../../reference/datamodel.rst:3084 +#: ../../reference/datamodel.rst:3119 msgid "" "For more information on context managers, see :ref:`typecontextmanager`." msgstr "" -#: ../../reference/datamodel.rst:3089 +#: ../../reference/datamodel.rst:3124 msgid "" "Enter the runtime context related to this object. The :keyword:`with` " "statement will bind this method's return value to the target(s) specified in " "the :keyword:`!as` clause of the statement, if any." msgstr "" -#: ../../reference/datamodel.rst:3096 +#: ../../reference/datamodel.rst:3131 msgid "" "Exit the runtime context related to this object. The parameters describe the " "exception that caused the context to be exited. If the context was exited " "without an exception, all three arguments will be :const:`None`." msgstr "" -#: ../../reference/datamodel.rst:3100 +#: ../../reference/datamodel.rst:3135 msgid "" "If an exception is supplied, and the method wishes to suppress the exception " "(i.e., prevent it from being propagated), it should return a true value. " @@ -3423,27 +3491,27 @@ msgid "" "method." msgstr "" -#: ../../reference/datamodel.rst:3104 +#: ../../reference/datamodel.rst:3139 msgid "" "Note that :meth:`~object.__exit__` methods should not reraise the passed-in " "exception; this is the caller's responsibility." msgstr "" -#: ../../reference/datamodel.rst:3111 +#: ../../reference/datamodel.rst:3146 msgid ":pep:`343` - The \"with\" statement" msgstr "" -#: ../../reference/datamodel.rst:3111 +#: ../../reference/datamodel.rst:3146 msgid "" "The specification, background, and examples for the Python :keyword:`with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:3118 +#: ../../reference/datamodel.rst:3153 msgid "Customizing positional arguments in class pattern matching" msgstr "" -#: ../../reference/datamodel.rst:3120 +#: ../../reference/datamodel.rst:3155 msgid "" "When using a class name in a pattern, positional arguments in the pattern " "are not allowed by default, i.e. ``case MyClass(x, y)`` is typically invalid " @@ -3451,7 +3519,7 @@ msgid "" "pattern, the class needs to define a *__match_args__* attribute." msgstr "" -#: ../../reference/datamodel.rst:3127 +#: ../../reference/datamodel.rst:3162 msgid "" "This class variable can be assigned a tuple of strings. When this class is " "used in a class pattern with positional arguments, each positional argument " @@ -3460,7 +3528,7 @@ msgid "" "to setting it to ``()``." msgstr "" -#: ../../reference/datamodel.rst:3133 +#: ../../reference/datamodel.rst:3168 msgid "" "For example, if ``MyClass.__match_args__`` is ``(\"left\", \"center\", " "\"right\")`` that means that ``case MyClass(x, y)`` is equivalent to ``case " @@ -3470,19 +3538,19 @@ msgid "" "exc:`TypeError`." msgstr "" -#: ../../reference/datamodel.rst:3143 +#: ../../reference/datamodel.rst:3178 msgid ":pep:`634` - Structural Pattern Matching" msgstr "" -#: ../../reference/datamodel.rst:3144 +#: ../../reference/datamodel.rst:3179 msgid "The specification for the Python ``match`` statement." msgstr "" -#: ../../reference/datamodel.rst:3150 +#: ../../reference/datamodel.rst:3185 msgid "Emulating buffer types" msgstr "" -#: ../../reference/datamodel.rst:3152 +#: ../../reference/datamodel.rst:3187 msgid "" "The :ref:`buffer protocol ` provides a way for Python objects " "to expose efficient access to a low-level memory array. This protocol is " @@ -3490,13 +3558,13 @@ msgid "" "and third-party libraries may define additional buffer types." msgstr "" -#: ../../reference/datamodel.rst:3157 +#: ../../reference/datamodel.rst:3192 msgid "" "While buffer types are usually implemented in C, it is also possible to " "implement the protocol in Python." msgstr "" -#: ../../reference/datamodel.rst:3162 +#: ../../reference/datamodel.rst:3197 msgid "" "Called when a buffer is requested from *self* (for example, by the :class:" "`memoryview` constructor). The *flags* argument is an integer representing " @@ -3506,7 +3574,7 @@ msgid "" "`memoryview` object." msgstr "" -#: ../../reference/datamodel.rst:3171 +#: ../../reference/datamodel.rst:3206 msgid "" "Called when a buffer is no longer needed. The *buffer* argument is a :class:" "`memoryview` object that was previously returned by :meth:`~object." @@ -3515,28 +3583,28 @@ msgid "" "to perform any cleanup are not required to implement this method." msgstr "" -#: ../../reference/datamodel.rst:3183 +#: ../../reference/datamodel.rst:3218 msgid ":pep:`688` - Making the buffer protocol accessible in Python" msgstr "" -#: ../../reference/datamodel.rst:3183 +#: ../../reference/datamodel.rst:3218 msgid "" "Introduces the Python ``__buffer__`` and ``__release_buffer__`` methods." msgstr "" -#: ../../reference/datamodel.rst:3185 +#: ../../reference/datamodel.rst:3220 msgid ":class:`collections.abc.Buffer`" msgstr "" -#: ../../reference/datamodel.rst:3186 +#: ../../reference/datamodel.rst:3221 msgid "ABC for buffer types." msgstr "" -#: ../../reference/datamodel.rst:3191 +#: ../../reference/datamodel.rst:3226 msgid "Special method lookup" msgstr "" -#: ../../reference/datamodel.rst:3193 +#: ../../reference/datamodel.rst:3228 msgid "" "For custom classes, implicit invocations of special methods are only " "guaranteed to work correctly if defined on an object's type, not in the " @@ -3544,7 +3612,7 @@ msgid "" "following code raises an exception::" msgstr "" -#: ../../reference/datamodel.rst:3208 +#: ../../reference/datamodel.rst:3243 msgid "" "The rationale behind this behaviour lies with a number of special methods " "such as :meth:`~object.__hash__` and :meth:`~object.__repr__` that are " @@ -3553,21 +3621,21 @@ msgid "" "invoked on the type object itself::" msgstr "" -#: ../../reference/datamodel.rst:3222 +#: ../../reference/datamodel.rst:3257 msgid "" "Incorrectly attempting to invoke an unbound method of a class in this way is " "sometimes referred to as 'metaclass confusion', and is avoided by bypassing " "the instance when looking up special methods::" msgstr "" -#: ../../reference/datamodel.rst:3231 +#: ../../reference/datamodel.rst:3266 msgid "" "In addition to bypassing any instance attributes in the interest of " "correctness, implicit special method lookup generally also bypasses the :" "meth:`~object.__getattribute__` method even of the object's metaclass::" msgstr "" -#: ../../reference/datamodel.rst:3257 +#: ../../reference/datamodel.rst:3292 msgid "" "Bypassing the :meth:`~object.__getattribute__` machinery in this fashion " "provides significant scope for speed optimisations within the interpreter, " @@ -3576,36 +3644,36 @@ msgid "" "consistently invoked by the interpreter)." msgstr "" -#: ../../reference/datamodel.rst:3268 +#: ../../reference/datamodel.rst:3303 msgid "Coroutines" msgstr "協程" -#: ../../reference/datamodel.rst:3272 +#: ../../reference/datamodel.rst:3307 msgid "Awaitable Objects" msgstr "" -#: ../../reference/datamodel.rst:3274 +#: ../../reference/datamodel.rst:3309 msgid "" "An :term:`awaitable` object generally implements an :meth:`~object." "__await__` method. :term:`Coroutine objects ` returned from :" "keyword:`async def` functions are awaitable." msgstr "" -#: ../../reference/datamodel.rst:3280 +#: ../../reference/datamodel.rst:3315 msgid "" "The :term:`generator iterator` objects returned from generators decorated " "with :func:`types.coroutine` are also awaitable, but they do not implement :" "meth:`~object.__await__`." msgstr "" -#: ../../reference/datamodel.rst:3286 +#: ../../reference/datamodel.rst:3321 msgid "" "Must return an :term:`iterator`. Should be used to implement :term:" "`awaitable` objects. For instance, :class:`asyncio.Future` implements this " "method to be compatible with the :keyword:`await` expression." msgstr "" -#: ../../reference/datamodel.rst:3292 +#: ../../reference/datamodel.rst:3327 msgid "" "The language doesn't place any restriction on the type or value of the " "objects yielded by the iterator returned by ``__await__``, as this is " @@ -3613,15 +3681,15 @@ msgid "" "g. :mod:`asyncio`) that will be managing the :term:`awaitable` object." msgstr "" -#: ../../reference/datamodel.rst:3300 +#: ../../reference/datamodel.rst:3335 msgid ":pep:`492` for additional information about awaitable objects." msgstr "" -#: ../../reference/datamodel.rst:3306 +#: ../../reference/datamodel.rst:3341 msgid "Coroutine Objects" msgstr "" -#: ../../reference/datamodel.rst:3308 +#: ../../reference/datamodel.rst:3343 msgid "" ":term:`Coroutine objects ` are :term:`awaitable` objects. A " "coroutine's execution can be controlled by calling :meth:`~object.__await__` " @@ -3632,18 +3700,18 @@ msgid "" "should not directly raise unhandled :exc:`StopIteration` exceptions." msgstr "" -#: ../../reference/datamodel.rst:3316 +#: ../../reference/datamodel.rst:3351 msgid "" "Coroutines also have the methods listed below, which are analogous to those " "of generators (see :ref:`generator-methods`). However, unlike generators, " "coroutines do not directly support iteration." msgstr "" -#: ../../reference/datamodel.rst:3320 +#: ../../reference/datamodel.rst:3355 msgid "It is a :exc:`RuntimeError` to await on a coroutine more than once." msgstr "" -#: ../../reference/datamodel.rst:3326 +#: ../../reference/datamodel.rst:3361 msgid "" "Starts or resumes execution of the coroutine. If *value* is ``None``, this " "is equivalent to advancing the iterator returned by :meth:`~object." @@ -3654,7 +3722,7 @@ msgid "" "value, described above." msgstr "" -#: ../../reference/datamodel.rst:3337 +#: ../../reference/datamodel.rst:3372 msgid "" "Raises the specified exception in the coroutine. This method delegates to " "the :meth:`~generator.throw` method of the iterator that caused the " @@ -3665,13 +3733,13 @@ msgid "" "not caught in the coroutine, it propagates back to the caller." msgstr "" -#: ../../reference/datamodel.rst:3348 +#: ../../reference/datamodel.rst:3383 msgid "" "The second signature \\(type\\[, value\\[, traceback\\]\\]\\) is deprecated " "and may be removed in a future version of Python." msgstr "" -#: ../../reference/datamodel.rst:3353 +#: ../../reference/datamodel.rst:3388 msgid "" "Causes the coroutine to clean itself up and exit. If the coroutine is " "suspended, this method first delegates to the :meth:`~generator.close` " @@ -3681,99 +3749,99 @@ msgid "" "is marked as having finished executing, even if it was never started." msgstr "" -#: ../../reference/datamodel.rst:3361 +#: ../../reference/datamodel.rst:3396 msgid "" "Coroutine objects are automatically closed using the above process when they " "are about to be destroyed." msgstr "" -#: ../../reference/datamodel.rst:3367 +#: ../../reference/datamodel.rst:3402 msgid "Asynchronous Iterators" msgstr "" -#: ../../reference/datamodel.rst:3369 +#: ../../reference/datamodel.rst:3404 msgid "" "An *asynchronous iterator* can call asynchronous code in its ``__anext__`` " "method." msgstr "" -#: ../../reference/datamodel.rst:3372 +#: ../../reference/datamodel.rst:3407 msgid "" "Asynchronous iterators can be used in an :keyword:`async for` statement." msgstr "" -#: ../../reference/datamodel.rst:3376 +#: ../../reference/datamodel.rst:3411 msgid "Must return an *asynchronous iterator* object." msgstr "" -#: ../../reference/datamodel.rst:3380 +#: ../../reference/datamodel.rst:3415 msgid "" "Must return an *awaitable* resulting in a next value of the iterator. " "Should raise a :exc:`StopAsyncIteration` error when the iteration is over." msgstr "" -#: ../../reference/datamodel.rst:3383 +#: ../../reference/datamodel.rst:3418 msgid "An example of an asynchronous iterable object::" msgstr "" -#: ../../reference/datamodel.rst:3400 +#: ../../reference/datamodel.rst:3435 msgid "" "Prior to Python 3.7, :meth:`~object.__aiter__` could return an *awaitable* " "that would resolve to an :term:`asynchronous iterator `." msgstr "" -#: ../../reference/datamodel.rst:3405 +#: ../../reference/datamodel.rst:3440 msgid "" "Starting with Python 3.7, :meth:`~object.__aiter__` must return an " "asynchronous iterator object. Returning anything else will result in a :exc:" "`TypeError` error." msgstr "" -#: ../../reference/datamodel.rst:3413 +#: ../../reference/datamodel.rst:3448 msgid "Asynchronous Context Managers" msgstr "" -#: ../../reference/datamodel.rst:3415 +#: ../../reference/datamodel.rst:3450 msgid "" "An *asynchronous context manager* is a *context manager* that is able to " "suspend execution in its ``__aenter__`` and ``__aexit__`` methods." msgstr "" -#: ../../reference/datamodel.rst:3418 +#: ../../reference/datamodel.rst:3453 msgid "" "Asynchronous context managers can be used in an :keyword:`async with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:3422 +#: ../../reference/datamodel.rst:3457 msgid "" "Semantically similar to :meth:`~object.__enter__`, the only difference being " "that it must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3427 +#: ../../reference/datamodel.rst:3462 msgid "" "Semantically similar to :meth:`~object.__exit__`, the only difference being " "that it must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3430 +#: ../../reference/datamodel.rst:3465 msgid "An example of an asynchronous context manager class::" msgstr "" -#: ../../reference/datamodel.rst:3443 +#: ../../reference/datamodel.rst:3478 msgid "Footnotes" msgstr "註解" -#: ../../reference/datamodel.rst:3444 +#: ../../reference/datamodel.rst:3479 msgid "" "It *is* possible in some cases to change an object's type, under certain " "controlled conditions. It generally isn't a good idea though, since it can " "lead to some very strange behaviour if it is handled incorrectly." msgstr "" -#: ../../reference/datamodel.rst:3448 +#: ../../reference/datamodel.rst:3483 msgid "" "The :meth:`~object.__hash__`, :meth:`~object.__iter__`, :meth:`~object." "__reversed__`, and :meth:`~object.__contains__` methods have special " @@ -3781,7 +3849,7 @@ msgid "" "by relying on the behavior that ``None`` is not callable." msgstr "" -#: ../../reference/datamodel.rst:3454 +#: ../../reference/datamodel.rst:3489 msgid "" "\"Does not support\" here means that the class has no such method, or the " "method returns ``NotImplemented``. Do not set the method to ``None`` if you " @@ -3789,7 +3857,7 @@ msgid "" "instead have the opposite effect of explicitly *blocking* such fallback." msgstr "" -#: ../../reference/datamodel.rst:3460 +#: ../../reference/datamodel.rst:3495 msgid "" "For operands of the same type, it is assumed that if the non-reflected " "method -- such as :meth:`~object.__add__` -- fails then the overall " @@ -3811,8 +3879,8 @@ msgstr "" #: ../../reference/datamodel.rst:856 ../../reference/datamodel.rst:938 #: ../../reference/datamodel.rst:1007 ../../reference/datamodel.rst:1034 #: ../../reference/datamodel.rst:1096 ../../reference/datamodel.rst:1198 -#: ../../reference/datamodel.rst:1264 ../../reference/datamodel.rst:1364 -#: ../../reference/datamodel.rst:1773 ../../reference/datamodel.rst:2788 +#: ../../reference/datamodel.rst:1299 ../../reference/datamodel.rst:1399 +#: ../../reference/datamodel.rst:1808 ../../reference/datamodel.rst:2823 msgid "object" msgstr "object(物件)" @@ -3823,13 +3891,13 @@ msgstr "data(資料)" #: ../../reference/datamodel.rst:23 ../../reference/datamodel.rst:292 #: ../../reference/datamodel.rst:336 ../../reference/datamodel.rst:420 #: ../../reference/datamodel.rst:459 ../../reference/datamodel.rst:799 -#: ../../reference/datamodel.rst:1053 ../../reference/datamodel.rst:1447 -#: ../../reference/datamodel.rst:1687 ../../reference/datamodel.rst:1692 -#: ../../reference/datamodel.rst:1773 ../../reference/datamodel.rst:2329 -#: ../../reference/datamodel.rst:2758 ../../reference/datamodel.rst:2916 -#: ../../reference/datamodel.rst:2951 ../../reference/datamodel.rst:2965 -#: ../../reference/datamodel.rst:3012 ../../reference/datamodel.rst:3022 -#: ../../reference/datamodel.rst:3050 +#: ../../reference/datamodel.rst:1053 ../../reference/datamodel.rst:1482 +#: ../../reference/datamodel.rst:1722 ../../reference/datamodel.rst:1727 +#: ../../reference/datamodel.rst:1808 ../../reference/datamodel.rst:2364 +#: ../../reference/datamodel.rst:2793 ../../reference/datamodel.rst:2951 +#: ../../reference/datamodel.rst:2986 ../../reference/datamodel.rst:3000 +#: ../../reference/datamodel.rst:3047 ../../reference/datamodel.rst:3057 +#: ../../reference/datamodel.rst:3085 msgid "built-in function" msgstr "built-in function(內建函式)" @@ -3838,7 +3906,7 @@ msgid "id" msgstr "id" #: ../../reference/datamodel.rst:23 ../../reference/datamodel.rst:122 -#: ../../reference/datamodel.rst:2329 +#: ../../reference/datamodel.rst:2364 msgid "type" msgstr "type(型別)" @@ -3962,12 +4030,12 @@ msgstr "number(數字)" msgid "Java" msgstr "Java" -#: ../../reference/datamodel.rst:279 ../../reference/datamodel.rst:3022 +#: ../../reference/datamodel.rst:279 ../../reference/datamodel.rst:3057 msgid "complex" msgstr "complex(複數)" #: ../../reference/datamodel.rst:292 ../../reference/datamodel.rst:420 -#: ../../reference/datamodel.rst:459 ../../reference/datamodel.rst:2758 +#: ../../reference/datamodel.rst:459 ../../reference/datamodel.rst:2793 msgid "len" msgstr "len" @@ -4000,8 +4068,8 @@ msgstr "immutable sequence(不可變序列)" msgid "immutable" msgstr "immutable(不可變)" -#: ../../reference/datamodel.rst:332 ../../reference/datamodel.rst:1662 -#: ../../reference/datamodel.rst:1692 +#: ../../reference/datamodel.rst:332 ../../reference/datamodel.rst:1697 +#: ../../reference/datamodel.rst:1727 msgid "string" msgstr "string(字串)" @@ -4037,7 +4105,7 @@ msgstr "singleton(單例)" msgid "empty" msgstr "empty(空的)" -#: ../../reference/datamodel.rst:369 ../../reference/datamodel.rst:1687 +#: ../../reference/datamodel.rst:369 ../../reference/datamodel.rst:1722 msgid "bytes" msgstr "bytes(位元組)" @@ -4059,8 +4127,8 @@ msgid "assignment" msgstr "assignment(賦值)" #: ../../reference/datamodel.rst:381 ../../reference/datamodel.rst:856 -#: ../../reference/datamodel.rst:1401 ../../reference/datamodel.rst:1583 -#: ../../reference/datamodel.rst:3077 +#: ../../reference/datamodel.rst:1436 ../../reference/datamodel.rst:1618 +#: ../../reference/datamodel.rst:3112 msgid "statement" msgstr "statement(陳述式)" @@ -4097,7 +4165,7 @@ msgid "mapping" msgstr "mapping(對映)" #: ../../reference/datamodel.rst:476 ../../reference/datamodel.rst:938 -#: ../../reference/datamodel.rst:1773 +#: ../../reference/datamodel.rst:1808 msgid "dictionary" msgstr "dictionary(字典)" @@ -4120,7 +4188,7 @@ msgid "function" msgstr "function (函式)" #: ../../reference/datamodel.rst:512 ../../reference/datamodel.rst:938 -#: ../../reference/datamodel.rst:961 ../../reference/datamodel.rst:2710 +#: ../../reference/datamodel.rst:961 ../../reference/datamodel.rst:2745 msgid "call" msgstr "call(呼叫)" @@ -4228,7 +4296,7 @@ msgstr "generator(產生器)" msgid "iterator" msgstr "itorator(疊代器)" -#: ../../reference/datamodel.rst:761 ../../reference/datamodel.rst:3264 +#: ../../reference/datamodel.rst:761 ../../reference/datamodel.rst:3299 msgid "coroutine" msgstr "coroutine(協程)" @@ -4273,8 +4341,8 @@ msgid "__dict__ (module attribute)" msgstr "__dict__ (模組屬性)" #: ../../reference/datamodel.rst:938 ../../reference/datamodel.rst:956 -#: ../../reference/datamodel.rst:1007 ../../reference/datamodel.rst:1566 -#: ../../reference/datamodel.rst:2440 +#: ../../reference/datamodel.rst:1007 ../../reference/datamodel.rst:1601 +#: ../../reference/datamodel.rst:2475 msgid "class" msgstr "class(類別)" @@ -4284,7 +4352,7 @@ msgid "class instance" msgstr "class instance(類別實例)" #: ../../reference/datamodel.rst:938 ../../reference/datamodel.rst:1007 -#: ../../reference/datamodel.rst:2710 +#: ../../reference/datamodel.rst:2745 msgid "instance" msgstr "instance(實例)" @@ -4464,287 +4532,287 @@ msgstr "co_qualname (程式碼物件屬性)" msgid "documentation string" msgstr "documentation string(文件字串)" -#: ../../reference/datamodel.rst:1264 +#: ../../reference/datamodel.rst:1299 msgid "frame" msgstr "frame" -#: ../../reference/datamodel.rst:1270 +#: ../../reference/datamodel.rst:1305 msgid "f_back (frame attribute)" msgstr "f_back (frame 屬性)" -#: ../../reference/datamodel.rst:1270 +#: ../../reference/datamodel.rst:1305 msgid "f_code (frame attribute)" msgstr "f_code (frame 屬性)" -#: ../../reference/datamodel.rst:1270 +#: ../../reference/datamodel.rst:1305 msgid "f_globals (frame attribute)" msgstr "f_globals (frame 屬性)" -#: ../../reference/datamodel.rst:1270 +#: ../../reference/datamodel.rst:1305 msgid "f_locals (frame attribute)" msgstr "f_locals (frame 屬性)" -#: ../../reference/datamodel.rst:1270 +#: ../../reference/datamodel.rst:1305 msgid "f_lasti (frame attribute)" msgstr "f_lasti (frame 屬性)" -#: ../../reference/datamodel.rst:1270 +#: ../../reference/datamodel.rst:1305 msgid "f_builtins (frame attribute)" msgstr "f_builtins (frame 屬性)" -#: ../../reference/datamodel.rst:1309 +#: ../../reference/datamodel.rst:1344 msgid "f_trace (frame attribute)" msgstr "f_trace (frame 屬性)" -#: ../../reference/datamodel.rst:1309 +#: ../../reference/datamodel.rst:1344 msgid "f_trace_lines (frame attribute)" msgstr "f_trace_lines (frame 屬性)" -#: ../../reference/datamodel.rst:1309 +#: ../../reference/datamodel.rst:1344 msgid "f_trace_opcodes (frame attribute)" msgstr "f_trace_opcodes (frame 屬性)" -#: ../../reference/datamodel.rst:1309 +#: ../../reference/datamodel.rst:1344 msgid "f_lineno (frame attribute)" msgstr "f_lineno (frame 屬性)" -#: ../../reference/datamodel.rst:1364 +#: ../../reference/datamodel.rst:1399 msgid "traceback" msgstr "traceback" -#: ../../reference/datamodel.rst:1364 +#: ../../reference/datamodel.rst:1399 msgid "stack" msgstr "stack(堆疊)" -#: ../../reference/datamodel.rst:1364 +#: ../../reference/datamodel.rst:1399 msgid "trace" msgstr "trace(追蹤)" -#: ../../reference/datamodel.rst:1364 +#: ../../reference/datamodel.rst:1399 msgid "exception" msgstr "exception(例外)" -#: ../../reference/datamodel.rst:1364 +#: ../../reference/datamodel.rst:1399 msgid "handler" msgstr "handler(處理器)" -#: ../../reference/datamodel.rst:1364 +#: ../../reference/datamodel.rst:1399 msgid "execution" msgstr "execution(執行)" -#: ../../reference/datamodel.rst:1364 +#: ../../reference/datamodel.rst:1399 msgid "exc_info (in module sys)" msgstr "exc_info (sys 模組中)" -#: ../../reference/datamodel.rst:1364 +#: ../../reference/datamodel.rst:1399 msgid "last_traceback (in module sys)" msgstr "last_traceback (sys 模組中)" -#: ../../reference/datamodel.rst:1364 +#: ../../reference/datamodel.rst:1399 msgid "sys.exc_info" msgstr "sys.exc_info" -#: ../../reference/datamodel.rst:1364 +#: ../../reference/datamodel.rst:1399 msgid "sys.exception" msgstr "sys.exception" -#: ../../reference/datamodel.rst:1364 +#: ../../reference/datamodel.rst:1399 msgid "sys.last_traceback" msgstr "sys.last_traceback" -#: ../../reference/datamodel.rst:1401 +#: ../../reference/datamodel.rst:1436 msgid "tb_frame (traceback attribute)" msgstr "tb_frame (traceback 屬性)" -#: ../../reference/datamodel.rst:1401 +#: ../../reference/datamodel.rst:1436 msgid "tb_lineno (traceback attribute)" msgstr "tb_lineno (traceback 屬性)" -#: ../../reference/datamodel.rst:1401 +#: ../../reference/datamodel.rst:1436 msgid "tb_lasti (traceback attribute)" msgstr "tb_lasti (traceback 屬性)" -#: ../../reference/datamodel.rst:1401 +#: ../../reference/datamodel.rst:1436 msgid "try" msgstr "try" -#: ../../reference/datamodel.rst:1431 +#: ../../reference/datamodel.rst:1466 msgid "tb_next (traceback attribute)" msgstr "tb_next (traceback 屬性)" -#: ../../reference/datamodel.rst:1447 ../../reference/datamodel.rst:2788 +#: ../../reference/datamodel.rst:1482 ../../reference/datamodel.rst:2823 msgid "slice" msgstr "slice(切片)" -#: ../../reference/datamodel.rst:1453 +#: ../../reference/datamodel.rst:1488 msgid "start (slice object attribute)" msgstr "start (slice 物件屬性)" -#: ../../reference/datamodel.rst:1453 +#: ../../reference/datamodel.rst:1488 msgid "stop (slice object attribute)" msgstr "stop (slice 物件屬性)" -#: ../../reference/datamodel.rst:1453 +#: ../../reference/datamodel.rst:1488 msgid "step (slice object attribute)" msgstr "step (slice 物件屬性)" -#: ../../reference/datamodel.rst:1501 +#: ../../reference/datamodel.rst:1536 msgid "operator" msgstr "operator(運算子)" -#: ../../reference/datamodel.rst:1501 +#: ../../reference/datamodel.rst:1536 msgid "overloading" msgstr "overloading(多載)" -#: ../../reference/datamodel.rst:1501 +#: ../../reference/datamodel.rst:1536 msgid "__getitem__() (mapping object method)" msgstr "__getitem__() (對映物件方法)" -#: ../../reference/datamodel.rst:1537 +#: ../../reference/datamodel.rst:1572 msgid "subclassing" msgstr "subclassing(子類別化)" -#: ../../reference/datamodel.rst:1537 +#: ../../reference/datamodel.rst:1572 msgid "immutable types" msgstr "immutable types(不可變型別)" -#: ../../reference/datamodel.rst:1566 +#: ../../reference/datamodel.rst:1601 msgid "constructor" msgstr "constructor(建構函式)" -#: ../../reference/datamodel.rst:1583 +#: ../../reference/datamodel.rst:1618 msgid "destructor" msgstr "destructor(解構函式)" -#: ../../reference/datamodel.rst:1583 +#: ../../reference/datamodel.rst:1618 msgid "finalizer" msgstr "finalizer(終結函式)" -#: ../../reference/datamodel.rst:1583 +#: ../../reference/datamodel.rst:1618 msgid "del" msgstr "del" -#: ../../reference/datamodel.rst:1645 +#: ../../reference/datamodel.rst:1680 msgid "repr() (built-in function)" msgstr "repr() (內建函式)" -#: ../../reference/datamodel.rst:1645 +#: ../../reference/datamodel.rst:1680 msgid "__repr__() (object method)" msgstr "__repr__() (物件方法)" -#: ../../reference/datamodel.rst:1662 +#: ../../reference/datamodel.rst:1697 msgid "__str__() (object method)" msgstr "__str__() (物件方法)" -#: ../../reference/datamodel.rst:1662 +#: ../../reference/datamodel.rst:1697 msgid "format() (built-in function)" msgstr "format() (內建函式)" -#: ../../reference/datamodel.rst:1662 +#: ../../reference/datamodel.rst:1697 msgid "print() (built-in function)" msgstr "print() (內建函式)" -#: ../../reference/datamodel.rst:1692 +#: ../../reference/datamodel.rst:1727 msgid "__format__() (object method)" msgstr "__format__() (物件方法)" -#: ../../reference/datamodel.rst:1692 +#: ../../reference/datamodel.rst:1727 msgid "conversion" msgstr "conversion" -#: ../../reference/datamodel.rst:1692 +#: ../../reference/datamodel.rst:1727 msgid "print" msgstr "print" -#: ../../reference/datamodel.rst:1731 +#: ../../reference/datamodel.rst:1766 msgid "comparisons" msgstr "comparison(比較)" -#: ../../reference/datamodel.rst:1773 +#: ../../reference/datamodel.rst:1808 msgid "hash" msgstr "hash(雜湊)" -#: ../../reference/datamodel.rst:1854 +#: ../../reference/datamodel.rst:1889 msgid "__len__() (mapping object method)" msgstr "__len__() (對映物件方法)" -#: ../../reference/datamodel.rst:1958 +#: ../../reference/datamodel.rst:1993 msgid "__getattr__ (module attribute)" msgstr "__getattr__ (模組屬性)" -#: ../../reference/datamodel.rst:1958 +#: ../../reference/datamodel.rst:1993 msgid "__dir__ (module attribute)" msgstr "__dir__ (模組屬性)" -#: ../../reference/datamodel.rst:1958 +#: ../../reference/datamodel.rst:1993 msgid "__class__ (module attribute)" msgstr "__class__ (模組屬性)" -#: ../../reference/datamodel.rst:2329 +#: ../../reference/datamodel.rst:2364 msgid "metaclass" msgstr "metaclass(元類別)" -#: ../../reference/datamodel.rst:2329 +#: ../../reference/datamodel.rst:2364 msgid "= (equals)" msgstr "= (等於)" -#: ../../reference/datamodel.rst:2329 +#: ../../reference/datamodel.rst:2364 msgid "class definition" msgstr "class definition(類別定義)" -#: ../../reference/datamodel.rst:2393 +#: ../../reference/datamodel.rst:2428 msgid "metaclass hint" msgstr "metaclass hint(元類別提示)" -#: ../../reference/datamodel.rst:2416 +#: ../../reference/datamodel.rst:2451 msgid "__prepare__ (metaclass method)" msgstr "__prepare__ (元類別方法)" -#: ../../reference/datamodel.rst:2440 +#: ../../reference/datamodel.rst:2475 msgid "body" msgstr "body" -#: ../../reference/datamodel.rst:2460 +#: ../../reference/datamodel.rst:2495 msgid "__class__ (method cell)" msgstr "__class__ (方法 cell)" -#: ../../reference/datamodel.rst:2460 +#: ../../reference/datamodel.rst:2495 msgid "__classcell__ (class namespace entry)" msgstr "__classcell__ (類別命名空間項目)" -#: ../../reference/datamodel.rst:2758 +#: ../../reference/datamodel.rst:2793 msgid "__bool__() (object method)" msgstr "__bool__() (物件方法)" -#: ../../reference/datamodel.rst:2916 ../../reference/datamodel.rst:2951 +#: ../../reference/datamodel.rst:2951 ../../reference/datamodel.rst:2986 msgid "divmod" msgstr "divmod" -#: ../../reference/datamodel.rst:2916 ../../reference/datamodel.rst:2951 -#: ../../reference/datamodel.rst:2965 +#: ../../reference/datamodel.rst:2951 ../../reference/datamodel.rst:2986 +#: ../../reference/datamodel.rst:3000 msgid "pow" msgstr "pow" -#: ../../reference/datamodel.rst:3012 +#: ../../reference/datamodel.rst:3047 msgid "abs" msgstr "abs" -#: ../../reference/datamodel.rst:3022 +#: ../../reference/datamodel.rst:3057 msgid "int" msgstr "int" -#: ../../reference/datamodel.rst:3022 +#: ../../reference/datamodel.rst:3057 msgid "float" msgstr "float" -#: ../../reference/datamodel.rst:3050 +#: ../../reference/datamodel.rst:3085 msgid "round" msgstr "round" -#: ../../reference/datamodel.rst:3077 +#: ../../reference/datamodel.rst:3112 msgid "with" msgstr "with" -#: ../../reference/datamodel.rst:3077 +#: ../../reference/datamodel.rst:3112 msgid "context manager" msgstr "context manager(情境管理器)" diff --git a/reference/expressions.po b/reference/expressions.po index a5401c2ff7..3762d22cb9 100644 --- a/reference/expressions.po +++ b/reference/expressions.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-11-26 00:03+0000\n" +"POT-Creation-Date: 2024-01-23 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -434,7 +434,7 @@ msgstr "" msgid "Yield expressions" msgstr "" -#: ../../reference/expressions.rst:427 +#: ../../reference/expressions.rst:428 msgid "" "The yield expression is used when defining a :term:`generator` function or " "an :term:`asynchronous generator` function and thus can only be used in the " @@ -444,27 +444,27 @@ msgid "" "asynchronous generator function. For example::" msgstr "" -#: ../../reference/expressions.rst:440 +#: ../../reference/expressions.rst:441 msgid "" "Due to their side effects on the containing scope, ``yield`` expressions are " "not permitted as part of the implicitly defined scopes used to implement " "comprehensions and generator expressions." msgstr "" -#: ../../reference/expressions.rst:444 +#: ../../reference/expressions.rst:445 msgid "" "Yield expressions prohibited in the implicitly nested scopes used to " "implement comprehensions and generator expressions." msgstr "" -#: ../../reference/expressions.rst:448 +#: ../../reference/expressions.rst:449 msgid "" "Generator functions are described below, while asynchronous generator " "functions are described separately in section :ref:`asynchronous-generator-" "functions`." msgstr "" -#: ../../reference/expressions.rst:452 +#: ../../reference/expressions.rst:453 msgid "" "When a generator function is called, it returns an iterator known as a " "generator. That generator then controls the execution of the generator " @@ -485,7 +485,7 @@ msgid "" "be the value passed in to that method." msgstr "" -#: ../../reference/expressions.rst:472 +#: ../../reference/expressions.rst:473 msgid "" "All of this makes generator functions quite similar to coroutines; they " "yield multiple times, they have more than one entry point and their " @@ -494,7 +494,7 @@ msgid "" "the control is always transferred to the generator's caller." msgstr "" -#: ../../reference/expressions.rst:478 +#: ../../reference/expressions.rst:479 msgid "" "Yield expressions are allowed anywhere in a :keyword:`try` construct. If " "the generator is not resumed before it is finalized (by reaching a zero " @@ -503,7 +503,7 @@ msgid "" "`finally` clauses to execute." msgstr "" -#: ../../reference/expressions.rst:487 +#: ../../reference/expressions.rst:488 msgid "" "When ``yield from `` is used, the supplied expression must be an " "iterable. The values produced by iterating that iterable are passed directly " @@ -515,7 +515,7 @@ msgid "" "will just raise the passed in exception immediately." msgstr "" -#: ../../reference/expressions.rst:496 +#: ../../reference/expressions.rst:497 msgid "" "When the underlying iterator is complete, the :attr:`~StopIteration.value` " "attribute of the raised :exc:`StopIteration` instance becomes the value of " @@ -524,73 +524,73 @@ msgid "" "returning a value from the subgenerator)." msgstr "" -#: ../../reference/expressions.rst:502 +#: ../../reference/expressions.rst:503 msgid "Added ``yield from `` to delegate control flow to a subiterator." msgstr "" -#: ../../reference/expressions.rst:505 +#: ../../reference/expressions.rst:506 msgid "" "The parentheses may be omitted when the yield expression is the sole " "expression on the right hand side of an assignment statement." msgstr "" -#: ../../reference/expressions.rst:511 +#: ../../reference/expressions.rst:512 msgid ":pep:`255` - Simple Generators" msgstr "" -#: ../../reference/expressions.rst:511 +#: ../../reference/expressions.rst:512 msgid "" "The proposal for adding generators and the :keyword:`yield` statement to " "Python." msgstr "" -#: ../../reference/expressions.rst:515 +#: ../../reference/expressions.rst:516 msgid ":pep:`342` - Coroutines via Enhanced Generators" msgstr "" -#: ../../reference/expressions.rst:514 +#: ../../reference/expressions.rst:515 msgid "" "The proposal to enhance the API and syntax of generators, making them usable " "as simple coroutines." msgstr "" -#: ../../reference/expressions.rst:519 +#: ../../reference/expressions.rst:520 msgid ":pep:`380` - Syntax for Delegating to a Subgenerator" msgstr "" -#: ../../reference/expressions.rst:518 +#: ../../reference/expressions.rst:519 msgid "" "The proposal to introduce the :token:`~python-grammar:yield_from` syntax, " "making delegation to subgenerators easy." msgstr "" -#: ../../reference/expressions.rst:522 +#: ../../reference/expressions.rst:523 msgid ":pep:`525` - Asynchronous Generators" msgstr "" -#: ../../reference/expressions.rst:522 +#: ../../reference/expressions.rst:523 msgid "" "The proposal that expanded on :pep:`492` by adding generator capabilities to " "coroutine functions." msgstr "" -#: ../../reference/expressions.rst:529 +#: ../../reference/expressions.rst:530 msgid "Generator-iterator methods" msgstr "" -#: ../../reference/expressions.rst:531 +#: ../../reference/expressions.rst:532 msgid "" "This subsection describes the methods of a generator iterator. They can be " "used to control the execution of a generator function." msgstr "" -#: ../../reference/expressions.rst:534 +#: ../../reference/expressions.rst:535 msgid "" "Note that calling any of the generator methods below when the generator is " "already executing raises a :exc:`ValueError` exception." msgstr "" -#: ../../reference/expressions.rst:542 +#: ../../reference/expressions.rst:543 msgid "" "Starts the execution of a generator function or resumes it at the last " "executed yield expression. When a generator function is resumed with a :" @@ -602,13 +602,13 @@ msgid "" "`StopIteration` exception is raised." msgstr "" -#: ../../reference/expressions.rst:551 +#: ../../reference/expressions.rst:552 msgid "" "This method is normally called implicitly, e.g. by a :keyword:`for` loop, or " "by the built-in :func:`next` function." msgstr "" -#: ../../reference/expressions.rst:557 +#: ../../reference/expressions.rst:558 msgid "" "Resumes the execution and \"sends\" a value into the generator function. " "The *value* argument becomes the result of the current yield expression. " @@ -619,7 +619,7 @@ msgid "" "expression that could receive the value." msgstr "" -#: ../../reference/expressions.rst:569 +#: ../../reference/expressions.rst:570 msgid "" "Raises an exception at the point where the generator was paused, and returns " "the next value yielded by the generator function. If the generator exits " @@ -628,13 +628,13 @@ msgid "" "a different exception, then that exception propagates to the caller." msgstr "" -#: ../../reference/expressions.rst:575 +#: ../../reference/expressions.rst:576 msgid "" "In typical use, this is called with a single exception instance similar to " "the way the :keyword:`raise` keyword is used." msgstr "" -#: ../../reference/expressions.rst:578 +#: ../../reference/expressions.rst:579 msgid "" "For backwards compatibility, however, the second signature is supported, " "following a convention from older versions of Python. The *type* argument " @@ -645,13 +645,13 @@ msgid "" "*value* may be cleared." msgstr "" -#: ../../reference/expressions.rst:589 ../../reference/expressions.rst:763 +#: ../../reference/expressions.rst:590 ../../reference/expressions.rst:764 msgid "" "The second signature \\(type\\[, value\\[, traceback\\]\\]\\) is deprecated " "and may be removed in a future version of Python." msgstr "" -#: ../../reference/expressions.rst:597 +#: ../../reference/expressions.rst:598 msgid "" "Raises a :exc:`GeneratorExit` at the point where the generator function was " "paused. If the generator function then exits gracefully, is already closed, " @@ -662,34 +662,34 @@ msgid "" "has already exited due to an exception or normal exit." msgstr "" -#: ../../reference/expressions.rst:608 +#: ../../reference/expressions.rst:609 msgid "Examples" msgstr "模組" -#: ../../reference/expressions.rst:610 +#: ../../reference/expressions.rst:611 msgid "" "Here is a simple example that demonstrates the behavior of generators and " "generator functions::" msgstr "" -#: ../../reference/expressions.rst:637 +#: ../../reference/expressions.rst:638 msgid "" "For examples using ``yield from``, see :ref:`pep-380` in \"What's New in " "Python.\"" msgstr "" -#: ../../reference/expressions.rst:643 +#: ../../reference/expressions.rst:644 msgid "Asynchronous generator functions" msgstr "" -#: ../../reference/expressions.rst:645 +#: ../../reference/expressions.rst:646 msgid "" "The presence of a yield expression in a function or method defined using :" "keyword:`async def` further defines the function as an :term:`asynchronous " "generator` function." msgstr "" -#: ../../reference/expressions.rst:649 +#: ../../reference/expressions.rst:650 msgid "" "When an asynchronous generator function is called, it returns an " "asynchronous iterator known as an asynchronous generator object. That object " @@ -699,7 +699,7 @@ msgid "" "keyword:`for` statement." msgstr "" -#: ../../reference/expressions.rst:656 +#: ../../reference/expressions.rst:657 msgid "" "Calling one of the asynchronous generator's methods returns an :term:" "`awaitable` object, and the execution starts when this object is awaited on. " @@ -718,7 +718,7 @@ msgid "" "method." msgstr "" -#: ../../reference/expressions.rst:671 +#: ../../reference/expressions.rst:672 msgid "" "If an asynchronous generator happens to exit early by :keyword:`break`, the " "caller task being cancelled, or other exceptions, the generator's async " @@ -730,7 +730,7 @@ msgid "" "generator and ultimately detach it from the event loop." msgstr "" -#: ../../reference/expressions.rst:681 +#: ../../reference/expressions.rst:682 msgid "" "In an asynchronous generator function, yield expressions are allowed " "anywhere in a :keyword:`try` construct. However, if an asynchronous " @@ -744,7 +744,7 @@ msgid "" "finally` clauses to execute." msgstr "" -#: ../../reference/expressions.rst:692 +#: ../../reference/expressions.rst:693 msgid "" "To take care of finalization upon event loop termination, an event loop " "should define a *finalizer* function which takes an asynchronous generator-" @@ -757,23 +757,23 @@ msgid "" "asyncio/base_events.py`." msgstr "" -#: ../../reference/expressions.rst:701 +#: ../../reference/expressions.rst:702 msgid "" "The expression ``yield from `` is a syntax error when used in an " "asynchronous generator function." msgstr "" -#: ../../reference/expressions.rst:708 +#: ../../reference/expressions.rst:709 msgid "Asynchronous generator-iterator methods" msgstr "" -#: ../../reference/expressions.rst:710 +#: ../../reference/expressions.rst:711 msgid "" "This subsection describes the methods of an asynchronous generator iterator, " "which are used to control the execution of a generator function." msgstr "" -#: ../../reference/expressions.rst:718 +#: ../../reference/expressions.rst:719 msgid "" "Returns an awaitable which when run starts to execute the asynchronous " "generator or resumes it at the last executed yield expression. When an " @@ -788,12 +788,12 @@ msgid "" "has completed." msgstr "" -#: ../../reference/expressions.rst:730 +#: ../../reference/expressions.rst:731 msgid "" "This method is normally called implicitly by a :keyword:`async for` loop." msgstr "" -#: ../../reference/expressions.rst:735 +#: ../../reference/expressions.rst:736 msgid "" "Returns an awaitable which when run resumes the execution of the " "asynchronous generator. As with the :meth:`~generator.send()` method for a " @@ -808,7 +808,7 @@ msgid "" "receive the value." msgstr "" -#: ../../reference/expressions.rst:751 +#: ../../reference/expressions.rst:752 msgid "" "Returns an awaitable that raises an exception of type ``type`` at the point " "where the asynchronous generator was paused, and returns the next value " @@ -820,7 +820,7 @@ msgid "" "that exception propagates to the caller of the awaitable." msgstr "" -#: ../../reference/expressions.rst:771 +#: ../../reference/expressions.rst:772 msgid "" "Returns an awaitable that when run will throw a :exc:`GeneratorExit` into " "the asynchronous generator function at the point where it was paused. If the " @@ -836,25 +836,25 @@ msgid "" "will return an awaitable that does nothing." msgstr "" -#: ../../reference/expressions.rst:787 +#: ../../reference/expressions.rst:788 msgid "Primaries" msgstr "" -#: ../../reference/expressions.rst:791 +#: ../../reference/expressions.rst:792 msgid "" "Primaries represent the most tightly bound operations of the language. Their " "syntax is:" msgstr "" -#: ../../reference/expressions.rst:801 +#: ../../reference/expressions.rst:802 msgid "Attribute references" msgstr "" -#: ../../reference/expressions.rst:807 +#: ../../reference/expressions.rst:808 msgid "An attribute reference is a primary followed by a period and a name:" msgstr "" -#: ../../reference/expressions.rst:817 +#: ../../reference/expressions.rst:818 msgid "" "The primary must evaluate to an object of a type that supports attribute " "references, which most objects do. This object is then asked to produce the " @@ -863,7 +863,7 @@ msgid "" "reference may yield different objects." msgstr "" -#: ../../reference/expressions.rst:823 +#: ../../reference/expressions.rst:824 msgid "" "This production can be customized by overriding the :meth:`~object." "__getattribute__` method or the :meth:`~object.__getattr__` method. The :" @@ -871,17 +871,17 @@ msgid "" "or raises :exc:`AttributeError` if the attribute is not available." msgstr "" -#: ../../reference/expressions.rst:829 +#: ../../reference/expressions.rst:830 msgid "" "If an :exc:`AttributeError` is raised and the object has a :meth:`!" "__getattr__` method, that method is called as a fallback." msgstr "" -#: ../../reference/expressions.rst:835 +#: ../../reference/expressions.rst:836 msgid "Subscriptions" msgstr "" -#: ../../reference/expressions.rst:850 +#: ../../reference/expressions.rst:851 msgid "" "The subscription of an instance of a :ref:`container class ` " "will generally select an element from the container. The subscription of a :" @@ -889,13 +889,13 @@ msgid "" "`GenericAlias ` object." msgstr "" -#: ../../reference/expressions.rst:858 +#: ../../reference/expressions.rst:859 msgid "" "When an object is subscripted, the interpreter will evaluate the primary and " "the expression list." msgstr "" -#: ../../reference/expressions.rst:861 +#: ../../reference/expressions.rst:862 msgid "" "The primary must evaluate to an object that supports subscription. An object " "may support subscription through defining one or both of :meth:`~object." @@ -905,20 +905,20 @@ msgid "" "called instead of ``__getitem__``, see :ref:`classgetitem-versus-getitem`." msgstr "" -#: ../../reference/expressions.rst:868 +#: ../../reference/expressions.rst:869 msgid "" "If the expression list contains at least one comma, it will evaluate to a :" "class:`tuple` containing the items of the expression list. Otherwise, the " "expression list will evaluate to the value of the list's sole member." msgstr "" -#: ../../reference/expressions.rst:872 +#: ../../reference/expressions.rst:873 msgid "" "For built-in objects, there are two types of objects that support " "subscription via :meth:`~object.__getitem__`:" msgstr "" -#: ../../reference/expressions.rst:875 +#: ../../reference/expressions.rst:876 msgid "" "Mappings. If the primary is a :term:`mapping`, the expression list must " "evaluate to an object whose value is one of the keys of the mapping, and the " @@ -926,7 +926,7 @@ msgid "" "An example of a builtin mapping class is the :class:`dict` class." msgstr "" -#: ../../reference/expressions.rst:879 +#: ../../reference/expressions.rst:880 msgid "" "Sequences. If the primary is a :term:`sequence`, the expression list must " "evaluate to an :class:`int` or a :class:`slice` (as discussed in the " @@ -934,7 +934,7 @@ msgid "" "`str`, :class:`list` and :class:`tuple` classes." msgstr "" -#: ../../reference/expressions.rst:884 +#: ../../reference/expressions.rst:885 msgid "" "The formal syntax makes no special provision for negative indices in :term:" "`sequences `. However, built-in sequences all provide a :meth:" @@ -948,25 +948,25 @@ msgid "" "explicitly add that support." msgstr "" -#: ../../reference/expressions.rst:898 +#: ../../reference/expressions.rst:899 msgid "" "A :class:`string ` is a special kind of sequence whose items are " "*characters*. A character is not a separate data type but a string of " "exactly one character." msgstr "" -#: ../../reference/expressions.rst:906 +#: ../../reference/expressions.rst:907 msgid "Slicings" msgstr "" -#: ../../reference/expressions.rst:920 +#: ../../reference/expressions.rst:921 msgid "" "A slicing selects a range of items in a sequence object (e.g., a string, " "tuple or list). Slicings may be used as expressions or as targets in " "assignment or :keyword:`del` statements. The syntax for a slicing:" msgstr "" -#: ../../reference/expressions.rst:933 +#: ../../reference/expressions.rst:934 msgid "" "There is ambiguity in the formal syntax here: anything that looks like an " "expression list also looks like a slice list, so any subscription can be " @@ -976,7 +976,7 @@ msgid "" "the case if the slice list contains no proper slice)." msgstr "" -#: ../../reference/expressions.rst:945 +#: ../../reference/expressions.rst:946 msgid "" "The semantics for a slicing are as follows. The primary is indexed (using " "the same :meth:`~object.__getitem__` method as normal subscription) with a " @@ -991,33 +991,33 @@ msgid "" "missing expressions." msgstr "" -#: ../../reference/expressions.rst:969 +#: ../../reference/expressions.rst:970 msgid "Calls" msgstr "" -#: ../../reference/expressions.rst:971 +#: ../../reference/expressions.rst:972 msgid "" "A call calls a callable object (e.g., a :term:`function`) with a possibly " "empty series of :term:`arguments `:" msgstr "" -#: ../../reference/expressions.rst:988 +#: ../../reference/expressions.rst:989 msgid "" "An optional trailing comma may be present after the positional and keyword " "arguments but does not affect the semantics." msgstr "" -#: ../../reference/expressions.rst:994 +#: ../../reference/expressions.rst:995 msgid "" "The primary must evaluate to a callable object (user-defined functions, " "built-in functions, methods of built-in objects, class objects, methods of " -"class instances, and all objects having a :meth:`__call__` method are " -"callable). All argument expressions are evaluated before the call is " +"class instances, and all objects having a :meth:`~object.__call__` method " +"are callable). All argument expressions are evaluated before the call is " "attempted. Please refer to section :ref:`function` for the syntax of " "formal :term:`parameter` lists." msgstr "" -#: ../../reference/expressions.rst:1002 +#: ../../reference/expressions.rst:1003 msgid "" "If keyword arguments are present, they are first converted to positional " "arguments, as follows. First, a list of unfilled slots is created for the " @@ -1038,7 +1038,7 @@ msgid "" "filled slots is used as the argument list for the call." msgstr "" -#: ../../reference/expressions.rst:1022 +#: ../../reference/expressions.rst:1023 msgid "" "An implementation may provide built-in functions whose positional parameters " "do not have names, even if they are 'named' for the purpose of " @@ -1047,7 +1047,7 @@ msgid "" "`PyArg_ParseTuple` to parse their arguments." msgstr "" -#: ../../reference/expressions.rst:1028 +#: ../../reference/expressions.rst:1029 msgid "" "If there are more positional arguments than there are formal parameter " "slots, a :exc:`TypeError` exception is raised, unless a formal parameter " @@ -1056,7 +1056,7 @@ msgid "" "empty tuple if there were no excess positional arguments)." msgstr "" -#: ../../reference/expressions.rst:1034 +#: ../../reference/expressions.rst:1035 msgid "" "If any keyword argument does not correspond to a formal parameter name, a :" "exc:`TypeError` exception is raised, unless a formal parameter using the " @@ -1066,7 +1066,7 @@ msgid "" "(new) empty dictionary if there were no excess keyword arguments." msgstr "" -#: ../../reference/expressions.rst:1045 +#: ../../reference/expressions.rst:1046 msgid "" "If the syntax ``*expression`` appears in the function call, ``expression`` " "must evaluate to an :term:`iterable`. Elements from these iterables are " @@ -1076,20 +1076,20 @@ msgid "" "*y1*, ..., *yM*, *x3*, *x4*." msgstr "" -#: ../../reference/expressions.rst:1052 +#: ../../reference/expressions.rst:1053 msgid "" "A consequence of this is that although the ``*expression`` syntax may appear " "*after* explicit keyword arguments, it is processed *before* the keyword " "arguments (and any ``**expression`` arguments -- see below). So::" msgstr "" -#: ../../reference/expressions.rst:1068 +#: ../../reference/expressions.rst:1069 msgid "" "It is unusual for both keyword arguments and the ``*expression`` syntax to " "be used in the same call, so in practice this confusion does not often arise." msgstr "" -#: ../../reference/expressions.rst:1074 +#: ../../reference/expressions.rst:1075 msgid "" "If the syntax ``**expression`` appears in the function call, ``expression`` " "must evaluate to a :term:`mapping`, the contents of which are treated as " @@ -1098,7 +1098,7 @@ msgid "" "a :exc:`TypeError` exception is raised." msgstr "" -#: ../../reference/expressions.rst:1080 +#: ../../reference/expressions.rst:1081 msgid "" "When ``**expression`` is used, each key in this mapping must be a string. " "Each value from the mapping is assigned to the first formal parameter " @@ -1110,35 +1110,35 @@ msgid "" "is raised." msgstr "" -#: ../../reference/expressions.rst:1090 +#: ../../reference/expressions.rst:1091 msgid "" "Formal parameters using the syntax ``*identifier`` or ``**identifier`` " "cannot be used as positional argument slots or as keyword argument names." msgstr "" -#: ../../reference/expressions.rst:1093 +#: ../../reference/expressions.rst:1094 msgid "" "Function calls accept any number of ``*`` and ``**`` unpackings, positional " "arguments may follow iterable unpackings (``*``), and keyword arguments may " "follow dictionary unpackings (``**``). Originally proposed by :pep:`448`." msgstr "" -#: ../../reference/expressions.rst:1099 +#: ../../reference/expressions.rst:1100 msgid "" "A call always returns some value, possibly ``None``, unless it raises an " "exception. How this value is computed depends on the type of the callable " "object." msgstr "" -#: ../../reference/expressions.rst:1103 +#: ../../reference/expressions.rst:1104 msgid "If it is---" msgstr "" -#: ../../reference/expressions.rst:1116 +#: ../../reference/expressions.rst:1117 msgid "a user-defined function:" msgstr "" -#: ../../reference/expressions.rst:1112 +#: ../../reference/expressions.rst:1113 msgid "" "The code block for the function is executed, passing it the argument list. " "The first thing the code block will do is bind the formal parameters to the " @@ -1147,73 +1147,73 @@ msgid "" "value of the function call." msgstr "" -#: ../../reference/expressions.rst:1130 +#: ../../reference/expressions.rst:1131 msgid "a built-in function or method:" msgstr "" -#: ../../reference/expressions.rst:1129 +#: ../../reference/expressions.rst:1130 msgid "" "The result is up to the interpreter; see :ref:`built-in-funcs` for the " "descriptions of built-in functions and methods." msgstr "" -#: ../../reference/expressions.rst:1137 +#: ../../reference/expressions.rst:1138 msgid "a class object:" msgstr "" -#: ../../reference/expressions.rst:1137 +#: ../../reference/expressions.rst:1138 msgid "A new instance of that class is returned." msgstr "" -#: ../../reference/expressions.rst:1147 +#: ../../reference/expressions.rst:1148 msgid "a class instance method:" msgstr "" -#: ../../reference/expressions.rst:1145 +#: ../../reference/expressions.rst:1146 msgid "" "The corresponding user-defined function is called, with an argument list " "that is one longer than the argument list of the call: the instance becomes " "the first argument." msgstr "" -#: ../../reference/expressions.rst:1156 +#: ../../reference/expressions.rst:1157 msgid "a class instance:" msgstr "" -#: ../../reference/expressions.rst:1154 +#: ../../reference/expressions.rst:1155 msgid "" -"The class must define a :meth:`__call__` method; the effect is then the same " -"as if that method was called." +"The class must define a :meth:`~object.__call__` method; the effect is then " +"the same as if that method was called." msgstr "" -#: ../../reference/expressions.rst:1162 ../../reference/expressions.rst:1944 +#: ../../reference/expressions.rst:1163 ../../reference/expressions.rst:1945 msgid "Await expression" msgstr "" -#: ../../reference/expressions.rst:1164 +#: ../../reference/expressions.rst:1165 msgid "" "Suspend the execution of :term:`coroutine` on an :term:`awaitable` object. " "Can only be used inside a :term:`coroutine function`." msgstr "" -#: ../../reference/expressions.rst:1176 +#: ../../reference/expressions.rst:1177 msgid "The power operator" msgstr "" -#: ../../reference/expressions.rst:1182 +#: ../../reference/expressions.rst:1183 msgid "" "The power operator binds more tightly than unary operators on its left; it " "binds less tightly than unary operators on its right. The syntax is:" msgstr "" -#: ../../reference/expressions.rst:1188 +#: ../../reference/expressions.rst:1189 msgid "" "Thus, in an unparenthesized sequence of power and unary operators, the " "operators are evaluated from right to left (this does not constrain the " "evaluation order for the operands): ``-1**2`` results in ``-1``." msgstr "" -#: ../../reference/expressions.rst:1192 +#: ../../reference/expressions.rst:1193 msgid "" "The power operator has the same semantics as the built-in :func:`pow` " "function, when called with two arguments: it yields its left argument raised " @@ -1221,7 +1221,7 @@ msgid "" "converted to a common type, and the result is of that type." msgstr "" -#: ../../reference/expressions.rst:1197 +#: ../../reference/expressions.rst:1198 msgid "" "For int operands, the result has the same type as the operands unless the " "second argument is negative; in that case, all arguments are converted to " @@ -1229,58 +1229,59 @@ msgid "" "``100``, but ``10**-2`` returns ``0.01``." msgstr "" -#: ../../reference/expressions.rst:1202 +#: ../../reference/expressions.rst:1203 msgid "" "Raising ``0.0`` to a negative power results in a :exc:`ZeroDivisionError`. " "Raising a negative number to a fractional power results in a :class:" "`complex` number. (In earlier versions it raised a :exc:`ValueError`.)" msgstr "" -#: ../../reference/expressions.rst:1206 +#: ../../reference/expressions.rst:1207 msgid "" -"This operation can be customized using the special :meth:`__pow__` method." +"This operation can be customized using the special :meth:`~object.__pow__` " +"method." msgstr "" -#: ../../reference/expressions.rst:1211 +#: ../../reference/expressions.rst:1212 msgid "Unary arithmetic and bitwise operations" msgstr "" -#: ../../reference/expressions.rst:1217 +#: ../../reference/expressions.rst:1218 msgid "All unary arithmetic and bitwise operations have the same priority:" msgstr "" -#: ../../reference/expressions.rst:1228 +#: ../../reference/expressions.rst:1229 msgid "" "The unary ``-`` (minus) operator yields the negation of its numeric " -"argument; the operation can be overridden with the :meth:`__neg__` special " -"method." +"argument; the operation can be overridden with the :meth:`~object.__neg__` " +"special method." msgstr "" -#: ../../reference/expressions.rst:1236 +#: ../../reference/expressions.rst:1237 msgid "" "The unary ``+`` (plus) operator yields its numeric argument unchanged; the " -"operation can be overridden with the :meth:`__pos__` special method." +"operation can be overridden with the :meth:`~object.__pos__` special method." msgstr "" -#: ../../reference/expressions.rst:1243 +#: ../../reference/expressions.rst:1244 msgid "" "The unary ``~`` (invert) operator yields the bitwise inversion of its " "integer argument. The bitwise inversion of ``x`` is defined as ``-(x+1)``. " "It only applies to integral numbers or to custom objects that override the :" -"meth:`__invert__` special method." +"meth:`~object.__invert__` special method." msgstr "" -#: ../../reference/expressions.rst:1252 +#: ../../reference/expressions.rst:1253 msgid "" "In all three cases, if the argument does not have the proper type, a :exc:" "`TypeError` exception is raised." msgstr "" -#: ../../reference/expressions.rst:1259 +#: ../../reference/expressions.rst:1260 msgid "Binary arithmetic operations" msgstr "" -#: ../../reference/expressions.rst:1263 +#: ../../reference/expressions.rst:1264 msgid "" "The binary arithmetic operations have the conventional priority levels. " "Note that some of these operations also apply to certain non-numeric types. " @@ -1288,7 +1289,7 @@ msgid "" "multiplicative operators and one for additive operators:" msgstr "" -#: ../../reference/expressions.rst:1278 +#: ../../reference/expressions.rst:1279 msgid "" "The ``*`` (multiplication) operator yields the product of its arguments. " "The arguments must either both be numbers, or one argument must be an " @@ -1298,19 +1299,19 @@ msgid "" "an empty sequence." msgstr "" -#: ../../reference/expressions.rst:1284 +#: ../../reference/expressions.rst:1285 msgid "" -"This operation can be customized using the special :meth:`__mul__` and :meth:" -"`__rmul__` methods." +"This operation can be customized using the special :meth:`~object.__mul__` " +"and :meth:`~object.__rmul__` methods." msgstr "" -#: ../../reference/expressions.rst:1291 +#: ../../reference/expressions.rst:1292 msgid "" "The ``@`` (at) operator is intended to be used for matrix multiplication. " "No builtin Python types implement this operator." msgstr "" -#: ../../reference/expressions.rst:1302 +#: ../../reference/expressions.rst:1303 msgid "" "The ``/`` (division) and ``//`` (floor division) operators yield the " "quotient of their arguments. The numeric arguments are first converted to a " @@ -1320,13 +1321,13 @@ msgid "" "the :exc:`ZeroDivisionError` exception." msgstr "" -#: ../../reference/expressions.rst:1309 +#: ../../reference/expressions.rst:1310 msgid "" -"This operation can be customized using the special :meth:`__truediv__` and :" -"meth:`__floordiv__` methods." +"This operation can be customized using the special :meth:`~object." +"__truediv__` and :meth:`~object.__floordiv__` methods." msgstr "" -#: ../../reference/expressions.rst:1316 +#: ../../reference/expressions.rst:1317 msgid "" "The ``%`` (modulo) operator yields the remainder from the division of the " "first argument by the second. The numeric arguments are first converted to " @@ -1338,7 +1339,7 @@ msgid "" "absolute value of the second operand [#]_." msgstr "" -#: ../../reference/expressions.rst:1325 +#: ../../reference/expressions.rst:1326 msgid "" "The floor division and modulo operators are connected by the following " "identity: ``x == (x//y)*y + (x%y)``. Floor division and modulo are also " @@ -1346,7 +1347,7 @@ msgid "" "y, x%y)``. [#]_." msgstr "" -#: ../../reference/expressions.rst:1330 +#: ../../reference/expressions.rst:1331 msgid "" "In addition to performing the modulo operation on numbers, the ``%`` " "operator is also overloaded by string objects to perform old-style string " @@ -1355,20 +1356,20 @@ msgid "" "formatting`." msgstr "" -#: ../../reference/expressions.rst:1335 +#: ../../reference/expressions.rst:1336 msgid "" -"The *modulo* operation can be customized using the special :meth:`__mod__` " -"method." +"The *modulo* operation can be customized using the special :meth:`~object." +"__mod__` method." msgstr "" -#: ../../reference/expressions.rst:1337 +#: ../../reference/expressions.rst:1338 msgid "" "The floor division operator, the modulo operator, and the :func:`divmod` " "function are not defined for complex numbers. Instead, convert to a " "floating point number using the :func:`abs` function if appropriate." msgstr "" -#: ../../reference/expressions.rst:1346 +#: ../../reference/expressions.rst:1347 msgid "" "The ``+`` (addition) operator yields the sum of its arguments. The " "arguments must either both be numbers or both be sequences of the same " @@ -1376,84 +1377,85 @@ msgid "" "then added together. In the latter case, the sequences are concatenated." msgstr "" -#: ../../reference/expressions.rst:1351 +#: ../../reference/expressions.rst:1352 msgid "" -"This operation can be customized using the special :meth:`__add__` and :meth:" -"`__radd__` methods." +"This operation can be customized using the special :meth:`~object.__add__` " +"and :meth:`~object.__radd__` methods." msgstr "" -#: ../../reference/expressions.rst:1359 +#: ../../reference/expressions.rst:1360 msgid "" "The ``-`` (subtraction) operator yields the difference of its arguments. " "The numeric arguments are first converted to a common type." msgstr "" -#: ../../reference/expressions.rst:1362 +#: ../../reference/expressions.rst:1363 msgid "" -"This operation can be customized using the special :meth:`__sub__` method." +"This operation can be customized using the special :meth:`~object.__sub__` " +"method." msgstr "" -#: ../../reference/expressions.rst:1368 +#: ../../reference/expressions.rst:1369 msgid "Shifting operations" msgstr "" -#: ../../reference/expressions.rst:1375 +#: ../../reference/expressions.rst:1376 msgid "" "The shifting operations have lower priority than the arithmetic operations:" msgstr "" -#: ../../reference/expressions.rst:1380 +#: ../../reference/expressions.rst:1381 msgid "" "These operators accept integers as arguments. They shift the first argument " "to the left or right by the number of bits given by the second argument." msgstr "" -#: ../../reference/expressions.rst:1383 +#: ../../reference/expressions.rst:1384 msgid "" -"This operation can be customized using the special :meth:`__lshift__` and :" -"meth:`__rshift__` methods." +"This operation can be customized using the special :meth:`~object." +"__lshift__` and :meth:`~object.__rshift__` methods." msgstr "" -#: ../../reference/expressions.rst:1388 +#: ../../reference/expressions.rst:1389 msgid "" "A right shift by *n* bits is defined as floor division by ``pow(2,n)``. A " "left shift by *n* bits is defined as multiplication with ``pow(2,n)``." msgstr "" -#: ../../reference/expressions.rst:1395 +#: ../../reference/expressions.rst:1396 msgid "Binary bitwise operations" msgstr "" -#: ../../reference/expressions.rst:1399 +#: ../../reference/expressions.rst:1400 msgid "Each of the three bitwise operations has a different priority level:" msgstr "" -#: ../../reference/expressions.rst:1410 +#: ../../reference/expressions.rst:1411 msgid "" "The ``&`` operator yields the bitwise AND of its arguments, which must be " -"integers or one of them must be a custom object overriding :meth:`__and__` " -"or :meth:`__rand__` special methods." +"integers or one of them must be a custom object overriding :meth:`~object." +"__and__` or :meth:`~object.__rand__` special methods." msgstr "" -#: ../../reference/expressions.rst:1419 +#: ../../reference/expressions.rst:1420 msgid "" "The ``^`` operator yields the bitwise XOR (exclusive OR) of its arguments, " "which must be integers or one of them must be a custom object overriding :" -"meth:`__xor__` or :meth:`__rxor__` special methods." +"meth:`~object.__xor__` or :meth:`~object.__rxor__` special methods." msgstr "" -#: ../../reference/expressions.rst:1428 +#: ../../reference/expressions.rst:1429 msgid "" "The ``|`` operator yields the bitwise (inclusive) OR of its arguments, which " "must be integers or one of them must be a custom object overriding :meth:" -"`__or__` or :meth:`__ror__` special methods." +"`~object.__or__` or :meth:`~object.__ror__` special methods." msgstr "" -#: ../../reference/expressions.rst:1436 +#: ../../reference/expressions.rst:1437 msgid "Comparisons" msgstr "" -#: ../../reference/expressions.rst:1448 +#: ../../reference/expressions.rst:1449 msgid "" "Unlike C, all comparison operations in Python have the same priority, which " "is lower than that of any arithmetic, shifting or bitwise operation. Also " @@ -1461,14 +1463,14 @@ msgid "" "conventional in mathematics:" msgstr "" -#: ../../reference/expressions.rst:1458 +#: ../../reference/expressions.rst:1459 msgid "" "Comparisons yield boolean values: ``True`` or ``False``. Custom :dfn:`rich " "comparison methods` may return non-boolean values. In this case Python will " "call :func:`bool` on such value in boolean contexts." msgstr "" -#: ../../reference/expressions.rst:1464 +#: ../../reference/expressions.rst:1465 msgid "" "Comparisons can be chained arbitrarily, e.g., ``x < y <= z`` is equivalent " "to ``x < y and y <= z``, except that ``y`` is evaluated only once (but in " @@ -1476,7 +1478,7 @@ msgid "" "false)." msgstr "" -#: ../../reference/expressions.rst:1468 +#: ../../reference/expressions.rst:1469 msgid "" "Formally, if *a*, *b*, *c*, ..., *y*, *z* are expressions and *op1*, " "*op2*, ..., *opN* are comparison operators, then ``a op1 b op2 c ... y opN " @@ -1484,24 +1486,24 @@ msgid "" "each expression is evaluated at most once." msgstr "" -#: ../../reference/expressions.rst:1473 +#: ../../reference/expressions.rst:1474 msgid "" "Note that ``a op1 b op2 c`` doesn't imply any kind of comparison between *a* " "and *c*, so that, e.g., ``x < y > z`` is perfectly legal (though perhaps not " "pretty)." msgstr "" -#: ../../reference/expressions.rst:1480 +#: ../../reference/expressions.rst:1481 msgid "Value comparisons" msgstr "" -#: ../../reference/expressions.rst:1482 +#: ../../reference/expressions.rst:1483 msgid "" "The operators ``<``, ``>``, ``==``, ``>=``, ``<=``, and ``!=`` compare the " "values of two objects. The objects do not need to have the same type." msgstr "" -#: ../../reference/expressions.rst:1485 +#: ../../reference/expressions.rst:1486 msgid "" "Chapter :ref:`objects` states that objects have a value (in addition to type " "and identity). The value of an object is a rather abstract notion in " @@ -1513,15 +1515,15 @@ msgid "" "indirectly, by means of their comparison implementation." msgstr "" -#: ../../reference/expressions.rst:1494 +#: ../../reference/expressions.rst:1495 msgid "" "Because all types are (direct or indirect) subtypes of :class:`object`, they " "inherit the default comparison behavior from :class:`object`. Types can " "customize their comparison behavior by implementing :dfn:`rich comparison " -"methods` like :meth:`__lt__`, described in :ref:`customization`." +"methods` like :meth:`~object.__lt__`, described in :ref:`customization`." msgstr "" -#: ../../reference/expressions.rst:1500 +#: ../../reference/expressions.rst:1501 msgid "" "The default behavior for equality comparison (``==`` and ``!=``) is based on " "the identity of the objects. Hence, equality comparison of instances with " @@ -1531,14 +1533,14 @@ msgid "" "``x is y`` implies ``x == y``)." msgstr "" -#: ../../reference/expressions.rst:1507 +#: ../../reference/expressions.rst:1508 msgid "" "A default order comparison (``<``, ``>``, ``<=``, and ``>=``) is not " "provided; an attempt raises :exc:`TypeError`. A motivation for this default " "behavior is the lack of a similar invariant as for equality." msgstr "" -#: ../../reference/expressions.rst:1511 +#: ../../reference/expressions.rst:1512 msgid "" "The behavior of the default equality comparison, that instances with " "different identities are always unequal, may be in contrast to what types " @@ -1547,13 +1549,13 @@ msgid "" "in fact, a number of built-in types have done that." msgstr "" -#: ../../reference/expressions.rst:1517 +#: ../../reference/expressions.rst:1518 msgid "" "The following list describes the comparison behavior of the most important " "built-in types." msgstr "" -#: ../../reference/expressions.rst:1520 +#: ../../reference/expressions.rst:1521 msgid "" "Numbers of built-in numeric types (:ref:`typesnumeric`) and of the standard " "library types :class:`fractions.Fraction` and :class:`decimal.Decimal` can " @@ -1563,7 +1565,7 @@ msgid "" "of precision." msgstr "" -#: ../../reference/expressions.rst:1527 +#: ../../reference/expressions.rst:1528 msgid "" "The not-a-number values ``float('NaN')`` and ``decimal.Decimal('NaN')`` are " "special. Any ordered comparison of a number to a not-a-number value is " @@ -1573,32 +1575,32 @@ msgid "" "is compliant with IEEE 754." msgstr "" -#: ../../reference/expressions.rst:1534 +#: ../../reference/expressions.rst:1535 msgid "" "``None`` and ``NotImplemented`` are singletons. :PEP:`8` advises that " "comparisons for singletons should always be done with ``is`` or ``is not``, " "never the equality operators." msgstr "" -#: ../../reference/expressions.rst:1538 +#: ../../reference/expressions.rst:1539 msgid "" "Binary sequences (instances of :class:`bytes` or :class:`bytearray`) can be " "compared within and across their types. They compare lexicographically " "using the numeric values of their elements." msgstr "" -#: ../../reference/expressions.rst:1542 +#: ../../reference/expressions.rst:1543 msgid "" "Strings (instances of :class:`str`) compare lexicographically using the " "numerical Unicode code points (the result of the built-in function :func:" "`ord`) of their characters. [#]_" msgstr "" -#: ../../reference/expressions.rst:1546 +#: ../../reference/expressions.rst:1547 msgid "Strings and binary sequences cannot be directly compared." msgstr "" -#: ../../reference/expressions.rst:1548 +#: ../../reference/expressions.rst:1549 msgid "" "Sequences (instances of :class:`tuple`, :class:`list`, or :class:`range`) " "can be compared only within each of their types, with the restriction that " @@ -1607,7 +1609,7 @@ msgid "" "raises :exc:`TypeError`." msgstr "" -#: ../../reference/expressions.rst:1554 +#: ../../reference/expressions.rst:1555 msgid "" "Sequences compare lexicographically using comparison of corresponding " "elements. The built-in containers typically assume identical objects are " @@ -1615,19 +1617,19 @@ msgid "" "objects to improve performance and to maintain their internal invariants." msgstr "" -#: ../../reference/expressions.rst:1559 +#: ../../reference/expressions.rst:1560 msgid "" "Lexicographical comparison between built-in collections works as follows:" msgstr "" -#: ../../reference/expressions.rst:1561 +#: ../../reference/expressions.rst:1562 msgid "" "For two collections to compare equal, they must be of the same type, have " "the same length, and each pair of corresponding elements must compare equal " "(for example, ``[1,2] == (1,2)`` is false because the type is not the same)." msgstr "" -#: ../../reference/expressions.rst:1566 +#: ../../reference/expressions.rst:1567 msgid "" "Collections that support order comparison are ordered the same as their " "first unequal elements (for example, ``[1,2,x] <= [1,2,y]`` has the same " @@ -1636,25 +1638,25 @@ msgid "" "true)." msgstr "" -#: ../../reference/expressions.rst:1572 +#: ../../reference/expressions.rst:1573 msgid "" "Mappings (instances of :class:`dict`) compare equal if and only if they have " "equal ``(key, value)`` pairs. Equality comparison of the keys and values " "enforces reflexivity." msgstr "" -#: ../../reference/expressions.rst:1576 +#: ../../reference/expressions.rst:1577 msgid "" "Order comparisons (``<``, ``>``, ``<=``, and ``>=``) raise :exc:`TypeError`." msgstr "" -#: ../../reference/expressions.rst:1578 +#: ../../reference/expressions.rst:1579 msgid "" "Sets (instances of :class:`set` or :class:`frozenset`) can be compared " "within and across their types." msgstr "" -#: ../../reference/expressions.rst:1581 +#: ../../reference/expressions.rst:1582 msgid "" "They define order comparison operators to mean subset and superset tests. " "Those relations do not define total orderings (for example, the two sets " @@ -1665,110 +1667,110 @@ msgid "" "sets as inputs)." msgstr "" -#: ../../reference/expressions.rst:1589 +#: ../../reference/expressions.rst:1590 msgid "Comparison of sets enforces reflexivity of its elements." msgstr "" -#: ../../reference/expressions.rst:1591 +#: ../../reference/expressions.rst:1592 msgid "" "Most other built-in types have no comparison methods implemented, so they " "inherit the default comparison behavior." msgstr "" -#: ../../reference/expressions.rst:1594 +#: ../../reference/expressions.rst:1595 msgid "" "User-defined classes that customize their comparison behavior should follow " "some consistency rules, if possible:" msgstr "" -#: ../../reference/expressions.rst:1597 +#: ../../reference/expressions.rst:1598 msgid "" "Equality comparison should be reflexive. In other words, identical objects " "should compare equal:" msgstr "" -#: ../../reference/expressions.rst:1600 +#: ../../reference/expressions.rst:1601 msgid "``x is y`` implies ``x == y``" msgstr "" -#: ../../reference/expressions.rst:1602 +#: ../../reference/expressions.rst:1603 msgid "" "Comparison should be symmetric. In other words, the following expressions " "should have the same result:" msgstr "" -#: ../../reference/expressions.rst:1605 +#: ../../reference/expressions.rst:1606 msgid "``x == y`` and ``y == x``" msgstr "``x == y`` 和 ``y == x``" -#: ../../reference/expressions.rst:1607 +#: ../../reference/expressions.rst:1608 msgid "``x != y`` and ``y != x``" msgstr "``x != y`` 和 ``y != x``" -#: ../../reference/expressions.rst:1609 +#: ../../reference/expressions.rst:1610 msgid "``x < y`` and ``y > x``" msgstr "``x < y`` 和 ``y > x``" -#: ../../reference/expressions.rst:1611 +#: ../../reference/expressions.rst:1612 msgid "``x <= y`` and ``y >= x``" msgstr "``x <= y`` 和 ``y >= x``" -#: ../../reference/expressions.rst:1613 +#: ../../reference/expressions.rst:1614 msgid "" "Comparison should be transitive. The following (non-exhaustive) examples " "illustrate that:" msgstr "" -#: ../../reference/expressions.rst:1616 +#: ../../reference/expressions.rst:1617 msgid "``x > y and y > z`` implies ``x > z``" msgstr "``x > y and y > z`` 暗示了 ``x > z``" -#: ../../reference/expressions.rst:1618 +#: ../../reference/expressions.rst:1619 msgid "``x < y and y <= z`` implies ``x < z``" msgstr "``x < y and y <= z`` 暗示了 ``x < z``" -#: ../../reference/expressions.rst:1620 +#: ../../reference/expressions.rst:1621 msgid "" "Inverse comparison should result in the boolean negation. In other words, " "the following expressions should have the same result:" msgstr "" -#: ../../reference/expressions.rst:1623 +#: ../../reference/expressions.rst:1624 msgid "``x == y`` and ``not x != y``" msgstr "``x == y`` 和 ``not x != y``" -#: ../../reference/expressions.rst:1625 +#: ../../reference/expressions.rst:1626 msgid "``x < y`` and ``not x >= y`` (for total ordering)" msgstr "" -#: ../../reference/expressions.rst:1627 +#: ../../reference/expressions.rst:1628 msgid "``x > y`` and ``not x <= y`` (for total ordering)" msgstr "" -#: ../../reference/expressions.rst:1629 +#: ../../reference/expressions.rst:1630 msgid "" "The last two expressions apply to totally ordered collections (e.g. to " "sequences, but not to sets or mappings). See also the :func:`~functools." "total_ordering` decorator." msgstr "" -#: ../../reference/expressions.rst:1633 +#: ../../reference/expressions.rst:1634 msgid "" "The :func:`hash` result should be consistent with equality. Objects that are " "equal should either have the same hash value, or be marked as unhashable." msgstr "" -#: ../../reference/expressions.rst:1637 +#: ../../reference/expressions.rst:1638 msgid "" "Python does not enforce these consistency rules. In fact, the not-a-number " "values are an example for not following these rules." msgstr "" -#: ../../reference/expressions.rst:1646 +#: ../../reference/expressions.rst:1647 msgid "Membership test operations" msgstr "" -#: ../../reference/expressions.rst:1648 +#: ../../reference/expressions.rst:1649 msgid "" "The operators :keyword:`in` and :keyword:`not in` test for membership. ``x " "in s`` evaluates to ``True`` if *x* is a member of *s*, and ``False`` " @@ -1779,7 +1781,7 @@ msgid "" "expression ``x in y`` is equivalent to ``any(x is e or x == e for e in y)``." msgstr "" -#: ../../reference/expressions.rst:1656 +#: ../../reference/expressions.rst:1657 msgid "" "For the string and bytes types, ``x in y`` is ``True`` if and only if *x* is " "a substring of *y*. An equivalent test is ``y.find(x) != -1``. Empty " @@ -1787,23 +1789,23 @@ msgid "" "``\"\" in \"abc\"`` will return ``True``." msgstr "" -#: ../../reference/expressions.rst:1661 +#: ../../reference/expressions.rst:1662 msgid "" -"For user-defined classes which define the :meth:`__contains__` method, ``x " -"in y`` returns ``True`` if ``y.__contains__(x)`` returns a true value, and " -"``False`` otherwise." +"For user-defined classes which define the :meth:`~object.__contains__` " +"method, ``x in y`` returns ``True`` if ``y.__contains__(x)`` returns a true " +"value, and ``False`` otherwise." msgstr "" -#: ../../reference/expressions.rst:1665 +#: ../../reference/expressions.rst:1666 msgid "" -"For user-defined classes which do not define :meth:`__contains__` but do " -"define :meth:`__iter__`, ``x in y`` is ``True`` if some value ``z``, for " -"which the expression ``x is z or x == z`` is true, is produced while " -"iterating over ``y``. If an exception is raised during the iteration, it is " -"as if :keyword:`in` raised that exception." +"For user-defined classes which do not define :meth:`~object.__contains__` " +"but do define :meth:`~object.__iter__`, ``x in y`` is ``True`` if some value " +"``z``, for which the expression ``x is z or x == z`` is true, is produced " +"while iterating over ``y``. If an exception is raised during the iteration, " +"it is as if :keyword:`in` raised that exception." msgstr "" -#: ../../reference/expressions.rst:1671 +#: ../../reference/expressions.rst:1672 msgid "" "Lastly, the old-style iteration protocol is tried: if a class defines :meth:" "`~object.__getitem__`, ``x in y`` is ``True`` if and only if there is a non-" @@ -1812,17 +1814,17 @@ msgid "" "exception is raised, it is as if :keyword:`in` raised that exception)." msgstr "" -#: ../../reference/expressions.rst:1683 +#: ../../reference/expressions.rst:1684 msgid "" "The operator :keyword:`not in` is defined to have the inverse truth value " "of :keyword:`in`." msgstr "" -#: ../../reference/expressions.rst:1696 +#: ../../reference/expressions.rst:1697 msgid "Identity comparisons" msgstr "" -#: ../../reference/expressions.rst:1698 +#: ../../reference/expressions.rst:1699 msgid "" "The operators :keyword:`is` and :keyword:`is not` test for an object's " "identity: ``x is y`` is true if and only if *x* and *y* are the same " @@ -1830,11 +1832,11 @@ msgid "" "``x is not y`` yields the inverse truth value. [#]_" msgstr "" -#: ../../reference/expressions.rst:1710 +#: ../../reference/expressions.rst:1711 msgid "Boolean operations" msgstr "" -#: ../../reference/expressions.rst:1721 +#: ../../reference/expressions.rst:1722 msgid "" "In the context of Boolean operations, and also when expressions are used by " "control flow statements, the following values are interpreted as false: " @@ -1845,25 +1847,25 @@ msgid "" "__bool__` method." msgstr "" -#: ../../reference/expressions.rst:1730 +#: ../../reference/expressions.rst:1731 msgid "" "The operator :keyword:`not` yields ``True`` if its argument is false, " "``False`` otherwise." msgstr "" -#: ../../reference/expressions.rst:1735 +#: ../../reference/expressions.rst:1736 msgid "" "The expression ``x and y`` first evaluates *x*; if *x* is false, its value " "is returned; otherwise, *y* is evaluated and the resulting value is returned." msgstr "" -#: ../../reference/expressions.rst:1740 +#: ../../reference/expressions.rst:1741 msgid "" "The expression ``x or y`` first evaluates *x*; if *x* is true, its value is " "returned; otherwise, *y* is evaluated and the resulting value is returned." msgstr "" -#: ../../reference/expressions.rst:1743 +#: ../../reference/expressions.rst:1744 msgid "" "Note that neither :keyword:`and` nor :keyword:`or` restrict the value and " "type they return to ``False`` and ``True``, but rather return the last " @@ -1874,11 +1876,11 @@ msgid "" "argument (for example, ``not 'foo'`` produces ``False`` rather than ``''``.)" msgstr "" -#: ../../reference/expressions.rst:1759 +#: ../../reference/expressions.rst:1760 msgid "Assignment expressions" msgstr "" -#: ../../reference/expressions.rst:1764 +#: ../../reference/expressions.rst:1765 msgid "" "An assignment expression (sometimes also called a \"named expression\" or " "\"walrus\") assigns an :token:`~python-grammar:expression` to an :token:" @@ -1886,15 +1888,15 @@ msgid "" "`~python-grammar:expression`." msgstr "" -#: ../../reference/expressions.rst:1769 +#: ../../reference/expressions.rst:1770 msgid "One common use case is when handling matched regular expressions:" msgstr "" -#: ../../reference/expressions.rst:1776 +#: ../../reference/expressions.rst:1777 msgid "Or, when processing a file stream in chunks:" msgstr "" -#: ../../reference/expressions.rst:1783 +#: ../../reference/expressions.rst:1784 msgid "" "Assignment expressions must be surrounded by parentheses when used as " "expression statements and when used as sub-expressions in slicing, " @@ -1904,36 +1906,36 @@ msgid "" "and ``while`` statements." msgstr "" -#: ../../reference/expressions.rst:1791 +#: ../../reference/expressions.rst:1792 msgid "See :pep:`572` for more details about assignment expressions." msgstr "" -#: ../../reference/expressions.rst:1798 +#: ../../reference/expressions.rst:1799 msgid "Conditional expressions" msgstr "" -#: ../../reference/expressions.rst:1810 +#: ../../reference/expressions.rst:1811 msgid "" "Conditional expressions (sometimes called a \"ternary operator\") have the " "lowest priority of all Python operations." msgstr "" -#: ../../reference/expressions.rst:1813 +#: ../../reference/expressions.rst:1814 msgid "" "The expression ``x if C else y`` first evaluates the condition, *C* rather " "than *x*. If *C* is true, *x* is evaluated and its value is returned; " "otherwise, *y* is evaluated and its value is returned." msgstr "" -#: ../../reference/expressions.rst:1817 +#: ../../reference/expressions.rst:1818 msgid "See :pep:`308` for more details about conditional expressions." msgstr "" -#: ../../reference/expressions.rst:1824 +#: ../../reference/expressions.rst:1825 msgid "Lambdas" msgstr "" -#: ../../reference/expressions.rst:1835 +#: ../../reference/expressions.rst:1836 msgid "" "Lambda expressions (sometimes called lambda forms) are used to create " "anonymous functions. The expression ``lambda parameters: expression`` yields " @@ -1941,25 +1943,25 @@ msgid "" "defined with:" msgstr "" -#: ../../reference/expressions.rst:1844 +#: ../../reference/expressions.rst:1845 msgid "" "See section :ref:`function` for the syntax of parameter lists. Note that " "functions created with lambda expressions cannot contain statements or " "annotations." msgstr "" -#: ../../reference/expressions.rst:1852 +#: ../../reference/expressions.rst:1853 msgid "Expression lists" msgstr "" -#: ../../reference/expressions.rst:1866 +#: ../../reference/expressions.rst:1867 msgid "" "Except when part of a list or set display, an expression list containing at " "least one comma yields a tuple. The length of the tuple is the number of " "expressions in the list. The expressions are evaluated from left to right." msgstr "" -#: ../../reference/expressions.rst:1875 +#: ../../reference/expressions.rst:1876 msgid "" "An asterisk ``*`` denotes :dfn:`iterable unpacking`. Its operand must be " "an :term:`iterable`. The iterable is expanded into a sequence of items, " @@ -1967,12 +1969,12 @@ msgid "" "unpacking." msgstr "" -#: ../../reference/expressions.rst:1880 +#: ../../reference/expressions.rst:1881 msgid "" "Iterable unpacking in expression lists, originally proposed by :pep:`448`." msgstr "" -#: ../../reference/expressions.rst:1885 +#: ../../reference/expressions.rst:1886 msgid "" "The trailing comma is required only to create a single tuple (a.k.a. a " "*singleton*); it is optional in all other cases. A single expression " @@ -1981,28 +1983,28 @@ msgid "" "parentheses: ``()``.)" msgstr "" -#: ../../reference/expressions.rst:1895 +#: ../../reference/expressions.rst:1896 msgid "Evaluation order" msgstr "" -#: ../../reference/expressions.rst:1899 +#: ../../reference/expressions.rst:1900 msgid "" "Python evaluates expressions from left to right. Notice that while " "evaluating an assignment, the right-hand side is evaluated before the left-" "hand side." msgstr "" -#: ../../reference/expressions.rst:1902 +#: ../../reference/expressions.rst:1903 msgid "" "In the following lines, expressions will be evaluated in the arithmetic " "order of their suffixes::" msgstr "" -#: ../../reference/expressions.rst:1916 +#: ../../reference/expressions.rst:1917 msgid "Operator precedence" msgstr "" -#: ../../reference/expressions.rst:1921 +#: ../../reference/expressions.rst:1922 msgid "" "The following table summarizes the operator precedence in Python, from " "highest precedence (most binding) to lowest precedence (least binding). " @@ -2012,176 +2014,176 @@ msgid "" "group from right to left)." msgstr "" -#: ../../reference/expressions.rst:1927 +#: ../../reference/expressions.rst:1928 msgid "" "Note that comparisons, membership tests, and identity tests, all have the " "same precedence and have a left-to-right chaining feature as described in " "the :ref:`comparisons` section." msgstr "" -#: ../../reference/expressions.rst:1933 +#: ../../reference/expressions.rst:1934 msgid "Operator" msgstr "" -#: ../../reference/expressions.rst:1933 +#: ../../reference/expressions.rst:1934 msgid "Description" msgstr "描述" -#: ../../reference/expressions.rst:1935 +#: ../../reference/expressions.rst:1936 msgid "``(expressions...)``," msgstr "``(expressions...)``," -#: ../../reference/expressions.rst:1937 +#: ../../reference/expressions.rst:1938 msgid "``[expressions...]``, ``{key: value...}``, ``{expressions...}``" msgstr "``[expressions...]``, ``{key: value...}``, ``{expressions...}``" -#: ../../reference/expressions.rst:1935 +#: ../../reference/expressions.rst:1936 msgid "" "Binding or parenthesized expression, list display, dictionary display, set " "display" msgstr "" -#: ../../reference/expressions.rst:1941 +#: ../../reference/expressions.rst:1942 msgid "``x[index]``, ``x[index:index]``, ``x(arguments...)``, ``x.attribute``" msgstr "``x[index]``, ``x[index:index]``, ``x(arguments...)``, ``x.attribute``" -#: ../../reference/expressions.rst:1941 +#: ../../reference/expressions.rst:1942 msgid "Subscription, slicing, call, attribute reference" msgstr "" -#: ../../reference/expressions.rst:1944 +#: ../../reference/expressions.rst:1945 msgid ":keyword:`await x `" msgstr ":keyword:`await x `" -#: ../../reference/expressions.rst:1946 +#: ../../reference/expressions.rst:1947 msgid "``**``" msgstr "``**``" -#: ../../reference/expressions.rst:1946 +#: ../../reference/expressions.rst:1947 msgid "Exponentiation [#]_" msgstr "" -#: ../../reference/expressions.rst:1948 +#: ../../reference/expressions.rst:1949 msgid "``+x``, ``-x``, ``~x``" msgstr "``+x``, ``-x``, ``~x``" -#: ../../reference/expressions.rst:1948 +#: ../../reference/expressions.rst:1949 msgid "Positive, negative, bitwise NOT" msgstr "" -#: ../../reference/expressions.rst:1950 +#: ../../reference/expressions.rst:1951 msgid "``*``, ``@``, ``/``, ``//``, ``%``" msgstr "``*``, ``@``, ``/``, ``//``, ``%``" -#: ../../reference/expressions.rst:1950 +#: ../../reference/expressions.rst:1951 msgid "" "Multiplication, matrix multiplication, division, floor division, remainder " "[#]_" msgstr "" -#: ../../reference/expressions.rst:1954 +#: ../../reference/expressions.rst:1955 msgid "``+``, ``-``" msgstr "``+``, ``-``" -#: ../../reference/expressions.rst:1954 +#: ../../reference/expressions.rst:1955 msgid "Addition and subtraction" msgstr "" -#: ../../reference/expressions.rst:1956 +#: ../../reference/expressions.rst:1957 msgid "``<<``, ``>>``" msgstr "``<<``, ``>>``" -#: ../../reference/expressions.rst:1956 +#: ../../reference/expressions.rst:1957 msgid "Shifts" msgstr "" -#: ../../reference/expressions.rst:1958 +#: ../../reference/expressions.rst:1959 msgid "``&``" msgstr "``&``" -#: ../../reference/expressions.rst:1958 +#: ../../reference/expressions.rst:1959 msgid "Bitwise AND" msgstr "" -#: ../../reference/expressions.rst:1960 +#: ../../reference/expressions.rst:1961 msgid "``^``" msgstr "``^``" -#: ../../reference/expressions.rst:1960 +#: ../../reference/expressions.rst:1961 msgid "Bitwise XOR" msgstr "" -#: ../../reference/expressions.rst:1962 +#: ../../reference/expressions.rst:1963 msgid "``|``" msgstr "``|``" -#: ../../reference/expressions.rst:1962 +#: ../../reference/expressions.rst:1963 msgid "Bitwise OR" msgstr "" -#: ../../reference/expressions.rst:1964 +#: ../../reference/expressions.rst:1965 msgid "" ":keyword:`in`, :keyword:`not in`, :keyword:`is`, :keyword:`is not`, ``<``, " "``<=``, ``>``, ``>=``, ``!=``, ``==``" msgstr "" -#: ../../reference/expressions.rst:1964 +#: ../../reference/expressions.rst:1965 msgid "Comparisons, including membership tests and identity tests" msgstr "" -#: ../../reference/expressions.rst:1968 +#: ../../reference/expressions.rst:1969 msgid ":keyword:`not x `" msgstr ":keyword:`not x `" -#: ../../reference/expressions.rst:1968 +#: ../../reference/expressions.rst:1969 msgid "Boolean NOT" msgstr "" -#: ../../reference/expressions.rst:1970 +#: ../../reference/expressions.rst:1971 msgid ":keyword:`and`" msgstr ":keyword:`and`" -#: ../../reference/expressions.rst:1970 +#: ../../reference/expressions.rst:1971 msgid "Boolean AND" msgstr "" -#: ../../reference/expressions.rst:1972 +#: ../../reference/expressions.rst:1973 msgid ":keyword:`or`" msgstr ":keyword:`or`" -#: ../../reference/expressions.rst:1972 +#: ../../reference/expressions.rst:1973 msgid "Boolean OR" msgstr "" -#: ../../reference/expressions.rst:1974 +#: ../../reference/expressions.rst:1975 msgid ":keyword:`if ` -- :keyword:`!else`" msgstr ":keyword:`if ` -- :keyword:`!else`" -#: ../../reference/expressions.rst:1974 +#: ../../reference/expressions.rst:1975 msgid "Conditional expression" msgstr "" -#: ../../reference/expressions.rst:1976 +#: ../../reference/expressions.rst:1977 msgid ":keyword:`lambda`" msgstr ":keyword:`lambda`" -#: ../../reference/expressions.rst:1976 +#: ../../reference/expressions.rst:1977 msgid "Lambda expression" msgstr "" -#: ../../reference/expressions.rst:1978 +#: ../../reference/expressions.rst:1979 msgid "``:=``" msgstr "``:=``" -#: ../../reference/expressions.rst:1978 +#: ../../reference/expressions.rst:1979 msgid "Assignment expression" msgstr "" -#: ../../reference/expressions.rst:1983 +#: ../../reference/expressions.rst:1984 msgid "Footnotes" msgstr "註解" -#: ../../reference/expressions.rst:1984 +#: ../../reference/expressions.rst:1985 msgid "" "While ``abs(x%y) < abs(y)`` is true mathematically, for floats it may not be " "true numerically due to roundoff. For example, and assuming a platform on " @@ -2193,7 +2195,7 @@ msgid "" "approach is more appropriate depends on the application." msgstr "" -#: ../../reference/expressions.rst:1993 +#: ../../reference/expressions.rst:1994 msgid "" "If x is very close to an exact integer multiple of y, it's possible for ``x//" "y`` to be one larger than ``(x-x%y)//y`` due to rounding. In such cases, " @@ -2201,7 +2203,7 @@ msgid "" "* y + x % y`` be very close to ``x``." msgstr "" -#: ../../reference/expressions.rst:1998 +#: ../../reference/expressions.rst:1999 msgid "" "The Unicode standard distinguishes between :dfn:`code points` (e.g. U+0041) " "and :dfn:`abstract characters` (e.g. \"LATIN CAPITAL LETTER A\"). While most " @@ -2215,7 +2217,7 @@ msgid "" "(COMBINING CEDILLA)." msgstr "" -#: ../../reference/expressions.rst:2009 +#: ../../reference/expressions.rst:2010 msgid "" "The comparison operators on strings compare at the level of Unicode code " "points. This may be counter-intuitive to humans. For example, ``\"\\u00C7\" " @@ -2223,13 +2225,13 @@ msgid "" "same abstract character \"LATIN CAPITAL LETTER C WITH CEDILLA\"." msgstr "" -#: ../../reference/expressions.rst:2014 +#: ../../reference/expressions.rst:2015 msgid "" "To compare strings at the level of abstract characters (that is, in a way " "intuitive to humans), use :func:`unicodedata.normalize`." msgstr "" -#: ../../reference/expressions.rst:2017 +#: ../../reference/expressions.rst:2018 msgid "" "Due to automatic garbage-collection, free lists, and the dynamic nature of " "descriptors, you may notice seemingly unusual behaviour in certain uses of " @@ -2237,32 +2239,31 @@ msgid "" "instance methods, or constants. Check their documentation for more info." msgstr "" -#: ../../reference/expressions.rst:2022 +#: ../../reference/expressions.rst:2023 msgid "" "The power operator ``**`` binds less tightly than an arithmetic or bitwise " "unary operator on its right, that is, ``2**-1`` is ``0.5``." msgstr "" -#: ../../reference/expressions.rst:2025 +#: ../../reference/expressions.rst:2026 msgid "" "The ``%`` operator is also used for string formatting; the same precedence " "applies." msgstr "" #: ../../reference/expressions.rst:8 ../../reference/expressions.rst:362 -#: ../../reference/expressions.rst:417 ../../reference/expressions.rst:1712 -#: ../../reference/expressions.rst:1800 ../../reference/expressions.rst:1826 -#: ../../reference/expressions.rst:1854 -#, fuzzy +#: ../../reference/expressions.rst:417 ../../reference/expressions.rst:1713 +#: ../../reference/expressions.rst:1801 ../../reference/expressions.rst:1827 +#: ../../reference/expressions.rst:1855 msgid "expression" -msgstr "``(expressions...)``," +msgstr "" #: ../../reference/expressions.rst:8 msgid "BNF" -msgstr "" +msgstr "BNF" -#: ../../reference/expressions.rst:28 ../../reference/expressions.rst:1213 -#: ../../reference/expressions.rst:1261 +#: ../../reference/expressions.rst:28 ../../reference/expressions.rst:1214 +#: ../../reference/expressions.rst:1262 msgid "arithmetic" msgstr "" @@ -2282,14 +2283,13 @@ msgstr "name(名稱)" msgid "identifier" msgstr "" -#: ../../reference/expressions.rst:74 ../../reference/expressions.rst:537 -#: ../../reference/expressions.rst:592 ../../reference/expressions.rst:714 -#: ../../reference/expressions.rst:766 ../../reference/expressions.rst:812 -#: ../../reference/expressions.rst:1250 ../../reference/expressions.rst:1296 -#: ../../reference/expressions.rst:1386 -#, fuzzy +#: ../../reference/expressions.rst:74 ../../reference/expressions.rst:538 +#: ../../reference/expressions.rst:593 ../../reference/expressions.rst:715 +#: ../../reference/expressions.rst:767 ../../reference/expressions.rst:813 +#: ../../reference/expressions.rst:1251 ../../reference/expressions.rst:1297 +#: ../../reference/expressions.rst:1387 msgid "exception" -msgstr "描述" +msgstr "" #: ../../reference/expressions.rst:74 msgid "NameError" @@ -2326,12 +2326,12 @@ msgstr "type(型別)" #: ../../reference/expressions.rst:117 ../../reference/expressions.rst:244 #: ../../reference/expressions.rst:270 ../../reference/expressions.rst:298 #: ../../reference/expressions.rst:341 ../../reference/expressions.rst:362 -#: ../../reference/expressions.rst:525 ../../reference/expressions.rst:704 -#: ../../reference/expressions.rst:812 ../../reference/expressions.rst:841 -#: ../../reference/expressions.rst:914 ../../reference/expressions.rst:958 -#: ../../reference/expressions.rst:1106 ../../reference/expressions.rst:1119 -#: ../../reference/expressions.rst:1133 ../../reference/expressions.rst:1140 -#: ../../reference/expressions.rst:1677 ../../reference/expressions.rst:1864 +#: ../../reference/expressions.rst:526 ../../reference/expressions.rst:705 +#: ../../reference/expressions.rst:813 ../../reference/expressions.rst:842 +#: ../../reference/expressions.rst:915 ../../reference/expressions.rst:959 +#: ../../reference/expressions.rst:1107 ../../reference/expressions.rst:1120 +#: ../../reference/expressions.rst:1134 ../../reference/expressions.rst:1141 +#: ../../reference/expressions.rst:1678 ../../reference/expressions.rst:1865 msgid "object" msgstr "object(物件)" @@ -2340,7 +2340,7 @@ msgid "parenthesized form" msgstr "" #: ../../reference/expressions.rst:133 ../../reference/expressions.rst:362 -#: ../../reference/expressions.rst:958 +#: ../../reference/expressions.rst:959 msgid "() (parentheses)" msgstr "() (圓括號)" @@ -2352,19 +2352,19 @@ msgstr "" msgid "empty" msgstr "" -#: ../../reference/expressions.rst:146 ../../reference/expressions.rst:841 -#: ../../reference/expressions.rst:914 ../../reference/expressions.rst:1864 +#: ../../reference/expressions.rst:146 ../../reference/expressions.rst:842 +#: ../../reference/expressions.rst:915 ../../reference/expressions.rst:1865 msgid "tuple" msgstr "" -#: ../../reference/expressions.rst:152 ../../reference/expressions.rst:1883 +#: ../../reference/expressions.rst:152 ../../reference/expressions.rst:1884 msgid "comma" msgstr "" #: ../../reference/expressions.rst:152 ../../reference/expressions.rst:244 #: ../../reference/expressions.rst:270 ../../reference/expressions.rst:298 -#: ../../reference/expressions.rst:908 ../../reference/expressions.rst:958 -#: ../../reference/expressions.rst:1854 +#: ../../reference/expressions.rst:909 ../../reference/expressions.rst:959 +#: ../../reference/expressions.rst:1855 msgid ", (comma)" msgstr ", (逗號)" @@ -2381,7 +2381,7 @@ msgstr "for" msgid "in comprehensions" msgstr "於 comprehensions(綜合運算)" -#: ../../reference/expressions.rst:177 ../../reference/expressions.rst:1800 +#: ../../reference/expressions.rst:177 ../../reference/expressions.rst:1801 msgid "if" msgstr "if" @@ -2389,13 +2389,13 @@ msgstr "if" msgid "async for" msgstr "async for" -#: ../../reference/expressions.rst:212 ../../reference/expressions.rst:1158 +#: ../../reference/expressions.rst:212 ../../reference/expressions.rst:1159 msgid "await" msgstr "await" -#: ../../reference/expressions.rst:244 ../../reference/expressions.rst:812 -#: ../../reference/expressions.rst:841 ../../reference/expressions.rst:914 -#: ../../reference/expressions.rst:1854 +#: ../../reference/expressions.rst:244 ../../reference/expressions.rst:813 +#: ../../reference/expressions.rst:842 ../../reference/expressions.rst:915 +#: ../../reference/expressions.rst:1855 msgid "list" msgstr "list(串列)" @@ -2404,7 +2404,7 @@ msgstr "list(串列)" msgid "display" msgstr "" -#: ../../reference/expressions.rst:244 ../../reference/expressions.rst:837 +#: ../../reference/expressions.rst:244 ../../reference/expressions.rst:838 msgid "[] (square brackets)" msgstr "[] (方括號)" @@ -2413,7 +2413,7 @@ msgid "list expression" msgstr "list expression(串列運算式)" #: ../../reference/expressions.rst:244 ../../reference/expressions.rst:270 -#: ../../reference/expressions.rst:1854 +#: ../../reference/expressions.rst:1855 msgid "expression list" msgstr "expression list(運算式串列)" @@ -2430,7 +2430,7 @@ msgid "set expression" msgstr "set expression(集合運算式)" #: ../../reference/expressions.rst:298 ../../reference/expressions.rst:324 -#: ../../reference/expressions.rst:841 +#: ../../reference/expressions.rst:842 msgid "dictionary" msgstr "dictionary(字典)" @@ -2450,8 +2450,8 @@ msgstr "key/value pair(鍵/值對)" msgid "dictionary expression" msgstr "dictionary expression(字典運算式)" -#: ../../reference/expressions.rst:298 ../../reference/expressions.rst:908 -#: ../../reference/expressions.rst:1826 +#: ../../reference/expressions.rst:298 ../../reference/expressions.rst:909 +#: ../../reference/expressions.rst:1827 msgid ": (colon)" msgstr ": (冒號)" @@ -2463,13 +2463,13 @@ msgstr "於字典運算式" msgid "in dictionary displays" msgstr "於字典顯示" -#: ../../reference/expressions.rst:324 ../../reference/expressions.rst:1041 -#: ../../reference/expressions.rst:1871 +#: ../../reference/expressions.rst:324 ../../reference/expressions.rst:1042 +#: ../../reference/expressions.rst:1872 msgid "unpacking" msgstr "unpacking(解包)" -#: ../../reference/expressions.rst:324 ../../reference/expressions.rst:1071 -#: ../../reference/expressions.rst:1178 +#: ../../reference/expressions.rst:324 ../../reference/expressions.rst:1072 +#: ../../reference/expressions.rst:1179 msgid "**" msgstr "**" @@ -2478,7 +2478,7 @@ msgid "hashable" msgstr "hashable(可雜湊)" #: ../../reference/expressions.rst:362 ../../reference/expressions.rst:417 -#: ../../reference/expressions.rst:525 +#: ../../reference/expressions.rst:526 msgid "generator" msgstr "generator(產生器)" @@ -2486,529 +2486,529 @@ msgstr "generator(產生器)" msgid "generator expression" msgstr "generator expression(產生器運算式)" -#: ../../reference/expressions.rst:417 ../../reference/expressions.rst:1158 +#: ../../reference/expressions.rst:417 ../../reference/expressions.rst:1159 msgid "keyword" msgstr "keyword(關鍵字)" -#: ../../reference/expressions.rst:417 ../../reference/expressions.rst:605 +#: ../../reference/expressions.rst:417 ../../reference/expressions.rst:606 msgid "yield" msgstr "yield" -#: ../../reference/expressions.rst:417 ../../reference/expressions.rst:484 +#: ../../reference/expressions.rst:417 ../../reference/expressions.rst:485 msgid "from" msgstr "from" -#: ../../reference/expressions.rst:417 ../../reference/expressions.rst:1106 -#: ../../reference/expressions.rst:1119 ../../reference/expressions.rst:1826 +#: ../../reference/expressions.rst:417 ../../reference/expressions.rst:1107 +#: ../../reference/expressions.rst:1120 ../../reference/expressions.rst:1827 msgid "function" msgstr "function (函式)" -#: ../../reference/expressions.rst:470 +#: ../../reference/expressions.rst:471 msgid "coroutine" msgstr "coroutine(協程)" -#: ../../reference/expressions.rst:484 +#: ../../reference/expressions.rst:485 msgid "yield from expression" msgstr "yield from expression(yield from 運算式)" -#: ../../reference/expressions.rst:537 +#: ../../reference/expressions.rst:538 msgid "StopIteration" msgstr "StopIteration" -#: ../../reference/expressions.rst:592 ../../reference/expressions.rst:766 +#: ../../reference/expressions.rst:593 ../../reference/expressions.rst:767 msgid "GeneratorExit" msgstr "GeneratorExit" -#: ../../reference/expressions.rst:605 +#: ../../reference/expressions.rst:606 msgid "examples" msgstr "範例" -#: ../../reference/expressions.rst:704 +#: ../../reference/expressions.rst:705 msgid "asynchronous-generator" msgstr "asynchronous-generator(非同步產生器)" -#: ../../reference/expressions.rst:714 +#: ../../reference/expressions.rst:715 msgid "StopAsyncIteration" msgstr "StopAsyncIteration" -#: ../../reference/expressions.rst:789 +#: ../../reference/expressions.rst:790 msgid "primary" msgstr "primary(主要)" -#: ../../reference/expressions.rst:803 +#: ../../reference/expressions.rst:804 msgid "attribute" msgstr "attribute(屬性)" -#: ../../reference/expressions.rst:803 +#: ../../reference/expressions.rst:804 msgid "reference" msgstr "reference(參照)" -#: ../../reference/expressions.rst:803 +#: ../../reference/expressions.rst:804 msgid ". (dot)" msgstr ". (點)" -#: ../../reference/expressions.rst:803 +#: ../../reference/expressions.rst:804 msgid "attribute reference" msgstr "attribute reference(屬性參照)" -#: ../../reference/expressions.rst:812 +#: ../../reference/expressions.rst:813 msgid "AttributeError" msgstr "AttributeError" -#: ../../reference/expressions.rst:812 +#: ../../reference/expressions.rst:813 msgid "module" msgstr "module(模組)" -#: ../../reference/expressions.rst:837 +#: ../../reference/expressions.rst:838 msgid "subscription" msgstr "subscription(下標)" -#: ../../reference/expressions.rst:841 ../../reference/expressions.rst:914 -#: ../../reference/expressions.rst:1677 +#: ../../reference/expressions.rst:842 ../../reference/expressions.rst:915 +#: ../../reference/expressions.rst:1678 msgid "sequence" msgstr "sequence(序列)" -#: ../../reference/expressions.rst:841 +#: ../../reference/expressions.rst:842 msgid "mapping" msgstr "mapping(對映)" -#: ../../reference/expressions.rst:841 ../../reference/expressions.rst:894 -#: ../../reference/expressions.rst:914 +#: ../../reference/expressions.rst:842 ../../reference/expressions.rst:895 +#: ../../reference/expressions.rst:915 msgid "string" msgstr "string(字串)" -#: ../../reference/expressions.rst:841 ../../reference/expressions.rst:894 +#: ../../reference/expressions.rst:842 ../../reference/expressions.rst:895 msgid "item" msgstr "item(項目)" -#: ../../reference/expressions.rst:894 +#: ../../reference/expressions.rst:895 msgid "character" msgstr "character(字元)" -#: ../../reference/expressions.rst:908 +#: ../../reference/expressions.rst:909 msgid "slicing" msgstr "slicing(切片)" -#: ../../reference/expressions.rst:908 +#: ../../reference/expressions.rst:909 msgid "slice" msgstr "slice(切片)" -#: ../../reference/expressions.rst:940 +#: ../../reference/expressions.rst:941 msgid "start (slice object attribute)" msgstr "start(切片物件屬性)" -#: ../../reference/expressions.rst:940 +#: ../../reference/expressions.rst:941 msgid "stop (slice object attribute)" msgstr "stop(切片物件屬性)" -#: ../../reference/expressions.rst:940 +#: ../../reference/expressions.rst:941 msgid "step (slice object attribute)" msgstr "step(切片物件屬性)" -#: ../../reference/expressions.rst:958 +#: ../../reference/expressions.rst:959 msgid "callable" msgstr "callable(可呼叫物件)" -#: ../../reference/expressions.rst:958 ../../reference/expressions.rst:1106 -#: ../../reference/expressions.rst:1119 ../../reference/expressions.rst:1133 -#: ../../reference/expressions.rst:1140 ../../reference/expressions.rst:1150 +#: ../../reference/expressions.rst:959 ../../reference/expressions.rst:1107 +#: ../../reference/expressions.rst:1120 ../../reference/expressions.rst:1134 +#: ../../reference/expressions.rst:1141 ../../reference/expressions.rst:1151 msgid "call" msgstr "call(呼叫)" -#: ../../reference/expressions.rst:958 +#: ../../reference/expressions.rst:959 msgid "argument" msgstr "argument(引數)" -#: ../../reference/expressions.rst:958 ../../reference/expressions.rst:991 +#: ../../reference/expressions.rst:959 ../../reference/expressions.rst:992 msgid "call semantics" msgstr "call semantics(呼叫語意)" -#: ../../reference/expressions.rst:958 +#: ../../reference/expressions.rst:959 msgid "argument list" msgstr "argument list(引數列表)" -#: ../../reference/expressions.rst:958 +#: ../../reference/expressions.rst:959 msgid "= (equals)" msgstr "= (等於)" -#: ../../reference/expressions.rst:958 ../../reference/expressions.rst:1041 -#: ../../reference/expressions.rst:1071 +#: ../../reference/expressions.rst:959 ../../reference/expressions.rst:1042 +#: ../../reference/expressions.rst:1072 msgid "in function calls" msgstr "於函式呼叫中" -#: ../../reference/expressions.rst:991 +#: ../../reference/expressions.rst:992 msgid "parameter" msgstr "parameter(參數)" -#: ../../reference/expressions.rst:1041 ../../reference/expressions.rst:1274 -#: ../../reference/expressions.rst:1871 +#: ../../reference/expressions.rst:1042 ../../reference/expressions.rst:1275 +#: ../../reference/expressions.rst:1872 msgid "* (asterisk)" msgstr "* (星號)" -#: ../../reference/expressions.rst:1106 +#: ../../reference/expressions.rst:1107 msgid "user-defined" msgstr "user-defined(使用者定義)" -#: ../../reference/expressions.rst:1106 +#: ../../reference/expressions.rst:1107 msgid "user-defined function" msgstr "user-defined function(使用者定義函式)" -#: ../../reference/expressions.rst:1119 +#: ../../reference/expressions.rst:1120 msgid "built-in function" msgstr "built-in function(內建函式)" -#: ../../reference/expressions.rst:1119 +#: ../../reference/expressions.rst:1120 msgid "method" msgstr "method(方法)" -#: ../../reference/expressions.rst:1119 +#: ../../reference/expressions.rst:1120 msgid "built-in method" msgstr "built-in method(內建方法)" -#: ../../reference/expressions.rst:1133 +#: ../../reference/expressions.rst:1134 msgid "class" msgstr "class(類別)" -#: ../../reference/expressions.rst:1133 +#: ../../reference/expressions.rst:1134 msgid "class object" msgstr "class object(類別物件)" -#: ../../reference/expressions.rst:1140 +#: ../../reference/expressions.rst:1141 msgid "class instance" msgstr "class instance(類別實例)" -#: ../../reference/expressions.rst:1140 ../../reference/expressions.rst:1150 +#: ../../reference/expressions.rst:1141 ../../reference/expressions.rst:1151 msgid "instance" msgstr "instance(實例)" -#: ../../reference/expressions.rst:1150 +#: ../../reference/expressions.rst:1151 msgid "__call__() (object method)" msgstr "__call__() (物件方法)" -#: ../../reference/expressions.rst:1178 +#: ../../reference/expressions.rst:1179 msgid "power" msgstr "power(次方)" -#: ../../reference/expressions.rst:1178 ../../reference/expressions.rst:1213 -#: ../../reference/expressions.rst:1261 ../../reference/expressions.rst:1370 -#: ../../reference/expressions.rst:1397 ../../reference/expressions.rst:1712 +#: ../../reference/expressions.rst:1179 ../../reference/expressions.rst:1214 +#: ../../reference/expressions.rst:1262 ../../reference/expressions.rst:1371 +#: ../../reference/expressions.rst:1398 ../../reference/expressions.rst:1713 msgid "operation" msgstr "operation(操作)" -#: ../../reference/expressions.rst:1178 ../../reference/expressions.rst:1222 -#: ../../reference/expressions.rst:1231 ../../reference/expressions.rst:1239 -#: ../../reference/expressions.rst:1274 ../../reference/expressions.rst:1287 -#: ../../reference/expressions.rst:1296 ../../reference/expressions.rst:1312 -#: ../../reference/expressions.rst:1341 ../../reference/expressions.rst:1354 -#: ../../reference/expressions.rst:1370 ../../reference/expressions.rst:1406 -#: ../../reference/expressions.rst:1414 ../../reference/expressions.rst:1423 -#: ../../reference/expressions.rst:1438 ../../reference/expressions.rst:1677 -#: ../../reference/expressions.rst:1686 ../../reference/expressions.rst:1728 -#: ../../reference/expressions.rst:1733 ../../reference/expressions.rst:1738 -#: ../../reference/expressions.rst:1800 ../../reference/expressions.rst:1918 +#: ../../reference/expressions.rst:1179 ../../reference/expressions.rst:1223 +#: ../../reference/expressions.rst:1232 ../../reference/expressions.rst:1240 +#: ../../reference/expressions.rst:1275 ../../reference/expressions.rst:1288 +#: ../../reference/expressions.rst:1297 ../../reference/expressions.rst:1313 +#: ../../reference/expressions.rst:1342 ../../reference/expressions.rst:1355 +#: ../../reference/expressions.rst:1371 ../../reference/expressions.rst:1407 +#: ../../reference/expressions.rst:1415 ../../reference/expressions.rst:1424 +#: ../../reference/expressions.rst:1439 ../../reference/expressions.rst:1678 +#: ../../reference/expressions.rst:1687 ../../reference/expressions.rst:1729 +#: ../../reference/expressions.rst:1734 ../../reference/expressions.rst:1739 +#: ../../reference/expressions.rst:1801 ../../reference/expressions.rst:1919 msgid "operator" msgstr "operator(運算子)" -#: ../../reference/expressions.rst:1213 +#: ../../reference/expressions.rst:1214 msgid "unary" msgstr "unary(一元)" -#: ../../reference/expressions.rst:1213 ../../reference/expressions.rst:1397 -#: ../../reference/expressions.rst:1406 ../../reference/expressions.rst:1414 -#: ../../reference/expressions.rst:1423 +#: ../../reference/expressions.rst:1214 ../../reference/expressions.rst:1398 +#: ../../reference/expressions.rst:1407 ../../reference/expressions.rst:1415 +#: ../../reference/expressions.rst:1424 msgid "bitwise" msgstr "bitwise(位元)" -#: ../../reference/expressions.rst:1222 +#: ../../reference/expressions.rst:1223 msgid "negation" msgstr "negation(否定)" -#: ../../reference/expressions.rst:1222 +#: ../../reference/expressions.rst:1223 msgid "minus" msgstr "minus(減)" -#: ../../reference/expressions.rst:1222 ../../reference/expressions.rst:1354 +#: ../../reference/expressions.rst:1223 ../../reference/expressions.rst:1355 msgid "- (minus)" msgstr "- (減號)" -#: ../../reference/expressions.rst:1222 ../../reference/expressions.rst:1231 +#: ../../reference/expressions.rst:1223 ../../reference/expressions.rst:1232 msgid "unary operator" msgstr "unary operator(一元運算子)" -#: ../../reference/expressions.rst:1231 +#: ../../reference/expressions.rst:1232 msgid "plus" msgstr "plus(加)" -#: ../../reference/expressions.rst:1231 ../../reference/expressions.rst:1341 +#: ../../reference/expressions.rst:1232 ../../reference/expressions.rst:1342 msgid "+ (plus)" msgstr "+ (加號)" -#: ../../reference/expressions.rst:1239 +#: ../../reference/expressions.rst:1240 msgid "inversion" msgstr "inversion(反轉)" -#: ../../reference/expressions.rst:1239 +#: ../../reference/expressions.rst:1240 msgid "~ (tilde)" msgstr "~ (波浪號)" -#: ../../reference/expressions.rst:1250 +#: ../../reference/expressions.rst:1251 msgid "TypeError" msgstr "TypeError" -#: ../../reference/expressions.rst:1261 ../../reference/expressions.rst:1397 +#: ../../reference/expressions.rst:1262 ../../reference/expressions.rst:1398 msgid "binary" msgstr "binary(二進位)" -#: ../../reference/expressions.rst:1274 +#: ../../reference/expressions.rst:1275 msgid "multiplication" msgstr "multiplication(乘)" -#: ../../reference/expressions.rst:1287 +#: ../../reference/expressions.rst:1288 msgid "matrix multiplication" msgstr "matrix multiplication(矩陣乘法)" -#: ../../reference/expressions.rst:1287 +#: ../../reference/expressions.rst:1288 msgid "@ (at)" msgstr "@ (在)" -#: ../../reference/expressions.rst:1296 +#: ../../reference/expressions.rst:1297 msgid "ZeroDivisionError" msgstr "ZeroDivisionError" -#: ../../reference/expressions.rst:1296 +#: ../../reference/expressions.rst:1297 msgid "division" msgstr "division(除)" -#: ../../reference/expressions.rst:1296 +#: ../../reference/expressions.rst:1297 msgid "/ (slash)" msgstr "/ (斜線)" -#: ../../reference/expressions.rst:1296 +#: ../../reference/expressions.rst:1297 msgid "//" msgstr "//" -#: ../../reference/expressions.rst:1312 +#: ../../reference/expressions.rst:1313 msgid "modulo" msgstr "modulo(餘數)" -#: ../../reference/expressions.rst:1312 +#: ../../reference/expressions.rst:1313 msgid "% (percent)" msgstr "% (百分號)" -#: ../../reference/expressions.rst:1341 +#: ../../reference/expressions.rst:1342 msgid "addition" msgstr "addition(加)" -#: ../../reference/expressions.rst:1341 ../../reference/expressions.rst:1354 +#: ../../reference/expressions.rst:1342 ../../reference/expressions.rst:1355 msgid "binary operator" msgstr "binary operator(二元運算子)" -#: ../../reference/expressions.rst:1354 +#: ../../reference/expressions.rst:1355 msgid "subtraction" msgstr "subtraction(減)" -#: ../../reference/expressions.rst:1370 +#: ../../reference/expressions.rst:1371 msgid "shifting" msgstr "shifting(移動)" -#: ../../reference/expressions.rst:1370 +#: ../../reference/expressions.rst:1371 msgid "<<" msgstr "<<" -#: ../../reference/expressions.rst:1370 +#: ../../reference/expressions.rst:1371 msgid ">>" msgstr ">>" -#: ../../reference/expressions.rst:1386 +#: ../../reference/expressions.rst:1387 msgid "ValueError" msgstr "ValueError" -#: ../../reference/expressions.rst:1406 ../../reference/expressions.rst:1733 +#: ../../reference/expressions.rst:1407 ../../reference/expressions.rst:1734 msgid "and" msgstr "and" -#: ../../reference/expressions.rst:1406 +#: ../../reference/expressions.rst:1407 msgid "& (ampersand)" msgstr "& (和號)" -#: ../../reference/expressions.rst:1414 +#: ../../reference/expressions.rst:1415 msgid "xor" msgstr "xor" -#: ../../reference/expressions.rst:1414 +#: ../../reference/expressions.rst:1415 msgid "exclusive" msgstr "exclusive(排外)" -#: ../../reference/expressions.rst:1414 ../../reference/expressions.rst:1423 -#: ../../reference/expressions.rst:1738 +#: ../../reference/expressions.rst:1415 ../../reference/expressions.rst:1424 +#: ../../reference/expressions.rst:1739 msgid "or" msgstr "or" -#: ../../reference/expressions.rst:1414 +#: ../../reference/expressions.rst:1415 msgid "^ (caret)" msgstr "^ (插入符號)" -#: ../../reference/expressions.rst:1423 +#: ../../reference/expressions.rst:1424 msgid "inclusive" msgstr "inclusive(包含)" -#: ../../reference/expressions.rst:1423 +#: ../../reference/expressions.rst:1424 msgid "| (vertical bar)" msgstr "| (垂直線)" -#: ../../reference/expressions.rst:1438 +#: ../../reference/expressions.rst:1439 msgid "comparison" msgstr "comparison(比較)" -#: ../../reference/expressions.rst:1438 +#: ../../reference/expressions.rst:1439 msgid "C" msgstr "C" -#: ../../reference/expressions.rst:1438 +#: ../../reference/expressions.rst:1439 msgid "language" msgstr "language(語言)" -#: ../../reference/expressions.rst:1438 +#: ../../reference/expressions.rst:1439 msgid "< (less)" msgstr "< (小於)" -#: ../../reference/expressions.rst:1438 +#: ../../reference/expressions.rst:1439 msgid "> (greater)" msgstr "> (大於)" -#: ../../reference/expressions.rst:1438 +#: ../../reference/expressions.rst:1439 msgid "<=" msgstr "<=" -#: ../../reference/expressions.rst:1438 +#: ../../reference/expressions.rst:1439 msgid ">=" msgstr ">=" -#: ../../reference/expressions.rst:1438 +#: ../../reference/expressions.rst:1439 msgid "==" msgstr "==" -#: ../../reference/expressions.rst:1438 +#: ../../reference/expressions.rst:1439 msgid "!=" msgstr "!=" -#: ../../reference/expressions.rst:1462 +#: ../../reference/expressions.rst:1463 msgid "chaining" msgstr "chaining(鏈接)" -#: ../../reference/expressions.rst:1462 +#: ../../reference/expressions.rst:1463 msgid "comparisons" msgstr "comparisons(比較)" -#: ../../reference/expressions.rst:1677 +#: ../../reference/expressions.rst:1678 msgid "in" msgstr "in" -#: ../../reference/expressions.rst:1677 +#: ../../reference/expressions.rst:1678 msgid "not in" msgstr "not in" -#: ../../reference/expressions.rst:1677 +#: ../../reference/expressions.rst:1678 msgid "membership" msgstr "membership(成員)" -#: ../../reference/expressions.rst:1677 ../../reference/expressions.rst:1686 +#: ../../reference/expressions.rst:1678 ../../reference/expressions.rst:1687 msgid "test" msgstr "test(測試)" -#: ../../reference/expressions.rst:1686 +#: ../../reference/expressions.rst:1687 msgid "is" msgstr "is" -#: ../../reference/expressions.rst:1686 +#: ../../reference/expressions.rst:1687 msgid "is not" msgstr "is not" -#: ../../reference/expressions.rst:1686 +#: ../../reference/expressions.rst:1687 msgid "identity" msgstr "identity" -#: ../../reference/expressions.rst:1712 +#: ../../reference/expressions.rst:1713 msgid "Conditional" msgstr "Conditional(條件式)" -#: ../../reference/expressions.rst:1712 +#: ../../reference/expressions.rst:1713 msgid "Boolean" msgstr "Boolean(布林)" -#: ../../reference/expressions.rst:1728 +#: ../../reference/expressions.rst:1729 msgid "not" msgstr "not" -#: ../../reference/expressions.rst:1752 +#: ../../reference/expressions.rst:1753 msgid ":= (colon equals)" msgstr ":= (冒號等於)" -#: ../../reference/expressions.rst:1752 +#: ../../reference/expressions.rst:1753 msgid "assignment expression" msgstr "assignment expression(賦值運算式)" -#: ../../reference/expressions.rst:1752 +#: ../../reference/expressions.rst:1753 msgid "walrus operator" msgstr "walrus operator(海象運算子)" -#: ../../reference/expressions.rst:1752 +#: ../../reference/expressions.rst:1753 msgid "named expression" msgstr "named expression(附名運算式)" -#: ../../reference/expressions.rst:1800 +#: ../../reference/expressions.rst:1801 msgid "conditional" msgstr "conditional(條件式)" -#: ../../reference/expressions.rst:1800 +#: ../../reference/expressions.rst:1801 msgid "ternary" msgstr "ternary(三元)" -#: ../../reference/expressions.rst:1800 +#: ../../reference/expressions.rst:1801 msgid "conditional expression" msgstr "conditional expression(條件運算式)" -#: ../../reference/expressions.rst:1800 +#: ../../reference/expressions.rst:1801 msgid "else" msgstr "else" -#: ../../reference/expressions.rst:1826 +#: ../../reference/expressions.rst:1827 msgid "lambda" msgstr "lambda" -#: ../../reference/expressions.rst:1826 +#: ../../reference/expressions.rst:1827 msgid "form" msgstr "form" -#: ../../reference/expressions.rst:1826 +#: ../../reference/expressions.rst:1827 msgid "anonymous" msgstr "anonymous(匿名)" -#: ../../reference/expressions.rst:1826 +#: ../../reference/expressions.rst:1827 msgid "lambda expression" msgstr "lambda expression(lambda 運算式)" -#: ../../reference/expressions.rst:1871 +#: ../../reference/expressions.rst:1872 msgid "iterable" msgstr "iterable(可疊代)" -#: ../../reference/expressions.rst:1871 +#: ../../reference/expressions.rst:1872 msgid "in expression lists" msgstr "於 expression list(運算式串列)" -#: ../../reference/expressions.rst:1883 +#: ../../reference/expressions.rst:1884 msgid "trailing" msgstr "trailing" -#: ../../reference/expressions.rst:1897 +#: ../../reference/expressions.rst:1898 msgid "evaluation" msgstr "evaluation" -#: ../../reference/expressions.rst:1897 +#: ../../reference/expressions.rst:1898 msgid "order" msgstr "order(順序)" -#: ../../reference/expressions.rst:1918 +#: ../../reference/expressions.rst:1919 msgid "precedence" msgstr "precedence(優先順序)" diff --git a/sphinx.po b/sphinx.po index 7bde7bfab9..91bc236984 100644 --- a/sphinx.po +++ b/sphinx.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-11 00:03+0000\n" +"POT-Creation-Date: 2024-01-03 20:44+0000\n" "PO-Revision-Date: 2023-03-15 10:19+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -46,8 +46,8 @@ msgid "Deprecated since version {deprecated}, removed in version {removed}" msgstr "自從版本 {deprecated} 後不推薦使用,已從版本 {removed} 中移除。" #: ../../tools/templates/dummy.html:12 -msgid " Part of the " -msgstr " 為 " +msgid "Part of the" +msgstr "為" #: ../../tools/templates/dummy.html:13 msgid "Limited API" @@ -58,23 +58,23 @@ msgid "Stable ABI" msgstr "穩定 ABI 的一部分" #: ../../tools/templates/dummy.html:15 -msgid " (as an opaque struct)" +msgid "(as an opaque struct)" msgstr "(做為一個不透明結構 (opaque struct))" #: ../../tools/templates/dummy.html:16 -msgid " (including all members)" +msgid "(including all members)" msgstr "(包含所有成員)" #: ../../tools/templates/dummy.html:17 -msgid " since version %s" -msgstr " 自 %s 版本開始" +msgid "since version %s" +msgstr "自 %s 版本開始" #: ../../tools/templates/dummy.html:18 -msgid " (Only some members are part of the stable ABI.)" +msgid "(Only some members are part of the stable ABI.)" msgstr "(只有部分成員是穩定 ABI 的一部分。)" #: ../../tools/templates/dummy.html:19 -msgid "This is " +msgid "This is" msgstr "這是" #: ../../tools/templates/dummy.html:20 diff --git a/tutorial/appendix.po b/tutorial/appendix.po index 3ac06d2f35..bc621fd8a9 100644 --- a/tutorial/appendix.po +++ b/tutorial/appendix.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-09-03 00:03+0000\n" +"POT-Creation-Date: 2024-01-13 00:03+0000\n" "PO-Revision-Date: 2021-07-05 14:35+0800\n" "Last-Translator: meowmeowcat \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -39,17 +39,17 @@ msgid "" "input came from a file, it exits with a nonzero exit status after printing " "the stack trace. (Exceptions handled by an :keyword:`except` clause in a :" "keyword:`try` statement are not errors in this context.) Some errors are " -"unconditionally fatal and cause an exit with a nonzero exit; this applies to " -"internal inconsistencies and some cases of running out of memory. All error " -"messages are written to the standard error stream; normal output from " -"executed commands is written to standard output." +"unconditionally fatal and cause an exit with a nonzero exit status; this " +"applies to internal inconsistencies and some cases of running out of " +"memory. All error messages are written to the standard error stream; normal " +"output from executed commands is written to standard output." msgstr "" "當一個錯誤發生時,直譯器會印出一個錯誤訊息和堆疊回溯。在互動模式下,它將返回" -"主提示字元;當輸入來自檔案時,它在印出堆疊回溯後以非零退出狀態退出。 (由 :" -"keyword:`except` 子句在 :keyword:`try` 陳述式中處理的例外在這種情況下不是錯" -"誤。) 有些錯誤是無條件嚴重的,會導致非零退出;這適用於內部不一致和一些記憶體" -"耗盡的情況。所有的錯誤訊息都被寫入標準錯誤輸出;被執行指令的正常輸出被寫入標" -"準輸出。" +"主提示字元;當輸入來自檔案時,它在印出堆疊回溯後以非零退出狀態 (nonzero exit " +"status) 退出。 (由 :keyword:`except` 子句在 :keyword:`try` 陳述式中處理的例外" +"在這種情況下不是錯誤。) 有些錯誤是無條件嚴重的,會導致非零退出狀態;這適用於" +"內部不一致和一些記憶體耗盡的情況。所有的錯誤訊息都被寫入標準錯誤輸出;被執行" +"指令的正常輸出被寫入標準輸出。" #: ../../tutorial/appendix.rst:28 msgid "" diff --git a/tutorial/classes.po b/tutorial/classes.po index 348127e3fa..aec0f3f79e 100644 --- a/tutorial/classes.po +++ b/tutorial/classes.po @@ -1,5 +1,4 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: @@ -9,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-08 16:59+0000\n" +"POT-Creation-Date: 2024-01-17 00:03+0000\n" "PO-Revision-Date: 2022-12-26 23:12+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -656,28 +655,24 @@ msgstr "" #: ../../tutorial/classes.rst:389 msgid "" -"If you still don't understand how methods work, a look at the implementation " -"can perhaps clarify matters. When a non-data attribute of an instance is " -"referenced, the instance's class is searched. If the name denotes a valid " -"class attribute that is a function object, a method object is created by " -"packing (pointers to) the instance object and the function object just found " -"together in an abstract object: this is the method object. When the method " -"object is called with an argument list, a new argument list is constructed " -"from the instance object and the argument list, and the function object is " -"called with this new argument list." -msgstr "" -"如果你仍然不了解 method 怎麼運作,看一眼實作可能會清楚一些事。當一個實例的非" -"資料屬性被參照時,該實例的 class 會被搜尋。如果該名稱是一個有效的 class 屬" -"性,而且是一個函式物件,則一個 method 物件會被建立,建立的方法是藉由打包(指" -"向)該實例物件及剛被找到的函式物件,形成一個抽象的物件:這就是 method 物件。" -"當 method 物件帶著一個引數列表被呼叫,則一個新的引數列表會從實例物件和該引數" -"列表被建構,而該函式物件會以這個新的引數列表被呼叫。" - -#: ../../tutorial/classes.rst:403 +"In general, methods work as follows. When a non-data attribute of an " +"instance is referenced, the instance's class is searched. If the name " +"denotes a valid class attribute that is a function object, references to " +"both the instance object and the function object are packed into a method " +"object. When the method object is called with an argument list, a new " +"argument list is constructed from the instance object and the argument list, " +"and the function object is called with this new argument list." +msgstr "" +"一般來說,方法的工作原理如下。當一個實例的非資料屬性被參照時,將會搜尋該實例" +"的 class。如果該名稱是一個有效的 class 屬性,而且是一個函式物件,則對實例物件" +"和函式物件的參照都會被打包到方法物件中。當使用引數串列呼叫方法物件時,會根據" +"實例物件和引數串列來建構一個新的引數串列,並使用該新引數串列來呼叫函式物件。" + +#: ../../tutorial/classes.rst:402 msgid "Class and Instance Variables" msgstr "Class 及實例變數" -#: ../../tutorial/classes.rst:405 +#: ../../tutorial/classes.rst:404 msgid "" "Generally speaking, instance variables are for data unique to each instance " "and class variables are for attributes and methods shared by all instances " @@ -688,7 +683,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/classes.rst:427 +#: ../../tutorial/classes.rst:426 msgid "" "As discussed in :ref:`tut-object`, shared data can have possibly surprising " "effects with involving :term:`mutable` objects such as lists and " @@ -703,18 +698,18 @@ msgstr "" "\n" "::" -#: ../../tutorial/classes.rst:450 +#: ../../tutorial/classes.rst:449 msgid "Correct design of the class should use an instance variable instead::" msgstr "" "正確的 class 設計應該使用實例變數:\n" "\n" "::" -#: ../../tutorial/classes.rst:474 +#: ../../tutorial/classes.rst:473 msgid "Random Remarks" msgstr "隨意的備註" -#: ../../tutorial/classes.rst:478 +#: ../../tutorial/classes.rst:477 msgid "" "If the same attribute name occurs in both an instance and in a class, then " "attribute lookup prioritizes the instance::" @@ -723,7 +718,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/classes.rst:493 +#: ../../tutorial/classes.rst:492 msgid "" "Data attributes may be referenced by methods as well as by ordinary users " "(\"clients\") of an object. In other words, classes are not usable to " @@ -739,7 +734,7 @@ msgstr "" "全隱藏實作細節並且在必要時控制物件的存取;這可以被以 C 編寫的 Python 擴充所使" "用。)" -#: ../../tutorial/classes.rst:501 +#: ../../tutorial/classes.rst:500 msgid "" "Clients should use data attributes with care --- clients may mess up " "invariants maintained by the methods by stamping on their data attributes. " @@ -752,7 +747,7 @@ msgstr "" "響 method 的有效性,只要避免名稱衝突即可——再一次提醒,命名慣例可以在這裡節省" "很多麻煩。" -#: ../../tutorial/classes.rst:507 +#: ../../tutorial/classes.rst:506 msgid "" "There is no shorthand for referencing data attributes (or other methods!) " "from within methods. I find that this actually increases the readability of " @@ -762,7 +757,7 @@ msgstr "" "在 method 中參照資料屬性(或其他 method!)是沒有簡寫的。我發現這實際上增加" "了 method 的可閱讀性:在瀏覽 method 時,絕不會混淆區域變數和實例變數。" -#: ../../tutorial/classes.rst:512 +#: ../../tutorial/classes.rst:511 msgid "" "Often, the first argument of a method is called ``self``. This is nothing " "more than a convention: the name ``self`` has absolutely no special meaning " @@ -776,7 +771,7 @@ msgstr "" "他 Python 程式設計師來說可讀性較低,此外,也可以想像一個可能因信任此慣例而編" "寫的 *class 瀏覽器 (browser)* 程式。" -#: ../../tutorial/classes.rst:518 +#: ../../tutorial/classes.rst:517 msgid "" "Any function object that is a class attribute defines a method for instances " "of that class. It is not necessary that the function definition is " @@ -789,7 +784,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/classes.rst:535 +#: ../../tutorial/classes.rst:534 msgid "" "Now ``f``, ``g`` and ``h`` are all attributes of class :class:`!C` that " "refer to function objects, and consequently they are all methods of " @@ -800,7 +795,7 @@ msgstr "" "以他們都是class :class:`!C` 實例的 method —— ``h`` 與 ``g`` 是完全一樣的。請" "注意,這種做法通常只會使該程式的讀者感到困惑。" -#: ../../tutorial/classes.rst:540 +#: ../../tutorial/classes.rst:539 msgid "" "Methods may call other methods by using method attributes of the ``self`` " "argument::" @@ -809,7 +804,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/classes.rst:554 +#: ../../tutorial/classes.rst:553 msgid "" "Methods may reference global names in the same way as ordinary functions. " "The global scope associated with a method is the module containing its " @@ -828,7 +823,7 @@ msgstr "" "class 所使用。通常,包含 method 的 class,它本身就是被定義在這個全域作用域," "在下一節,我們將看到 method 想要參照自己的 class 的一些好原因。" -#: ../../tutorial/classes.rst:564 +#: ../../tutorial/classes.rst:563 msgid "" "Each value is an object, and therefore has a *class* (also called its " "*type*). It is stored as ``object.__class__``." @@ -836,11 +831,11 @@ msgstr "" "每個值都是一個物件,因此都具有一個 *class*,也可以稱為它的 *type(型別)*。它" "以 ``object.__class__`` 被儲存。" -#: ../../tutorial/classes.rst:571 +#: ../../tutorial/classes.rst:570 msgid "Inheritance" msgstr "繼承 (Inheritance)" -#: ../../tutorial/classes.rst:573 +#: ../../tutorial/classes.rst:572 msgid "" "Of course, a language feature would not be worthy of the name \"class\" " "without supporting inheritance. The syntax for a derived class definition " @@ -851,7 +846,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/classes.rst:584 +#: ../../tutorial/classes.rst:583 msgid "" "The name :class:`!BaseClassName` must be defined in a namespace accessible " "from the scope containing the derived class definition. In place of a base " @@ -865,7 +860,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/classes.rst:592 +#: ../../tutorial/classes.rst:591 msgid "" "Execution of a derived class definition proceeds the same as for a base " "class. When the class object is constructed, the base class is remembered. " @@ -879,7 +874,7 @@ msgstr "" "class 中找到,則會繼續在 base class 中搜尋。假如該 base class 本身也是衍生自" "其他 class,則這個規則會遞迴地被應用。" -#: ../../tutorial/classes.rst:598 +#: ../../tutorial/classes.rst:597 msgid "" "There's nothing special about instantiation of derived classes: " "``DerivedClassName()`` creates a new instance of the class. Method " @@ -892,7 +887,7 @@ msgstr "" "需要,沿著 base class 的繼承鍊往下走,如果這產生了一個函式物件,則該 method " "的參照是有效的。" -#: ../../tutorial/classes.rst:604 +#: ../../tutorial/classes.rst:603 msgid "" "Derived classes may override methods of their base classes. Because methods " "have no special privileges when calling other methods of the same object, a " @@ -906,7 +901,7 @@ msgstr "" "class 中的 method。(給 C++ 程式設計師:Python 中所有 method 實際上都是 " "``virtual``。)" -#: ../../tutorial/classes.rst:610 +#: ../../tutorial/classes.rst:609 msgid "" "An overriding method in a derived class may in fact want to extend rather " "than simply replace the base class method of the same name. There is a " @@ -921,11 +916,11 @@ msgstr "" "用。(請注意,只有在 base class 在全域作用域可以用 ``BaseClassName`` 被存取" "時,這方法才有效。)" -#: ../../tutorial/classes.rst:617 +#: ../../tutorial/classes.rst:616 msgid "Python has two built-in functions that work with inheritance:" msgstr "Python 有兩個內建函式可以用於繼承:" -#: ../../tutorial/classes.rst:619 +#: ../../tutorial/classes.rst:618 msgid "" "Use :func:`isinstance` to check an instance's type: ``isinstance(obj, int)`` " "will be ``True`` only if ``obj.__class__`` is :class:`int` or some class " @@ -935,7 +930,7 @@ msgstr "" "``obj.__class__`` 是 :class:`int` 或衍伸自 :class:`int` 時,結果才會是 " "``True``。" -#: ../../tutorial/classes.rst:623 +#: ../../tutorial/classes.rst:622 msgid "" "Use :func:`issubclass` to check class inheritance: ``issubclass(bool, int)`` " "is ``True`` since :class:`bool` is a subclass of :class:`int`. However, " @@ -947,11 +942,11 @@ msgstr "" "``issubclass(float, int)`` 是 ``False``,因為 :class:`float` 並不是 :class:" "`int` 的 subclass。" -#: ../../tutorial/classes.rst:633 +#: ../../tutorial/classes.rst:632 msgid "Multiple Inheritance" msgstr "多重繼承" -#: ../../tutorial/classes.rst:635 +#: ../../tutorial/classes.rst:634 msgid "" "Python supports a form of multiple inheritance as well. A class definition " "with multiple base classes looks like this::" @@ -961,7 +956,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/classes.rst:645 +#: ../../tutorial/classes.rst:644 msgid "" "For most purposes, in the simplest cases, you can think of the search for " "attributes inherited from a parent class as depth-first, left-to-right, not " @@ -977,7 +972,7 @@ msgstr "" "class:`!Base1` 搜尋它,接著(遞迴地)在 :class:`!Base1` 的 base class 中搜" "尋,假如在那裡又沒有找到的話,會在 :class:`!Base2` 搜尋,依此類推。" -#: ../../tutorial/classes.rst:652 +#: ../../tutorial/classes.rst:651 msgid "" "In fact, it is slightly more complex than that; the method resolution order " "changes dynamically to support cooperative calls to :func:`super`. This " @@ -989,7 +984,7 @@ msgstr "" "`super` 的合作呼叫。這個方式在其他的多重繼承語言中,稱為呼叫下一個方法 (call-" "next-method),且比在單一繼承語言中的 super call(超級呼叫)來得更強大。" -#: ../../tutorial/classes.rst:658 +#: ../../tutorial/classes.rst:657 msgid "" "Dynamic ordering is necessary because all cases of multiple inheritance " "exhibit one or more diamond relationships (where at least one of the parent " @@ -1015,11 +1010,11 @@ msgstr "" "充、具有多重繼承的 class 成為可能。更多資訊,請見 https://www.python.org/" "download/releases/2.3/mro/。" -#: ../../tutorial/classes.rst:675 +#: ../../tutorial/classes.rst:674 msgid "Private Variables" msgstr "私有變數" -#: ../../tutorial/classes.rst:677 +#: ../../tutorial/classes.rst:676 msgid "" "\"Private\" instance variables that cannot be accessed except from inside an " "object don't exist in Python. However, there is a convention that is " @@ -1034,7 +1029,7 @@ msgstr "" "(無論它是函式、方法或是資料成員)。這被視為一個實作細節,如有調整,亦不另行" "通知。" -#: ../../tutorial/classes.rst:687 +#: ../../tutorial/classes.rst:686 msgid "" "Since there is a valid use-case for class-private members (namely to avoid " "name clashes of names with names defined by subclasses), there is limited " @@ -1052,7 +1047,7 @@ msgstr "" "``classname`` 就是去掉前導下底線的當前 class 名稱。只要這個修飾是在 class 的" "定義之中發生,它就會在不考慮該物件名稱的語法位置的情況下完成。" -#: ../../tutorial/classes.rst:696 +#: ../../tutorial/classes.rst:695 msgid "" "Name mangling is helpful for letting subclasses override methods without " "breaking intraclass method calls. For example::" @@ -1062,7 +1057,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/classes.rst:718 +#: ../../tutorial/classes.rst:717 msgid "" "The above example would work even if ``MappingSubclass`` were to introduce a " "``__update`` identifier since it is replaced with ``_Mapping__update`` in " @@ -1073,7 +1068,7 @@ msgstr "" "作,因為在 ``Mapping`` class 中,它會被替換為 ``_Mapping__update``,而在 " "``MappingSubclass`` class 中,它會被替換為 ``_MappingSubclass__update``。" -#: ../../tutorial/classes.rst:723 +#: ../../tutorial/classes.rst:722 msgid "" "Note that the mangling rules are designed mostly to avoid accidents; it " "still is possible to access or modify a variable that is considered " @@ -1083,7 +1078,7 @@ msgstr "" "請注意,修飾規則是被設計來避免意外;它仍可能存取或修改一個被視為私有的變數。" "這在特殊情況下甚至可能很有用,例如在除錯器 (debugger)。" -#: ../../tutorial/classes.rst:727 +#: ../../tutorial/classes.rst:726 msgid "" "Notice that code passed to ``exec()`` or ``eval()`` does not consider the " "classname of the invoking class to be the current class; this is similar to " @@ -1097,11 +1092,11 @@ msgstr "" "組編譯後 (byte-compiled) 的程式碼。同樣的限制適用於 ``getattr()``," "``setattr()`` 和 ``delattr()``,以及直接參照 ``__dict__`` 時。" -#: ../../tutorial/classes.rst:738 +#: ../../tutorial/classes.rst:737 msgid "Odds and Ends" msgstr "補充說明" -#: ../../tutorial/classes.rst:740 +#: ../../tutorial/classes.rst:739 msgid "" "Sometimes it is useful to have a data type similar to the Pascal \"record\" " "or C \"struct\", bundling together a few named data items. The idiomatic " @@ -1113,7 +1108,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/classes.rst:760 +#: ../../tutorial/classes.rst:759 msgid "" "A piece of Python code that expects a particular abstract data type can " "often be passed a class that emulates the methods of that data type " @@ -1128,7 +1123,7 @@ msgstr "" "meth:`~io.TextIOBase.readline` method 的 class 作為替代方式,從字串緩衝區取得" "資料,並將其作為引數來傳遞。" -#: ../../tutorial/classes.rst:772 +#: ../../tutorial/classes.rst:771 msgid "" ":ref:`Instance method objects ` have attributes, too: :" "attr:`m.__self__ ` is the instance object with the method :" @@ -1140,11 +1135,11 @@ msgstr "" "__func__ ` 則是該 method 所對應的\\ :ref:`函式物件 `。" -#: ../../tutorial/classes.rst:782 +#: ../../tutorial/classes.rst:781 msgid "Iterators" msgstr "疊代器 (Iterator)" -#: ../../tutorial/classes.rst:784 +#: ../../tutorial/classes.rst:783 msgid "" "By now you have probably noticed that most container objects can be looped " "over using a :keyword:`for` statement::" @@ -1154,7 +1149,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/classes.rst:798 +#: ../../tutorial/classes.rst:797 msgid "" "This style of access is clear, concise, and convenient. The use of " "iterators pervades and unifies Python. Behind the scenes, the :keyword:" @@ -1176,7 +1171,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/classes.rst:823 +#: ../../tutorial/classes.rst:822 msgid "" "Having seen the mechanics behind the iterator protocol, it is easy to add " "iterator behavior to your classes. Define an :meth:`~container.__iter__` " @@ -1191,11 +1186,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/classes.rst:860 +#: ../../tutorial/classes.rst:859 msgid "Generators" msgstr "產生器 (Generator)" -#: ../../tutorial/classes.rst:862 +#: ../../tutorial/classes.rst:861 msgid "" ":term:`Generators ` are a simple and powerful tool for creating " "iterators. They are written like regular functions but use the :keyword:" @@ -1211,7 +1206,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/classes.rst:883 +#: ../../tutorial/classes.rst:882 msgid "" "Anything that can be done with generators can also be done with class-based " "iterators as described in the previous section. What makes generators so " @@ -1222,7 +1217,7 @@ msgstr "" "描述。而讓產生器的程式碼更為精簡的原因是,:meth:`~iterator.__iter__` 和 :" "meth:`~generator.__next__` method 會自動被建立。" -#: ../../tutorial/classes.rst:888 +#: ../../tutorial/classes.rst:887 msgid "" "Another key feature is that the local variables and execution state are " "automatically saved between calls. This made the function easier to write " @@ -1233,7 +1228,7 @@ msgstr "" "函式比使用 ``self.index`` 和 ``self.data`` 這種實例變數的方式更容易編寫且更為" "清晰。" -#: ../../tutorial/classes.rst:893 +#: ../../tutorial/classes.rst:892 msgid "" "In addition to automatic method creation and saving program state, when " "generators terminate, they automatically raise :exc:`StopIteration`. In " @@ -1243,11 +1238,11 @@ msgstr "" "除了會自動建立 method 和儲存程式狀態,當產生器終止時,它們還會自動引發 :exc:" "`StopIteration`。這些特性結合在一起,使建立疊代器能與編寫常規函式一樣容易。" -#: ../../tutorial/classes.rst:902 +#: ../../tutorial/classes.rst:901 msgid "Generator Expressions" msgstr "產生器運算式" -#: ../../tutorial/classes.rst:904 +#: ../../tutorial/classes.rst:903 msgid "" "Some simple generators can be coded succinctly as expressions using a syntax " "similar to list comprehensions but with parentheses instead of square " @@ -1262,18 +1257,18 @@ msgstr "" "產生器定義相比,程式碼較精簡但功能較少,也比等效的 list comprehension 更為節" "省記憶體。" -#: ../../tutorial/classes.rst:911 +#: ../../tutorial/classes.rst:910 msgid "Examples::" msgstr "" "例如:\n" "\n" "::" -#: ../../tutorial/classes.rst:932 +#: ../../tutorial/classes.rst:931 msgid "Footnotes" msgstr "註解" -#: ../../tutorial/classes.rst:933 +#: ../../tutorial/classes.rst:932 msgid "" "Except for one thing. Module objects have a secret read-only attribute " "called :attr:`~object.__dict__` which returns the dictionary used to " @@ -1295,10 +1290,10 @@ msgstr "object(物件)" msgid "method" msgstr "method(方法)" -#: ../../tutorial/classes.rst:684 +#: ../../tutorial/classes.rst:683 msgid "name" msgstr "name(名稱)" -#: ../../tutorial/classes.rst:684 +#: ../../tutorial/classes.rst:683 msgid "mangling" msgstr "mangling(修飾)" diff --git a/using/cmdline.po b/using/cmdline.po index 78aa28f582..c6e6dc4569 100644 --- a/using/cmdline.po +++ b/using/cmdline.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-13 00:03+0000\n" +"POT-Creation-Date: 2024-01-11 00:04+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -483,8 +483,8 @@ msgstr "" msgid "" "Hash randomization is intended to provide protection against a denial-of-" "service caused by carefully chosen inputs that exploit the worst case " -"performance of a dict construction, O(n\\ :sup:`2`) complexity. See http://" -"ocert.org/advisories/ocert-2011-003.html for details." +"performance of a dict construction, *O*\\ (*n*\\ :sup:`2`) complexity. See " +"http://ocert.org/advisories/ocert-2011-003.html for details." msgstr "" #: ../../using/cmdline.rst:375 diff --git a/whatsnew/2.0.po b/whatsnew/2.0.po index 33a04e993e..172201cdb1 100644 --- a/whatsnew/2.0.po +++ b/whatsnew/2.0.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-11-28 00:03+0000\n" +"POT-Creation-Date: 2024-01-10 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -183,7 +183,7 @@ msgid "" "style, and format. PEPs are kept in the Python CVS tree on SourceForge, " "though they're not part of the Python 2.0 distribution, and are also " "available in HTML form from https://peps.python.org/. As of September 2000, " -"there are 25 PEPS, ranging from :pep:`201`, \"Lockstep Iteration\", to PEP " +"there are 25 PEPs, ranging from :pep:`201`, \"Lockstep Iteration\", to PEP " "225, \"Elementwise/Objectwise Operators\"." msgstr "" @@ -1246,10 +1246,10 @@ msgstr "模組變更" msgid "" "Lots of improvements and bugfixes were made to Python's extensive standard " "library; some of the affected modules include :mod:`readline`, :mod:" -"`ConfigParser`, :mod:`cgi`, :mod:`calendar`, :mod:`posix`, :mod:`readline`, :" -"mod:`xmllib`, :mod:`aifc`, :mod:`chunk, wave`, :mod:`random`, :mod:`shelve`, " -"and :mod:`nntplib`. Consult the CVS logs for the exact patch-by-patch " -"details." +"`ConfigParser `, :mod:`cgi`, :mod:`calendar`, :mod:`posix`, :" +"mod:`readline`, :mod:`xmllib`, :mod:`aifc`, :mod:`chunk, wave`, :mod:" +"`random`, :mod:`shelve`, and :mod:`nntplib`. Consult the CVS logs for the " +"exact patch-by-patch details." msgstr "" #: ../../whatsnew/2.0.rst:1037 @@ -1344,9 +1344,9 @@ msgstr "" #: ../../whatsnew/2.0.rst:1098 msgid "" -":mod:`linuxaudiodev`: Support for the :file:`/dev/audio` device on Linux, a " -"twin to the existing :mod:`sunaudiodev` module. (Contributed by Peter Bosch, " -"with fixes by Jeremy Hylton.)" +":mod:`!linuxaudiodev`: Support for the :file:`/dev/audio` device on Linux, a " +"twin to the existing :mod:`!sunaudiodev` module. (Contributed by Peter " +"Bosch, with fixes by Jeremy Hylton.)" msgstr "" #: ../../whatsnew/2.0.rst:1102 @@ -1416,8 +1416,8 @@ msgstr "" #: ../../whatsnew/2.0.rst:1142 msgid "" -":mod:`imputil`: A module that provides a simpler way for writing customized " -"import hooks, in comparison to the existing :mod:`ihooks` module. " +":mod:`!imputil`: A module that provides a simpler way for writing customized " +"import hooks, in comparison to the existing :mod:`!ihooks` module. " "(Implemented by Greg Stein, with much discussion on python-dev along the " "way.)" msgstr "" diff --git a/whatsnew/2.2.po b/whatsnew/2.2.po index 2875c7f1d3..e395a440e9 100644 --- a/whatsnew/2.2.po +++ b/whatsnew/2.2.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-20 00:03+0000\n" +"POT-Creation-Date: 2024-01-06 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -200,9 +200,9 @@ msgstr "" #: ../../whatsnew/2.2.rst:146 msgid "" -"The now-obsolete :mod:`posixfile` module contained a class that emulated all " -"of a file object's methods and also added a :meth:`lock` method, but this " -"class couldn't be passed to internal functions that expected a built-in " +"The now-obsolete :mod:`!posixfile` module contained a class that emulated " +"all of a file object's methods and also added a :meth:`!lock` method, but " +"this class couldn't be passed to internal functions that expected a built-in " "file, something which is possible with our new :class:`LockableFile`." msgstr "" diff --git a/whatsnew/2.3.po b/whatsnew/2.3.po index 58d4441a39..9aa7bdcab9 100644 --- a/whatsnew/2.3.po +++ b/whatsnew/2.3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-15 00:03+0000\n" +"POT-Creation-Date: 2024-01-11 00:04+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1270,9 +1270,9 @@ msgstr "" msgid "" "Multiplication of large long integers is now much faster thanks to an " "implementation of Karatsuba multiplication, an algorithm that scales better " -"than the O(n\\*n) required for the grade-school multiplication algorithm. " -"(Original patch by Christopher A. Craig, and significantly reworked by Tim " -"Peters.)" +"than the *O*\\ (*n*\\ :sup:`2`) required for the grade-school multiplication " +"algorithm. (Original patch by Christopher A. Craig, and significantly " +"reworked by Tim Peters.)" msgstr "" #: ../../whatsnew/2.3.rst:1202 @@ -1429,8 +1429,9 @@ msgid "" "partially sorted order such that, for every index *k*, ``heap[k] <= " "heap[2*k+1]`` and ``heap[k] <= heap[2*k+2]``. This makes it quick to remove " "the smallest item, and inserting a new item while maintaining the heap " -"property is O(lg n). (See https://xlinux.nist.gov/dads//HTML/priorityque." -"html for more information about the priority queue data structure.)" +"property is *O*\\ (log *n*). (See https://xlinux.nist.gov/dads//HTML/" +"priorityque.html for more information about the priority queue data " +"structure.)" msgstr "" #: ../../whatsnew/2.3.rst:1314 diff --git a/whatsnew/2.4.po b/whatsnew/2.4.po index aef3635e47..a2ae062dd5 100644 --- a/whatsnew/2.4.po +++ b/whatsnew/2.4.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-13 13:14+0000\n" +"POT-Creation-Date: 2024-01-06 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -409,7 +409,7 @@ msgid "" "offering different features and different levels of complexity. ``os." "system(command)`` is easy to use, but slow (it runs a shell process which " "executes the command) and dangerous (you have to be careful about escaping " -"the shell's metacharacters). The :mod:`popen2` module offers classes that " +"the shell's metacharacters). The :mod:`!popen2` module offers classes that " "can capture standard output and standard error from the subprocess, but the " "naming is confusing. The :mod:`subprocess` module cleans this up, " "providing a unified interface that offers all the features you might need." @@ -417,9 +417,9 @@ msgstr "" #: ../../whatsnew/2.4.rst:395 msgid "" -"Instead of :mod:`popen2`'s collection of classes, :mod:`subprocess` contains " -"a single class called :class:`Popen` whose constructor supports a number of " -"different keyword arguments. ::" +"Instead of :mod:`!popen2`'s collection of classes, :mod:`subprocess` " +"contains a single class called :class:`subprocess.Popen` whose constructor " +"supports a number of different keyword arguments. ::" msgstr "" #: ../../whatsnew/2.4.rst:405 @@ -1129,7 +1129,7 @@ msgstr "" #: ../../whatsnew/2.4.rst:998 msgid "" -"The :mod:`asyncore` module's :func:`loop` function now has a *count* " +"The :mod:`!asyncore` module's :func:`!loop` function now has a *count* " "parameter that lets you perform a limited number of passes through the " "polling loop. The default is still to loop forever." msgstr "" @@ -1207,9 +1207,10 @@ msgstr "" #: ../../whatsnew/2.4.rst:1055 msgid "" -"The :mod:`ConfigParser` classes have been enhanced slightly. The :meth:" -"`read` method now returns a list of the files that were successfully parsed, " -"and the :meth:`set` method raises :exc:`TypeError` if passed a *value* " +"The :mod:`ConfigParser ` classes have been enhanced slightly. " +"The :meth:`~configparser.ConfigParser.read` method now returns a list of the " +"files that were successfully parsed, and the :meth:`~configparser." +"ConfigParser.set` method raises :exc:`TypeError` if passed a *value* " "argument that isn't a string. (Contributed by John Belmonte and David " "Goodger.)" msgstr "" @@ -1751,7 +1752,7 @@ msgstr "" #: ../../whatsnew/2.4.rst:1532 msgid "" -":func:`dircache.listdir` now passes exceptions to the caller instead of " +":func:`!dircache.listdir` now passes exceptions to the caller instead of " "returning empty lists." msgstr "" diff --git a/whatsnew/2.5.po b/whatsnew/2.5.po index ff036fd978..1682e4923f 100644 --- a/whatsnew/2.5.po +++ b/whatsnew/2.5.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-13 13:14+0000\n" +"POT-Creation-Date: 2024-01-06 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1986,7 +1986,7 @@ msgstr "ctypes 套件" msgid "" "The :mod:`ctypes` package, written by Thomas Heller, has been added to the " "standard library. :mod:`ctypes` lets you call arbitrary functions in " -"shared libraries or DLLs. Long-time users may remember the :mod:`dl` " +"shared libraries or DLLs. Long-time users may remember the :mod:`!dl` " "module, which provides functions for loading shared libraries and calling " "functions in them. The :mod:`ctypes` package is much fancier." msgstr "" @@ -2276,15 +2276,15 @@ msgstr "hashlib 套件" #: ../../whatsnew/2.5.rst:1879 msgid "" "A new :mod:`hashlib` module, written by Gregory P. Smith, has been added to " -"replace the :mod:`md5` and :mod:`sha` modules. :mod:`hashlib` adds support " -"for additional secure hashes (SHA-224, SHA-256, SHA-384, and SHA-512). When " -"available, the module uses OpenSSL for fast platform optimized " -"implementations of algorithms." +"replace the :mod:`!md5` and :mod:`!sha` modules. :mod:`hashlib` adds " +"support for additional secure hashes (SHA-224, SHA-256, SHA-384, and " +"SHA-512). When available, the module uses OpenSSL for fast platform " +"optimized implementations of algorithms." msgstr "" #: ../../whatsnew/2.5.rst:1885 msgid "" -"The old :mod:`md5` and :mod:`sha` modules still exist as wrappers around " +"The old :mod:`!md5` and :mod:`!sha` modules still exist as wrappers around " "hashlib to preserve backwards compatibility. The new module's interface is " "very close to that of the old modules, but not identical. The most " "significant difference is that the constructor functions for creating new " diff --git a/whatsnew/2.6.po b/whatsnew/2.6.po index 70e04585d0..f2a0af0177 100644 --- a/whatsnew/2.6.po +++ b/whatsnew/2.6.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-08 16:59+0000\n" +"POT-Creation-Date: 2024-01-10 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -26,17 +26,17 @@ msgstr "Python 2.6 有什麼新功能" msgid "Author" msgstr "作者" -#: ../../whatsnew/2.6.rst:9 +#: ../../whatsnew/2.6.rst:7 msgid "A.M. Kuchling (amk at amk.ca)" msgstr "A.M. Kuchling (amk at amk.ca)" -#: ../../whatsnew/2.6.rst:52 +#: ../../whatsnew/2.6.rst:50 msgid "" "This article explains the new features in Python 2.6, released on October 1, " "2008. The release schedule is described in :pep:`361`." msgstr "" -#: ../../whatsnew/2.6.rst:55 +#: ../../whatsnew/2.6.rst:53 msgid "" "The major theme of Python 2.6 is preparing the migration path to Python 3.0, " "a major redesign of the language. Whenever possible, Python 2.6 " @@ -47,14 +47,14 @@ msgid "" "`!-3` switch to warn about usages that will become unsupported in 3.0." msgstr "" -#: ../../whatsnew/2.6.rst:64 +#: ../../whatsnew/2.6.rst:62 msgid "" "Some significant new packages have been added to the standard library, such " "as the :mod:`multiprocessing` and :mod:`json` modules, but there aren't many " "new features that aren't related to Python 3.0 in some way." msgstr "" -#: ../../whatsnew/2.6.rst:69 +#: ../../whatsnew/2.6.rst:67 msgid "" "Python 2.6 also sees a number of improvements and bugfixes throughout the " "source. A search through the change logs finds there were 259 patches " @@ -62,7 +62,7 @@ msgid "" "likely to be underestimates." msgstr "" -#: ../../whatsnew/2.6.rst:74 +#: ../../whatsnew/2.6.rst:72 msgid "" "This article doesn't attempt to provide a complete specification of the new " "features, but instead provides a convenient overview. For full details, you " @@ -72,18 +72,18 @@ msgid "" "the bug/patch item for each change." msgstr "" -#: ../../whatsnew/2.6.rst:90 +#: ../../whatsnew/2.6.rst:88 msgid "Python 3.0" msgstr "Python 3.0" -#: ../../whatsnew/2.6.rst:92 +#: ../../whatsnew/2.6.rst:90 msgid "" "The development cycle for Python versions 2.6 and 3.0 was synchronized, with " "the alpha and beta releases for both versions being made on the same days. " "The development of 3.0 has influenced many features in 2.6." msgstr "" -#: ../../whatsnew/2.6.rst:97 +#: ../../whatsnew/2.6.rst:95 msgid "" "Python 3.0 is a far-ranging redesign of Python that breaks compatibility " "with the 2.x series. This means that existing Python code will need some " @@ -94,22 +94,22 @@ msgid "" "derived features are:" msgstr "" -#: ../../whatsnew/2.6.rst:106 +#: ../../whatsnew/2.6.rst:104 msgid "" "A :meth:`__complex__` method for converting objects to a complex number." msgstr "" -#: ../../whatsnew/2.6.rst:107 +#: ../../whatsnew/2.6.rst:105 msgid "Alternate syntax for catching exceptions: ``except TypeError as exc``." msgstr "" -#: ../../whatsnew/2.6.rst:108 +#: ../../whatsnew/2.6.rst:106 msgid "" "The addition of :func:`functools.reduce` as a synonym for the built-in :func:" "`reduce` function." msgstr "" -#: ../../whatsnew/2.6.rst:111 +#: ../../whatsnew/2.6.rst:109 msgid "" "Python 3.0 adds several new built-in functions and changes the semantics of " "some existing builtins. Functions that are new in 3.0 such as :func:`bin` " @@ -119,7 +119,7 @@ msgid "" "future_builtins import hex, map`` as necessary." msgstr "" -#: ../../whatsnew/2.6.rst:119 +#: ../../whatsnew/2.6.rst:117 msgid "" "A new command-line switch, :option:`!-3`, enables warnings about features " "that will be removed in Python 3.0. You can run code with this switch to " @@ -128,19 +128,19 @@ msgid "" "py3kwarning`, and to C extension code as :c:data:`Py_Py3kWarningFlag`." msgstr "" -#: ../../whatsnew/2.6.rst:128 +#: ../../whatsnew/2.6.rst:126 msgid "" "The 3\\ *xxx* series of PEPs, which contains proposals for Python 3.0. :pep:" "`3000` describes the development process for Python 3.0. Start with :pep:" "`3100` that describes the general goals for Python 3.0, and then explore the " -"higher-numbered PEPS that propose specific features." +"higher-numbered PEPs that propose specific features." msgstr "" -#: ../../whatsnew/2.6.rst:136 +#: ../../whatsnew/2.6.rst:134 msgid "Changes to the Development Process" msgstr "" -#: ../../whatsnew/2.6.rst:138 +#: ../../whatsnew/2.6.rst:136 msgid "" "While 2.6 was being developed, the Python development process underwent two " "significant changes: we switched from SourceForge's issue tracker to a " @@ -148,11 +148,11 @@ msgid "" "LaTeX to reStructuredText." msgstr "" -#: ../../whatsnew/2.6.rst:145 +#: ../../whatsnew/2.6.rst:143 msgid "New Issue Tracker: Roundup" msgstr "" -#: ../../whatsnew/2.6.rst:147 +#: ../../whatsnew/2.6.rst:145 msgid "" "For a long time, the Python developers had been growing increasingly annoyed " "by SourceForge's bug tracker. SourceForge's hosted solution doesn't permit " @@ -160,7 +160,7 @@ msgid "" "cycle of issues." msgstr "" -#: ../../whatsnew/2.6.rst:152 +#: ../../whatsnew/2.6.rst:150 msgid "" "The infrastructure committee of the Python Software Foundation therefore " "posted a call for issue trackers, asking volunteers to set up different " @@ -174,7 +174,7 @@ msgid "" "volunteers to administer it and a server to host it." msgstr "" -#: ../../whatsnew/2.6.rst:166 +#: ../../whatsnew/2.6.rst:164 msgid "" "After posting a call for volunteers, a new Roundup installation was set up " "at https://bugs.python.org. One installation of Roundup can host multiple " @@ -184,7 +184,7 @@ msgid "" "item for each change." msgstr "" -#: ../../whatsnew/2.6.rst:174 +#: ../../whatsnew/2.6.rst:172 msgid "" "Hosting of the Python bug tracker is kindly provided by `Upfront Systems " "`__ of Stellenbosch, South Africa. Martin " @@ -194,43 +194,43 @@ msgid "" "wishing to move from SourceForge to Roundup." msgstr "" -#: ../../whatsnew/2.6.rst:185 +#: ../../whatsnew/2.6.rst:183 msgid "https://bugs.python.org" msgstr "https://bugs.python.org" -#: ../../whatsnew/2.6.rst:185 +#: ../../whatsnew/2.6.rst:183 msgid "The Python bug tracker." msgstr "" -#: ../../whatsnew/2.6.rst:188 +#: ../../whatsnew/2.6.rst:186 msgid "https://bugs.jython.org:" msgstr "https://bugs.jython.org:" -#: ../../whatsnew/2.6.rst:188 +#: ../../whatsnew/2.6.rst:186 msgid "The Jython bug tracker." msgstr "" -#: ../../whatsnew/2.6.rst:191 +#: ../../whatsnew/2.6.rst:189 msgid "https://roundup.sourceforge.io/" msgstr "https://roundup.sourceforge.io/" -#: ../../whatsnew/2.6.rst:191 +#: ../../whatsnew/2.6.rst:189 msgid "Roundup downloads and documentation." msgstr "" -#: ../../whatsnew/2.6.rst:193 +#: ../../whatsnew/2.6.rst:191 msgid "https://svn.python.org/view/tracker/importer/" msgstr "https://svn.python.org/view/tracker/importer/" -#: ../../whatsnew/2.6.rst:194 +#: ../../whatsnew/2.6.rst:192 msgid "Martin von Löwis's conversion scripts." msgstr "" -#: ../../whatsnew/2.6.rst:197 +#: ../../whatsnew/2.6.rst:195 msgid "New Documentation Format: reStructuredText Using Sphinx" msgstr "" -#: ../../whatsnew/2.6.rst:199 +#: ../../whatsnew/2.6.rst:197 msgid "" "The Python documentation was written using LaTeX since the project started " "around 1989. In the 1980s and early 1990s, most documentation was printed " @@ -239,7 +239,7 @@ msgid "" "once the basic rules of the markup were learned." msgstr "" -#: ../../whatsnew/2.6.rst:206 +#: ../../whatsnew/2.6.rst:204 msgid "" "Today LaTeX is still used for writing publications destined for printing, " "but the landscape for programming tools has shifted. We no longer print out " @@ -252,14 +252,14 @@ msgid "" "and no one ever committed the time required to finish the job." msgstr "" -#: ../../whatsnew/2.6.rst:217 +#: ../../whatsnew/2.6.rst:215 msgid "" "During the 2.6 development cycle, Georg Brandl put a lot of effort into " "building a new toolchain for processing the documentation. The resulting " "package is called Sphinx, and is available from https://www.sphinx-doc.org/." msgstr "" -#: ../../whatsnew/2.6.rst:222 +#: ../../whatsnew/2.6.rst:220 msgid "" "Sphinx concentrates on HTML output, producing attractively styled and modern " "HTML; printed output is still supported through conversion to LaTeX. The " @@ -267,7 +267,7 @@ msgid "" "extensions and directives that is commonly used in the Python community." msgstr "" -#: ../../whatsnew/2.6.rst:228 +#: ../../whatsnew/2.6.rst:226 msgid "" "Sphinx is a standalone package that can be used for writing, and almost two " "dozen other projects (`listed on the Sphinx web site `__" msgstr "" -#: ../../whatsnew/2.6.rst:236 +#: ../../whatsnew/2.6.rst:234 msgid "Describes how to write for Python's documentation." msgstr "" -#: ../../whatsnew/2.6.rst:239 +#: ../../whatsnew/2.6.rst:237 msgid "`Sphinx `__" msgstr "" -#: ../../whatsnew/2.6.rst:239 +#: ../../whatsnew/2.6.rst:237 msgid "Documentation and code for the Sphinx toolchain." msgstr "" -#: ../../whatsnew/2.6.rst:241 +#: ../../whatsnew/2.6.rst:239 msgid "`Docutils `__" msgstr "" -#: ../../whatsnew/2.6.rst:242 +#: ../../whatsnew/2.6.rst:240 msgid "The underlying reStructuredText parser and toolset." msgstr "" -#: ../../whatsnew/2.6.rst:248 +#: ../../whatsnew/2.6.rst:246 msgid "PEP 343: The 'with' statement" msgstr "" -#: ../../whatsnew/2.6.rst:250 +#: ../../whatsnew/2.6.rst:248 msgid "" "The previous version, Python 2.5, added the ':keyword:`with`' statement as " "an optional feature, to be enabled by a ``from __future__ import " @@ -314,7 +314,7 @@ msgid "" "':keyword:`!with`' statement from Python 2.5, you can skip this section." msgstr "" -#: ../../whatsnew/2.6.rst:259 +#: ../../whatsnew/2.6.rst:257 msgid "" "The ':keyword:`with`' statement clarifies code that previously would use " "``try...finally`` blocks to ensure that clean-up code is executed. In this " @@ -323,20 +323,20 @@ msgid "" "objects for use with this statement." msgstr "" -#: ../../whatsnew/2.6.rst:265 +#: ../../whatsnew/2.6.rst:263 msgid "" "The ':keyword:`with`' statement is a control-flow structure whose basic " "structure is::" msgstr "" -#: ../../whatsnew/2.6.rst:271 +#: ../../whatsnew/2.6.rst:269 msgid "" "The expression is evaluated, and it should result in an object that supports " "the context management protocol (that is, has :meth:`~object.__enter__` and :" "meth:`~object.__exit__` methods)." msgstr "" -#: ../../whatsnew/2.6.rst:275 +#: ../../whatsnew/2.6.rst:273 msgid "" "The object's :meth:`~object.__enter__` is called before *with-block* is " "executed and therefore can run set-up code. It also may return a value that " @@ -344,57 +344,57 @@ msgid "" "is *not* assigned the result of *expression*.)" msgstr "" -#: ../../whatsnew/2.6.rst:280 +#: ../../whatsnew/2.6.rst:278 msgid "" "After execution of the *with-block* is finished, the object's :meth:`~object." "__exit__` method is called, even if the block raised an exception, and can " "therefore run clean-up code." msgstr "" -#: ../../whatsnew/2.6.rst:284 +#: ../../whatsnew/2.6.rst:282 msgid "" "Some standard Python objects now support the context management protocol and " "can be used with the ':keyword:`with`' statement. File objects are one " "example::" msgstr "" -#: ../../whatsnew/2.6.rst:292 +#: ../../whatsnew/2.6.rst:290 msgid "" "After this statement has executed, the file object in *f* will have been " "automatically closed, even if the :keyword:`for` loop raised an exception " "part-way through the block." msgstr "" -#: ../../whatsnew/2.6.rst:298 +#: ../../whatsnew/2.6.rst:296 msgid "" "In this case, *f* is the same object created by :func:`open`, because :meth:" "`~object.__enter__` returns *self*." msgstr "" -#: ../../whatsnew/2.6.rst:301 +#: ../../whatsnew/2.6.rst:299 msgid "" "The :mod:`threading` module's locks and condition variables also support " "the ':keyword:`with`' statement::" msgstr "" -#: ../../whatsnew/2.6.rst:309 +#: ../../whatsnew/2.6.rst:307 msgid "" "The lock is acquired before the block is executed and always released once " "the block is complete." msgstr "" -#: ../../whatsnew/2.6.rst:312 +#: ../../whatsnew/2.6.rst:310 msgid "" "The :func:`localcontext` function in the :mod:`decimal` module makes it easy " "to save and restore the current decimal context, which encapsulates the " "desired precision and rounding characteristics for computations::" msgstr "" -#: ../../whatsnew/2.6.rst:331 +#: ../../whatsnew/2.6.rst:329 msgid "Writing Context Managers" msgstr "" -#: ../../whatsnew/2.6.rst:333 +#: ../../whatsnew/2.6.rst:331 msgid "" "Under the hood, the ':keyword:`with`' statement is fairly complicated. Most " "people will only use ':keyword:`!with`' in company with existing objects and " @@ -403,29 +403,29 @@ msgid "" "the underlying implementation and should keep reading." msgstr "" -#: ../../whatsnew/2.6.rst:339 +#: ../../whatsnew/2.6.rst:337 msgid "A high-level explanation of the context management protocol is:" msgstr "" -#: ../../whatsnew/2.6.rst:341 +#: ../../whatsnew/2.6.rst:339 msgid "" "The expression is evaluated and should result in an object called a " "\"context manager\". The context manager must have :meth:`~object." "__enter__` and :meth:`~object.__exit__` methods." msgstr "" -#: ../../whatsnew/2.6.rst:345 +#: ../../whatsnew/2.6.rst:343 msgid "" "The context manager's :meth:`~object.__enter__` method is called. The value " "returned is assigned to *VAR*. If no ``as VAR`` clause is present, the " "value is simply discarded." msgstr "" -#: ../../whatsnew/2.6.rst:349 +#: ../../whatsnew/2.6.rst:347 msgid "The code in *BLOCK* is executed." msgstr "" -#: ../../whatsnew/2.6.rst:351 +#: ../../whatsnew/2.6.rst:349 msgid "" "If *BLOCK* raises an exception, the context manager's :meth:`~object." "__exit__` method is called with three arguments, the exception details " @@ -438,19 +438,19 @@ msgid "" "realize anything went wrong." msgstr "" -#: ../../whatsnew/2.6.rst:360 +#: ../../whatsnew/2.6.rst:358 msgid "" "If *BLOCK* didn't raise an exception, the :meth:`~object.__exit__` method " "is still called, but *type*, *value*, and *traceback* are all ``None``." msgstr "" -#: ../../whatsnew/2.6.rst:363 +#: ../../whatsnew/2.6.rst:361 msgid "" "Let's think through an example. I won't present detailed code but will only " "sketch the methods necessary for a database that supports transactions." msgstr "" -#: ../../whatsnew/2.6.rst:366 +#: ../../whatsnew/2.6.rst:364 msgid "" "(For people unfamiliar with database terminology: a set of changes to the " "database are grouped into a transaction. Transactions can be either " @@ -459,20 +459,20 @@ msgid "" "unchanged. See any database textbook for more information.)" msgstr "" -#: ../../whatsnew/2.6.rst:372 +#: ../../whatsnew/2.6.rst:370 msgid "" "Let's assume there's an object representing a database connection. Our goal " "will be to let the user write code like this::" msgstr "" -#: ../../whatsnew/2.6.rst:381 +#: ../../whatsnew/2.6.rst:379 msgid "" "The transaction should be committed if the code in the block runs flawlessly " "or rolled back if there's an exception. Here's the basic interface for :" "class:`DatabaseConnection` that I'll assume::" msgstr "" -#: ../../whatsnew/2.6.rst:394 +#: ../../whatsnew/2.6.rst:392 msgid "" "The :meth:`~object.__enter__` method is pretty easy, having only to start a " "new transaction. For this application the resulting cursor object would be " @@ -481,7 +481,7 @@ msgid "" "variable name. ::" msgstr "" -#: ../../whatsnew/2.6.rst:406 +#: ../../whatsnew/2.6.rst:404 msgid "" "The :meth:`~object.__exit__` method is the most complicated because it's " "where most of the work has to be done. The method has to check if an " @@ -489,7 +489,7 @@ msgid "" "committed. The transaction is rolled back if there was an exception." msgstr "" -#: ../../whatsnew/2.6.rst:411 +#: ../../whatsnew/2.6.rst:409 msgid "" "In the code below, execution will just fall off the end of the function, " "returning the default value of ``None``. ``None`` is false, so the " @@ -497,17 +497,17 @@ msgid "" "explicit and add a :keyword:`return` statement at the marked location. ::" msgstr "" -#: ../../whatsnew/2.6.rst:431 +#: ../../whatsnew/2.6.rst:429 msgid "The contextlib module" msgstr "" -#: ../../whatsnew/2.6.rst:433 +#: ../../whatsnew/2.6.rst:431 msgid "" "The :mod:`contextlib` module provides some functions and a decorator that " "are useful when writing objects for use with the ':keyword:`with`' statement." msgstr "" -#: ../../whatsnew/2.6.rst:436 +#: ../../whatsnew/2.6.rst:434 msgid "" "The decorator is called :func:`contextmanager`, and lets you write a single " "generator function instead of defining a new class. The generator should " @@ -520,13 +520,13 @@ msgid "" "yield` statement." msgstr "" -#: ../../whatsnew/2.6.rst:445 +#: ../../whatsnew/2.6.rst:443 msgid "" "Using this decorator, our database example from the previous section could " "be written as::" msgstr "" -#: ../../whatsnew/2.6.rst:465 +#: ../../whatsnew/2.6.rst:463 msgid "" "The :mod:`contextlib` module also has a ``nested(mgr1, mgr2, ...)`` function " "that combines a number of context managers so you don't need to write nested " @@ -535,18 +535,18 @@ msgid "" "lock::" msgstr "" -#: ../../whatsnew/2.6.rst:474 +#: ../../whatsnew/2.6.rst:472 msgid "" "Finally, the :func:`closing` function returns its argument so that it can be " "bound to a variable, and calls the argument's ``.close()`` method at the end " "of the block. ::" msgstr "" -#: ../../whatsnew/2.6.rst:492 +#: ../../whatsnew/2.6.rst:490 msgid ":pep:`343` - The \"with\" statement" msgstr "" -#: ../../whatsnew/2.6.rst:489 +#: ../../whatsnew/2.6.rst:487 msgid "" "PEP written by Guido van Rossum and Nick Coghlan; implemented by Mike Bland, " "Guido van Rossum, and Neal Norwitz. The PEP shows the code generated for a " @@ -554,29 +554,29 @@ msgid "" "statement works." msgstr "" -#: ../../whatsnew/2.6.rst:494 +#: ../../whatsnew/2.6.rst:492 msgid "The documentation for the :mod:`contextlib` module." msgstr "" -#: ../../whatsnew/2.6.rst:501 +#: ../../whatsnew/2.6.rst:499 msgid "PEP 366: Explicit Relative Imports From a Main Module" msgstr "" -#: ../../whatsnew/2.6.rst:503 +#: ../../whatsnew/2.6.rst:501 msgid "" "Python's :option:`-m` switch allows running a module as a script. When you " "ran a module that was located inside a package, relative imports didn't work " "correctly." msgstr "" -#: ../../whatsnew/2.6.rst:507 +#: ../../whatsnew/2.6.rst:505 msgid "" "The fix for Python 2.6 adds a :attr:`__package__` attribute to modules. " "When this attribute is present, relative imports will be relative to the " "value of this attribute instead of the :attr:`__name__` attribute." msgstr "" -#: ../../whatsnew/2.6.rst:512 +#: ../../whatsnew/2.6.rst:510 msgid "" "PEP 302-style importers can then set :attr:`__package__` as necessary. The :" "mod:`runpy` module that implements the :option:`-m` switch now does this, so " @@ -584,11 +584,11 @@ msgid "" "package." msgstr "" -#: ../../whatsnew/2.6.rst:522 +#: ../../whatsnew/2.6.rst:520 msgid "PEP 370: Per-user ``site-packages`` Directory" msgstr "" -#: ../../whatsnew/2.6.rst:524 +#: ../../whatsnew/2.6.rst:522 msgid "" "When you run Python, the module search path ``sys.path`` usually includes a " "directory whose path ends in ``\"site-packages\"``. This directory is " @@ -596,28 +596,28 @@ msgid "" "machine or a particular site installation." msgstr "" -#: ../../whatsnew/2.6.rst:529 +#: ../../whatsnew/2.6.rst:527 msgid "" "Python 2.6 introduces a convention for user-specific site directories. The " "directory varies depending on the platform:" msgstr "" -#: ../../whatsnew/2.6.rst:532 +#: ../../whatsnew/2.6.rst:530 msgid "Unix and Mac OS X: :file:`~/.local/`" msgstr "" -#: ../../whatsnew/2.6.rst:533 +#: ../../whatsnew/2.6.rst:531 msgid "Windows: :file:`%APPDATA%/Python`" msgstr "" -#: ../../whatsnew/2.6.rst:535 +#: ../../whatsnew/2.6.rst:533 msgid "" "Within this directory, there will be version-specific subdirectories, such " "as :file:`lib/python2.6/site-packages` on Unix/Mac OS and :file:`Python26/" "site-packages` on Windows." msgstr "" -#: ../../whatsnew/2.6.rst:539 +#: ../../whatsnew/2.6.rst:537 msgid "" "If you don't like the default directory, it can be overridden by an " "environment variable. :envvar:`PYTHONUSERBASE` sets the root directory used " @@ -627,25 +627,25 @@ msgid "" "file for your Python installation." msgstr "" -#: ../../whatsnew/2.6.rst:546 +#: ../../whatsnew/2.6.rst:544 msgid "" "The feature can be disabled entirely by running Python with the :option:`-s` " "option or setting the :envvar:`PYTHONNOUSERSITE` environment variable." msgstr "" -#: ../../whatsnew/2.6.rst:552 +#: ../../whatsnew/2.6.rst:550 msgid ":pep:`370` - Per-user ``site-packages`` Directory" msgstr "" -#: ../../whatsnew/2.6.rst:553 +#: ../../whatsnew/2.6.rst:551 msgid "PEP written and implemented by Christian Heimes." msgstr "由 Christian Heimes 撰寫 PEP 與實作。" -#: ../../whatsnew/2.6.rst:561 +#: ../../whatsnew/2.6.rst:559 msgid "PEP 371: The ``multiprocessing`` Package" msgstr "" -#: ../../whatsnew/2.6.rst:563 +#: ../../whatsnew/2.6.rst:561 msgid "" "The new :mod:`multiprocessing` package lets Python programs create new " "processes that will perform a computation and return a result to the " @@ -654,7 +654,7 @@ msgid "" "share simple arrays of data." msgstr "" -#: ../../whatsnew/2.6.rst:569 +#: ../../whatsnew/2.6.rst:567 msgid "" "The :mod:`multiprocessing` module started out as an exact emulation of the :" "mod:`threading` module using processes instead of threads. That goal was " @@ -666,14 +666,14 @@ msgid "" "still running and the :meth:`join` method to wait for the process to exit." msgstr "" -#: ../../whatsnew/2.6.rst:579 +#: ../../whatsnew/2.6.rst:577 msgid "" "Here's a simple example where the subprocess will calculate a factorial. " "The function doing the calculation is written strangely so that it takes " "significantly longer when the input argument is a multiple of 4." msgstr "" -#: ../../whatsnew/2.6.rst:616 +#: ../../whatsnew/2.6.rst:614 msgid "" "A :class:`~queue.Queue` is used to communicate the result of the factorial. " "The :class:`~queue.Queue` object is stored in a global variable. The child " @@ -683,7 +683,7 @@ msgid "" "variable, the child's value would be unaffected, and vice versa.)" msgstr "" -#: ../../whatsnew/2.6.rst:624 +#: ../../whatsnew/2.6.rst:622 msgid "" "Two other classes, :class:`Pool` and :class:`Manager`, provide higher-level " "interfaces. :class:`Pool` will create a fixed number of worker processes, " @@ -694,11 +694,11 @@ msgid "" "results::" msgstr "" -#: ../../whatsnew/2.6.rst:642 +#: ../../whatsnew/2.6.rst:640 msgid "This produces the following output::" msgstr "" -#: ../../whatsnew/2.6.rst:651 +#: ../../whatsnew/2.6.rst:649 msgid "" "The other high-level interface, the :class:`Manager` class, creates a " "separate server process that can hold master copies of Python data " @@ -711,36 +711,36 @@ msgid "" "create shared locks.)" msgstr "" -#: ../../whatsnew/2.6.rst:695 +#: ../../whatsnew/2.6.rst:693 msgid "This will produce the output::" msgstr "" -#: ../../whatsnew/2.6.rst:706 +#: ../../whatsnew/2.6.rst:704 msgid "The documentation for the :mod:`multiprocessing` module." msgstr "" -#: ../../whatsnew/2.6.rst:709 +#: ../../whatsnew/2.6.rst:707 msgid ":pep:`371` - Addition of the multiprocessing package" msgstr "" -#: ../../whatsnew/2.6.rst:709 +#: ../../whatsnew/2.6.rst:707 msgid "" "PEP written by Jesse Noller and Richard Oudkerk; implemented by Richard " "Oudkerk and Jesse Noller." msgstr "" -#: ../../whatsnew/2.6.rst:718 +#: ../../whatsnew/2.6.rst:716 msgid "PEP 3101: Advanced String Formatting" msgstr "" -#: ../../whatsnew/2.6.rst:720 +#: ../../whatsnew/2.6.rst:718 msgid "" "In Python 3.0, the ``%`` operator is supplemented by a more powerful string " "formatting method, :meth:`format`. Support for the :meth:`str.format` " "method has been backported to Python 2.6." msgstr "" -#: ../../whatsnew/2.6.rst:724 +#: ../../whatsnew/2.6.rst:722 msgid "" "In 2.6, both 8-bit and Unicode strings have a ``.format()`` method that " "treats the string as a template and takes the arguments to be formatted. The " @@ -748,18 +748,18 @@ msgid "" "characters::" msgstr "" -#: ../../whatsnew/2.6.rst:737 +#: ../../whatsnew/2.6.rst:735 msgid "Curly brackets can be escaped by doubling them::" msgstr "" -#: ../../whatsnew/2.6.rst:742 +#: ../../whatsnew/2.6.rst:740 msgid "" "Field names can be integers indicating positional arguments, such as ``{0}" "``, ``{1}``, etc. or names of keyword arguments. You can also supply " "compound field names that read attributes or access dictionary keys::" msgstr "" -#: ../../whatsnew/2.6.rst:756 +#: ../../whatsnew/2.6.rst:754 msgid "" "Note that when using dictionary-style notation such as ``[.mp4]``, you don't " "need to put any quotation marks around the string; it will look up the value " @@ -768,249 +768,249 @@ msgid "" "inside a format string." msgstr "" -#: ../../whatsnew/2.6.rst:762 +#: ../../whatsnew/2.6.rst:760 msgid "" "So far we've shown how to specify which field to substitute into the " "resulting string. The precise formatting used is also controllable by " "adding a colon followed by a format specifier. For example::" msgstr "" -#: ../../whatsnew/2.6.rst:776 +#: ../../whatsnew/2.6.rst:774 msgid "Format specifiers can reference other fields through nesting::" msgstr "" -#: ../../whatsnew/2.6.rst:786 +#: ../../whatsnew/2.6.rst:784 msgid "The alignment of a field within the desired width can be specified:" msgstr "" -#: ../../whatsnew/2.6.rst:789 +#: ../../whatsnew/2.6.rst:787 msgid "Character" msgstr "" -#: ../../whatsnew/2.6.rst:789 +#: ../../whatsnew/2.6.rst:787 msgid "Effect" msgstr "" -#: ../../whatsnew/2.6.rst:791 +#: ../../whatsnew/2.6.rst:789 msgid "< (default)" msgstr "" -#: ../../whatsnew/2.6.rst:791 +#: ../../whatsnew/2.6.rst:789 msgid "Left-align" msgstr "" -#: ../../whatsnew/2.6.rst:792 +#: ../../whatsnew/2.6.rst:790 msgid ">" msgstr ">" -#: ../../whatsnew/2.6.rst:792 +#: ../../whatsnew/2.6.rst:790 msgid "Right-align" msgstr "" -#: ../../whatsnew/2.6.rst:793 +#: ../../whatsnew/2.6.rst:791 msgid "^" msgstr "^" -#: ../../whatsnew/2.6.rst:793 +#: ../../whatsnew/2.6.rst:791 msgid "Center" msgstr "" -#: ../../whatsnew/2.6.rst:794 +#: ../../whatsnew/2.6.rst:792 msgid "=" msgstr "=" -#: ../../whatsnew/2.6.rst:794 +#: ../../whatsnew/2.6.rst:792 msgid "(For numeric types only) Pad after the sign." msgstr "" -#: ../../whatsnew/2.6.rst:797 +#: ../../whatsnew/2.6.rst:795 msgid "" "Format specifiers can also include a presentation type, which controls how " "the value is formatted. For example, floating-point numbers can be " "formatted as a general number or in exponential notation::" msgstr "" -#: ../../whatsnew/2.6.rst:806 +#: ../../whatsnew/2.6.rst:804 msgid "" "A variety of presentation types are available. Consult the 2.6 " "documentation for a :ref:`complete list `; here's a sample:" msgstr "" -#: ../../whatsnew/2.6.rst:810 +#: ../../whatsnew/2.6.rst:808 msgid "``b``" msgstr "``b``" -#: ../../whatsnew/2.6.rst:810 +#: ../../whatsnew/2.6.rst:808 msgid "Binary. Outputs the number in base 2." msgstr "" -#: ../../whatsnew/2.6.rst:811 +#: ../../whatsnew/2.6.rst:809 msgid "``c``" msgstr "``c``" -#: ../../whatsnew/2.6.rst:811 +#: ../../whatsnew/2.6.rst:809 msgid "" "Character. Converts the integer to the corresponding Unicode character " "before printing." msgstr "" -#: ../../whatsnew/2.6.rst:813 +#: ../../whatsnew/2.6.rst:811 msgid "``d``" msgstr "``d``" -#: ../../whatsnew/2.6.rst:813 +#: ../../whatsnew/2.6.rst:811 msgid "Decimal Integer. Outputs the number in base 10." msgstr "" -#: ../../whatsnew/2.6.rst:814 +#: ../../whatsnew/2.6.rst:812 msgid "``o``" msgstr "``o``" -#: ../../whatsnew/2.6.rst:814 +#: ../../whatsnew/2.6.rst:812 msgid "Octal format. Outputs the number in base 8." msgstr "" -#: ../../whatsnew/2.6.rst:815 +#: ../../whatsnew/2.6.rst:813 msgid "``x``" msgstr "``x``" -#: ../../whatsnew/2.6.rst:815 +#: ../../whatsnew/2.6.rst:813 msgid "" "Hex format. Outputs the number in base 16, using lower-case letters for the " "digits above 9." msgstr "" -#: ../../whatsnew/2.6.rst:817 +#: ../../whatsnew/2.6.rst:815 msgid "``e``" msgstr "``e``" -#: ../../whatsnew/2.6.rst:817 +#: ../../whatsnew/2.6.rst:815 msgid "" "Exponent notation. Prints the number in scientific notation using the letter " "'e' to indicate the exponent." msgstr "" -#: ../../whatsnew/2.6.rst:819 +#: ../../whatsnew/2.6.rst:817 msgid "``g``" msgstr "``g``" -#: ../../whatsnew/2.6.rst:819 +#: ../../whatsnew/2.6.rst:817 msgid "" "General format. This prints the number as a fixed-point number, unless the " "number is too large, in which case it switches to 'e' exponent notation." msgstr "" -#: ../../whatsnew/2.6.rst:822 +#: ../../whatsnew/2.6.rst:820 msgid "``n``" msgstr "``n``" -#: ../../whatsnew/2.6.rst:822 +#: ../../whatsnew/2.6.rst:820 msgid "" "Number. This is the same as 'g' (for floats) or 'd' (for integers), except " "that it uses the current locale setting to insert the appropriate number " "separator characters." msgstr "" -#: ../../whatsnew/2.6.rst:825 +#: ../../whatsnew/2.6.rst:823 msgid "``%``" msgstr "``%``" -#: ../../whatsnew/2.6.rst:825 +#: ../../whatsnew/2.6.rst:823 msgid "" "Percentage. Multiplies the number by 100 and displays in fixed ('f') format, " "followed by a percent sign." msgstr "" -#: ../../whatsnew/2.6.rst:829 +#: ../../whatsnew/2.6.rst:827 msgid "" "Classes and types can define a :meth:`__format__` method to control how " "they're formatted. It receives a single argument, the format specifier::" msgstr "" -#: ../../whatsnew/2.6.rst:838 +#: ../../whatsnew/2.6.rst:836 msgid "" "There's also a :func:`format` builtin that will format a single value. It " "calls the type's :meth:`__format__` method with the provided specifier::" msgstr "" -#: ../../whatsnew/2.6.rst:849 +#: ../../whatsnew/2.6.rst:847 msgid ":ref:`formatstrings`" msgstr ":ref:`formatstrings`" -#: ../../whatsnew/2.6.rst:849 +#: ../../whatsnew/2.6.rst:847 msgid "The reference documentation for format fields." msgstr "" -#: ../../whatsnew/2.6.rst:851 +#: ../../whatsnew/2.6.rst:849 msgid ":pep:`3101` - Advanced String Formatting" msgstr "" -#: ../../whatsnew/2.6.rst:852 +#: ../../whatsnew/2.6.rst:850 msgid "PEP written by Talin. Implemented by Eric Smith." msgstr "由 Talin 撰寫 PEP、由 Eric Smith 實作。" -#: ../../whatsnew/2.6.rst:859 +#: ../../whatsnew/2.6.rst:857 msgid "PEP 3105: ``print`` As a Function" msgstr "" -#: ../../whatsnew/2.6.rst:861 +#: ../../whatsnew/2.6.rst:859 msgid "" "The ``print`` statement becomes the :func:`print` function in Python 3.0. " "Making :func:`print` a function makes it possible to replace the function by " "doing ``def print(...)`` or importing a new function from somewhere else." msgstr "" -#: ../../whatsnew/2.6.rst:865 +#: ../../whatsnew/2.6.rst:863 msgid "" "Python 2.6 has a ``__future__`` import that removes ``print`` as language " "syntax, letting you use the functional form instead. For example::" msgstr "" -#: ../../whatsnew/2.6.rst:871 +#: ../../whatsnew/2.6.rst:869 msgid "The signature of the new function is::" msgstr "" -#: ../../whatsnew/2.6.rst:876 +#: ../../whatsnew/2.6.rst:874 msgid "The parameters are:" msgstr "" -#: ../../whatsnew/2.6.rst:878 +#: ../../whatsnew/2.6.rst:876 msgid "*args*: positional arguments whose values will be printed out." msgstr "" -#: ../../whatsnew/2.6.rst:879 +#: ../../whatsnew/2.6.rst:877 msgid "*sep*: the separator, which will be printed between arguments." msgstr "" -#: ../../whatsnew/2.6.rst:880 +#: ../../whatsnew/2.6.rst:878 msgid "" "*end*: the ending text, which will be printed after all of the arguments " "have been output." msgstr "" -#: ../../whatsnew/2.6.rst:882 +#: ../../whatsnew/2.6.rst:880 msgid "*file*: the file object to which the output will be sent." msgstr "" -#: ../../whatsnew/2.6.rst:886 +#: ../../whatsnew/2.6.rst:884 msgid ":pep:`3105` - Make print a function" msgstr "" -#: ../../whatsnew/2.6.rst:887 +#: ../../whatsnew/2.6.rst:885 msgid "PEP written by Georg Brandl." msgstr "由 Georg Brandl 撰寫 PEP。" -#: ../../whatsnew/2.6.rst:894 +#: ../../whatsnew/2.6.rst:892 msgid "PEP 3110: Exception-Handling Changes" msgstr "" -#: ../../whatsnew/2.6.rst:896 +#: ../../whatsnew/2.6.rst:894 msgid "" "One error that Python programmers occasionally make is writing the following " "code::" msgstr "" -#: ../../whatsnew/2.6.rst:904 +#: ../../whatsnew/2.6.rst:902 msgid "" "The author is probably trying to catch both :exc:`TypeError` and :exc:" "`ValueError` exceptions, but this code actually does something different: it " @@ -1019,21 +1019,21 @@ msgid "" "caught at all. The correct code specifies a tuple of exceptions::" msgstr "" -#: ../../whatsnew/2.6.rst:916 +#: ../../whatsnew/2.6.rst:914 msgid "" "This error happens because the use of the comma here is ambiguous: does it " "indicate two different nodes in the parse tree, or a single node that's a " "tuple?" msgstr "" -#: ../../whatsnew/2.6.rst:920 +#: ../../whatsnew/2.6.rst:918 msgid "" "Python 3.0 makes this unambiguous by replacing the comma with the word " "\"as\". To catch an exception and store the exception object in the " "variable ``exc``, you must write::" msgstr "" -#: ../../whatsnew/2.6.rst:929 +#: ../../whatsnew/2.6.rst:927 msgid "" "Python 3.0 will only support the use of \"as\", and therefore interprets the " "first example as catching two different exceptions. Python 2.6 supports " @@ -1042,19 +1042,19 @@ msgid "" "be executed with 2.6." msgstr "" -#: ../../whatsnew/2.6.rst:937 +#: ../../whatsnew/2.6.rst:935 msgid ":pep:`3110` - Catching Exceptions in Python 3000" msgstr "" -#: ../../whatsnew/2.6.rst:938 +#: ../../whatsnew/2.6.rst:936 msgid "PEP written and implemented by Collin Winter." msgstr "由 Collin Winter 撰寫 PEP 與實作。" -#: ../../whatsnew/2.6.rst:945 +#: ../../whatsnew/2.6.rst:943 msgid "PEP 3112: Byte Literals" msgstr "" -#: ../../whatsnew/2.6.rst:947 +#: ../../whatsnew/2.6.rst:945 msgid "" "Python 3.0 adopts Unicode as the language's fundamental string type and " "denotes 8-bit literals differently, either as ``b'string'`` or using a :" @@ -1063,7 +1063,7 @@ msgid "" "``b''`` notation." msgstr "" -#: ../../whatsnew/2.6.rst:954 +#: ../../whatsnew/2.6.rst:952 msgid "" "The 2.6 :class:`str` differs from 3.0's :class:`bytes` type in various ways; " "most notably, the constructor is completely different. In 3.0, ``bytes([65, " @@ -1072,7 +1072,7 @@ msgid "" "func:`str` of the list." msgstr "" -#: ../../whatsnew/2.6.rst:960 +#: ../../whatsnew/2.6.rst:958 msgid "" "The primary use of :class:`bytes` in 2.6 will be to write tests of object " "type such as ``isinstance(x, bytes)``. This will help the 2to3 converter, " @@ -1082,14 +1082,14 @@ msgid "" "be correct in Python 3.0." msgstr "" -#: ../../whatsnew/2.6.rst:967 +#: ../../whatsnew/2.6.rst:965 msgid "" "There's also a ``__future__`` import that causes all string literals to " "become Unicode strings. This means that ``\\u`` escape sequences can be " "used to include Unicode characters::" msgstr "" -#: ../../whatsnew/2.6.rst:979 +#: ../../whatsnew/2.6.rst:977 msgid "" "At the C level, Python 3.0 will rename the existing 8-bit string type, " "called :c:type:`!PyStringObject` in Python 2.x, to :c:type:`PyBytesObject`. " @@ -1099,38 +1099,38 @@ msgid "" "with strings." msgstr "" -#: ../../whatsnew/2.6.rst:986 +#: ../../whatsnew/2.6.rst:984 msgid "" "Instances of the :class:`bytes` type are immutable just as strings are. A " "new :class:`bytearray` type stores a mutable sequence of bytes::" msgstr "" -#: ../../whatsnew/2.6.rst:1001 +#: ../../whatsnew/2.6.rst:999 msgid "" "Byte arrays support most of the methods of string types, such as :meth:" "`startswith`/:meth:`endswith`, :meth:`find`/:meth:`rfind`, and some of the " "methods of lists, such as :meth:`append`, :meth:`pop`, and :meth:`reverse`." msgstr "" -#: ../../whatsnew/2.6.rst:1014 +#: ../../whatsnew/2.6.rst:1012 msgid "" "There's also a corresponding C API, with :c:func:`PyByteArray_FromObject`, :" "c:func:`PyByteArray_FromStringAndSize`, and various other functions." msgstr "" -#: ../../whatsnew/2.6.rst:1021 +#: ../../whatsnew/2.6.rst:1019 msgid ":pep:`3112` - Bytes literals in Python 3000" msgstr "" -#: ../../whatsnew/2.6.rst:1022 +#: ../../whatsnew/2.6.rst:1020 msgid "PEP written by Jason Orendorff; backported to 2.6 by Christian Heimes." msgstr "" -#: ../../whatsnew/2.6.rst:1029 +#: ../../whatsnew/2.6.rst:1027 msgid "PEP 3116: New I/O Library" msgstr "" -#: ../../whatsnew/2.6.rst:1031 +#: ../../whatsnew/2.6.rst:1029 msgid "" "Python's built-in file objects support a number of methods, but file-like " "objects don't necessarily support all of them. Objects that imitate files " @@ -1140,13 +1140,13 @@ msgid "" "from the fundamental read and write operations." msgstr "" -#: ../../whatsnew/2.6.rst:1039 +#: ../../whatsnew/2.6.rst:1037 msgid "" "There are three levels of abstract base classes provided by the :mod:`io` " "module:" msgstr "" -#: ../../whatsnew/2.6.rst:1042 +#: ../../whatsnew/2.6.rst:1040 msgid "" ":class:`RawIOBase` defines raw I/O operations: :meth:`read`, :meth:" "`readinto`, :meth:`write`, :meth:`seek`, :meth:`tell`, :meth:`truncate`, " @@ -1156,13 +1156,13 @@ msgid "" "allow." msgstr "" -#: ../../whatsnew/2.6.rst:1050 +#: ../../whatsnew/2.6.rst:1048 msgid "" "Python 3.0 has concrete implementations of this class for files and sockets, " "but Python 2.6 hasn't restructured its file and socket objects in this way." msgstr "" -#: ../../whatsnew/2.6.rst:1056 +#: ../../whatsnew/2.6.rst:1052 msgid "" ":class:`BufferedIOBase` is an abstract base class that buffers data in " "memory to reduce the number of system calls used, making I/O processing more " @@ -1170,7 +1170,7 @@ msgid "" "attr:`raw` attribute holding the underlying raw object." msgstr "" -#: ../../whatsnew/2.6.rst:1062 +#: ../../whatsnew/2.6.rst:1058 msgid "" "There are five concrete classes implementing this ABC. :class:" "`BufferedWriter` and :class:`BufferedReader` are for objects that support " @@ -1182,7 +1182,7 @@ msgid "" "seeking over an in-memory buffer." msgstr "" -#: ../../whatsnew/2.6.rst:1075 +#: ../../whatsnew/2.6.rst:1071 msgid "" ":class:`TextIOBase`: Provides functions for reading and writing strings " "(remember, strings will be Unicode in Python 3.0), and supporting :term:" @@ -1190,7 +1190,7 @@ msgid "" "method and supports iteration upon objects." msgstr "" -#: ../../whatsnew/2.6.rst:1081 +#: ../../whatsnew/2.6.rst:1077 msgid "" "There are two concrete implementations. :class:`TextIOWrapper` wraps a " "buffered I/O object, supporting all of the methods for text I/O and adding " @@ -1199,7 +1199,7 @@ msgid "" "to disk." msgstr "" -#: ../../whatsnew/2.6.rst:1087 +#: ../../whatsnew/2.6.rst:1083 msgid "" "(In Python 2.6, :class:`io.StringIO` is implemented in pure Python, so it's " "pretty slow. You should therefore stick with the existing :mod:`StringIO` " @@ -1208,7 +1208,7 @@ msgid "" "will be backported to the 2.x releases.)" msgstr "" -#: ../../whatsnew/2.6.rst:1093 +#: ../../whatsnew/2.6.rst:1089 msgid "" "In Python 2.6, the underlying implementations haven't been restructured to " "build on top of the :mod:`io` module's classes. The module is being " @@ -1217,22 +1217,22 @@ msgid "" "buffering and text I/O." msgstr "" -#: ../../whatsnew/2.6.rst:1103 +#: ../../whatsnew/2.6.rst:1099 msgid ":pep:`3116` - New I/O" msgstr "" -#: ../../whatsnew/2.6.rst:1102 +#: ../../whatsnew/2.6.rst:1098 msgid "" "PEP written by Daniel Stutzbach, Mike Verdone, and Guido van Rossum. Code by " "Guido van Rossum, Georg Brandl, Walter Doerwald, Jeremy Hylton, Martin von " "Löwis, Tony Lownds, and others." msgstr "" -#: ../../whatsnew/2.6.rst:1111 +#: ../../whatsnew/2.6.rst:1107 msgid "PEP 3118: Revised Buffer Protocol" msgstr "PEP 3118:修訂緩衝協定" -#: ../../whatsnew/2.6.rst:1113 +#: ../../whatsnew/2.6.rst:1109 msgid "" "The buffer protocol is a C-level API that lets Python types exchange " "pointers into their internal representations. A memory-mapped file can be " @@ -1241,7 +1241,7 @@ msgid "" "searched." msgstr "" -#: ../../whatsnew/2.6.rst:1119 +#: ../../whatsnew/2.6.rst:1115 msgid "" "The primary users of the buffer protocol are numeric-processing packages " "such as NumPy, which expose the internal representation of arrays so that " @@ -1251,7 +1251,7 @@ msgid "" "the shape of an array or locking a memory region." msgstr "" -#: ../../whatsnew/2.6.rst:1126 +#: ../../whatsnew/2.6.rst:1122 msgid "" "The most important new C API function is ``PyObject_GetBuffer(PyObject *obj, " "Py_buffer *view, int flags)``, which takes an object and a set of flags, and " @@ -1262,49 +1262,49 @@ msgid "" "external caller is done." msgstr "" -#: ../../whatsnew/2.6.rst:1138 +#: ../../whatsnew/2.6.rst:1132 msgid "" "The *flags* argument to :c:func:`PyObject_GetBuffer` specifies constraints " "upon the memory returned. Some examples are:" msgstr "" -#: ../../whatsnew/2.6.rst:1141 +#: ../../whatsnew/2.6.rst:1135 msgid ":c:macro:`PyBUF_WRITABLE` indicates that the memory must be writable." msgstr "" -#: ../../whatsnew/2.6.rst:1143 +#: ../../whatsnew/2.6.rst:1137 msgid "" ":c:macro:`PyBUF_LOCK` requests a read-only or exclusive lock on the memory." msgstr "" -#: ../../whatsnew/2.6.rst:1145 +#: ../../whatsnew/2.6.rst:1139 msgid "" ":c:macro:`PyBUF_C_CONTIGUOUS` and :c:macro:`PyBUF_F_CONTIGUOUS` requests a C-" "contiguous (last dimension varies the fastest) or Fortran-contiguous (first " "dimension varies the fastest) array layout." msgstr "" -#: ../../whatsnew/2.6.rst:1149 +#: ../../whatsnew/2.6.rst:1143 msgid "" "Two new argument codes for :c:func:`PyArg_ParseTuple`, ``s*`` and ``z*``, " "return locked buffer objects for a parameter." msgstr "" -#: ../../whatsnew/2.6.rst:1155 +#: ../../whatsnew/2.6.rst:1149 msgid ":pep:`3118` - Revising the buffer protocol" msgstr "" -#: ../../whatsnew/2.6.rst:1155 +#: ../../whatsnew/2.6.rst:1149 msgid "" "PEP written by Travis Oliphant and Carl Banks; implemented by Travis " "Oliphant." msgstr "" -#: ../../whatsnew/2.6.rst:1164 +#: ../../whatsnew/2.6.rst:1158 msgid "PEP 3119: Abstract Base Classes" msgstr "" -#: ../../whatsnew/2.6.rst:1166 +#: ../../whatsnew/2.6.rst:1160 msgid "" "Some object-oriented languages such as Java support interfaces, declaring " "that a class has a given set of methods or supports a given access " @@ -1316,7 +1316,7 @@ msgid "" "versions of Python will probably add more ABCs." msgstr "" -#: ../../whatsnew/2.6.rst:1176 +#: ../../whatsnew/2.6.rst:1170 msgid "" "Let's say you have a particular class and wish to know whether it supports " "dictionary-style access. The phrase \"dictionary-style\" is vague, however. " @@ -1327,7 +1327,7 @@ msgid "" "`update`? Iterating over the object with :func:`iter`?" msgstr "" -#: ../../whatsnew/2.6.rst:1184 +#: ../../whatsnew/2.6.rst:1178 msgid "" "The Python 2.6 :mod:`collections` module includes a number of different ABCs " "that represent these distinctions. :class:`Iterable` indicates that a class " @@ -1338,20 +1338,20 @@ msgid "" "`MutableMapping` ABC." msgstr "" -#: ../../whatsnew/2.6.rst:1193 +#: ../../whatsnew/2.6.rst:1187 msgid "" "You can derive your own classes from a particular ABC to indicate they " "support that ABC's interface::" msgstr "" -#: ../../whatsnew/2.6.rst:1202 +#: ../../whatsnew/2.6.rst:1196 msgid "" "Alternatively, you could write the class without deriving from the desired " "ABC and instead register the class by calling the ABC's :meth:`register` " "method::" msgstr "" -#: ../../whatsnew/2.6.rst:1213 +#: ../../whatsnew/2.6.rst:1207 msgid "" "For classes that you write, deriving from the ABC is probably clearer. The :" "meth:`register` method is useful when you've written a new ABC that can " @@ -1360,20 +1360,20 @@ msgid "" "`PrintableType` ABC, it's legal to do::" msgstr "" -#: ../../whatsnew/2.6.rst:1225 +#: ../../whatsnew/2.6.rst:1219 msgid "" "Classes should obey the semantics specified by an ABC, but Python can't " "check this; it's up to the class author to understand the ABC's requirements " "and to implement the code accordingly." msgstr "" -#: ../../whatsnew/2.6.rst:1229 +#: ../../whatsnew/2.6.rst:1223 msgid "" "To check whether an object supports a particular interface, you can now " "write::" msgstr "" -#: ../../whatsnew/2.6.rst:1236 +#: ../../whatsnew/2.6.rst:1230 msgid "" "Don't feel that you must now begin writing lots of checks as in the above " "example. Python has a strong tradition of duck-typing, where explicit type-" @@ -1383,13 +1383,13 @@ msgid "" "necessary." msgstr "" -#: ../../whatsnew/2.6.rst:1243 +#: ../../whatsnew/2.6.rst:1237 msgid "" "You can write your own ABCs by using ``abc.ABCMeta`` as the metaclass in a " "class definition::" msgstr "" -#: ../../whatsnew/2.6.rst:1264 +#: ../../whatsnew/2.6.rst:1258 msgid "" "In the :class:`Drawable` ABC above, the :meth:`draw_doubled` method renders " "the object at twice its size and can be implemented in terms of other " @@ -1399,7 +1399,7 @@ msgid "" "necessary, though; the ABC can't provide a useful generic implementation." msgstr "" -#: ../../whatsnew/2.6.rst:1272 +#: ../../whatsnew/2.6.rst:1266 msgid "" "You can apply the ``@abstractmethod`` decorator to methods such as :meth:" "`draw` that must be implemented; Python will then raise an exception for " @@ -1408,51 +1408,51 @@ msgid "" "method::" msgstr "" -#: ../../whatsnew/2.6.rst:1287 +#: ../../whatsnew/2.6.rst:1281 msgid "" "Abstract data attributes can be declared using the ``@abstractproperty`` " "decorator::" msgstr "" -#: ../../whatsnew/2.6.rst:1297 +#: ../../whatsnew/2.6.rst:1291 msgid "Subclasses must then define a :meth:`readonly` property." msgstr "" -#: ../../whatsnew/2.6.rst:1303 +#: ../../whatsnew/2.6.rst:1297 msgid ":pep:`3119` - Introducing Abstract Base Classes" msgstr "" -#: ../../whatsnew/2.6.rst:1302 +#: ../../whatsnew/2.6.rst:1296 msgid "" "PEP written by Guido van Rossum and Talin. Implemented by Guido van Rossum. " "Backported to 2.6 by Benjamin Aranguren, with Alex Martelli." msgstr "" -#: ../../whatsnew/2.6.rst:1311 +#: ../../whatsnew/2.6.rst:1305 msgid "PEP 3127: Integer Literal Support and Syntax" msgstr "" -#: ../../whatsnew/2.6.rst:1313 +#: ../../whatsnew/2.6.rst:1307 msgid "" "Python 3.0 changes the syntax for octal (base-8) integer literals, prefixing " "them with \"0o\" or \"0O\" instead of a leading zero, and adds support for " "binary (base-2) integer literals, signalled by a \"0b\" or \"0B\" prefix." msgstr "" -#: ../../whatsnew/2.6.rst:1318 +#: ../../whatsnew/2.6.rst:1312 msgid "" "Python 2.6 doesn't drop support for a leading 0 signalling an octal number, " "but it does add support for \"0o\" and \"0b\"::" msgstr "" -#: ../../whatsnew/2.6.rst:1326 +#: ../../whatsnew/2.6.rst:1320 msgid "" "The :func:`oct` builtin still returns numbers prefixed with a leading zero, " "and a new :func:`bin` builtin returns the binary representation for a " "number::" msgstr "" -#: ../../whatsnew/2.6.rst:1337 +#: ../../whatsnew/2.6.rst:1331 msgid "" "The :func:`int` and :func:`long` builtins will now accept the \"0o\" and " "\"0b\" prefixes when base-8 or base-2 are requested, or when the *base* " @@ -1460,55 +1460,55 @@ msgid "" "the string)::" msgstr "" -#: ../../whatsnew/2.6.rst:1355 +#: ../../whatsnew/2.6.rst:1349 msgid ":pep:`3127` - Integer Literal Support and Syntax" msgstr "" -#: ../../whatsnew/2.6.rst:1355 +#: ../../whatsnew/2.6.rst:1349 msgid "PEP written by Patrick Maupin; backported to 2.6 by Eric Smith." msgstr "" -#: ../../whatsnew/2.6.rst:1363 +#: ../../whatsnew/2.6.rst:1357 msgid "PEP 3129: Class Decorators" msgstr "" -#: ../../whatsnew/2.6.rst:1365 +#: ../../whatsnew/2.6.rst:1359 msgid "" "Decorators have been extended from functions to classes. It's now legal to " "write::" msgstr "" -#: ../../whatsnew/2.6.rst:1373 +#: ../../whatsnew/2.6.rst:1367 msgid "This is equivalent to::" msgstr "" -#: ../../whatsnew/2.6.rst:1382 +#: ../../whatsnew/2.6.rst:1376 msgid ":pep:`3129` - Class Decorators" msgstr "" -#: ../../whatsnew/2.6.rst:1383 +#: ../../whatsnew/2.6.rst:1377 msgid "PEP written by Collin Winter." msgstr "由 Collin Winter 撰寫 PEP。" -#: ../../whatsnew/2.6.rst:1390 +#: ../../whatsnew/2.6.rst:1384 msgid "PEP 3141: A Type Hierarchy for Numbers" msgstr "" -#: ../../whatsnew/2.6.rst:1392 +#: ../../whatsnew/2.6.rst:1386 msgid "" "Python 3.0 adds several abstract base classes for numeric types inspired by " "Scheme's numeric tower. These classes were backported to 2.6 as the :mod:" "`numbers` module." msgstr "" -#: ../../whatsnew/2.6.rst:1396 +#: ../../whatsnew/2.6.rst:1390 msgid "" "The most general ABC is :class:`Number`. It defines no operations at all, " "and only exists to allow checking if an object is a number by doing " "``isinstance(obj, Number)``." msgstr "" -#: ../../whatsnew/2.6.rst:1400 +#: ../../whatsnew/2.6.rst:1394 msgid "" ":class:`Complex` is a subclass of :class:`Number`. Complex numbers can " "undergo the basic operations of addition, subtraction, multiplication, " @@ -1517,14 +1517,14 @@ msgid "" "implementation of :class:`Complex`." msgstr "" -#: ../../whatsnew/2.6.rst:1406 +#: ../../whatsnew/2.6.rst:1400 msgid "" ":class:`Real` further derives from :class:`Complex`, and adds operations " "that only work on real numbers: :func:`floor`, :func:`trunc`, rounding, " "taking the remainder mod N, floor division, and comparisons." msgstr "" -#: ../../whatsnew/2.6.rst:1411 +#: ../../whatsnew/2.6.rst:1405 msgid "" ":class:`Rational` numbers derive from :class:`Real`, have :attr:`numerator` " "and :attr:`denominator` properties, and can be converted to floats. Python " @@ -1533,7 +1533,7 @@ msgid "" "`Rational` to avoid a name clash with :class:`numbers.Rational`.)" msgstr "" -#: ../../whatsnew/2.6.rst:1418 +#: ../../whatsnew/2.6.rst:1412 msgid "" ":class:`Integral` numbers derive from :class:`Rational`, and can be shifted " "left and right with ``<<`` and ``>>``, combined using bitwise operations " @@ -1541,7 +1541,7 @@ msgid "" "boundaries." msgstr "" -#: ../../whatsnew/2.6.rst:1423 +#: ../../whatsnew/2.6.rst:1417 msgid "" "In Python 3.0, the PEP slightly redefines the existing builtins :func:" "`round`, :func:`math.floor`, :func:`math.ceil`, and adds a new one, :func:" @@ -1550,32 +1550,32 @@ msgid "" "the function's argument and zero." msgstr "" -#: ../../whatsnew/2.6.rst:1432 +#: ../../whatsnew/2.6.rst:1426 msgid ":pep:`3141` - A Type Hierarchy for Numbers" msgstr "" -#: ../../whatsnew/2.6.rst:1432 +#: ../../whatsnew/2.6.rst:1426 msgid "PEP written by Jeffrey Yasskin." msgstr "由 Jeffrey Yasskin 撰寫 PEP。" -#: ../../whatsnew/2.6.rst:1434 +#: ../../whatsnew/2.6.rst:1428 msgid "" "`Scheme's numerical tower `__, from the Guile manual." msgstr "" -#: ../../whatsnew/2.6.rst:1436 +#: ../../whatsnew/2.6.rst:1430 msgid "" "`Scheme's number datatypes `__ from the R5RS " "Scheme specification." msgstr "" -#: ../../whatsnew/2.6.rst:1440 +#: ../../whatsnew/2.6.rst:1434 msgid "The :mod:`fractions` Module" msgstr "" -#: ../../whatsnew/2.6.rst:1442 +#: ../../whatsnew/2.6.rst:1436 msgid "" "To fill out the hierarchy of numeric types, the :mod:`fractions` module " "provides a rational-number class. Rational numbers store their values as a " @@ -1583,42 +1583,42 @@ msgid "" "numbers such as ``2/3`` that floating-point numbers can only approximate." msgstr "" -#: ../../whatsnew/2.6.rst:1448 +#: ../../whatsnew/2.6.rst:1442 msgid "" "The :class:`Fraction` constructor takes two :class:`Integral` values that " "will be the numerator and denominator of the resulting fraction. ::" msgstr "" -#: ../../whatsnew/2.6.rst:1461 +#: ../../whatsnew/2.6.rst:1455 msgid "" "For converting floating-point numbers to rationals, the float type now has " "an :meth:`as_integer_ratio()` method that returns the numerator and " "denominator for a fraction that evaluates to the same floating-point value::" msgstr "" -#: ../../whatsnew/2.6.rst:1473 +#: ../../whatsnew/2.6.rst:1467 msgid "" "Note that values that can only be approximated by floating-point numbers, " "such as 1./3, are not simplified to the number being approximated; the " "fraction attempts to match the floating-point value **exactly**." msgstr "" -#: ../../whatsnew/2.6.rst:1478 +#: ../../whatsnew/2.6.rst:1472 msgid "" "The :mod:`fractions` module is based upon an implementation by Sjoerd " "Mullender that was in Python's :file:`Demo/classes/` directory for a long " "time. This implementation was significantly updated by Jeffrey Yasskin." msgstr "" -#: ../../whatsnew/2.6.rst:1485 +#: ../../whatsnew/2.6.rst:1479 msgid "Other Language Changes" msgstr "其他語言更動" -#: ../../whatsnew/2.6.rst:1487 +#: ../../whatsnew/2.6.rst:1481 msgid "Some smaller changes made to the core Python language are:" msgstr "" -#: ../../whatsnew/2.6.rst:1489 +#: ../../whatsnew/2.6.rst:1483 msgid "" "Directories and zip archives containing a :file:`__main__.py` file can now " "be executed directly by passing their name to the interpreter. The directory " @@ -1627,7 +1627,7 @@ msgid "" "J. Eby and Nick Coghlan; :issue:`1739468`.)" msgstr "" -#: ../../whatsnew/2.6.rst:1496 +#: ../../whatsnew/2.6.rst:1490 msgid "" "The :func:`hasattr` function was catching and ignoring all errors, under the " "assumption that they meant a :meth:`__getattr__` method was failing somehow " @@ -1638,30 +1638,30 @@ msgid "" "`2196`.)" msgstr "" -#: ../../whatsnew/2.6.rst:1504 +#: ../../whatsnew/2.6.rst:1498 msgid "" "When calling a function using the ``**`` syntax to provide keyword " "arguments, you are no longer required to use a Python dictionary; any " "mapping will now work::" msgstr "" -#: ../../whatsnew/2.6.rst:1517 +#: ../../whatsnew/2.6.rst:1511 msgid "(Contributed by Alexander Belopolsky; :issue:`1686487`.)" msgstr "(由 Alexander Belopolsky 所貢獻;:issue:`1686487`。)" -#: ../../whatsnew/2.6.rst:1519 +#: ../../whatsnew/2.6.rst:1513 msgid "" "It's also become legal to provide keyword arguments after a ``*args`` " "argument to a function call. ::" msgstr "" -#: ../../whatsnew/2.6.rst:1528 +#: ../../whatsnew/2.6.rst:1522 msgid "" "Previously this would have been a syntax error. (Contributed by Amaury " "Forgeot d'Arc; :issue:`3473`.)" msgstr "" -#: ../../whatsnew/2.6.rst:1531 +#: ../../whatsnew/2.6.rst:1525 msgid "" "A new builtin, ``next(iterator, [default])`` returns the next item from the " "specified iterator. If the *default* argument is supplied, it will be " @@ -1669,17 +1669,17 @@ msgid "" "`StopIteration` exception will be raised. (Backported in :issue:`2719`.)" msgstr "" -#: ../../whatsnew/2.6.rst:1537 +#: ../../whatsnew/2.6.rst:1531 msgid "" "Tuples now have :meth:`index` and :meth:`count` methods matching the list " "type's :meth:`index` and :meth:`count` methods::" msgstr "" -#: ../../whatsnew/2.6.rst:1546 +#: ../../whatsnew/2.6.rst:1540 msgid "(Contributed by Raymond Hettinger)" msgstr "(由 Raymond Hettinger 所貢獻。)" -#: ../../whatsnew/2.6.rst:1548 +#: ../../whatsnew/2.6.rst:1542 msgid "" "The built-in types now have improved support for extended slicing syntax, " "accepting various combinations of ``(start, stop, step)``. Previously, the " @@ -1687,7 +1687,7 @@ msgid "" "Thomas Wouters.)" msgstr "" -#: ../../whatsnew/2.6.rst:1555 +#: ../../whatsnew/2.6.rst:1549 msgid "" "Properties now have three attributes, :attr:`getter`, :attr:`setter` and :" "attr:`deleter`, that are decorators providing useful shortcuts for adding a " @@ -1695,19 +1695,19 @@ msgid "" "them like this::" msgstr "" -#: ../../whatsnew/2.6.rst:1582 +#: ../../whatsnew/2.6.rst:1576 msgid "" "Several methods of the built-in set types now accept multiple iterables: :" "meth:`intersection`, :meth:`intersection_update`, :meth:`union`, :meth:" "`update`, :meth:`difference` and :meth:`difference_update`." msgstr "" -#: ../../whatsnew/2.6.rst:1596 ../../whatsnew/2.6.rst:1881 -#: ../../whatsnew/2.6.rst:1902 +#: ../../whatsnew/2.6.rst:1590 ../../whatsnew/2.6.rst:1875 +#: ../../whatsnew/2.6.rst:1896 msgid "(Contributed by Raymond Hettinger.)" msgstr "(由 Raymond Hettinger 所貢獻。)" -#: ../../whatsnew/2.6.rst:1598 +#: ../../whatsnew/2.6.rst:1592 msgid "" "Many floating-point features were added. The :func:`float` function will " "now turn the string ``nan`` into an IEEE 754 Not A Number value, and " @@ -1716,14 +1716,14 @@ msgid "" "`1635`.)" msgstr "" -#: ../../whatsnew/2.6.rst:1604 +#: ../../whatsnew/2.6.rst:1598 msgid "" "Other functions in the :mod:`math` module, :func:`isinf` and :func:`isnan`, " "return true if their floating-point argument is infinite or Not A Number. (:" "issue:`1640`)" msgstr "" -#: ../../whatsnew/2.6.rst:1608 +#: ../../whatsnew/2.6.rst:1602 msgid "" "Conversion functions were added to convert floating-point numbers into " "hexadecimal strings (:issue:`3008`). These functions convert floats to and " @@ -1733,7 +1733,7 @@ msgid "" "converts a string back into a number::" msgstr "" -#: ../../whatsnew/2.6.rst:1625 +#: ../../whatsnew/2.6.rst:1619 msgid "" "A numerical nicety: when creating a complex number from two floats on " "systems that support signed zeros (-0 and +0), the :func:`complex` " @@ -1741,7 +1741,7 @@ msgid "" "Dickinson; :issue:`1507`.)" msgstr "" -#: ../../whatsnew/2.6.rst:1630 +#: ../../whatsnew/2.6.rst:1624 msgid "" "Classes that inherit a :meth:`__hash__` method from a parent class can set " "``__hash__ = None`` to indicate that the class isn't hashable. This will " @@ -1749,7 +1749,7 @@ msgid "" "indicated as implementing the :class:`Hashable` ABC." msgstr "" -#: ../../whatsnew/2.6.rst:1636 +#: ../../whatsnew/2.6.rst:1630 msgid "" "You should do this when you've defined a :meth:`__cmp__` or :meth:`__eq__` " "method that compares objects by their value rather than by identity. All " @@ -1761,7 +1761,7 @@ msgid "" "d'Arc; :issue:`2235`.)" msgstr "" -#: ../../whatsnew/2.6.rst:1646 +#: ../../whatsnew/2.6.rst:1640 msgid "" "The :exc:`GeneratorExit` exception now subclasses :exc:`BaseException` " "instead of :exc:`Exception`. This means that an exception handler that does " @@ -1769,20 +1769,20 @@ msgid "" "(Contributed by Chad Austin; :issue:`1537`.)" msgstr "" -#: ../../whatsnew/2.6.rst:1652 +#: ../../whatsnew/2.6.rst:1646 msgid "" "Generator objects now have a :attr:`gi_code` attribute that refers to the " "original code object backing the generator. (Contributed by Collin Winter; :" "issue:`1473257`.)" msgstr "" -#: ../../whatsnew/2.6.rst:1656 +#: ../../whatsnew/2.6.rst:1650 msgid "" "The :func:`compile` built-in function now accepts keyword arguments as well " "as positional parameters. (Contributed by Thomas Wouters; :issue:`1444529`.)" msgstr "" -#: ../../whatsnew/2.6.rst:1660 +#: ../../whatsnew/2.6.rst:1654 msgid "" "The :func:`complex` constructor now accepts strings containing parenthesized " "complex numbers, meaning that ``complex(repr(cplx))`` will now round-trip " @@ -1790,7 +1790,7 @@ msgid "" "issue:`1491866`)" msgstr "" -#: ../../whatsnew/2.6.rst:1665 +#: ../../whatsnew/2.6.rst:1659 msgid "" "The string :meth:`translate` method now accepts ``None`` as the translation " "table parameter, which is treated as the identity transformation. This " @@ -1799,7 +1799,7 @@ msgid "" "`1193128`.)" msgstr "" -#: ../../whatsnew/2.6.rst:1671 +#: ../../whatsnew/2.6.rst:1665 msgid "" "The built-in :func:`dir` function now checks for a :meth:`__dir__` method on " "the objects it receives. This method must return a list of strings " @@ -1809,7 +1809,7 @@ msgid "" "pseudo-attributes they will honor. (:issue:`1591665`)" msgstr "" -#: ../../whatsnew/2.6.rst:1679 +#: ../../whatsnew/2.6.rst:1673 msgid "" "Instance method objects have new attributes for the object and function " "comprising the method; the new synonym for :attr:`!im_self` is :attr:" @@ -1818,7 +1818,7 @@ msgid "" "3.0." msgstr "" -#: ../../whatsnew/2.6.rst:1685 +#: ../../whatsnew/2.6.rst:1679 msgid "" "An obscure change: when you use the :func:`locals` function inside a :" "keyword:`class` statement, the resulting dictionary no longer returns free " @@ -1826,11 +1826,11 @@ msgid "" "keyword:`!class` statement that aren't attributes of the class.)" msgstr "" -#: ../../whatsnew/2.6.rst:1694 +#: ../../whatsnew/2.6.rst:1688 msgid "Optimizations" msgstr "最佳化" -#: ../../whatsnew/2.6.rst:1696 +#: ../../whatsnew/2.6.rst:1690 msgid "" "The :mod:`warnings` module has been rewritten in C. This makes it possible " "to invoke warnings from the parser, and may also make the interpreter's " @@ -1838,7 +1838,7 @@ msgid "" "`1631171`.)" msgstr "" -#: ../../whatsnew/2.6.rst:1701 +#: ../../whatsnew/2.6.rst:1695 msgid "" "Type objects now have a cache of methods that can reduce the work required " "to find the correct method implementation for a particular class; once " @@ -1849,7 +1849,7 @@ msgid "" "updated for Python 2.6 by Kevin Jacobs; :issue:`1700288`.)" msgstr "" -#: ../../whatsnew/2.6.rst:1711 +#: ../../whatsnew/2.6.rst:1705 msgid "" "By default, this change is only applied to types that are included with the " "Python core. Extension modules may not necessarily be compatible with this " @@ -1861,7 +1861,7 @@ msgid "" "interpreter to determine that. See :issue:`1878` for some discussion.)" msgstr "" -#: ../../whatsnew/2.6.rst:1722 +#: ../../whatsnew/2.6.rst:1716 msgid "" "Function calls that use keyword arguments are significantly faster by doing " "a quick pointer comparison, usually saving the time of a full string " @@ -1869,21 +1869,21 @@ msgid "" "implementation by Antoine Pitrou; :issue:`1819`.)" msgstr "" -#: ../../whatsnew/2.6.rst:1727 +#: ../../whatsnew/2.6.rst:1721 msgid "" "All of the functions in the :mod:`struct` module have been rewritten in C, " "thanks to work at the Need For Speed sprint. (Contributed by Raymond " "Hettinger.)" msgstr "" -#: ../../whatsnew/2.6.rst:1731 +#: ../../whatsnew/2.6.rst:1725 msgid "" "Some of the standard built-in types now set a bit in their type objects. " "This speeds up checking whether an object is a subclass of one of these " "types. (Contributed by Neal Norwitz.)" msgstr "" -#: ../../whatsnew/2.6.rst:1735 +#: ../../whatsnew/2.6.rst:1729 msgid "" "Unicode strings now use faster code for detecting whitespace and line " "breaks; this speeds up the :meth:`split` method by about 25% and :meth:" @@ -1891,24 +1891,24 @@ msgid "" "reduced by using pymalloc for the Unicode string's data." msgstr "" -#: ../../whatsnew/2.6.rst:1741 +#: ../../whatsnew/2.6.rst:1735 msgid "" "The ``with`` statement now stores the :meth:`~object.__exit__` method on the " "stack, producing a small speedup. (Implemented by Jeffrey Yasskin.)" msgstr "" -#: ../../whatsnew/2.6.rst:1744 +#: ../../whatsnew/2.6.rst:1738 msgid "" "To reduce memory usage, the garbage collector will now clear internal free " "lists when garbage-collecting the highest generation of objects. This may " "return memory to the operating system sooner." msgstr "" -#: ../../whatsnew/2.6.rst:1753 +#: ../../whatsnew/2.6.rst:1747 msgid "Interpreter Changes" msgstr "" -#: ../../whatsnew/2.6.rst:1755 +#: ../../whatsnew/2.6.rst:1749 msgid "" "Two command-line options have been reserved for use by other Python " "implementations. The :option:`-J` switch has been reserved for use by " @@ -1919,7 +1919,7 @@ msgid "" "the option isn't currently used." msgstr "" -#: ../../whatsnew/2.6.rst:1763 +#: ../../whatsnew/2.6.rst:1757 msgid "" "Python can now be prevented from writing :file:`.pyc` or :file:`.pyo` files " "by supplying the :option:`-B` switch to the Python interpreter, or by " @@ -1930,7 +1930,7 @@ msgid "" "and Georg Brandl.)" msgstr "" -#: ../../whatsnew/2.6.rst:1771 +#: ../../whatsnew/2.6.rst:1765 msgid "" "The encoding used for standard input, output, and standard error can be " "specified by setting the :envvar:`PYTHONIOENCODING` environment variable " @@ -1942,11 +1942,11 @@ msgid "" "\"replace\". (Contributed by Martin von Löwis.)" msgstr "" -#: ../../whatsnew/2.6.rst:1784 +#: ../../whatsnew/2.6.rst:1778 msgid "New and Improved Modules" msgstr "" -#: ../../whatsnew/2.6.rst:1786 +#: ../../whatsnew/2.6.rst:1780 msgid "" "As in every release, Python's standard library received a number of " "enhancements and bug fixes. Here's a partial list of the most notable " @@ -1955,14 +1955,14 @@ msgid "" "the Subversion logs for all the details." msgstr "" -#: ../../whatsnew/2.6.rst:1792 +#: ../../whatsnew/2.6.rst:1786 msgid "" -"The :mod:`asyncore` and :mod:`asynchat` modules are being actively " +"The :mod:`!asyncore` and :mod:`!asynchat` modules are being actively " "maintained again, and a number of patches and bugfixes were applied. " "(Maintained by Josiah Carlson; see :issue:`1736190` for one patch.)" msgstr "" -#: ../../whatsnew/2.6.rst:1797 +#: ../../whatsnew/2.6.rst:1791 msgid "" "The :mod:`bsddb` module also has a new maintainer, Jesús Cea Avión, and the " "package is now available as a standalone package. The web page for the " @@ -1972,14 +1972,14 @@ msgid "" "frequent than Python's." msgstr "" -#: ../../whatsnew/2.6.rst:1805 +#: ../../whatsnew/2.6.rst:1799 msgid "" "The :mod:`bsddb.dbshelve` module now uses the highest pickling protocol " "available, instead of restricting itself to protocol 1. (Contributed by W. " "Barnes.)" msgstr "" -#: ../../whatsnew/2.6.rst:1809 +#: ../../whatsnew/2.6.rst:1803 msgid "" "The :mod:`cgi` module will now read variables from the query string of an " "HTTP POST request. This makes it possible to use form actions with URLs " @@ -1987,7 +1987,7 @@ msgid "" "(Contributed by Alexandre Fiori and Nubis; :issue:`1817`.)" msgstr "" -#: ../../whatsnew/2.6.rst:1815 +#: ../../whatsnew/2.6.rst:1809 msgid "" "The :func:`parse_qs` and :func:`parse_qsl` functions have been relocated " "from the :mod:`cgi` module to the :mod:`urlparse` module. The versions still " @@ -1995,43 +1995,43 @@ msgid "" "`PendingDeprecationWarning` messages in 2.6 (:issue:`600362`)." msgstr "" -#: ../../whatsnew/2.6.rst:1821 +#: ../../whatsnew/2.6.rst:1815 msgid "" "The :mod:`cmath` module underwent extensive revision, contributed by Mark " "Dickinson and Christian Heimes. Five new functions were added:" msgstr "" -#: ../../whatsnew/2.6.rst:1825 +#: ../../whatsnew/2.6.rst:1819 msgid "" ":func:`polar` converts a complex number to polar form, returning the modulus " "and argument of the complex number." msgstr "" -#: ../../whatsnew/2.6.rst:1828 +#: ../../whatsnew/2.6.rst:1822 msgid "" ":func:`rect` does the opposite, turning a modulus, argument pair back into " "the corresponding complex number." msgstr "" -#: ../../whatsnew/2.6.rst:1831 +#: ../../whatsnew/2.6.rst:1825 msgid "" ":func:`phase` returns the argument (also called the angle) of a complex " "number." msgstr "" -#: ../../whatsnew/2.6.rst:1834 +#: ../../whatsnew/2.6.rst:1828 msgid "" ":func:`isnan` returns True if either the real or imaginary part of its " "argument is a NaN." msgstr "" -#: ../../whatsnew/2.6.rst:1837 +#: ../../whatsnew/2.6.rst:1831 msgid "" ":func:`isinf` returns True if either the real or imaginary part of its " "argument is infinite." msgstr "" -#: ../../whatsnew/2.6.rst:1840 +#: ../../whatsnew/2.6.rst:1834 msgid "" "The revisions also improved the numerical soundness of the :mod:`cmath` " "module. For all functions, the real and imaginary parts of the results are " @@ -2040,27 +2040,27 @@ msgid "" "`atanh`: and :func:`atan` have also been corrected." msgstr "" -#: ../../whatsnew/2.6.rst:1847 +#: ../../whatsnew/2.6.rst:1841 msgid "" "The tests for the module have been greatly expanded; nearly 2000 new test " "cases exercise the algebraic functions." msgstr "" -#: ../../whatsnew/2.6.rst:1850 +#: ../../whatsnew/2.6.rst:1844 msgid "" "On IEEE 754 platforms, the :mod:`cmath` module now handles IEEE 754 special " "values and floating-point exceptions in a manner consistent with Annex 'G' " "of the C99 standard." msgstr "" -#: ../../whatsnew/2.6.rst:1854 +#: ../../whatsnew/2.6.rst:1848 msgid "" "A new data type in the :mod:`collections` module: ``namedtuple(typename, " "fieldnames)`` is a factory function that creates subclasses of the standard " "tuple whose fields are accessible by name as well as index. For example::" msgstr "" -#: ../../whatsnew/2.6.rst:1876 +#: ../../whatsnew/2.6.rst:1870 msgid "" "Several places in the standard library that returned tuples have been " "modified to return :func:`namedtuple` instances. For example, the :meth:" @@ -2068,7 +2068,7 @@ msgid "" "`digits`, and :attr:`exponent` fields." msgstr "" -#: ../../whatsnew/2.6.rst:1883 +#: ../../whatsnew/2.6.rst:1877 msgid "" "Another change to the :mod:`collections` module is that the :class:`deque` " "type now supports an optional *maxlen* parameter; if supplied, the deque's " @@ -2076,7 +2076,7 @@ msgid "" "to a full deque causes old items to be discarded." msgstr "" -#: ../../whatsnew/2.6.rst:1904 +#: ../../whatsnew/2.6.rst:1898 msgid "" "The :mod:`Cookie` module's :class:`Morsel` objects now support an :attr:" "`httponly` attribute. In some browsers. cookies with this attribute set " @@ -2084,14 +2084,14 @@ msgid "" "Schnell; :issue:`1638033`.)" msgstr "" -#: ../../whatsnew/2.6.rst:1909 +#: ../../whatsnew/2.6.rst:1903 msgid "" "A new window method in the :mod:`curses` module, :meth:`chgat`, changes the " "display attributes for a certain number of characters on a single line. " "(Contributed by Fabian Kreutz.)" msgstr "" -#: ../../whatsnew/2.6.rst:1919 +#: ../../whatsnew/2.6.rst:1913 msgid "" "The :class:`Textbox` class in the :mod:`curses.textpad` module now supports " "editing in insert mode as well as overwrite mode. Insert mode is enabled by " @@ -2099,7 +2099,7 @@ msgid "" "class:`Textbox` instance." msgstr "" -#: ../../whatsnew/2.6.rst:1924 +#: ../../whatsnew/2.6.rst:1918 msgid "" "The :mod:`datetime` module's :meth:`strftime` methods now support a ``%f`` " "format code that expands to the number of microseconds in the object, zero-" @@ -2107,7 +2107,7 @@ msgid "" "`1158`.)" msgstr "" -#: ../../whatsnew/2.6.rst:1929 +#: ../../whatsnew/2.6.rst:1923 msgid "" "The :mod:`decimal` module was updated to version 1.66 of `the General " "Decimal Specification `__. " @@ -2115,26 +2115,26 @@ msgid "" "as :meth:`exp` and :meth:`log10`::" msgstr "" -#: ../../whatsnew/2.6.rst:1941 +#: ../../whatsnew/2.6.rst:1935 msgid "" "The :meth:`as_tuple` method of :class:`Decimal` objects now returns a named " "tuple with :attr:`sign`, :attr:`digits`, and :attr:`exponent` fields." msgstr "" -#: ../../whatsnew/2.6.rst:1944 +#: ../../whatsnew/2.6.rst:1938 msgid "" "(Implemented by Facundo Batista and Mark Dickinson. Named tuple support " "added by Raymond Hettinger.)" msgstr "" -#: ../../whatsnew/2.6.rst:1947 +#: ../../whatsnew/2.6.rst:1941 msgid "" "The :mod:`difflib` module's :class:`SequenceMatcher` class now returns named " "tuples representing matches, with :attr:`a`, :attr:`b`, and :attr:`size` " "attributes. (Contributed by Raymond Hettinger.)" msgstr "" -#: ../../whatsnew/2.6.rst:1952 +#: ../../whatsnew/2.6.rst:1946 msgid "" "An optional ``timeout`` parameter, specifying a timeout measured in seconds, " "was added to the :class:`ftplib.FTP` class constructor as well as the :meth:" @@ -2144,7 +2144,7 @@ msgid "" "data has been sent. (Contributed by Phil Schwartz; :issue:`1221598`.)" msgstr "" -#: ../../whatsnew/2.6.rst:1960 +#: ../../whatsnew/2.6.rst:1954 msgid "" "The :func:`reduce` built-in function is also available in the :mod:" "`functools` module. In Python 3.0, the builtin has been dropped and :func:" @@ -2153,7 +2153,7 @@ msgid "" "issue:`1739906`.)" msgstr "" -#: ../../whatsnew/2.6.rst:1966 +#: ../../whatsnew/2.6.rst:1960 msgid "" "When possible, the :mod:`getpass` module will now use :file:`/dev/tty` to " "print a prompt message and read the password, falling back to standard error " @@ -2162,14 +2162,14 @@ msgid "" "P. Smith.)" msgstr "" -#: ../../whatsnew/2.6.rst:1972 +#: ../../whatsnew/2.6.rst:1966 msgid "" "The :func:`glob.glob` function can now return Unicode filenames if a Unicode " "path was used and Unicode filenames are matched within the directory. (:" "issue:`1001604`)" msgstr "" -#: ../../whatsnew/2.6.rst:1976 +#: ../../whatsnew/2.6.rst:1970 msgid "" "A new function in the :mod:`heapq` module, ``merge(iter1, iter2, ...)``, " "takes any number of iterables returning data in sorted order, and returns a " @@ -2177,14 +2177,14 @@ msgid "" "order. For example::" msgstr "" -#: ../../whatsnew/2.6.rst:1984 +#: ../../whatsnew/2.6.rst:1978 msgid "" "Another new function, ``heappushpop(heap, item)``, pushes *item* onto " "*heap*, then pops off and returns the smallest item. This is more efficient " "than making a call to :func:`heappush` and then :func:`heappop`." msgstr "" -#: ../../whatsnew/2.6.rst:1989 +#: ../../whatsnew/2.6.rst:1983 msgid "" ":mod:`heapq` is now implemented to only use less-than comparison, instead of " "the less-than-or-equal comparison it previously used. This makes :mod:" @@ -2192,14 +2192,14 @@ msgid "" "by Raymond Hettinger.)" msgstr "" -#: ../../whatsnew/2.6.rst:1995 +#: ../../whatsnew/2.6.rst:1989 msgid "" "An optional ``timeout`` parameter, specifying a timeout measured in seconds, " "was added to the :class:`httplib.HTTPConnection` and :class:" "`HTTPSConnection` class constructors. (Added by Facundo Batista.)" msgstr "" -#: ../../whatsnew/2.6.rst:2000 +#: ../../whatsnew/2.6.rst:1994 msgid "" "Most of the :mod:`inspect` module's functions, such as :func:`getmoduleinfo` " "and :func:`getargs`, now return named tuples. In addition to behaving like " @@ -2207,55 +2207,55 @@ msgid "" "attributes. (Contributed by Raymond Hettinger.)" msgstr "" -#: ../../whatsnew/2.6.rst:2006 +#: ../../whatsnew/2.6.rst:2000 msgid "" "Some new functions in the module include :func:`isgenerator`, :func:" "`isgeneratorfunction`, and :func:`isabstract`." msgstr "" -#: ../../whatsnew/2.6.rst:2010 +#: ../../whatsnew/2.6.rst:2004 msgid "The :mod:`itertools` module gained several new functions." msgstr "" -#: ../../whatsnew/2.6.rst:2012 +#: ../../whatsnew/2.6.rst:2006 msgid "" "``izip_longest(iter1, iter2, ...[, fillvalue])`` makes tuples from each of " "the elements; if some of the iterables are shorter than others, the missing " "values are set to *fillvalue*. For example::" msgstr "" -#: ../../whatsnew/2.6.rst:2019 +#: ../../whatsnew/2.6.rst:2013 msgid "" "``product(iter1, iter2, ..., [repeat=N])`` returns the Cartesian product of " "the supplied iterables, a set of tuples containing every possible " "combination of the elements returned from each iterable. ::" msgstr "" -#: ../../whatsnew/2.6.rst:2028 +#: ../../whatsnew/2.6.rst:2022 msgid "" "The optional *repeat* keyword argument is used for taking the product of an " "iterable or a set of iterables with themselves, repeated *N* times. With a " "single iterable argument, *N*-tuples are returned::" msgstr "" -#: ../../whatsnew/2.6.rst:2037 +#: ../../whatsnew/2.6.rst:2031 msgid "With two iterables, *2N*-tuples are returned. ::" msgstr "" -#: ../../whatsnew/2.6.rst:2045 +#: ../../whatsnew/2.6.rst:2039 msgid "" "``combinations(iterable, r)`` returns sub-sequences of length *r* from the " "elements of *iterable*. ::" msgstr "" -#: ../../whatsnew/2.6.rst:2056 +#: ../../whatsnew/2.6.rst:2050 msgid "" "``permutations(iter[, r])`` returns all the permutations of length *r* of " "the iterable's elements. If *r* is not specified, it will default to the " "number of elements produced by the iterable. ::" msgstr "" -#: ../../whatsnew/2.6.rst:2066 +#: ../../whatsnew/2.6.rst:2060 msgid "" "``itertools.chain(*iterables)`` is an existing function in :mod:`itertools` " "that gained a new constructor in Python 2.6. ``itertools.chain." @@ -2264,11 +2264,11 @@ msgid "" "iterable, then all the elements of the second, and so on. ::" msgstr "" -#: ../../whatsnew/2.6.rst:2076 +#: ../../whatsnew/2.6.rst:2070 msgid "(All contributed by Raymond Hettinger.)" msgstr "" -#: ../../whatsnew/2.6.rst:2078 +#: ../../whatsnew/2.6.rst:2072 msgid "" "The :mod:`logging` module's :class:`FileHandler` class and its subclasses :" "class:`WatchedFileHandler`, :class:`RotatingFileHandler`, and :class:" @@ -2277,68 +2277,68 @@ msgid "" "the first :meth:`emit` call is made. (Contributed by Vinay Sajip.)" msgstr "" -#: ../../whatsnew/2.6.rst:2085 +#: ../../whatsnew/2.6.rst:2079 msgid "" ":class:`TimedRotatingFileHandler` also has a *utc* constructor parameter. " "If the argument is true, UTC time will be used in determining when midnight " "occurs and in generating filenames; otherwise local time will be used." msgstr "" -#: ../../whatsnew/2.6.rst:2090 +#: ../../whatsnew/2.6.rst:2084 msgid "Several new functions were added to the :mod:`math` module:" msgstr "" -#: ../../whatsnew/2.6.rst:2092 +#: ../../whatsnew/2.6.rst:2086 msgid "" ":func:`~math.isinf` and :func:`~math.isnan` determine whether a given float " "is a (positive or negative) infinity or a NaN (Not a Number), respectively." msgstr "" -#: ../../whatsnew/2.6.rst:2095 +#: ../../whatsnew/2.6.rst:2089 msgid "" ":func:`~math.copysign` copies the sign bit of an IEEE 754 number, returning " "the absolute value of *x* combined with the sign bit of *y*. For example, " "``math.copysign(1, -0.0)`` returns -1.0. (Contributed by Christian Heimes.)" msgstr "" -#: ../../whatsnew/2.6.rst:2100 +#: ../../whatsnew/2.6.rst:2094 msgid "" ":func:`~math.factorial` computes the factorial of a number. (Contributed by " "Raymond Hettinger; :issue:`2138`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2103 +#: ../../whatsnew/2.6.rst:2097 msgid "" ":func:`~math.fsum` adds up the stream of numbers from an iterable, and is " "careful to avoid loss of precision through using partial sums. (Contributed " "by Jean Brouwers, Raymond Hettinger, and Mark Dickinson; :issue:`2819`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2108 +#: ../../whatsnew/2.6.rst:2102 msgid "" ":func:`~math.acosh`, :func:`~math.asinh` and :func:`~math.atanh` compute the " "inverse hyperbolic functions." msgstr "" -#: ../../whatsnew/2.6.rst:2111 +#: ../../whatsnew/2.6.rst:2105 msgid ":func:`~math.log1p` returns the natural logarithm of *1+x* (base *e*)." msgstr "" -#: ../../whatsnew/2.6.rst:2114 +#: ../../whatsnew/2.6.rst:2108 msgid "" ":func:`trunc` rounds a number toward zero, returning the closest :class:" "`Integral` that's between the function's argument and zero. Added as part of " "the backport of `PEP 3141's type hierarchy for numbers <#pep-3141>`__." msgstr "" -#: ../../whatsnew/2.6.rst:2119 +#: ../../whatsnew/2.6.rst:2113 msgid "" "The :mod:`math` module has been improved to give more consistent behaviour " "across platforms, especially with respect to handling of floating-point " "exceptions and IEEE 754 special values." msgstr "" -#: ../../whatsnew/2.6.rst:2123 +#: ../../whatsnew/2.6.rst:2117 msgid "" "Whenever possible, the module follows the recommendations of the C99 " "standard about 754's special values. For example, ``sqrt(-1.)`` should now " @@ -2350,11 +2350,11 @@ msgid "" "`OverflowError`. (See :issue:`711019` and :issue:`1640`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2133 +#: ../../whatsnew/2.6.rst:2127 msgid "(Contributed by Christian Heimes and Mark Dickinson.)" msgstr "(由 Christian Heimes 和 Mark Dickinson 所貢獻。)" -#: ../../whatsnew/2.6.rst:2135 +#: ../../whatsnew/2.6.rst:2129 msgid "" ":class:`~mmap.mmap` objects now have a :meth:`rfind` method that searches " "for a substring beginning at the end of the string and searching backwards. " @@ -2362,28 +2362,28 @@ msgid "" "which to stop searching. (Contributed by John Lenton.)" msgstr "" -#: ../../whatsnew/2.6.rst:2141 +#: ../../whatsnew/2.6.rst:2135 msgid "" "The :mod:`operator` module gained a :func:`methodcaller` function that takes " "a name and an optional set of arguments, returning a callable that will call " "the named function on any arguments passed to it. For example::" msgstr "" -#: ../../whatsnew/2.6.rst:2151 +#: ../../whatsnew/2.6.rst:2145 msgid "(Contributed by Georg Brandl, after a suggestion by Gregory Petrosyan.)" msgstr "(經 Gregory Petrosyan 建議後由 Georg Brandl 所貢獻。)" -#: ../../whatsnew/2.6.rst:2153 +#: ../../whatsnew/2.6.rst:2147 msgid "" "The :func:`attrgetter` function now accepts dotted names and performs the " "corresponding attribute lookups::" msgstr "" -#: ../../whatsnew/2.6.rst:2163 +#: ../../whatsnew/2.6.rst:2157 msgid "(Contributed by Georg Brandl, after a suggestion by Barry Warsaw.)" msgstr "(經 Barry Warsaw 建議後由 Georg Brandl 所貢獻。)" -#: ../../whatsnew/2.6.rst:2165 +#: ../../whatsnew/2.6.rst:2159 msgid "" "The :mod:`os` module now wraps several new system calls. ``fchmod(fd, " "mode)`` and ``fchown(fd, uid, gid)`` change the mode and ownership of an " @@ -2391,7 +2391,7 @@ msgid "" "(Contributed by Georg Brandl and Christian Heimes.)" msgstr "" -#: ../../whatsnew/2.6.rst:2171 +#: ../../whatsnew/2.6.rst:2165 msgid "" ":func:`chflags` and :func:`lchflags` are wrappers for the corresponding " "system calls (where they're available), changing the flags set on a file. " @@ -2401,7 +2401,7 @@ msgid "" "the file. (Contributed by M. Levinson.)" msgstr "" -#: ../../whatsnew/2.6.rst:2179 +#: ../../whatsnew/2.6.rst:2173 msgid "" "``os.closerange(low, high)`` efficiently closes all file descriptors from " "*low* to *high*, ignoring any errors and not including *high* itself. This " @@ -2409,14 +2409,14 @@ msgid "" "processes faster. (Contributed by Georg Brandl; :issue:`1663329`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2184 +#: ../../whatsnew/2.6.rst:2178 msgid "" "The ``os.environ`` object's :meth:`clear` method will now unset the " "environment variables using :func:`os.unsetenv` in addition to clearing the " "object's keys. (Contributed by Martin Horcicka; :issue:`1181`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2188 +#: ../../whatsnew/2.6.rst:2182 msgid "" "The :func:`os.walk` function now has a ``followlinks`` parameter. If set to " "True, it will follow symlinks pointing to directories and visit the " @@ -2425,7 +2425,7 @@ msgid "" "if there's a symlink that points to a parent directory. (:issue:`1273829`)" msgstr "" -#: ../../whatsnew/2.6.rst:2195 +#: ../../whatsnew/2.6.rst:2189 msgid "" "In the :mod:`os.path` module, the :func:`splitext` function has been changed " "to not split on leading period characters. This produces better results when " @@ -2434,7 +2434,7 @@ msgid "" "`1115886`)" msgstr "" -#: ../../whatsnew/2.6.rst:2202 +#: ../../whatsnew/2.6.rst:2196 msgid "" "A new function, ``os.path.relpath(path, start='.')``, returns a relative " "path from the ``start`` path, if it's supplied, or from the current working " @@ -2442,14 +2442,14 @@ msgid "" "issue:`1339796`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2207 +#: ../../whatsnew/2.6.rst:2201 msgid "" "On Windows, :func:`os.path.expandvars` will now expand environment variables " "given in the form \"%var%\", and \"~user\" will be expanded into the user's " "home directory path. (Contributed by Josiah Carlson; :issue:`957650`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2212 +#: ../../whatsnew/2.6.rst:2206 msgid "" "The Python debugger provided by the :mod:`pdb` module gained a new command: " "\"run\" restarts the Python program being debugged and can optionally take " @@ -2457,14 +2457,14 @@ msgid "" "Bernstein; :issue:`1393667`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2217 +#: ../../whatsnew/2.6.rst:2211 msgid "" "The :func:`pdb.post_mortem` function, used to begin debugging a traceback, " "will now use the traceback returned by :func:`sys.exc_info` if no traceback " "is supplied. (Contributed by Facundo Batista; :issue:`1106316`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2222 +#: ../../whatsnew/2.6.rst:2216 msgid "" "The :mod:`pickletools` module now has an :func:`optimize` function that " "takes a string containing a pickle and removes some unused opcodes, " @@ -2472,25 +2472,25 @@ msgid "" "(Contributed by Raymond Hettinger.)" msgstr "" -#: ../../whatsnew/2.6.rst:2227 +#: ../../whatsnew/2.6.rst:2221 msgid "" "A :func:`get_data` function was added to the :mod:`pkgutil` module that " "returns the contents of resource files included with an installed Python " "package. For example::" msgstr "" -#: ../../whatsnew/2.6.rst:2242 +#: ../../whatsnew/2.6.rst:2236 msgid "(Contributed by Paul Moore; :issue:`2439`.)" msgstr "(由 Paul Moore 貢獻;:issue:`2439`。)" -#: ../../whatsnew/2.6.rst:2244 +#: ../../whatsnew/2.6.rst:2238 msgid "" "The :mod:`pyexpat` module's :class:`Parser` objects now allow setting their :" "attr:`buffer_size` attribute to change the size of the buffer used to hold " "character data. (Contributed by Achim Gaedke; :issue:`1137`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2249 +#: ../../whatsnew/2.6.rst:2243 msgid "" "The :mod:`Queue` module now provides queue variants that retrieve entries in " "different orders. The :class:`PriorityQueue` class stores queued items in a " @@ -2499,7 +2499,7 @@ msgid "" "(Contributed by Raymond Hettinger.)" msgstr "" -#: ../../whatsnew/2.6.rst:2256 +#: ../../whatsnew/2.6.rst:2250 msgid "" "The :mod:`random` module's :class:`Random` objects can now be pickled on a " "32-bit system and unpickled on a 64-bit system, and vice versa. " @@ -2508,7 +2508,7 @@ msgid "" "(Contributed by Shawn Ligocki; :issue:`1727780`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2263 +#: ../../whatsnew/2.6.rst:2257 msgid "" "The new ``triangular(low, high, mode)`` function returns random numbers " "following a triangular distribution. The returned values are between *low* " @@ -2517,14 +2517,14 @@ msgid "" "der Laan and Raymond Hettinger; :issue:`1681432`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2270 +#: ../../whatsnew/2.6.rst:2264 msgid "" "Long regular expression searches carried out by the :mod:`re` module will " "check for signals being delivered, so time-consuming searches can now be " "interrupted. (Contributed by Josh Hoyt and Ralf Schmitt; :issue:`846388`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2275 +#: ../../whatsnew/2.6.rst:2269 msgid "" "The regular expression module is implemented by compiling bytecodes for a " "tiny regex-specific virtual machine. Untrusted code could create malicious " @@ -2533,14 +2533,14 @@ msgid "" "for Google App Engine; :issue:`3487`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2282 +#: ../../whatsnew/2.6.rst:2276 msgid "" "The :mod:`rlcompleter` module's :meth:`Completer.complete()` method will now " "ignore exceptions triggered while evaluating a name. (Fixed by Lorenz " "Quack; :issue:`2250`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2286 +#: ../../whatsnew/2.6.rst:2280 msgid "" "The :mod:`sched` module's :class:`scheduler` instances now have a read-only :" "attr:`queue` attribute that returns the contents of the scheduler's queue, " @@ -2548,7 +2548,7 @@ msgid "" "action, argument)``. (Contributed by Raymond Hettinger; :issue:`1861`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2292 +#: ../../whatsnew/2.6.rst:2286 msgid "" "The :mod:`select` module now has wrapper functions for the Linux :c:func:`!" "epoll` and BSD :c:func:`!kqueue` system calls. :meth:`modify` method was " @@ -2558,7 +2558,7 @@ msgid "" "Heimes; :issue:`1657`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2300 +#: ../../whatsnew/2.6.rst:2294 msgid "" "The :func:`shutil.copytree` function now has an optional *ignore* argument " "that takes a callable object. This callable will receive each directory " @@ -2566,7 +2566,7 @@ msgid "" "that will be ignored, not copied." msgstr "" -#: ../../whatsnew/2.6.rst:2305 +#: ../../whatsnew/2.6.rst:2299 msgid "" "The :mod:`shutil` module also provides an :func:`ignore_patterns` function " "for use with this new parameter. :func:`ignore_patterns` takes an arbitrary " @@ -2576,11 +2576,11 @@ msgid "" "Emacs backup files, which have names ending with '~'::" msgstr "" -#: ../../whatsnew/2.6.rst:2316 +#: ../../whatsnew/2.6.rst:2310 msgid "(Contributed by Tarek Ziadé; :issue:`2663`.)" msgstr "(由 Tarek Ziadé 貢獻;:issue:`2663`。)" -#: ../../whatsnew/2.6.rst:2318 +#: ../../whatsnew/2.6.rst:2312 msgid "" "Integrating signal handling with GUI handling event loops like those used by " "Tkinter or GTk+ has long been a problem; most software ends up polling, " @@ -2592,7 +2592,7 @@ msgid "" "descriptor." msgstr "" -#: ../../whatsnew/2.6.rst:2328 +#: ../../whatsnew/2.6.rst:2322 msgid "" "Event loops will use this by opening a pipe to create two descriptors, one " "for reading and one for writing. The writable descriptor will be passed to :" @@ -2602,18 +2602,18 @@ msgid "" "loop will be woken up, avoiding the need to poll." msgstr "" -#: ../../whatsnew/2.6.rst:2336 +#: ../../whatsnew/2.6.rst:2330 msgid "(Contributed by Adam Olsen; :issue:`1583`.)" msgstr "(由 Adam Olsen 貢獻;:issue:`1583`。)" -#: ../../whatsnew/2.6.rst:2338 +#: ../../whatsnew/2.6.rst:2332 msgid "" "The :func:`siginterrupt` function is now available from Python code, and " "allows changing whether signals can interrupt system calls or not. " "(Contributed by Ralf Schmitt.)" msgstr "" -#: ../../whatsnew/2.6.rst:2342 +#: ../../whatsnew/2.6.rst:2336 msgid "" "The :func:`setitimer` and :func:`getitimer` functions have also been added " "(where they're available). :func:`setitimer` allows setting interval timers " @@ -2622,7 +2622,7 @@ msgid "" "process+system time. (Contributed by Guilherme Polo; :issue:`2240`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2349 +#: ../../whatsnew/2.6.rst:2343 msgid "" "The :mod:`smtplib` module now supports SMTP over SSL thanks to the addition " "of the :class:`SMTP_SSL` class. This class supports an interface identical " @@ -2632,7 +2632,7 @@ msgid "" "seconds. (Contributed by Facundo Batista.)" msgstr "" -#: ../../whatsnew/2.6.rst:2357 +#: ../../whatsnew/2.6.rst:2351 msgid "" "An implementation of the LMTP protocol (:rfc:`2033`) was also added to the " "module. LMTP is used in place of SMTP when transferring e-mail between " @@ -2640,14 +2640,14 @@ msgid "" "issue:`957003`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2362 +#: ../../whatsnew/2.6.rst:2356 msgid "" ":meth:`SMTP.starttls` now complies with :rfc:`3207` and forgets any " "knowledge obtained from the server not obtained from the TLS negotiation " "itself. (Patch contributed by Bill Fenner; :issue:`829951`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2367 +#: ../../whatsnew/2.6.rst:2361 msgid "" "The :mod:`socket` module now supports TIPC (https://tipc.sourceforge.net/), " "a high-performance non-IP-based protocol designed for use in clustered " @@ -2655,7 +2655,7 @@ msgid "" "Bertogli; :issue:`1646`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2372 +#: ../../whatsnew/2.6.rst:2366 msgid "" "A new function, :func:`create_connection`, takes an address and connects to " "it using an optional timeout value, returning the connected socket object. " @@ -2665,7 +2665,7 @@ msgid "" "make your code work with IPv6." msgstr "" -#: ../../whatsnew/2.6.rst:2380 +#: ../../whatsnew/2.6.rst:2374 msgid "" "The base classes in the :mod:`SocketServer` module now support calling a :" "meth:`handle_timeout` method after a span of inactivity specified by the " @@ -2676,19 +2676,19 @@ msgid "" "`742598`, :issue:`1193577`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2389 +#: ../../whatsnew/2.6.rst:2383 msgid "" "The :mod:`sqlite3` module, maintained by Gerhard Häring, has been updated " "from version 2.3.2 in Python 2.5 to version 2.4.1." msgstr "" -#: ../../whatsnew/2.6.rst:2393 +#: ../../whatsnew/2.6.rst:2387 msgid "" "The :mod:`struct` module now supports the C99 :c:expr:`_Bool` type, using " "the format character ``'?'``. (Contributed by David Remahl.)" msgstr "" -#: ../../whatsnew/2.6.rst:2397 +#: ../../whatsnew/2.6.rst:2391 msgid "" "The :class:`Popen` objects provided by the :mod:`subprocess` module now " "have :meth:`terminate`, :meth:`kill`, and :meth:`send_signal` methods. On " @@ -2697,7 +2697,7 @@ msgid "" "`TerminateProcess`. (Contributed by Christian Heimes.)" msgstr "" -#: ../../whatsnew/2.6.rst:2404 +#: ../../whatsnew/2.6.rst:2398 msgid "" "A new variable in the :mod:`sys` module, :attr:`float_info`, is an object " "containing information derived from the :file:`float.h` file about the " @@ -2707,7 +2707,7 @@ msgid "" "several others. (Contributed by Christian Heimes; :issue:`1534`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2412 +#: ../../whatsnew/2.6.rst:2406 msgid "" "Another new variable, :attr:`dont_write_bytecode`, controls whether Python " "writes any :file:`.pyc` or :file:`.pyo` files on importing a module. If this " @@ -2719,7 +2719,7 @@ msgid "" "written or not. (Contributed by Neal Norwitz and Georg Brandl.)" msgstr "" -#: ../../whatsnew/2.6.rst:2423 +#: ../../whatsnew/2.6.rst:2417 msgid "" "Information about the command-line arguments supplied to the Python " "interpreter is available by reading attributes of a named tuple available as " @@ -2728,7 +2728,7 @@ msgid "" "These attributes are all read-only. (Contributed by Christian Heimes.)" msgstr "" -#: ../../whatsnew/2.6.rst:2431 +#: ../../whatsnew/2.6.rst:2425 msgid "" "A new function, :func:`getsizeof`, takes a Python object and returns the " "amount of memory used by the object, measured in bytes. Built-in objects " @@ -2737,14 +2737,14 @@ msgid "" "Schuppenies; :issue:`2898`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2438 +#: ../../whatsnew/2.6.rst:2432 msgid "" "It's now possible to determine the current profiler and tracer functions by " "calling :func:`sys.getprofile` and :func:`sys.gettrace`. (Contributed by " "Georg Brandl; :issue:`1648`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2442 +#: ../../whatsnew/2.6.rst:2436 msgid "" "The :mod:`tarfile` module now supports POSIX.1-2001 (pax) tarfiles in " "addition to the POSIX.1-1988 (ustar) and GNU tar formats that were already " @@ -2752,7 +2752,7 @@ msgid "" "to open a file using a different format::" msgstr "" -#: ../../whatsnew/2.6.rst:2450 +#: ../../whatsnew/2.6.rst:2444 msgid "" "The new ``encoding`` and ``errors`` parameters specify an encoding and an " "error handling scheme for character conversions. ``'strict'``, " @@ -2762,7 +2762,7 @@ msgid "" "PAX format supports Unicode filenames, defaulting to UTF-8 encoding.)" msgstr "" -#: ../../whatsnew/2.6.rst:2458 +#: ../../whatsnew/2.6.rst:2452 msgid "" "The :meth:`TarFile.add` method now accepts an ``exclude`` argument that's a " "function that can be used to exclude certain filenames from an archive. The " @@ -2772,18 +2772,18 @@ msgid "" "added directories." msgstr "" -#: ../../whatsnew/2.6.rst:2466 +#: ../../whatsnew/2.6.rst:2460 msgid "(All changes contributed by Lars Gustäbel)." msgstr "" -#: ../../whatsnew/2.6.rst:2468 +#: ../../whatsnew/2.6.rst:2462 msgid "" "An optional ``timeout`` parameter was added to the :class:`telnetlib.Telnet` " "class constructor, specifying a timeout measured in seconds. (Added by " "Facundo Batista.)" msgstr "" -#: ../../whatsnew/2.6.rst:2472 +#: ../../whatsnew/2.6.rst:2466 msgid "" "The :class:`tempfile.NamedTemporaryFile` class usually deletes the temporary " "file it created when the file is closed. This behaviour can now be changed " @@ -2791,7 +2791,7 @@ msgid "" "Miller; :issue:`1537850`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2477 +#: ../../whatsnew/2.6.rst:2471 msgid "" "A new class, :class:`SpooledTemporaryFile`, behaves like a temporary file " "but stores its data in memory until a maximum size is exceeded. On reaching " @@ -2799,7 +2799,7 @@ msgid "" "(Contributed by Dustin J. Mitchell.)" msgstr "" -#: ../../whatsnew/2.6.rst:2482 +#: ../../whatsnew/2.6.rst:2476 msgid "" "The :class:`NamedTemporaryFile` and :class:`SpooledTemporaryFile` classes " "both work as context managers, so you can write ``with tempfile." @@ -2807,7 +2807,7 @@ msgid "" "issue:`2021`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2487 +#: ../../whatsnew/2.6.rst:2481 msgid "" "The :mod:`test.test_support` module gained a number of context managers " "useful for writing tests. :func:`EnvironmentVarGuard` is a context manager " @@ -2815,7 +2815,7 @@ msgid "" "them to their old values." msgstr "" -#: ../../whatsnew/2.6.rst:2493 +#: ../../whatsnew/2.6.rst:2487 msgid "" "Another context manager, :class:`TransientResource`, can surround calls to " "resources that may or may not be available; it will catch and ignore a " @@ -2823,29 +2823,29 @@ msgid "" "certain failures when connecting to an external web site::" msgstr "" -#: ../../whatsnew/2.6.rst:2504 +#: ../../whatsnew/2.6.rst:2498 msgid "" "Finally, :func:`check_warnings` resets the :mod:`warning` module's warning " "filters and returns an object that will record all warning messages " "triggered (:issue:`3781`)::" msgstr "" -#: ../../whatsnew/2.6.rst:2514 +#: ../../whatsnew/2.6.rst:2508 msgid "(Contributed by Brett Cannon.)" msgstr "(由 Brett Cannon 貢獻。)" -#: ../../whatsnew/2.6.rst:2516 +#: ../../whatsnew/2.6.rst:2510 msgid "" "The :mod:`textwrap` module can now preserve existing whitespace at the " "beginnings and ends of the newly created lines by specifying " "``drop_whitespace=False`` as an argument::" msgstr "" -#: ../../whatsnew/2.6.rst:2535 +#: ../../whatsnew/2.6.rst:2529 msgid "(Contributed by Dwayne Bailey; :issue:`1581073`.)" msgstr "(由 Dwayne Bailey 貢獻;:issue:`1581073`。)" -#: ../../whatsnew/2.6.rst:2537 +#: ../../whatsnew/2.6.rst:2531 msgid "" "The :mod:`threading` module API is being changed to use properties such as :" "attr:`daemon` instead of :meth:`setDaemon` and :meth:`isDaemon` methods, and " @@ -2858,14 +2858,14 @@ msgid "" "Peterson.)" msgstr "" -#: ../../whatsnew/2.6.rst:2548 +#: ../../whatsnew/2.6.rst:2542 msgid "" "The :mod:`threading` module's :class:`Thread` objects gained an :attr:" "`ident` property that returns the thread's identifier, a nonzero integer. " "(Contributed by Gregory P. Smith; :issue:`2871`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2553 +#: ../../whatsnew/2.6.rst:2547 msgid "" "The :mod:`timeit` module now accepts callables as well as strings for the " "statement being timed and for the setup code. Two convenience functions were " @@ -2875,62 +2875,62 @@ msgid "" "issue:`1533909`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2562 +#: ../../whatsnew/2.6.rst:2556 msgid "" "The :mod:`Tkinter` module now accepts lists and tuples for options, " "separating the elements by spaces before passing the resulting value to Tcl/" "Tk. (Contributed by Guilherme Polo; :issue:`2906`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2567 +#: ../../whatsnew/2.6.rst:2561 msgid "" "The :mod:`turtle` module for turtle graphics was greatly enhanced by Gregor " "Lingl. New features in the module include:" msgstr "" -#: ../../whatsnew/2.6.rst:2570 +#: ../../whatsnew/2.6.rst:2564 msgid "Better animation of turtle movement and rotation." msgstr "" -#: ../../whatsnew/2.6.rst:2571 +#: ../../whatsnew/2.6.rst:2565 msgid "" "Control over turtle movement using the new :meth:`delay`, :meth:`tracer`, " "and :meth:`speed` methods." msgstr "" -#: ../../whatsnew/2.6.rst:2573 +#: ../../whatsnew/2.6.rst:2567 msgid "" "The ability to set new shapes for the turtle, and to define a new coordinate " "system." msgstr "" -#: ../../whatsnew/2.6.rst:2575 +#: ../../whatsnew/2.6.rst:2569 msgid "Turtles now have an :meth:`undo()` method that can roll back actions." msgstr "" -#: ../../whatsnew/2.6.rst:2576 +#: ../../whatsnew/2.6.rst:2570 msgid "" "Simple support for reacting to input events such as mouse and keyboard " "activity, making it possible to write simple games." msgstr "" -#: ../../whatsnew/2.6.rst:2578 +#: ../../whatsnew/2.6.rst:2572 msgid "" "A :file:`turtle.cfg` file can be used to customize the starting appearance " "of the turtle's screen." msgstr "" -#: ../../whatsnew/2.6.rst:2580 +#: ../../whatsnew/2.6.rst:2574 msgid "" "The module's docstrings can be replaced by new docstrings that have been " "translated into another language." msgstr "" -#: ../../whatsnew/2.6.rst:2583 +#: ../../whatsnew/2.6.rst:2577 msgid "(:issue:`1513695`)" msgstr "" -#: ../../whatsnew/2.6.rst:2585 +#: ../../whatsnew/2.6.rst:2579 msgid "" "An optional ``timeout`` parameter was added to the :func:`urllib.urlopen` " "function and the :class:`urllib.ftpwrapper` class constructor, as well as " @@ -2938,17 +2938,17 @@ msgid "" "measured in seconds. For example::" msgstr "" -#: ../../whatsnew/2.6.rst:2598 +#: ../../whatsnew/2.6.rst:2592 msgid "(Added by Facundo Batista.)" msgstr "" -#: ../../whatsnew/2.6.rst:2600 +#: ../../whatsnew/2.6.rst:2594 msgid "" "The Unicode database provided by the :mod:`unicodedata` module has been " "updated to version 5.1.0. (Updated by Martin von Löwis; :issue:`3811`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2604 +#: ../../whatsnew/2.6.rst:2598 msgid "" "The :mod:`warnings` module's :func:`formatwarning` and :func:`showwarning` " "gained an optional *line* argument that can be used to supply the line of " @@ -2956,14 +2956,14 @@ msgid "" "of the :mod:`warnings` module in C code.)" msgstr "" -#: ../../whatsnew/2.6.rst:2609 +#: ../../whatsnew/2.6.rst:2603 msgid "" "A new function, :func:`catch_warnings`, is a context manager intended for " "testing purposes that lets you temporarily modify the warning filters and " "then restore their original values (:issue:`3781`)." msgstr "" -#: ../../whatsnew/2.6.rst:2613 +#: ../../whatsnew/2.6.rst:2607 msgid "" "The XML-RPC :class:`SimpleXMLRPCServer` and :class:`DocXMLRPCServer` classes " "can now be prevented from immediately opening and binding to their socket by " @@ -2974,7 +2974,7 @@ msgid "" "Peter Parente; :issue:`1599845`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2622 +#: ../../whatsnew/2.6.rst:2616 msgid "" ":class:`SimpleXMLRPCServer` also has a :attr:`_send_traceback_header` " "attribute; if true, the exception and formatted traceback are returned as " @@ -2985,7 +2985,7 @@ msgid "" "Code 2007.)" msgstr "" -#: ../../whatsnew/2.6.rst:2630 +#: ../../whatsnew/2.6.rst:2624 msgid "" "The :mod:`xmlrpclib` module no longer automatically converts :class:" "`datetime.date` and :class:`datetime.time` to the :class:`xmlrpclib." @@ -2997,18 +2997,18 @@ msgid "" "by Riku Lindblad; :issue:`2985`)." msgstr "" -#: ../../whatsnew/2.6.rst:2640 +#: ../../whatsnew/2.6.rst:2634 msgid "" "The :mod:`zipfile` module's :class:`ZipFile` class now has :meth:`extract` " "and :meth:`extractall` methods that will unpack a single file or all the " "files in the archive to the current directory, or to a specified directory::" msgstr "" -#: ../../whatsnew/2.6.rst:2654 +#: ../../whatsnew/2.6.rst:2648 msgid "(Contributed by Alan McIntyre; :issue:`467924`.)" msgstr "(由 Alan McIntyre 貢獻;:issue:`467924`。)" -#: ../../whatsnew/2.6.rst:2656 +#: ../../whatsnew/2.6.rst:2650 msgid "" "The :meth:`open`, :meth:`read` and :meth:`extract` methods can now take " "either a filename or a :class:`ZipInfo` object. This is useful when an " @@ -3016,17 +3016,17 @@ msgid "" "Horler; :issue:`1775025`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2661 +#: ../../whatsnew/2.6.rst:2655 msgid "" "Finally, :mod:`zipfile` now supports using Unicode filenames for archived " "files. (Contributed by Alexey Borzenkov; :issue:`1734346`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2668 +#: ../../whatsnew/2.6.rst:2662 msgid "The :mod:`ast` module" msgstr "" -#: ../../whatsnew/2.6.rst:2670 +#: ../../whatsnew/2.6.rst:2664 msgid "" "The :mod:`ast` module provides an Abstract Syntax Tree representation of " "Python code, and Armin Ronacher contributed a set of helper functions that " @@ -3034,17 +3034,17 @@ msgid "" "packages, code analyzers, and similar tools that process Python code." msgstr "" -#: ../../whatsnew/2.6.rst:2677 +#: ../../whatsnew/2.6.rst:2671 msgid "" "The :func:`parse` function takes an expression and returns an AST. The :func:" "`dump` function outputs a representation of a tree, suitable for debugging::" msgstr "" -#: ../../whatsnew/2.6.rst:2691 +#: ../../whatsnew/2.6.rst:2685 msgid "This outputs a deeply nested tree::" msgstr "" -#: ../../whatsnew/2.6.rst:2724 +#: ../../whatsnew/2.6.rst:2718 msgid "" "The :func:`literal_eval` method takes a string or an AST representing a " "literal expression, parses and evaluates it, and returns the resulting " @@ -3054,18 +3054,18 @@ msgid "" "an :func:`eval` call, :func:`literal_eval` will handle it safely::" msgstr "" -#: ../../whatsnew/2.6.rst:2740 +#: ../../whatsnew/2.6.rst:2734 msgid "" "The module also includes :class:`NodeVisitor` and :class:`NodeTransformer` " "classes for traversing and modifying an AST, and functions for common " "transformations such as changing line numbers." msgstr "" -#: ../../whatsnew/2.6.rst:2748 +#: ../../whatsnew/2.6.rst:2742 msgid "The :mod:`future_builtins` module" msgstr "" -#: ../../whatsnew/2.6.rst:2750 +#: ../../whatsnew/2.6.rst:2744 msgid "" "Python 3.0 makes many changes to the repertoire of built-in functions, and " "most of the changes can't be introduced in the Python 2.x series because " @@ -3074,24 +3074,24 @@ msgid "" "compatible code." msgstr "" -#: ../../whatsnew/2.6.rst:2757 +#: ../../whatsnew/2.6.rst:2751 msgid "The functions in this module currently include:" msgstr "" -#: ../../whatsnew/2.6.rst:2759 +#: ../../whatsnew/2.6.rst:2753 msgid "" "``ascii(obj)``: equivalent to :func:`repr`. In Python 3.0, :func:`repr` " "will return a Unicode string, while :func:`ascii` will return a pure ASCII " "bytestring." msgstr "" -#: ../../whatsnew/2.6.rst:2763 +#: ../../whatsnew/2.6.rst:2757 msgid "" "``filter(predicate, iterable)``, ``map(func, iterable1, ...)``: the 3.0 " "versions return iterators, unlike the 2.x builtins which return lists." msgstr "" -#: ../../whatsnew/2.6.rst:2767 +#: ../../whatsnew/2.6.rst:2761 msgid "" "``hex(value)``, ``oct(value)``: instead of calling the :meth:`__hex__` or :" "meth:`__oct__` methods, these versions will call the :meth:`__index__` " @@ -3099,11 +3099,11 @@ msgid "" "the new ``0o`` notation for its result." msgstr "" -#: ../../whatsnew/2.6.rst:2776 +#: ../../whatsnew/2.6.rst:2770 msgid "The :mod:`json` module: JavaScript Object Notation" msgstr "" -#: ../../whatsnew/2.6.rst:2778 +#: ../../whatsnew/2.6.rst:2772 msgid "" "The new :mod:`json` module supports the encoding and decoding of Python " "types in JSON (Javascript Object Notation). JSON is a lightweight " @@ -3111,34 +3111,34 @@ msgid "" "about JSON, see http://www.json.org." msgstr "" -#: ../../whatsnew/2.6.rst:2783 +#: ../../whatsnew/2.6.rst:2777 msgid "" ":mod:`json` comes with support for decoding and encoding most built-in " "Python types. The following example encodes and decodes a dictionary::" msgstr "" -#: ../../whatsnew/2.6.rst:2794 +#: ../../whatsnew/2.6.rst:2788 msgid "" "It's also possible to write your own decoders and encoders to support more " "types. Pretty-printing of the JSON strings is also supported." msgstr "" -#: ../../whatsnew/2.6.rst:2797 +#: ../../whatsnew/2.6.rst:2791 msgid ":mod:`json` (originally called simplejson) was written by Bob Ippolito." msgstr "" -#: ../../whatsnew/2.6.rst:2804 +#: ../../whatsnew/2.6.rst:2798 msgid "The :mod:`plistlib` module: A Property-List Parser" msgstr "" -#: ../../whatsnew/2.6.rst:2806 +#: ../../whatsnew/2.6.rst:2800 msgid "" "The ``.plist`` format is commonly used on Mac OS X to store basic data types " "(numbers, strings, lists, and dictionaries) by serializing them into an XML-" "based format. It resembles the XML-RPC serialization of data types." msgstr "" -#: ../../whatsnew/2.6.rst:2811 +#: ../../whatsnew/2.6.rst:2805 msgid "" "Despite being primarily used on Mac OS X, the format has nothing Mac-" "specific about it and the Python implementation works on any platform that " @@ -3146,33 +3146,33 @@ msgid "" "standard library." msgstr "" -#: ../../whatsnew/2.6.rst:2816 +#: ../../whatsnew/2.6.rst:2810 msgid "Using the module is simple::" msgstr "" -#: ../../whatsnew/2.6.rst:2843 +#: ../../whatsnew/2.6.rst:2837 msgid "ctypes Enhancements" msgstr "" -#: ../../whatsnew/2.6.rst:2845 +#: ../../whatsnew/2.6.rst:2839 msgid "" "Thomas Heller continued to maintain and enhance the :mod:`ctypes` module." msgstr "" -#: ../../whatsnew/2.6.rst:2848 +#: ../../whatsnew/2.6.rst:2842 msgid "" ":mod:`ctypes` now supports a :class:`c_bool` datatype that represents the " "C99 ``bool`` type. (Contributed by David Remahl; :issue:`1649190`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2852 +#: ../../whatsnew/2.6.rst:2846 msgid "" "The :mod:`ctypes` string, buffer and array types have improved support for " "extended slicing syntax, where various combinations of ``(start, stop, " "step)`` are supplied. (Implemented by Thomas Wouters.)" msgstr "" -#: ../../whatsnew/2.6.rst:2859 +#: ../../whatsnew/2.6.rst:2853 msgid "" "All :mod:`ctypes` data types now support :meth:`from_buffer` and :meth:" "`from_buffer_copy` methods that create a ctypes instance based on a provided " @@ -3180,14 +3180,14 @@ msgid "" "while :meth:`from_buffer` will share the same memory area." msgstr "" -#: ../../whatsnew/2.6.rst:2866 +#: ../../whatsnew/2.6.rst:2860 msgid "" "A new calling convention tells :mod:`ctypes` to clear the ``errno`` or Win32 " "LastError variables at the outset of each wrapped call. (Implemented by " "Thomas Heller; :issue:`1798`.)" msgstr "" -#: ../../whatsnew/2.6.rst:2870 +#: ../../whatsnew/2.6.rst:2864 msgid "" "You can now retrieve the Unix ``errno`` variable after a function call. " "When creating a wrapped function, you can supply ``use_errno=True`` as a " @@ -3196,7 +3196,7 @@ msgid "" "error value." msgstr "" -#: ../../whatsnew/2.6.rst:2876 +#: ../../whatsnew/2.6.rst:2870 msgid "" "The Win32 LastError variable is similarly supported by the :func:`DLL`, :" "func:`OleDLL`, and :func:`WinDLL` functions. You supply " @@ -3204,18 +3204,18 @@ msgid "" "level methods :meth:`set_last_error` and :meth:`get_last_error`." msgstr "" -#: ../../whatsnew/2.6.rst:2882 +#: ../../whatsnew/2.6.rst:2876 msgid "" "The :func:`byref` function, used to retrieve a pointer to a ctypes instance, " "now has an optional *offset* parameter that is a byte count that will be " "added to the returned pointer." msgstr "" -#: ../../whatsnew/2.6.rst:2889 +#: ../../whatsnew/2.6.rst:2883 msgid "Improved SSL Support" msgstr "" -#: ../../whatsnew/2.6.rst:2891 +#: ../../whatsnew/2.6.rst:2885 msgid "" "Bill Janssen made extensive improvements to Python 2.6's support for the " "Secure Sockets Layer by adding a new module, :mod:`ssl`, that's built atop " @@ -3226,7 +3226,7 @@ msgid "" "removed and continues to work, though it will be removed in Python 3.0." msgstr "" -#: ../../whatsnew/2.6.rst:2900 +#: ../../whatsnew/2.6.rst:2894 msgid "" "To use the new module, you must first create a TCP connection in the usual " "way and then pass it to the :func:`ssl.wrap_socket` function. It's possible " @@ -3234,97 +3234,98 @@ msgid "" "by calling the :meth:`getpeercert` method." msgstr "" -#: ../../whatsnew/2.6.rst:2907 +#: ../../whatsnew/2.6.rst:2901 msgid "The documentation for the :mod:`ssl` module." msgstr "" -#: ../../whatsnew/2.6.rst:2912 +#: ../../whatsnew/2.6.rst:2906 msgid "Deprecations and Removals" msgstr "" -#: ../../whatsnew/2.6.rst:2914 ../../whatsnew/2.6.rst:3242 +#: ../../whatsnew/2.6.rst:2908 ../../whatsnew/2.6.rst:3236 msgid "" "String exceptions have been removed. Attempting to use them raises a :exc:" "`TypeError`." msgstr "" -#: ../../whatsnew/2.6.rst:2917 +#: ../../whatsnew/2.6.rst:2911 msgid "" "Changes to the :class:`Exception` interface as dictated by :pep:`352` " -"continue to be made. For 2.6, the :attr:`message` attribute is being " -"deprecated in favor of the :attr:`args` attribute." +"continue to be made. For 2.6, the :attr:`!message` attribute is being " +"deprecated in favor of the :attr:`~BaseException.args` attribute." msgstr "" -#: ../../whatsnew/2.6.rst:2922 +#: ../../whatsnew/2.6.rst:2916 msgid "" "(3.0-warning mode) Python 3.0 will feature a reorganized standard library " "that will drop many outdated modules and rename others. Python 2.6 running " "in 3.0-warning mode will warn about these modules when they are imported." msgstr "" -#: ../../whatsnew/2.6.rst:2927 +#: ../../whatsnew/2.6.rst:2921 msgid "" -"The list of deprecated modules is: :mod:`audiodev`, :mod:`bgenlocations`, :" -"mod:`buildtools`, :mod:`bundlebuilder`, :mod:`Canvas`, :mod:`compiler`, :mod:" -"`dircache`, :mod:`dl`, :mod:`fpformat`, :mod:`gensuitemodule`, :mod:" -"`ihooks`, :mod:`imageop`, :mod:`imgfile`, :mod:`linuxaudiodev`, :mod:" -"`mhlib`, :mod:`mimetools`, :mod:`multifile`, :mod:`new`, :mod:`pure`, :mod:" -"`statvfs`, :mod:`sunaudiodev`, :mod:`test.testall`, and :mod:`toaiff`." +"The list of deprecated modules is: :mod:`!audiodev`, :mod:`!bgenlocations`, :" +"mod:`!buildtools`, :mod:`!bundlebuilder`, :mod:`!Canvas`, :mod:`!compiler`, :" +"mod:`!dircache`, :mod:`!dl`, :mod:`!fpformat`, :mod:`!gensuitemodule`, :mod:" +"`!ihooks`, :mod:`!imageop`, :mod:`!imgfile`, :mod:`!linuxaudiodev`, :mod:`!" +"mhlib`, :mod:`!mimetools`, :mod:`!multifile`, :mod:`!new`, :mod:`!pure`, :" +"mod:`!statvfs`, :mod:`!sunaudiodev`, :mod:`!test.testall`, and :mod:`!" +"toaiff`." msgstr "" -#: ../../whatsnew/2.6.rst:2952 -msgid "The :mod:`gopherlib` module has been removed." +#: ../../whatsnew/2.6.rst:2946 +msgid "The :mod:`!gopherlib` module has been removed." msgstr "" -#: ../../whatsnew/2.6.rst:2954 +#: ../../whatsnew/2.6.rst:2948 msgid "" -"The :mod:`MimeWriter` module and :mod:`mimify` module have been deprecated; " -"use the :mod:`email` package instead." +"The :mod:`!MimeWriter` module and :mod:`!mimify` module have been " +"deprecated; use the :mod:`email` package instead." msgstr "" -#: ../../whatsnew/2.6.rst:2958 +#: ../../whatsnew/2.6.rst:2952 msgid "" -"The :mod:`md5` module has been deprecated; use the :mod:`hashlib` module " +"The :mod:`!md5` module has been deprecated; use the :mod:`hashlib` module " "instead." msgstr "" -#: ../../whatsnew/2.6.rst:2961 +#: ../../whatsnew/2.6.rst:2955 msgid "" -"The :mod:`posixfile` module has been deprecated; :func:`fcntl.lockf` " +"The :mod:`!posixfile` module has been deprecated; :func:`fcntl.lockf` " "provides better locking." msgstr "" -#: ../../whatsnew/2.6.rst:2964 +#: ../../whatsnew/2.6.rst:2958 msgid "" -"The :mod:`popen2` module has been deprecated; use the :mod:`subprocess` " +"The :mod:`!popen2` module has been deprecated; use the :mod:`subprocess` " "module." msgstr "" -#: ../../whatsnew/2.6.rst:2967 -msgid "The :mod:`rgbimg` module has been removed." +#: ../../whatsnew/2.6.rst:2961 +msgid "The :mod:`!rgbimg` module has been removed." msgstr "" -#: ../../whatsnew/2.6.rst:2969 +#: ../../whatsnew/2.6.rst:2963 msgid "" -"The :mod:`sets` module has been deprecated; it's better to use the built-in :" -"class:`set` and :class:`frozenset` types." +"The :mod:`!sets` module has been deprecated; it's better to use the built-" +"in :class:`set` and :class:`frozenset` types." msgstr "" -#: ../../whatsnew/2.6.rst:2972 +#: ../../whatsnew/2.6.rst:2966 msgid "" -"The :mod:`sha` module has been deprecated; use the :mod:`hashlib` module " +"The :mod:`!sha` module has been deprecated; use the :mod:`hashlib` module " "instead." msgstr "" -#: ../../whatsnew/2.6.rst:2980 +#: ../../whatsnew/2.6.rst:2974 msgid "Build and C API Changes" msgstr "" -#: ../../whatsnew/2.6.rst:2982 +#: ../../whatsnew/2.6.rst:2976 msgid "Changes to Python's build process and to the C API include:" msgstr "" -#: ../../whatsnew/2.6.rst:2984 +#: ../../whatsnew/2.6.rst:2978 msgid "" "Python now must be compiled with C89 compilers (after 19 years!). This " "means that the Python source tree has dropped its own implementations of :c:" @@ -3332,14 +3333,14 @@ msgid "" "library." msgstr "" -#: ../../whatsnew/2.6.rst:2989 +#: ../../whatsnew/2.6.rst:2983 msgid "" "Python 2.6 can be built with Microsoft Visual Studio 2008 (version 9.0), and " "this is the new default compiler. See the :file:`PCbuild` directory for the " "build files. (Implemented by Christian Heimes.)" msgstr "" -#: ../../whatsnew/2.6.rst:2994 +#: ../../whatsnew/2.6.rst:2988 msgid "" "On Mac OS X, Python 2.6 can be compiled as a 4-way universal build. The :" "program:`configure` script can take a :option:`!--with-universal-archs=[32-" @@ -3348,21 +3349,21 @@ msgid "" "(Contributed by Ronald Oussoren.)" msgstr "" -#: ../../whatsnew/2.6.rst:3001 +#: ../../whatsnew/2.6.rst:2995 msgid "" "The BerkeleyDB module now has a C API object, available as ``bsddb.db." "api``. This object can be used by other C extensions that wish to use the :" "mod:`bsddb` module for their own purposes. (Contributed by Duncan Grisby.)" msgstr "" -#: ../../whatsnew/2.6.rst:3006 +#: ../../whatsnew/2.6.rst:3000 msgid "" "The new buffer interface, previously described in `the PEP 3118 section " "<#pep-3118-revised-buffer-protocol>`__, adds :c:func:`PyObject_GetBuffer` " "and :c:func:`PyBuffer_Release`, as well as a few other functions." msgstr "" -#: ../../whatsnew/2.6.rst:3011 +#: ../../whatsnew/2.6.rst:3005 msgid "" "Python's use of the C stdio library is now thread-safe, or at least as " "thread-safe as the underlying library is. A long-standing potential bug " @@ -3377,7 +3378,7 @@ msgid "" "Gregory P. Smith.)" msgstr "" -#: ../../whatsnew/2.6.rst:3024 +#: ../../whatsnew/2.6.rst:3018 msgid "" "Importing modules simultaneously in two different threads no longer " "deadlocks; it will now raise an :exc:`ImportError`. A new API function, :c:" @@ -3387,7 +3388,7 @@ msgid "" "(Contributed by Christian Heimes.)" msgstr "" -#: ../../whatsnew/2.6.rst:3032 +#: ../../whatsnew/2.6.rst:3026 msgid "" "Several functions return information about the platform's floating-point " "support. :c:func:`PyFloat_GetMax` returns the maximum representable " @@ -3399,7 +3400,7 @@ msgid "" "by Christian Heimes; :issue:`1534`.)" msgstr "" -#: ../../whatsnew/2.6.rst:3043 +#: ../../whatsnew/2.6.rst:3037 msgid "" "C functions and methods that use :c:func:`PyComplex_AsCComplex` will now " "accept arguments that have a :meth:`__complex__` method. In particular, the " @@ -3408,14 +3409,14 @@ msgid "" "Dickinson; :issue:`1675423`.)" msgstr "" -#: ../../whatsnew/2.6.rst:3050 +#: ../../whatsnew/2.6.rst:3044 msgid "" "Python's C API now includes two functions for case-insensitive string " "comparisons, ``PyOS_stricmp(char*, char*)`` and ``PyOS_strnicmp(char*, " "char*, Py_ssize_t)``. (Contributed by Christian Heimes; :issue:`1635`.)" msgstr "" -#: ../../whatsnew/2.6.rst:3055 +#: ../../whatsnew/2.6.rst:3049 msgid "" "Many C extensions define their own little macro for adding integers and " "strings to the module's dictionary in the ``init*`` function. Python 2.6 " @@ -3424,7 +3425,7 @@ msgid "" "(Contributed by Christian Heimes.)" msgstr "" -#: ../../whatsnew/2.6.rst:3062 +#: ../../whatsnew/2.6.rst:3056 msgid "" "Some macros were renamed in both 3.0 and 2.6 to make it clearer that they " "are macros, not functions. :c:macro:`!Py_Size()` became :c:macro:" @@ -3433,14 +3434,14 @@ msgid "" "still available in Python 2.6 for backward compatibility. (:issue:`1629`)" msgstr "" -#: ../../whatsnew/2.6.rst:3071 +#: ../../whatsnew/2.6.rst:3065 msgid "" "Distutils now places C extensions it builds in a different directory when " "running on a debug version of Python. (Contributed by Collin Winter; :issue:" "`1530959`.)" msgstr "" -#: ../../whatsnew/2.6.rst:3075 +#: ../../whatsnew/2.6.rst:3069 msgid "" "Several basic data types, such as integers and strings, maintain internal " "free lists of objects that can be re-used. The data structures for these " @@ -3449,7 +3450,7 @@ msgid "" "``Py_MAXFREELIST`` is always defined." msgstr "" -#: ../../whatsnew/2.6.rst:3082 +#: ../../whatsnew/2.6.rst:3076 msgid "" "A new Makefile target, \"make patchcheck\", prepares the Python source tree " "for making a patch: it fixes trailing whitespace in all modified ``.py`` " @@ -3458,7 +3459,7 @@ msgid "" "(Contributed by Brett Cannon.)" msgstr "" -#: ../../whatsnew/2.6.rst:3089 +#: ../../whatsnew/2.6.rst:3083 msgid "" "Another new target, \"make profile-opt\", compiles a Python binary using " "GCC's profile-guided optimization. It compiles Python with profiling " @@ -3467,17 +3468,17 @@ msgid "" "Smith.)" msgstr "" -#: ../../whatsnew/2.6.rst:3098 +#: ../../whatsnew/2.6.rst:3092 msgid "Port-Specific Changes: Windows" msgstr "" -#: ../../whatsnew/2.6.rst:3100 +#: ../../whatsnew/2.6.rst:3094 msgid "" "The support for Windows 95, 98, ME and NT4 has been dropped. Python 2.6 " "requires at least Windows 2000 SP4." msgstr "" -#: ../../whatsnew/2.6.rst:3103 +#: ../../whatsnew/2.6.rst:3097 msgid "" "The new default compiler on Windows is Visual Studio 2008 (version 9.0). The " "build directories for Visual Studio 2003 (version 7.1) and 2005 (version " @@ -3488,124 +3489,127 @@ msgid "" "Martin von Löwis.)" msgstr "" -#: ../../whatsnew/2.6.rst:3111 +#: ../../whatsnew/2.6.rst:3105 msgid "" "The :mod:`msvcrt` module now supports both the normal and wide char variants " -"of the console I/O API. The :func:`getwch` function reads a keypress and " -"returns a Unicode value, as does the :func:`getwche` function. The :func:" -"`putwch` function takes a Unicode character and writes it to the console. " -"(Contributed by Christian Heimes.)" +"of the console I/O API. The :func:`~msvcrt.getwch` function reads a " +"keypress and returns a Unicode value, as does the :func:`~msvcrt.getwche` " +"function. The :func:`~msvcrt.putwch` function takes a Unicode character and " +"writes it to the console. (Contributed by Christian Heimes.)" msgstr "" -#: ../../whatsnew/2.6.rst:3118 +#: ../../whatsnew/2.6.rst:3112 msgid "" ":func:`os.path.expandvars` will now expand environment variables in the form " "\"%var%\", and \"~user\" will be expanded into the user's home directory " "path. (Contributed by Josiah Carlson; :issue:`957650`.)" msgstr "" -#: ../../whatsnew/2.6.rst:3122 +#: ../../whatsnew/2.6.rst:3116 msgid "" -"The :mod:`socket` module's socket objects now have an :meth:`ioctl` method " -"that provides a limited interface to the :c:func:`WSAIoctl` system interface." +"The :mod:`socket` module's socket objects now have an :meth:`~socket.socket." +"ioctl` method that provides a limited interface to the :c:func:`WSAIoctl` " +"system interface." msgstr "" -#: ../../whatsnew/2.6.rst:3126 +#: ../../whatsnew/2.6.rst:3120 msgid "" -"The :mod:`_winreg` module now has a function, :func:" -"`ExpandEnvironmentStrings`, that expands environment variable references " -"such as ``%NAME%`` in an input string. The handle objects provided by this " +"The :mod:`_winreg ` module now has a function, :func:`~winreg." +"ExpandEnvironmentStrings`, that expands environment variable references such " +"as ``%NAME%`` in an input string. The handle objects provided by this " "module now support the context protocol, so they can be used in :keyword:" "`with` statements. (Contributed by Christian Heimes.)" msgstr "" -#: ../../whatsnew/2.6.rst:3133 +#: ../../whatsnew/2.6.rst:3127 msgid "" -":mod:`_winreg` also has better support for x64 systems, exposing the :func:" -"`DisableReflectionKey`, :func:`EnableReflectionKey`, and :func:" -"`QueryReflectionKey` functions, which enable and disable registry reflection " -"for 32-bit processes running on 64-bit systems. (:issue:`1753245`)" +":mod:`_winreg ` also has better support for x64 systems, exposing " +"the :func:`~winreg.DisableReflectionKey`, :func:`~winreg." +"EnableReflectionKey`, and :func:`~winreg.QueryReflectionKey` functions, " +"which enable and disable registry reflection for 32-bit processes running on " +"64-bit systems. (:issue:`1753245`)" msgstr "" -#: ../../whatsnew/2.6.rst:3139 +#: ../../whatsnew/2.6.rst:3133 msgid "" -"The :mod:`msilib` module's :class:`Record` object gained :meth:`GetInteger` " -"and :meth:`GetString` methods that return field values as an integer or a " -"string. (Contributed by Floris Bruynooghe; :issue:`2125`.)" +"The :mod:`msilib` module's :class:`!Record` object gained :meth:`~msilib." +"Record.GetInteger` and :meth:`~msilib.Record.GetString` methods that return " +"field values as an integer or a string. (Contributed by Floris Bruynooghe; :" +"issue:`2125`.)" msgstr "" -#: ../../whatsnew/2.6.rst:3147 +#: ../../whatsnew/2.6.rst:3141 msgid "Port-Specific Changes: Mac OS X" msgstr "" -#: ../../whatsnew/2.6.rst:3149 +#: ../../whatsnew/2.6.rst:3143 msgid "" "When compiling a framework build of Python, you can now specify the " "framework name to be used by providing the :option:`!--with-framework-name=` " "option to the :program:`configure` script." msgstr "" -#: ../../whatsnew/2.6.rst:3154 +#: ../../whatsnew/2.6.rst:3148 msgid "" -"The :mod:`macfs` module has been removed. This in turn required the :func:" -"`macostools.touched` function to be removed because it depended on the :mod:" -"`macfs` module. (:issue:`1490190`)" +"The :mod:`!macfs` module has been removed. This in turn required the :func:" +"`!macostools.touched` function to be removed because it depended on the :mod:" +"`!macfs` module. (:issue:`1490190`)" msgstr "" -#: ../../whatsnew/2.6.rst:3158 +#: ../../whatsnew/2.6.rst:3152 msgid "" "Many other Mac OS modules have been deprecated and will be removed in Python " -"3.0: :mod:`_builtinSuites`, :mod:`aepack`, :mod:`aetools`, :mod:`aetypes`, :" -"mod:`applesingle`, :mod:`appletrawmain`, :mod:`appletrunner`, :mod:" -"`argvemulator`, :mod:`Audio_mac`, :mod:`autoGIL`, :mod:`Carbon`, :mod:" -"`cfmfile`, :mod:`CodeWarrior`, :mod:`ColorPicker`, :mod:`EasyDialogs`, :mod:" -"`Explorer`, :mod:`Finder`, :mod:`FrameWork`, :mod:`findertools`, :mod:`ic`, :" -"mod:`icglue`, :mod:`icopen`, :mod:`macerrors`, :mod:`MacOS`, :mod:`macfs`, :" -"mod:`macostools`, :mod:`macresource`, :mod:`MiniAEFrame`, :mod:`Nav`, :mod:" -"`Netscape`, :mod:`OSATerminology`, :mod:`pimp`, :mod:`PixMapWrapper`, :mod:" -"`StdSuites`, :mod:`SystemEvents`, :mod:`Terminal`, and :mod:" -"`terminalcommand`." -msgstr "" - -#: ../../whatsnew/2.6.rst:3201 +"3.0: :mod:`!_builtinSuites`, :mod:`!aepack`, :mod:`!aetools`, :mod:`!" +"aetypes`, :mod:`!applesingle`, :mod:`!appletrawmain`, :mod:`!appletrunner`, :" +"mod:`!argvemulator`, :mod:`!Audio_mac`, :mod:`!autoGIL`, :mod:`!Carbon`, :" +"mod:`!cfmfile`, :mod:`!CodeWarrior`, :mod:`!ColorPicker`, :mod:`!" +"EasyDialogs`, :mod:`!Explorer`, :mod:`!Finder`, :mod:`!FrameWork`, :mod:`!" +"findertools`, :mod:`!ic`, :mod:`!icglue`, :mod:`!icopen`, :mod:`!" +"macerrors`, :mod:`!MacOS`, :mod:`!macfs`, :mod:`!macostools`, :mod:`!" +"macresource`, :mod:`!MiniAEFrame`, :mod:`!Nav`, :mod:`!Netscape`, :mod:`!" +"OSATerminology`, :mod:`!pimp`, :mod:`!PixMapWrapper`, :mod:`!StdSuites`, :" +"mod:`!SystemEvents`, :mod:`!Terminal`, and :mod:`!terminalcommand`." +msgstr "" + +#: ../../whatsnew/2.6.rst:3195 msgid "Port-Specific Changes: IRIX" msgstr "" -#: ../../whatsnew/2.6.rst:3203 +#: ../../whatsnew/2.6.rst:3197 msgid "" "A number of old IRIX-specific modules were deprecated and will be removed in " -"Python 3.0: :mod:`al` and :mod:`AL`, :mod:`cd`, :mod:`cddb`, :mod:" -"`cdplayer`, :mod:`CL` and :mod:`cl`, :mod:`DEVICE`, :mod:`ERRNO`, :mod:" -"`FILE`, :mod:`FL` and :mod:`fl`, :mod:`flp`, :mod:`fm`, :mod:`GET`, :mod:" -"`GLWS`, :mod:`GL` and :mod:`gl`, :mod:`IN`, :mod:`IOCTL`, :mod:`jpeg`, :mod:" -"`panelparser`, :mod:`readcd`, :mod:`SV` and :mod:`sv`, :mod:`torgb`, :mod:" -"`videoreader`, and :mod:`WAIT`." +"Python 3.0: :mod:`!al` and :mod:`!AL`, :mod:`!cd`, :mod:`!cddb`, :mod:`!" +"cdplayer`, :mod:`!CL` and :mod:`!cl`, :mod:`!DEVICE`, :mod:`!ERRNO`, :mod:`!" +"FILE`, :mod:`!FL` and :mod:`!fl`, :mod:`!flp`, :mod:`!fm`, :mod:`!GET`, :mod:" +"`!GLWS`, :mod:`!GL` and :mod:`!gl`, :mod:`!IN`, :mod:`!IOCTL`, :mod:`!" +"jpeg`, :mod:`!panelparser`, :mod:`!readcd`, :mod:`!SV` and :mod:`!sv`, :mod:" +"`!torgb`, :mod:`!videoreader`, and :mod:`!WAIT`." msgstr "" -#: ../../whatsnew/2.6.rst:3233 +#: ../../whatsnew/2.6.rst:3227 msgid "Porting to Python 2.6" msgstr "" -#: ../../whatsnew/2.6.rst:3235 +#: ../../whatsnew/2.6.rst:3229 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code:" msgstr "" -#: ../../whatsnew/2.6.rst:3238 +#: ../../whatsnew/2.6.rst:3232 msgid "" "Classes that aren't supposed to be hashable should set ``__hash__ = None`` " "in their definitions to indicate the fact." msgstr "" -#: ../../whatsnew/2.6.rst:3245 +#: ../../whatsnew/2.6.rst:3239 msgid "" "The :meth:`__init__` method of :class:`collections.deque` now clears any " "existing contents of the deque before adding elements from the iterable. " "This change makes the behavior match ``list.__init__()``." msgstr "" -#: ../../whatsnew/2.6.rst:3250 +#: ../../whatsnew/2.6.rst:3244 msgid "" ":meth:`object.__init__` previously accepted arbitrary arguments and keyword " "arguments, ignoring them. In Python 2.6, this is no longer allowed and will " @@ -3614,7 +3618,7 @@ msgid "" "through using :func:`super`). See :issue:`1683368` for discussion." msgstr "" -#: ../../whatsnew/2.6.rst:3257 +#: ../../whatsnew/2.6.rst:3251 msgid "" "The :class:`Decimal` constructor now accepts leading and trailing whitespace " "when passed a string. Previously it would raise an :exc:`InvalidOperation` " @@ -3623,7 +3627,7 @@ msgid "" "`ConversionSyntax` exception." msgstr "" -#: ../../whatsnew/2.6.rst:3264 +#: ../../whatsnew/2.6.rst:3258 msgid "" "Due to an implementation accident, if you passed a file path to the built-" "in :func:`__import__` function, it would actually import the specified " @@ -3631,20 +3635,20 @@ msgid "" "explicitly checks for this case and raises an :exc:`ImportError`." msgstr "" -#: ../../whatsnew/2.6.rst:3270 +#: ../../whatsnew/2.6.rst:3264 msgid "" "C API: the :c:func:`PyImport_Import` and :c:func:`PyImport_ImportModule` " "functions now default to absolute imports, not relative imports. This will " "affect C extensions that import other modules." msgstr "" -#: ../../whatsnew/2.6.rst:3274 +#: ../../whatsnew/2.6.rst:3268 msgid "" "C API: extension data types that shouldn't be hashable should define their " "``tp_hash`` slot to :c:func:`PyObject_HashNotImplemented`." msgstr "" -#: ../../whatsnew/2.6.rst:3278 +#: ../../whatsnew/2.6.rst:3272 msgid "" "The :mod:`socket` module exception :exc:`socket.error` now inherits from :" "exc:`IOError`. Previously it wasn't a subclass of :exc:`StandardError` but " @@ -3652,7 +3656,7 @@ msgid "" "`1706815`.)" msgstr "" -#: ../../whatsnew/2.6.rst:3283 +#: ../../whatsnew/2.6.rst:3277 msgid "" "The :mod:`xmlrpclib` module no longer automatically converts :class:" "`datetime.date` and :class:`datetime.time` to the :class:`xmlrpclib." @@ -3661,32 +3665,32 @@ msgid "" "and :class:`~datetime.time` instances. (:issue:`1330538`)" msgstr "" -#: ../../whatsnew/2.6.rst:3290 +#: ../../whatsnew/2.6.rst:3284 msgid "" "(3.0-warning mode) The :class:`Exception` class now warns when accessed " "using slicing or index access; having :class:`Exception` behave like a tuple " "is being phased out." msgstr "" -#: ../../whatsnew/2.6.rst:3294 +#: ../../whatsnew/2.6.rst:3288 msgid "" "(3.0-warning mode) inequality comparisons between two dictionaries or two " "objects that don't implement comparison methods are reported as warnings. " "``dict1 == dict2`` still works, but ``dict1 < dict2`` is being phased out." msgstr "" -#: ../../whatsnew/2.6.rst:3299 +#: ../../whatsnew/2.6.rst:3293 msgid "" "Comparisons between cells, which are an implementation detail of Python's " "scoping rules, also cause warnings because such comparisons are forbidden " "entirely in 3.0." msgstr "" -#: ../../whatsnew/2.6.rst:3309 +#: ../../whatsnew/2.6.rst:3303 msgid "Acknowledgements" msgstr "致謝" -#: ../../whatsnew/2.6.rst:3311 +#: ../../whatsnew/2.6.rst:3305 msgid "" "The author would like to thank the following people for offering " "suggestions, corrections and assistance with various drafts of this article: " @@ -3694,11 +3698,11 @@ msgid "" "Johnson, Chris Lambacher, Martin Michlmayr, Antoine Pitrou, Brian Warner." msgstr "" -#: ../../whatsnew/2.6.rst:1072 +#: ../../whatsnew/2.6.rst:1068 msgid "universal newlines" msgstr "universal newlines" -#: ../../whatsnew/2.6.rst:1072 +#: ../../whatsnew/2.6.rst:1068 msgid "What's new" msgstr "What's new(有什麼新功能)" diff --git a/whatsnew/2.7.po b/whatsnew/2.7.po index e428f5b6d2..89bc5bbddb 100644 --- a/whatsnew/2.7.po +++ b/whatsnew/2.7.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-13 13:14+0000\n" +"POT-Creation-Date: 2024-01-11 00:04+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -334,7 +334,8 @@ msgid "" "How does the :class:`~collections.OrderedDict` work? It maintains a doubly " "linked list of keys, appending new keys to the list as they're inserted. A " "secondary dictionary maps keys to their corresponding list node, so deletion " -"doesn't have to traverse the entire linked list and therefore remains O(1)." +"doesn't have to traverse the entire linked list and therefore remains *O*\\ " +"(1)." msgstr "" #: ../../whatsnew/2.7.rst:287 @@ -345,8 +346,8 @@ msgstr "" #: ../../whatsnew/2.7.rst:290 msgid "" -"The :mod:`ConfigParser` module uses them by default, meaning that " -"configuration files can now be read, modified, and then written back in " +"The :mod:`ConfigParser ` module uses them by default, meaning " +"that configuration files can now be read, modified, and then written back in " "their original order." msgstr "" @@ -1189,9 +1190,9 @@ msgstr "" #: ../../whatsnew/2.7.rst:1137 msgid "" -"Constructors for the parsing classes in the :mod:`ConfigParser` module now " -"take an *allow_no_value* parameter, defaulting to false; if true, options " -"without values will be allowed. For example::" +"Constructors for the parsing classes in the :mod:`ConfigParser " +"` module now take an *allow_no_value* parameter, defaulting to " +"false; if true, options without values will be allowed. For example::" msgstr "" #: ../../whatsnew/2.7.rst:1159 @@ -1425,9 +1426,9 @@ msgstr "" #: ../../whatsnew/2.7.rst:1318 msgid "" -"The :mod:`ihooks` module now supports relative imports. Note that :mod:" -"`ihooks` is an older module for customizing imports, superseded by the :mod:" -"`imputil` module added in Python 2.0. (Relative import support added by Neil " +"The :mod:`!ihooks` module now supports relative imports. Note that :mod:`!" +"ihooks` is an older module for customizing imports, superseded by the :mod:`!" +"imputil` module added in Python 2.0. (Relative import support added by Neil " "Schemenauer.)" msgstr "" diff --git a/whatsnew/3.0.po b/whatsnew/3.0.po index 457f089778..b992384b16 100644 --- a/whatsnew/3.0.po +++ b/whatsnew/3.0.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-14 00:03+0000\n" +"POT-Creation-Date: 2024-01-06 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -723,12 +723,12 @@ msgstr "" #: ../../whatsnew/3.0.rst:558 msgid "" -"Many old modules were removed. Some, like :mod:`gopherlib` (no longer used) " -"and :mod:`md5` (replaced by :mod:`hashlib`), were already deprecated by :pep:" -"`4`. Others were removed as a result of the removal of support for various " -"platforms such as Irix, BeOS and Mac OS 9 (see :pep:`11`). Some modules " -"were also selected for removal in Python 3.0 due to lack of use or because a " -"better replacement exists. See :pep:`3108` for an exhaustive list." +"Many old modules were removed. Some, like :mod:`!gopherlib` (no longer " +"used) and :mod:`!md5` (replaced by :mod:`hashlib`), were already deprecated " +"by :pep:`4`. Others were removed as a result of the removal of support for " +"various platforms such as Irix, BeOS and Mac OS 9 (see :pep:`11`). Some " +"modules were also selected for removal in Python 3.0 due to lack of use or " +"because a better replacement exists. See :pep:`3108` for an exhaustive list." msgstr "" #: ../../whatsnew/3.0.rst:566 @@ -884,8 +884,8 @@ msgid "" msgstr "" #: ../../whatsnew/3.0.rst:629 -msgid "Killed :mod:`sets`. Use the built-in :func:`set` class." -msgstr "移除 :mod:`sets`。請使用內建的 :func:`set` 類別。" +msgid "Killed :mod:`!sets`. Use the built-in :func:`set` class." +msgstr "移除 :mod:`!sets`。請使用內建的 :func:`set` 類別。" #: ../../whatsnew/3.0.rst:631 msgid "" @@ -919,7 +919,7 @@ msgid "Cleanup of the :mod:`random` module: removed the :func:`jumpahead` API." msgstr "" #: ../../whatsnew/3.0.rst:651 -msgid "The :mod:`new` module is gone." +msgid "The :mod:`!new` module is gone." msgstr "" #: ../../whatsnew/3.0.rst:653 diff --git a/whatsnew/3.10.po b/whatsnew/3.10.po index 5de23be36b..920729bffa 100644 --- a/whatsnew/3.10.po +++ b/whatsnew/3.10.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-07 00:03+0000\n" +"POT-Creation-Date: 2024-01-06 00:03+0000\n" "PO-Revision-Date: 2023-06-26 03:02+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -125,7 +125,7 @@ msgstr ":pep:`624`,刪除 Py_UNICODE 編碼器 API" msgid ":pep:`597`, Add optional EncodingWarning" msgstr ":pep:`597`,新增可選的 EncodingWarning" -#: ../../whatsnew/3.10.rst:92 ../../whatsnew/3.10.rst:2044 +#: ../../whatsnew/3.10.rst:92 ../../whatsnew/3.10.rst:2046 msgid "New Features" msgstr "新功能" @@ -393,18 +393,20 @@ msgstr "影格 (frame) 物件的 :attr:`~frame.f_lineno` 屬性總會包含預 #: ../../whatsnew/3.10.rst:405 msgid "" -"The :attr:`~codeobject.co_lnotab` attribute of code objects is deprecated " -"and will be removed in 3.12. Code that needs to convert from offset to line " -"number should use the new ``co_lines()`` method instead." +"The :attr:`~codeobject.co_lnotab` attribute of :ref:`code objects ` is deprecated and will be removed in 3.12. Code that needs to " +"convert from offset to line number should use the new :meth:`~codeobject." +"co_lines` method instead." msgstr "" -"程式碼物件的 :attr:`~codeobject.co_lnotab` 屬性已棄用,並將在 3.12 中刪除。需" -"要從偏移量轉換為列號的程式碼應使用新的 ``co_lines()`` 方法。" +":ref:`程式碼物件 `\\ 的 :attr:`~codeobject.co_lnotab` 屬性已棄" +"用,並將在 3.12 中刪除。需要從偏移量轉換為列號的程式碼應使用新的 :meth:" +"`~codeobject.co_lines` 方法。" -#: ../../whatsnew/3.10.rst:410 +#: ../../whatsnew/3.10.rst:412 msgid "PEP 634: Structural Pattern Matching" msgstr "PEP 634:結構模式匹配" -#: ../../whatsnew/3.10.rst:412 +#: ../../whatsnew/3.10.rst:414 msgid "" "Structural pattern matching has been added in the form of a *match " "statement* and *case statements* of patterns with associated actions. " @@ -418,15 +420,15 @@ msgstr "" "(primitive data types) 以及類別實例組成。模式匹配使程式能夠從複雜的資料型別中" "提取資訊,在資料結構上進行分支,並根據不同形式的資料應用特定的操作。" -#: ../../whatsnew/3.10.rst:420 +#: ../../whatsnew/3.10.rst:422 msgid "Syntax and operations" msgstr "語法和操作" -#: ../../whatsnew/3.10.rst:422 +#: ../../whatsnew/3.10.rst:424 msgid "The generic syntax of pattern matching is::" msgstr "模式匹配的通用語法是:" -#: ../../whatsnew/3.10.rst:434 +#: ../../whatsnew/3.10.rst:436 msgid "" "A match statement takes an expression and compares its value to successive " "patterns given as one or more case blocks. Specifically, pattern matching " @@ -435,25 +437,25 @@ msgstr "" "match 陳述式採用一個運算式,並將其值與作為一個或多個 case 區塊給出的連續模式" "進行比較。具體來說,模式匹配是透過以下方式進行操作:" -#: ../../whatsnew/3.10.rst:438 +#: ../../whatsnew/3.10.rst:440 msgid "using data with type and shape (the ``subject``)" msgstr "使用具有型態 (type) 和特徵 (shape) 的資料 (主語 ``subject``)" -#: ../../whatsnew/3.10.rst:439 +#: ../../whatsnew/3.10.rst:441 msgid "evaluating the ``subject`` in the ``match`` statement" msgstr "``match`` 陳述式中 ``subject`` 的求值 (evaluating)" -#: ../../whatsnew/3.10.rst:440 +#: ../../whatsnew/3.10.rst:442 msgid "" "comparing the subject with each pattern in a ``case`` statement from top to " "bottom until a match is confirmed." msgstr "從上到下將主語與 ``case`` 陳述式中的每個模式進行比較,直到確認匹配。" -#: ../../whatsnew/3.10.rst:442 +#: ../../whatsnew/3.10.rst:444 msgid "executing the action associated with the pattern of the confirmed match" msgstr "執行與已確認匹配模式對應的操作" -#: ../../whatsnew/3.10.rst:444 +#: ../../whatsnew/3.10.rst:446 msgid "" "If an exact match is not confirmed, the last case, a wildcard ``_``, if " "provided, will be used as the matching case. If an exact match is not " @@ -464,11 +466,11 @@ msgstr "" "到的情況。如未有任何匹配且不存在萬用字元的 case,則整個 match 區塊會是個無操" "作 (no-op)。" -#: ../../whatsnew/3.10.rst:450 +#: ../../whatsnew/3.10.rst:452 msgid "Declarative approach" msgstr "宣告式方法 (Declarative approach)" -#: ../../whatsnew/3.10.rst:452 +#: ../../whatsnew/3.10.rst:454 msgid "" "Readers may be aware of pattern matching through the simple example of " "matching a subject (data object) to a literal (pattern) with the switch " @@ -480,7 +482,7 @@ msgstr "" "式將主語(資料物件)與字面值 (literal)(模式)進行匹配的簡單範例來了解模式匹" "配。 switch 語句通常用於將物件/運算式與包含字面值的 case 陳述式進行比較。" -#: ../../whatsnew/3.10.rst:458 +#: ../../whatsnew/3.10.rst:460 msgid "" "More powerful examples of pattern matching can be found in languages such as " "Scala and Elixir. With structural pattern matching, the approach is " @@ -490,7 +492,7 @@ msgstr "" "更強大的模式匹配範例可以在 Scala 和 Elixir 等語言中找到。對於結構模式匹配,該" "方法是「宣告式的 (declarative)」,並且明確地說明了資料匹配的條件(模式)。" -#: ../../whatsnew/3.10.rst:462 +#: ../../whatsnew/3.10.rst:464 msgid "" "While an \"imperative\" series of instructions using nested \"if\" " "statements could be used to accomplish something similar to structural " @@ -507,11 +509,11 @@ msgstr "" "模式匹配可以用其最簡單的形式達成,將變數與 case 陳述式中的字面值進行比較,但" "它對 Python 的真正價值在於它對主語的型態和特徵的處理。" -#: ../../whatsnew/3.10.rst:471 +#: ../../whatsnew/3.10.rst:473 msgid "Simple pattern: match to a literal" msgstr "簡單模式:與字面值匹配" -#: ../../whatsnew/3.10.rst:473 +#: ../../whatsnew/3.10.rst:475 msgid "" "Let's look at this example as pattern matching in its simplest form: a " "value, the subject, being matched to several literals, the patterns. In the " @@ -523,7 +525,7 @@ msgstr "" "配。在下面的範例中,``status`` 是匹配陳述式的主語。這些模式是每個 case 陳述" "式,其中文字表示請求狀態程式碼。與案例相關的操作在匹配後執行:" -#: ../../whatsnew/3.10.rst:490 +#: ../../whatsnew/3.10.rst:492 msgid "" "If the above function is passed a ``status`` of 418, \"I'm a teapot\" is " "returned. If the above function is passed a ``status`` of 500, the case " @@ -537,22 +539,22 @@ msgstr "" "傳 \"Something's wrong with the internet\"。請注意最後一個區塊:變數名稱 " "``_`` 充當 *萬用字元* 並確保主語始終匹配。``_`` 的使用是可選的。" -#: ../../whatsnew/3.10.rst:497 +#: ../../whatsnew/3.10.rst:499 msgid "" "You can combine several literals in a single pattern using ``|`` (\"or\")::" msgstr "你可以使用 ``|`` (\"or\") 將多個字面值組合在一個模式中:" -#: ../../whatsnew/3.10.rst:503 +#: ../../whatsnew/3.10.rst:505 msgid "Behavior without the wildcard" msgstr "沒有萬用字元 (wildcard) 的行為" -#: ../../whatsnew/3.10.rst:505 +#: ../../whatsnew/3.10.rst:507 msgid "" "If we modify the above example by removing the last case block, the example " "becomes::" msgstr "如果我們透過刪除最後一個 case 區塊來修改上面的範例,則範例將變為:" -#: ../../whatsnew/3.10.rst:517 +#: ../../whatsnew/3.10.rst:519 msgid "" "Without the use of ``_`` in a case statement, a match may not exist. If no " "match exists, the behavior is a no-op. For example, if ``status`` of 500 is " @@ -561,11 +563,11 @@ msgstr "" "如果在 case 陳述式中不使用 ``_``,則可能不存在匹配項目。如果不存在匹配項目," "則該行為是無操作 (no-op)。例如,如果 ``status`` 為 500,則不會有任何操作。" -#: ../../whatsnew/3.10.rst:522 +#: ../../whatsnew/3.10.rst:524 msgid "Patterns with a literal and variable" msgstr "具有字面值和變數的模式" -#: ../../whatsnew/3.10.rst:524 +#: ../../whatsnew/3.10.rst:526 msgid "" "Patterns can look like unpacking assignments, and a pattern may be used to " "bind variables. In this example, a data point can be unpacked to its x-" @@ -574,7 +576,7 @@ msgstr "" "模式看起來就像解包賦值 (unpacking assignment),並且模式可用於繫結 (bind) 變" "數。在此範例中,可以將資料點解包為其 x 坐標和 y 坐標:" -#: ../../whatsnew/3.10.rst:541 +#: ../../whatsnew/3.10.rst:543 msgid "" "The first pattern has two literals, ``(0, 0)``, and may be thought of as an " "extension of the literal pattern shown above. The next two patterns combine " @@ -587,11 +589,11 @@ msgstr "" "(``point``)的值。第四個模式捕獲兩個值,這使得它在概念上類似於解包賦值 " "``(x, y) = point``。" -#: ../../whatsnew/3.10.rst:548 +#: ../../whatsnew/3.10.rst:550 msgid "Patterns and classes" msgstr "模式和類別" -#: ../../whatsnew/3.10.rst:550 +#: ../../whatsnew/3.10.rst:552 msgid "" "If you are using classes to structure your data, you can use as a pattern " "the class name followed by an argument list resembling a constructor. This " @@ -600,11 +602,11 @@ msgstr "" "如果你使用類別來建構資料,則可以用類別名稱與後面的引數列表組合成的建構函式作" "為模式。該模式能夠將類別屬性捕獲到變數中:" -#: ../../whatsnew/3.10.rst:572 +#: ../../whatsnew/3.10.rst:574 msgid "Patterns with positional parameters" msgstr "具有位置參數的模式" -#: ../../whatsnew/3.10.rst:574 +#: ../../whatsnew/3.10.rst:576 msgid "" "You can use positional parameters with some builtin classes that provide an " "ordering for their attributes (e.g. dataclasses). You can also define a " @@ -618,11 +620,11 @@ msgstr "" "置。如果它被設定為 (\"x\", \"y\"),則以下模式都是等效的(且都將 ``y`` 屬性繫" "結到 ``var`` 變數):" -#: ../../whatsnew/3.10.rst:586 +#: ../../whatsnew/3.10.rst:588 msgid "Nested patterns" msgstr "巢狀模式" -#: ../../whatsnew/3.10.rst:588 +#: ../../whatsnew/3.10.rst:590 msgid "" "Patterns can be arbitrarily nested. For example, if our data is a short " "list of points, it could be matched like this::" @@ -630,11 +632,11 @@ msgstr "" "模式可以任意巢套。例如,如果我們的資料是一個簡短的座標點列表,則可以這樣匹" "配:" -#: ../../whatsnew/3.10.rst:604 +#: ../../whatsnew/3.10.rst:606 msgid "Complex patterns and the wildcard" msgstr "複雜模式和萬用字元" -#: ../../whatsnew/3.10.rst:606 +#: ../../whatsnew/3.10.rst:608 msgid "" "To this point, the examples have used ``_`` alone in the last case " "statement. A wildcard can be used in more complex patterns, such as " @@ -643,7 +645,7 @@ msgstr "" "到目前為止,範例在最後一個 case 陳述式中單獨使用了 ``_``。萬用字元可以用在更" "複雜的模式中,像是 ``('error', code, _)``。例如" -#: ../../whatsnew/3.10.rst:616 +#: ../../whatsnew/3.10.rst:618 msgid "" "In the above case, ``test_variable`` will match for ('error', code, 100) and " "('error', code, 800)." @@ -651,11 +653,11 @@ msgstr "" "在上述情況下,值像是 ('error', code, 100) 和 ('error', code, 800) 的 " "``test_variable`` 將會成功匹配。" -#: ../../whatsnew/3.10.rst:620 +#: ../../whatsnew/3.10.rst:622 msgid "Guard" msgstr "Guard" -#: ../../whatsnew/3.10.rst:622 +#: ../../whatsnew/3.10.rst:624 msgid "" "We can add an ``if`` clause to a pattern, known as a \"guard\". If the " "guard is false, ``match`` goes on to try the next case block. Note that " @@ -665,15 +667,15 @@ msgstr "" "則 ``match`` 會繼續嘗試下一個 case 區塊。請注意,值的捕獲發生在 guard 的求值 " "(evaluate) 之前:" -#: ../../whatsnew/3.10.rst:633 +#: ../../whatsnew/3.10.rst:635 msgid "Other Key Features" msgstr "其他主要功能" -#: ../../whatsnew/3.10.rst:635 +#: ../../whatsnew/3.10.rst:637 msgid "Several other key features:" msgstr "其他幾個主要功能:" -#: ../../whatsnew/3.10.rst:637 +#: ../../whatsnew/3.10.rst:639 msgid "" "Like unpacking assignments, tuple and list patterns have exactly the same " "meaning and actually match arbitrary sequences. Technically, the subject " @@ -685,7 +687,7 @@ msgstr "" "列。從技術上來說,主語必須是一個序列。因此,一個重要的例外是模式不會去匹配疊" "代器。另外,為了防止常常出錯,序列模式也不會去匹配字串。" -#: ../../whatsnew/3.10.rst:643 +#: ../../whatsnew/3.10.rst:645 msgid "" "Sequence patterns support wildcards: ``[x, y, *rest]`` and ``(x, y, *rest)`` " "work similar to wildcards in unpacking assignments. The name after ``*`` " @@ -696,7 +698,7 @@ msgstr "" "用字元類似。 ``*`` 後面的名稱也可能是 ``_``,因此 ``(x, y, *_)`` 會匹配至少兩" "個項目的序列,且不繫結其餘項目。" -#: ../../whatsnew/3.10.rst:648 +#: ../../whatsnew/3.10.rst:650 msgid "" "Mapping patterns: ``{\"bandwidth\": b, \"latency\": l}`` captures the " "``\"bandwidth\"`` and ``\"latency\"`` values from a dict. Unlike sequence " @@ -707,11 +709,11 @@ msgstr "" "``\"bandwidth\"`` 和 ``\"latency\"`` 值。與序列模式不同,額外的鍵將被忽略。也" "支援萬用字元 ``**rest``。(但是 ``**_`` 是多餘的,所以是不允許的。)" -#: ../../whatsnew/3.10.rst:653 +#: ../../whatsnew/3.10.rst:655 msgid "Subpatterns may be captured using the ``as`` keyword::" msgstr "可以使用 ``as`` 關鍵字捕獲子模式:" -#: ../../whatsnew/3.10.rst:657 +#: ../../whatsnew/3.10.rst:659 msgid "" "This binds x1, y1, x2, y2 like you would expect without the ``as`` clause, " "and p2 to the entire second item of the subject." @@ -719,7 +721,7 @@ msgstr "" "這將繫結 x1、y1、x2、y2,如同沒有 ``as`` 子句的情況下所預期的,並將 p2 繫結到" "主語的整個第二項目。" -#: ../../whatsnew/3.10.rst:660 +#: ../../whatsnew/3.10.rst:662 msgid "" "Most literals are compared by equality. However, the singletons ``True``, " "``False`` and ``None`` are compared by identity." @@ -727,7 +729,7 @@ msgstr "" "大多數字面值都是通過相等進行比較的。然而,單例 ``True``、``False`` 和 " "``None`` 是按標識值 (identity) 來進行比較的。" -#: ../../whatsnew/3.10.rst:663 +#: ../../whatsnew/3.10.rst:665 msgid "" "Named constants may be used in patterns. These named constants must be " "dotted names to prevent the constant from being interpreted as a capture " @@ -736,7 +738,7 @@ msgstr "" "附名常數 (named constant) 可以在模式中使用。這些附名常數必須有帶有點的名稱 " "(dotted name),以防止常數被直譯為捕獲的變數:" -#: ../../whatsnew/3.10.rst:682 +#: ../../whatsnew/3.10.rst:684 msgid "" "For the full specification see :pep:`634`. Motivation and rationale are in :" "pep:`635`, and a longer tutorial is in :pep:`636`." @@ -744,11 +746,11 @@ msgstr "" "有關完整規範,請參閱 :pep:`634`。動機和基本原理位於 :pep:`635` 中,較完整的教" "學位於 :pep:`636` 中。" -#: ../../whatsnew/3.10.rst:689 +#: ../../whatsnew/3.10.rst:691 msgid "Optional ``EncodingWarning`` and ``encoding=\"locale\"`` option" msgstr "可選的 ``EncodingWarning`` 和 ``encoding=\"locale\"`` 選項" -#: ../../whatsnew/3.10.rst:691 +#: ../../whatsnew/3.10.rst:693 msgid "" "The default encoding of :class:`TextIOWrapper` and :func:`open` is platform " "and locale dependent. Since UTF-8 is used on most Unix platforms, omitting " @@ -759,7 +761,7 @@ msgstr "" "多數 Unix 平台都使用 UTF-8,因此在打開 UTF-8 檔案(例如 JSON、YAML、TOML、" "Markdown)時省略 ``encoding`` 選項是個常見的 bug,例如:" -#: ../../whatsnew/3.10.rst:700 +#: ../../whatsnew/3.10.rst:702 msgid "" "To find this type of bug, an optional ``EncodingWarning`` is added. It is " "emitted when :data:`sys.flags.warn_default_encoding ` is true and " @@ -769,7 +771,7 @@ msgstr "" "warn_default_encoding ` 為 true 且使用特定於語言環境的預設編碼時," "會發出該信號。" -#: ../../whatsnew/3.10.rst:704 +#: ../../whatsnew/3.10.rst:706 msgid "" "``-X warn_default_encoding`` option and :envvar:`PYTHONWARNDEFAULTENCODING` " "are added to enable the warning." @@ -777,25 +779,25 @@ msgstr "" "新增 ``-X warn_default_encoding`` 選項和 :envvar:`PYTHONWARNDEFAULTENCODING` " "來啟用警告。" -#: ../../whatsnew/3.10.rst:707 +#: ../../whatsnew/3.10.rst:709 msgid "See :ref:`io-text-encoding` for more information." msgstr "更多資訊請見 :ref:`io-text-encoding`\\ 。" -#: ../../whatsnew/3.10.rst:712 +#: ../../whatsnew/3.10.rst:714 msgid "New Features Related to Type Hints" msgstr "與型別提示相關的新功能" -#: ../../whatsnew/3.10.rst:714 +#: ../../whatsnew/3.10.rst:716 msgid "" "This section covers major changes affecting :pep:`484` type hints and the :" "mod:`typing` module." msgstr "本節介紹影響 :pep:`484` 型別提示和 :mod:`typing` 模組的主要更改。" -#: ../../whatsnew/3.10.rst:719 +#: ../../whatsnew/3.10.rst:721 msgid "PEP 604: New Type Union Operator" msgstr "PEP 604:新型聯集運算子" -#: ../../whatsnew/3.10.rst:721 +#: ../../whatsnew/3.10.rst:723 msgid "" "A new type union operator was introduced which enables the syntax ``X | Y``. " "This provides a cleaner way of expressing 'either type X or type Y' instead " @@ -805,7 +807,7 @@ msgstr "" "別提示中更清晰的方式來表達「型別 X 或型別 Y」,來取代使用 :data:`typing." "Union`。" -#: ../../whatsnew/3.10.rst:725 +#: ../../whatsnew/3.10.rst:727 msgid "" "In previous versions of Python, to apply a type hint for functions accepting " "arguments of multiple types, :data:`typing.Union` was used::" @@ -813,22 +815,22 @@ msgstr "" "在以前版本的 Python 中,要使用接受多種型別參數之型別提示的函式,要使用 :data:" "`typing.Union`:" -#: ../../whatsnew/3.10.rst:732 +#: ../../whatsnew/3.10.rst:734 msgid "Type hints can now be written in a more succinct manner::" msgstr "現在可以用更簡潔的方式編寫型別提示:" -#: ../../whatsnew/3.10.rst:738 +#: ../../whatsnew/3.10.rst:740 msgid "" "This new syntax is also accepted as the second argument to :func:" "`isinstance` and :func:`issubclass`::" msgstr "" "這種新語法也接受作為 :func:`isinstance` 和 :func:`issubclass` 的第二個引數:" -#: ../../whatsnew/3.10.rst:744 +#: ../../whatsnew/3.10.rst:746 msgid "See :ref:`types-union` and :pep:`604` for more details." msgstr "更多資訊請見 :ref:`types-union` 與 :pep:`604`\\ 。" -#: ../../whatsnew/3.10.rst:746 +#: ../../whatsnew/3.10.rst:748 msgid "" "(Contributed by Maggie Moss and Philippe Prados in :issue:`41428`, with " "additions by Yurii Karabas and Serhiy Storchaka in :issue:`44490`.)" @@ -836,11 +838,11 @@ msgstr "" "(由 Maggie Moss 和 Philippe Prados 在 :issue:`41428` 中貢獻,由 Yurii " "Karabas 和 Serhiy Storchaka 在 :issue:`44490` 中補充。)" -#: ../../whatsnew/3.10.rst:751 +#: ../../whatsnew/3.10.rst:753 msgid "PEP 612: Parameter Specification Variables" msgstr "PEP 612:參數規範變數" -#: ../../whatsnew/3.10.rst:753 +#: ../../whatsnew/3.10.rst:755 msgid "" "Two new options to improve the information provided to static type checkers " "for :pep:`484`\\ 's ``Callable`` have been added to the :mod:`typing` module." @@ -848,7 +850,7 @@ msgstr "" ":mod:`typing` 模組中新增了兩個新選項,用於改進為 :pep:`484` ``Callable`` 的靜" "態型別檢查器 (static type checker) 所提供的資訊。" -#: ../../whatsnew/3.10.rst:756 +#: ../../whatsnew/3.10.rst:758 msgid "" "The first is the parameter specification variable. They are used to forward " "the parameter types of one callable to another callable -- a pattern " @@ -861,7 +863,7 @@ msgstr "" "用範例可以在 :class:`typing.ParamSpec` 中找到。在過去是沒有簡單的方法可以如此" "精確地來為參數型別的依賴關係做型別註釋。" -#: ../../whatsnew/3.10.rst:762 +#: ../../whatsnew/3.10.rst:764 msgid "" "The second option is the new ``Concatenate`` operator. It's used in " "conjunction with parameter specification variables to type annotate a higher " @@ -872,7 +874,7 @@ msgstr "" "階、會新增或刪除另一個可呼叫物件參數的可呼叫物件進行型別註釋。使用範例可以" "在 :class:`typing.Concatenate` 中找到。" -#: ../../whatsnew/3.10.rst:767 +#: ../../whatsnew/3.10.rst:769 msgid "" "See :class:`typing.Callable`, :class:`typing.ParamSpec`, :class:`typing." "Concatenate`, :class:`typing.ParamSpecArgs`, :class:`typing." @@ -882,7 +884,7 @@ msgstr "" "Concatenate`、:class:`typing.ParamSpecArgs`、:class:`typing.ParamSpecKwargs` " "和 :pep:`612` 以了解更多詳情。" -#: ../../whatsnew/3.10.rst:771 +#: ../../whatsnew/3.10.rst:773 msgid "" "(Contributed by Ken Jin in :issue:`41559`, with minor enhancements by Jelle " "Zijlstra in :issue:`43783`. PEP written by Mark Mendoza.)" @@ -890,11 +892,11 @@ msgstr "" "(由 Ken Jin 在 :issue:`41559` 中貢獻、Jelle Zijlstra 在 :issue:`43783` 中進" "行了小幅改進。PEP 由 Mark Mendoza 編寫。)" -#: ../../whatsnew/3.10.rst:776 +#: ../../whatsnew/3.10.rst:778 msgid "PEP 613: TypeAlias" msgstr "PEP 613:型別別名 (TypeAlias)" -#: ../../whatsnew/3.10.rst:778 +#: ../../whatsnew/3.10.rst:780 msgid "" ":pep:`484` introduced the concept of type aliases, only requiring them to be " "top-level unannotated assignments. This simplicity sometimes made it " @@ -906,7 +908,7 @@ msgstr "" "賦值 (top-level unannotated assignments)。這種簡單性有時使型別檢查器難以區分" "型別別名和普通賦值,尤其是在涉及傳遞參照 (reference) 或無效型別時。比較如下:" -#: ../../whatsnew/3.10.rst:786 +#: ../../whatsnew/3.10.rst:788 msgid "" "Now the :mod:`typing` module has a special value :data:`TypeAlias` which " "lets you declare type aliases more explicitly::" @@ -914,19 +916,19 @@ msgstr "" "現在 :mod:`typing` 模組有一個特殊值 :data:`TypeAlias`,它可以讓你更明確地宣告" "型別別名:" -#: ../../whatsnew/3.10.rst:792 +#: ../../whatsnew/3.10.rst:794 msgid "See :pep:`613` for more details." msgstr "更多資訊請見 :pep:`613`\\ 。" -#: ../../whatsnew/3.10.rst:794 +#: ../../whatsnew/3.10.rst:796 msgid "(Contributed by Mikhail Golubev in :issue:`41923`.)" msgstr "(由 Mikhail Golubev 在 :issue:`41923` 中貢獻。)" -#: ../../whatsnew/3.10.rst:797 +#: ../../whatsnew/3.10.rst:799 msgid "PEP 647: User-Defined Type Guards" msgstr "PEP 647:使用者定義的型別防護" -#: ../../whatsnew/3.10.rst:799 +#: ../../whatsnew/3.10.rst:801 msgid "" ":data:`TypeGuard` has been added to the :mod:`typing` module to annotate " "type guard functions and improve information provided to static type " @@ -937,7 +939,7 @@ msgstr "" "護函式並改進在型別窄縮 (type narrowing) 期間提供給靜態型別檢查器的資訊。有關" "更多資訊,請參閱 :data:`TypeGuard` 的文件和 :pep:`647`。" -#: ../../whatsnew/3.10.rst:804 +#: ../../whatsnew/3.10.rst:806 msgid "" "(Contributed by Ken Jin and Guido van Rossum in :issue:`43766`. PEP written " "by Eric Traut.)" @@ -945,11 +947,11 @@ msgstr "" "(由 Ken Jin 和 Guido van Rossum 在 :issue:`43766` 中貢獻。PEP 由 Eric Traut " "編寫。)" -#: ../../whatsnew/3.10.rst:808 +#: ../../whatsnew/3.10.rst:810 msgid "Other Language Changes" msgstr "其他語言更動" -#: ../../whatsnew/3.10.rst:810 +#: ../../whatsnew/3.10.rst:812 msgid "" "The :class:`int` type has a new method :meth:`int.bit_count`, returning the " "number of ones in the binary expansion of a given integer, also known as the " @@ -959,7 +961,7 @@ msgstr "" "式中 1 的數量,也稱為總體計數 (population count)。(由 Niklas Fiekas 在 :" "issue:`29882` 中貢獻。)" -#: ../../whatsnew/3.10.rst:814 +#: ../../whatsnew/3.10.rst:816 msgid "" "The views returned by :meth:`dict.keys`, :meth:`dict.values` and :meth:`dict." "items` now all have a ``mapping`` attribute that gives a :class:`types." @@ -971,7 +973,7 @@ msgstr "" "MappingProxyType` 包裝原始的字典物件。(由 Dennis Sweeney 在 :issue:`40890` " "中貢獻。)" -#: ../../whatsnew/3.10.rst:819 +#: ../../whatsnew/3.10.rst:821 msgid "" ":pep:`618`: The :func:`zip` function now has an optional ``strict`` flag, " "used to require that all the iterables have an equal length." @@ -979,7 +981,7 @@ msgstr "" ":pep:`618`::func:`zip` 函式現在有一個可選的 ``strict`` 旗標,用於要求所有可" "疊代物件具有相同的長度。" -#: ../../whatsnew/3.10.rst:822 +#: ../../whatsnew/3.10.rst:824 msgid "" "Builtin and extension functions that take integer arguments no longer " "accept :class:`~decimal.Decimal`\\ s, :class:`~fractions.Fraction`\\ s and " @@ -992,7 +994,7 @@ msgstr "" "meth:`~object.__int__` 方法,但沒有 :meth:`~object.__index__` 方法)。(由 " "Serhiy Storchaka 在 :issue:`37999` 中貢獻。)" -#: ../../whatsnew/3.10.rst:829 +#: ../../whatsnew/3.10.rst:831 msgid "" "If :func:`object.__ipow__` returns :const:`NotImplemented`, the operator " "will correctly fall back to :func:`object.__pow__` and :func:`object." @@ -1002,7 +1004,7 @@ msgstr "" "正確回退到 :func:`object.__pow__` 和 :func:`object.__rpow__` 。(由 Alex " "Shkop 在 :issue:`38302` 中貢獻。)" -#: ../../whatsnew/3.10.rst:833 +#: ../../whatsnew/3.10.rst:835 msgid "" "Assignment expressions can now be used unparenthesized within set literals " "and set comprehensions, as well as in sequence indexes (but not slices)." @@ -1010,7 +1012,7 @@ msgstr "" "現在可以在集合字面值 (set literals) 和集合綜合運算 (set comprehensions) 以及" "序列索引(但不能是切片)中使用不帶括號的賦值運算式 (assignment expressions)。" -#: ../../whatsnew/3.10.rst:836 +#: ../../whatsnew/3.10.rst:838 msgid "" "Functions have a new ``__builtins__`` attribute which is used to look for " "builtin symbols when a function is executed, instead of looking into " @@ -1023,7 +1025,7 @@ msgstr "" "存在,則屬性會以此做初始化,否則從當前內建物件 (builtins) 初始化。(由 Mark " "Shannon 在 :issue:`42990` 中貢獻。)" -#: ../../whatsnew/3.10.rst:842 +#: ../../whatsnew/3.10.rst:844 msgid "" "Two new builtin functions -- :func:`aiter` and :func:`anext` have been added " "to provide asynchronous counterparts to :func:`iter` and :func:`next`, " @@ -1034,7 +1036,7 @@ msgstr "" "func:`next` 提供非同步的對應函式。(由 Joshua Bronson、Daniel Pope 和 Justin " "Wang 在 :issue:`31861` 中貢獻。)" -#: ../../whatsnew/3.10.rst:847 +#: ../../whatsnew/3.10.rst:849 msgid "" "Static methods (:func:`@staticmethod `) and class methods (:" "func:`@classmethod `) now inherit the method attributes " @@ -1049,7 +1051,7 @@ msgstr "" "的 ``__wrapped__`` 屬性。此外,靜態方法現在可以像是常規函式般呼叫。(由 " "Victor Stinner 在 :issue:`43682` 中貢獻。)" -#: ../../whatsnew/3.10.rst:854 +#: ../../whatsnew/3.10.rst:856 msgid "" "Annotations for complex targets (everything beside ``simple name`` targets " "defined by :pep:`526`) no longer cause any runtime effects with ``from " @@ -1060,7 +1062,7 @@ msgstr "" "使用 ``from __future__ import comments`` 造成任何執行環境 (runtime) 影響。" "(由 Batuhan Taskaya 在 :issue:`42737` 中貢獻。)" -#: ../../whatsnew/3.10.rst:858 +#: ../../whatsnew/3.10.rst:860 msgid "" "Class and module objects now lazy-create empty annotations dicts on demand. " "The annotations dicts are stored in the object’s ``__dict__`` for backwards " @@ -1073,7 +1075,7 @@ msgstr "" "改進了 ``__annotations__`` 使用方式的最佳實踐方法;有關更多資訊,請參閱 :ref:" "`annotations-howto`。(由 Larry Hastings 在 :issue:`43901` 中貢獻。)" -#: ../../whatsnew/3.10.rst:865 +#: ../../whatsnew/3.10.rst:867 msgid "" "Annotations consist of ``yield``, ``yield from``, ``await`` or named " "expressions are now forbidden under ``from __future__ import annotations`` " @@ -1084,7 +1086,7 @@ msgstr "" "__future__ import comments`` 下被禁止,因為它們有些不預期的行為。(由 " "Batuhan Taskaya 在 :issue:`42725` 中貢獻。)" -#: ../../whatsnew/3.10.rst:870 +#: ../../whatsnew/3.10.rst:872 msgid "" "Usage of unbound variables, ``super()`` and other expressions that might " "alter the processing of symbol table as annotations are now rendered " @@ -1095,7 +1097,7 @@ msgstr "" "(symbol table) 的運算式,現在在 ``from __future__ import comments`` 下變得無" "效。(由 Batuhan Taskaya 在 :issue:`42725` 中貢獻。)" -#: ../../whatsnew/3.10.rst:875 +#: ../../whatsnew/3.10.rst:877 msgid "" "Hashes of NaN values of both :class:`float` type and :class:`decimal." "Decimal` type now depend on object identity. Formerly, they always hashed to " @@ -1110,7 +1112,7 @@ msgstr "" "collision),可能導致潛在的二次方執行環境行為 (quadratic runtime behavior)。" "(由 Raymond Hettinger 在 :issue:`43475` 中貢獻。)" -#: ../../whatsnew/3.10.rst:882 +#: ../../whatsnew/3.10.rst:884 msgid "" "A :exc:`SyntaxError` (instead of a :exc:`NameError`) will be raised when " "deleting the :const:`__debug__` constant. (Contributed by Donghee Na in :" @@ -1119,7 +1121,7 @@ msgstr "" "刪除 :const:`__debug__` 常數時將引發 :exc:`SyntaxError` (而不是 :exc:" "`NameError`)。(由 Donghee Na 在 :issue:`45000` 中貢獻。)" -#: ../../whatsnew/3.10.rst:885 +#: ../../whatsnew/3.10.rst:887 msgid "" ":exc:`SyntaxError` exceptions now have ``end_lineno`` and ``end_offset`` " "attributes. They will be ``None`` if not determined. (Contributed by Pablo " @@ -1128,23 +1130,23 @@ msgstr "" ":exc:`SyntaxError` 例外現在具有 ``end_lineno`` 和 ``end_offset`` 屬性。如果未" "被決定,它們將會是 ``None``。(由 Pablo Galindo 在 :issue:`43914` 中貢獻。)" -#: ../../whatsnew/3.10.rst:890 +#: ../../whatsnew/3.10.rst:892 msgid "New Modules" msgstr "新模組" -#: ../../whatsnew/3.10.rst:892 +#: ../../whatsnew/3.10.rst:894 msgid "None." msgstr "無。" -#: ../../whatsnew/3.10.rst:896 +#: ../../whatsnew/3.10.rst:898 msgid "Improved Modules" msgstr "改進的模組" -#: ../../whatsnew/3.10.rst:899 +#: ../../whatsnew/3.10.rst:901 msgid "asyncio" msgstr "asyncio" -#: ../../whatsnew/3.10.rst:901 +#: ../../whatsnew/3.10.rst:903 msgid "" "Add missing :meth:`~asyncio.events.AbstractEventLoop." "connect_accepted_socket` method. (Contributed by Alex Grönholm in :issue:" @@ -1153,11 +1155,11 @@ msgstr "" "新增缺少的 :meth:`~asyncio.events.AbstractEventLoop.connect_accepted_socket` " "方法。(由 Alex Grönholm 在 :issue:`41332` 中貢獻。)" -#: ../../whatsnew/3.10.rst:906 +#: ../../whatsnew/3.10.rst:908 msgid "argparse" msgstr "argparse" -#: ../../whatsnew/3.10.rst:908 +#: ../../whatsnew/3.10.rst:910 msgid "" "Misleading phrase \"optional arguments\" was replaced with \"options\" in " "argparse help. Some tests might require adaptation if they rely on exact " @@ -1167,11 +1169,11 @@ msgstr "" "(options)」。某些依賴於精確輸出匹配的測試可能需要進行調整。(由 Raymond " "Hettinger 在 :issue:`9694` 中貢獻。)" -#: ../../whatsnew/3.10.rst:912 +#: ../../whatsnew/3.10.rst:914 msgid "array" msgstr "array" -#: ../../whatsnew/3.10.rst:914 +#: ../../whatsnew/3.10.rst:916 msgid "" "The :meth:`~array.array.index` method of :class:`array.array` now has " "optional *start* and *stop* parameters. (Contributed by Anders Lorentsen and " @@ -1181,11 +1183,11 @@ msgstr "" "*start* 和 *stop* 參數。(由 Anders Lorentsen 和 Zackery Spytz 在 :issue:" "`31956` 中貢獻。)" -#: ../../whatsnew/3.10.rst:919 +#: ../../whatsnew/3.10.rst:921 msgid "asynchat, asyncore, smtpd" msgstr "asynchat, asyncore, smtpd" -#: ../../whatsnew/3.10.rst:920 +#: ../../whatsnew/3.10.rst:922 msgid "" "These modules have been marked as deprecated in their module documentation " "since Python 3.6. An import-time :class:`DeprecationWarning` has now been " @@ -1194,11 +1196,11 @@ msgstr "" "自 Python 3.6 起,這些模組在其文件中被標記為已棄用。引入時的 :class:" "`DeprecationWarning` 現已新增到這三個模組中。" -#: ../../whatsnew/3.10.rst:925 +#: ../../whatsnew/3.10.rst:927 msgid "base64" msgstr "base64" -#: ../../whatsnew/3.10.rst:927 +#: ../../whatsnew/3.10.rst:929 msgid "" "Add :func:`base64.b32hexencode` and :func:`base64.b32hexdecode` to support " "the Base32 Encoding with Extended Hex Alphabet." @@ -1206,11 +1208,11 @@ msgstr "" "新增 :func:`base64.b32hexencode` 和 :func:`base64.b32hexdecode` 以支援擴充十" "六進位字母的 Base32 編碼 (Base32 Encoding with Extended Hex Alphabet)。" -#: ../../whatsnew/3.10.rst:931 +#: ../../whatsnew/3.10.rst:933 msgid "bdb" msgstr "bdb" -#: ../../whatsnew/3.10.rst:933 +#: ../../whatsnew/3.10.rst:935 msgid "" "Add :meth:`~bdb.Breakpoint.clearBreakpoints` to reset all set breakpoints. " "(Contributed by Irit Katriel in :issue:`24160`.)" @@ -1218,11 +1220,11 @@ msgstr "" "新增 :meth:`~bdb.Breakpoint.clearBreakpoints` 來重置所有設定的斷點。(由 " "Irit Katriel 在 :issue:`24160` 中貢獻。)" -#: ../../whatsnew/3.10.rst:937 +#: ../../whatsnew/3.10.rst:939 msgid "bisect" msgstr "bisect" -#: ../../whatsnew/3.10.rst:939 +#: ../../whatsnew/3.10.rst:941 msgid "" "Added the possibility of providing a *key* function to the APIs in the :mod:" "`bisect` module. (Contributed by Raymond Hettinger in :issue:`4356`.)" @@ -1230,11 +1232,11 @@ msgstr "" "新增向 :mod:`bisect` 模組 API 提供 *key* 函式的可能性。(由 Raymond " "Hettinger 在 :issue:`4356` 中貢獻。)" -#: ../../whatsnew/3.10.rst:943 +#: ../../whatsnew/3.10.rst:945 msgid "codecs" msgstr "codecs" -#: ../../whatsnew/3.10.rst:945 +#: ../../whatsnew/3.10.rst:947 msgid "" "Add a :func:`codecs.unregister` function to unregister a codec search " "function. (Contributed by Hai Shi in :issue:`41842`.)" @@ -1242,11 +1244,11 @@ msgstr "" "新增 :func:`codecs.unregister` 函式來取消註冊 (unregister) 一個編解碼器的搜索" "功能。 (Hai Shi 在 :issue:`41842` 中貢獻。)" -#: ../../whatsnew/3.10.rst:949 +#: ../../whatsnew/3.10.rst:951 msgid "collections.abc" msgstr "collections.abc" -#: ../../whatsnew/3.10.rst:951 +#: ../../whatsnew/3.10.rst:953 msgid "" "The ``__args__`` of the :ref:`parameterized generic ` " "for :class:`collections.abc.Callable` are now consistent with :data:`typing." @@ -1272,11 +1274,11 @@ msgstr "" "Callable` 參數化可能會引發 :exc:`TypeError`,而在 Python 3.9 中該參數可能會無" "引發例外地傳遞。(由 Ken Jin 在 :issue:`42195` 中貢獻。)" -#: ../../whatsnew/3.10.rst:964 +#: ../../whatsnew/3.10.rst:966 msgid "contextlib" msgstr "contextlib" -#: ../../whatsnew/3.10.rst:966 +#: ../../whatsnew/3.10.rst:968 msgid "" "Add a :func:`contextlib.aclosing` context manager to safely close async " "generators and objects representing asynchronously released resources. " @@ -1286,7 +1288,7 @@ msgstr "" "步釋放資源的物件。(由 Joongi Kim 和 John Belmonte 在 :issue:`41229` 中貢" "獻。)" -#: ../../whatsnew/3.10.rst:970 +#: ../../whatsnew/3.10.rst:972 msgid "" "Add asynchronous context manager support to :func:`contextlib.nullcontext`. " "(Contributed by Tom Gringauz in :issue:`41543`.)" @@ -1294,7 +1296,7 @@ msgstr "" "向 :func:`contextlib.nullcontext` 新增非同步情境管理器支援。(由 Tom " "Gringauz 在 :issue:`41543` 中貢獻。)" -#: ../../whatsnew/3.10.rst:973 +#: ../../whatsnew/3.10.rst:975 msgid "" "Add :class:`AsyncContextDecorator`, for supporting usage of async context " "managers as decorators." @@ -1302,11 +1304,11 @@ msgstr "" "新增 :class:`AsyncContextDecorator`,用於支援將非同步情境管理器作為裝飾器使" "用。" -#: ../../whatsnew/3.10.rst:977 +#: ../../whatsnew/3.10.rst:979 msgid "curses" msgstr "curses" -#: ../../whatsnew/3.10.rst:979 +#: ../../whatsnew/3.10.rst:981 msgid "" "The extended color functions added in ncurses 6.1 will be used transparently " "by :func:`curses.color_content`, :func:`curses.init_color`, :func:`curses." @@ -1321,7 +1323,7 @@ msgstr "" "ncurses 函式庫是否支援擴充顏色。 (由 Jeffrey Kintscher 和 Hans Petter " "Jansson 在 :issue:`36982` 中貢獻。)" -#: ../../whatsnew/3.10.rst:986 +#: ../../whatsnew/3.10.rst:988 msgid "" "The ``BUTTON5_*`` constants are now exposed in the :mod:`curses` module if " "they are provided by the underlying curses library. (Contributed by Zackery " @@ -1330,15 +1332,15 @@ msgstr "" "如果 ``BUTTON5_*`` 常數是由底層 :mod:`curses` 函式庫提供的,那麼它們現在會在 " "curses 模組中公開。(由 Zackery Spytz 在 :issue:`39273` 中貢獻。)" -#: ../../whatsnew/3.10.rst:991 +#: ../../whatsnew/3.10.rst:993 msgid "dataclasses" msgstr "dataclasses" -#: ../../whatsnew/3.10.rst:994 +#: ../../whatsnew/3.10.rst:996 msgid "__slots__" msgstr "__slots__" -#: ../../whatsnew/3.10.rst:996 +#: ../../whatsnew/3.10.rst:998 msgid "" "Added ``slots`` parameter in :func:`dataclasses.dataclass` decorator. " "(Contributed by Yurii Karabas in :issue:`42269`)" @@ -1346,11 +1348,11 @@ msgstr "" "在 :func:`dataclasses.dataclass` 裝飾器中新增了 ``slots`` 參數。(由 Yurii " "Karabas 在 :issue:`42269` 中貢獻)" -#: ../../whatsnew/3.10.rst:1000 +#: ../../whatsnew/3.10.rst:1002 msgid "Keyword-only fields" msgstr "僅限關鍵字欄位 (Keyword-only fields)" -#: ../../whatsnew/3.10.rst:1002 +#: ../../whatsnew/3.10.rst:1004 msgid "" "dataclasses now supports fields that are keyword-only in the generated " "__init__ method. There are a number of ways of specifying keyword-only " @@ -1359,21 +1361,21 @@ msgstr "" "dataclasses 現在支援在產生的 __init__ 方法中包含僅限關鍵字的欄位。有多種方法" "可以指定僅限關鍵字欄位。" -#: ../../whatsnew/3.10.rst:1006 +#: ../../whatsnew/3.10.rst:1008 msgid "You can say that every field is keyword-only:" msgstr "你可以說每個欄位都是關鍵字:" -#: ../../whatsnew/3.10.rst:1017 +#: ../../whatsnew/3.10.rst:1019 msgid "" "Both ``name`` and ``birthday`` are keyword-only parameters to the generated " "__init__ method." msgstr "``name`` 和 ``birthday`` 都是產生的 __init__ 方法的僅限關鍵字參數。" -#: ../../whatsnew/3.10.rst:1020 +#: ../../whatsnew/3.10.rst:1022 msgid "You can specify keyword-only on a per-field basis:" msgstr "你可以在每個欄位的基礎上指定僅限關鍵字:" -#: ../../whatsnew/3.10.rst:1031 +#: ../../whatsnew/3.10.rst:1033 msgid "" "Here only ``birthday`` is keyword-only. If you set ``kw_only`` on " "individual fields, be aware that there are rules about re-ordering fields " @@ -1384,7 +1386,7 @@ msgstr "" "意,由於僅限關鍵字欄位需要遵循非僅限關鍵字欄位,因此會有欄位重新排序的相關規" "則。詳細資訊請參閱完整的 dataclasses 文件。" -#: ../../whatsnew/3.10.rst:1036 +#: ../../whatsnew/3.10.rst:1038 msgid "" "You can also specify that all fields following a KW_ONLY marker are keyword-" "only. This will probably be the most common usage:" @@ -1392,7 +1394,7 @@ msgstr "" "你還可以指定 KW_ONLY 標記後面的所有欄位均為僅限關鍵字欄位。這可能是最常見的用" "法:" -#: ../../whatsnew/3.10.rst:1051 +#: ../../whatsnew/3.10.rst:1053 msgid "" "Here, ``z`` and ``t`` are keyword-only parameters, while ``x`` and ``y`` are " "not. (Contributed by Eric V. Smith in :issue:`43532`.)" @@ -1400,11 +1402,11 @@ msgstr "" "這裡的 ``z`` 和 ``t`` 是僅限關鍵字參數,而 ``x`` 和 ``y`` 則不是。(由 Eric " "V. Smith 在 :issue:`43532` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1058 +#: ../../whatsnew/3.10.rst:1060 msgid "distutils" msgstr "distutils" -#: ../../whatsnew/3.10.rst:1060 +#: ../../whatsnew/3.10.rst:1062 msgid "" "The entire ``distutils`` package is deprecated, to be removed in Python " "3.12. Its functionality for specifying package builds has already been " @@ -1423,7 +1425,7 @@ msgstr "" "遷移任何其他地方的計畫,且使用其他功能的應用程式應該開始規劃如何取得程式碼的" "私有副本。請參閱 :pep:`632` 的討論。" -#: ../../whatsnew/3.10.rst:1070 +#: ../../whatsnew/3.10.rst:1072 msgid "" "The ``bdist_wininst`` command deprecated in Python 3.8 has been removed. The " "``bdist_wheel`` command is now recommended to distribute binary packages on " @@ -1433,12 +1435,12 @@ msgstr "" "``bdist_wheel`` 命令來在 Windows 上發布二進位套件。(由 Victor Stinner 在 :" "issue:`42802` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1076 +#: ../../whatsnew/3.10.rst:1078 msgid "doctest" msgstr "doctest" -#: ../../whatsnew/3.10.rst:1078 ../../whatsnew/3.10.rst:1213 -#: ../../whatsnew/3.10.rst:1240 ../../whatsnew/3.10.rst:1339 +#: ../../whatsnew/3.10.rst:1080 ../../whatsnew/3.10.rst:1215 +#: ../../whatsnew/3.10.rst:1242 ../../whatsnew/3.10.rst:1341 msgid "" "When a module does not define ``__loader__``, fall back to ``__spec__." "loader``. (Contributed by Brett Cannon in :issue:`42133`.)" @@ -1446,11 +1448,11 @@ msgstr "" "當模組未定義 ``__loader__`` 時,回退到 ``__spec__.loader`` 。(由 Brett " "Cannon 在 :issue:`42133` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1082 +#: ../../whatsnew/3.10.rst:1084 msgid "encodings" msgstr "encodings" -#: ../../whatsnew/3.10.rst:1084 +#: ../../whatsnew/3.10.rst:1086 msgid "" ":func:`encodings.normalize_encoding` now ignores non-ASCII characters. " "(Contributed by Hai Shi in :issue:`39337`.)" @@ -1458,11 +1460,11 @@ msgstr "" ":func:`encodings.normalize_encoding` 現在會忽略非 ASCII 字元。(Hai Shi 在 :" "issue:`39337` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1088 +#: ../../whatsnew/3.10.rst:1090 msgid "enum" msgstr "enum" -#: ../../whatsnew/3.10.rst:1090 +#: ../../whatsnew/3.10.rst:1092 msgid "" ":class:`Enum` :func:`__repr__` now returns ``enum_name.member_name`` and :" "func:`__str__` now returns ``member_name``. Stdlib enums available as " @@ -1474,7 +1476,7 @@ msgstr "" "``module_name.member_name`` 的 :func:`repr`。(由 Ethan Furman 在 :issue:" "`40066` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1095 +#: ../../whatsnew/3.10.rst:1097 msgid "" "Add :class:`enum.StrEnum` for enums where all members are strings. " "(Contributed by Ethan Furman in :issue:`41816`.)" @@ -1482,11 +1484,11 @@ msgstr "" "新增 :class:`enum.StrEnum`,為所有成員都是字串的列舉。(由 Ethan Furman 在 :" "issue:`41816` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1099 +#: ../../whatsnew/3.10.rst:1101 msgid "fileinput" msgstr "fileinput" -#: ../../whatsnew/3.10.rst:1101 +#: ../../whatsnew/3.10.rst:1103 msgid "" "Add *encoding* and *errors* parameters in :func:`fileinput.input` and :class:" "`fileinput.FileInput`. (Contributed by Inada Naoki in :issue:`43712`.)" @@ -1494,7 +1496,7 @@ msgstr "" "在 :func:`fileinput.input` 和 :class:`fileinput.FileInput` 中新增 *encoding* " "和 *errors* 參數。(由 Inada Naoki 在 :issue:`43712` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1105 +#: ../../whatsnew/3.10.rst:1107 msgid "" ":func:`fileinput.hook_compressed` now returns :class:`TextIOWrapper` object " "when *mode* is \"r\" and file is compressed, like uncompressed files. " @@ -1504,11 +1506,11 @@ msgstr "" "會回傳 :class:`TextIOWrapper` 物件(和未壓縮檔案一樣)。(由 Inada Naoki 在 :" "issue:`5758` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1110 +#: ../../whatsnew/3.10.rst:1112 msgid "faulthandler" msgstr "faulthandler" -#: ../../whatsnew/3.10.rst:1112 +#: ../../whatsnew/3.10.rst:1114 msgid "" "The :mod:`faulthandler` module now detects if a fatal error occurs during a " "garbage collector collection. (Contributed by Victor Stinner in :issue:" @@ -1517,11 +1519,11 @@ msgstr "" ":mod:`faulthandler` 模組現在可以檢測垃圾收集器 (garbage collector) 在收集期間" "是否發生嚴重錯誤。(由 Victor Stinner 在 :issue:`44466` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1117 +#: ../../whatsnew/3.10.rst:1119 msgid "gc" msgstr "gc" -#: ../../whatsnew/3.10.rst:1119 +#: ../../whatsnew/3.10.rst:1121 msgid "" "Add audit hooks for :func:`gc.get_objects`, :func:`gc.get_referrers` and :" "func:`gc.get_referents`. (Contributed by Pablo Galindo in :issue:`43439`.)" @@ -1530,11 +1532,11 @@ msgstr "" "get_referents` 新增稽核掛鉤 (audit hooks)。(由 Pablo Galindo 在 :issue:" "`43439` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1123 +#: ../../whatsnew/3.10.rst:1125 msgid "glob" msgstr "glob" -#: ../../whatsnew/3.10.rst:1125 +#: ../../whatsnew/3.10.rst:1127 msgid "" "Add the *root_dir* and *dir_fd* parameters in :func:`~glob.glob` and :func:" "`~glob.iglob` which allow to specify the root directory for searching. " @@ -1543,11 +1545,11 @@ msgstr "" "在 :func:`~glob.glob` 和 :func:`~glob.iglob` 中新增 *root_dir* 和 *dir_fd* 參" "數,允許指定搜索的根目錄。(由 Serhiy Storchaka 在 :issue:`38144` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1130 +#: ../../whatsnew/3.10.rst:1132 msgid "hashlib" msgstr "hashlib" -#: ../../whatsnew/3.10.rst:1132 +#: ../../whatsnew/3.10.rst:1134 msgid "" "The hashlib module requires OpenSSL 1.1.1 or newer. (Contributed by " "Christian Heimes in :pep:`644` and :issue:`43669`.)" @@ -1555,7 +1557,7 @@ msgstr "" "hashlib 模組需要 OpenSSL 1.1.1 或更高版本。(由 Christian Heimes 在 :pep:" "`644` 和 :issue:`43669` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1135 +#: ../../whatsnew/3.10.rst:1137 msgid "" "The hashlib module has preliminary support for OpenSSL 3.0.0. (Contributed " "by Christian Heimes in :issue:`38820` and other issues.)" @@ -1563,7 +1565,7 @@ msgstr "" "hashlib 模組初步支援 OpenSSL 3.0.0。(由 Christian Heimes 在 :issue:`38820` " "和其他問題中貢獻。)" -#: ../../whatsnew/3.10.rst:1138 +#: ../../whatsnew/3.10.rst:1140 msgid "" "The pure-Python fallback of :func:`~hashlib.pbkdf2_hmac` is deprecated. In " "the future PBKDF2-HMAC will only be available when Python has been built " @@ -1573,11 +1575,11 @@ msgstr "" "支援的建置 Python 中才能夠使用 PBKDF2-HMAC。(由 Christian Heimes 在 :issue:" "`43880` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1144 +#: ../../whatsnew/3.10.rst:1146 msgid "hmac" msgstr "hmac" -#: ../../whatsnew/3.10.rst:1146 +#: ../../whatsnew/3.10.rst:1148 msgid "" "The hmac module now uses OpenSSL's HMAC implementation internally. " "(Contributed by Christian Heimes in :issue:`40645`.)" @@ -1585,11 +1587,11 @@ msgstr "" "hmac 模組現在在內部使用 OpenSSL 的 HMAC 實作。 (由 Christian Heimes 在 :" "issue:`40645` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1150 +#: ../../whatsnew/3.10.rst:1152 msgid "IDLE and idlelib" msgstr "IDLE 和 idlelib" -#: ../../whatsnew/3.10.rst:1152 +#: ../../whatsnew/3.10.rst:1154 msgid "" "Make IDLE invoke :func:`sys.excepthook` (when started without '-n'). User " "hooks were previously ignored. (Contributed by Ken Hilton in :issue:" @@ -1599,7 +1601,7 @@ msgstr "" "掛鉤 (user hooks) 在以前是被忽略的。(由 Ken Hilton 在 :issue:`43008` 中貢" "獻。)" -#: ../../whatsnew/3.10.rst:1156 +#: ../../whatsnew/3.10.rst:1158 msgid "" "Rearrange the settings dialog. Split the General tab into Windows and Shell/" "Ed tabs. Move help sources, which extend the Help menu, to the Extensions " @@ -1615,11 +1617,11 @@ msgstr "" "獻。)將縮排空間設定從 Font 分頁移至新的 Windows 分頁。(由 Mark Roseman 和 " "Terry Jan Reedy 在 :issue:`33962` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1164 +#: ../../whatsnew/3.10.rst:1166 msgid "The changes above were backported to a 3.9 maintenance release." msgstr "上述更改已向後移植到 3.9 維護版本。" -#: ../../whatsnew/3.10.rst:1166 +#: ../../whatsnew/3.10.rst:1168 msgid "" "Add a Shell sidebar. Move the primary prompt ('>>>') to the sidebar. Add " "secondary prompts ('...') to the sidebar. Left click and optional drag " @@ -1635,7 +1637,7 @@ msgstr "" "prompts)」的情境選單,這會將側邊欄中提示字元與所選文字並排,此選項也會出現在" "文字的情境選單上。(由 Tal Einat 在 :issue:`37903` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1175 +#: ../../whatsnew/3.10.rst:1177 msgid "" "Use spaces instead of tabs to indent interactive code. This makes " "interactive code entries 'look right'. Making this feasible was a major " @@ -1646,7 +1648,7 @@ msgstr "" "起來正確」。新增 shell 側邊欄的主要動機是實現這一點。(由 Terry Jan Reedy " "在 :issue:`37892` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1180 +#: ../../whatsnew/3.10.rst:1182 msgid "" "Highlight the new :ref:`soft keywords ` :keyword:`match`, :" "keyword:`case `, and :keyword:`_ ` in pattern-" @@ -1659,11 +1661,11 @@ msgstr "" "`。然而這種突顯並不完美,並且在某些罕見的情況下會出錯,包" "括 ``case`` 模式中的一些 ``_``。(由 Tal Einat 在 :issue:`44010` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1186 +#: ../../whatsnew/3.10.rst:1188 msgid "New in 3.10 maintenance releases." msgstr "3.10 維護版本中的新增功能。" -#: ../../whatsnew/3.10.rst:1188 +#: ../../whatsnew/3.10.rst:1190 msgid "" "Apply syntax highlighting to ``.pyi`` files. (Contributed by Alex Waygood " "and Terry Jan Reedy in :issue:`45447`.)" @@ -1671,7 +1673,7 @@ msgstr "" "將語法突顯 (syntax highlighting) 應用於 ``.pyi`` 檔案。(由 Alex Waygood 和 " "Terry Jan Reedy 在 :issue:`45447` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1191 +#: ../../whatsnew/3.10.rst:1193 msgid "" "Include prompts when saving Shell with inputs and outputs. (Contributed by " "Terry Jan Reedy in :gh:`95191`.)" @@ -1679,11 +1681,11 @@ msgstr "" "保存帶有輸入和輸出的 Shell 時,會包含提示字元。(由 Terry Jan Reedy 在 :gh:" "`95191` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1195 +#: ../../whatsnew/3.10.rst:1197 msgid "importlib.metadata" msgstr "importlib.metadata" -#: ../../whatsnew/3.10.rst:1197 +#: ../../whatsnew/3.10.rst:1199 msgid "" "Feature parity with ``importlib_metadata`` 4.6 (`history `_)." @@ -1691,7 +1693,7 @@ msgstr "" "與 ``importlib_metadata`` 4.6 功能相同(`歷史 `_)。" -#: ../../whatsnew/3.10.rst:1200 +#: ../../whatsnew/3.10.rst:1202 msgid "" ":ref:`importlib.metadata entry points ` now provide a nicer " "experience for selecting entry points by group and name through a new :class:" @@ -1702,7 +1704,7 @@ msgstr "" "`importlib.metadata.EntryPoints` 類別提供了以群組和名稱選擇入口點的更好體驗。" "有關棄用與用法的更多資訊,請參閱文件中的相容性說明。" -#: ../../whatsnew/3.10.rst:1206 +#: ../../whatsnew/3.10.rst:1208 msgid "" "Added :func:`importlib.metadata.packages_distributions` for resolving top-" "level Python modules and packages to their :class:`importlib.metadata." @@ -1711,11 +1713,11 @@ msgstr "" "新增了 :func:`importlib.metadata.packages_distributions` 用於將頂階 Python 模" "組和套件解析出 :class:`importlib.metadata.Distribution`。" -#: ../../whatsnew/3.10.rst:1211 +#: ../../whatsnew/3.10.rst:1213 msgid "inspect" msgstr "inspect" -#: ../../whatsnew/3.10.rst:1216 +#: ../../whatsnew/3.10.rst:1218 msgid "" "Add :func:`inspect.get_annotations`, which safely computes the annotations " "defined on an object. It works around the quirks of accessing the " @@ -1743,11 +1745,11 @@ msgstr "" "著 :func:`inspect.signature` 和 :func:`inspect.Signature.from_callable` 現在" "也可以取消字串化註釋。(由 Larry Hastings 在 :issue:`43817` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1232 +#: ../../whatsnew/3.10.rst:1234 msgid "itertools" msgstr "itertools" -#: ../../whatsnew/3.10.rst:1234 +#: ../../whatsnew/3.10.rst:1236 msgid "" "Add :func:`itertools.pairwise()`. (Contributed by Raymond Hettinger in :" "issue:`38200`.)" @@ -1755,15 +1757,15 @@ msgstr "" "新增 :func:`itertools.pairwise()`。(由 Raymond Hettinger 在 :issue:`38200` " "中貢獻。)" -#: ../../whatsnew/3.10.rst:1238 +#: ../../whatsnew/3.10.rst:1240 msgid "linecache" msgstr "linecache" -#: ../../whatsnew/3.10.rst:1244 +#: ../../whatsnew/3.10.rst:1246 msgid "os" msgstr "os" -#: ../../whatsnew/3.10.rst:1246 +#: ../../whatsnew/3.10.rst:1248 msgid "" "Add :func:`os.cpu_count()` support for VxWorks RTOS. (Contributed by Peixing " "Xin in :issue:`41440`.)" @@ -1771,7 +1773,7 @@ msgstr "" "為 VxWorks RTOS 新增 :func:`os.cpu_count()` 支援。(由 Peixing Xin 在 :issue:" "`41440` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1249 +#: ../../whatsnew/3.10.rst:1251 msgid "" "Add a new function :func:`os.eventfd` and related helpers to wrap the " "``eventfd2`` syscall on Linux. (Contributed by Christian Heimes in :issue:" @@ -1780,7 +1782,7 @@ msgstr "" "新增函式 :func:`os.eventfd` 和相關幫助程式來包裝 Linux 上的 ``eventfd2`` 系統" "呼叫。 (由 Christian Heimes 在 :issue:`41001` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1253 +#: ../../whatsnew/3.10.rst:1255 msgid "" "Add :func:`os.splice()` that allows to move data between two file " "descriptors without copying between kernel address space and user address " @@ -1792,7 +1794,7 @@ msgstr "" "address space) 之間進行複製,其中檔案描述器之一必須是個 pipe。(由 Pablo " "Galindo 在 :issue:`41625` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1258 +#: ../../whatsnew/3.10.rst:1260 msgid "" "Add :const:`~os.O_EVTONLY`, :const:`~os.O_FSYNC`, :const:`~os.O_SYMLINK` " "and :const:`~os.O_NOFOLLOW_ANY` for macOS. (Contributed by Donghee Na in :" @@ -1802,11 +1804,11 @@ msgstr "" "O_SYMLINK` 和 :const:`~os.O_NOFOLLOW_ANY`。(由 Donghee Na 在 :issue:`43106` " "中貢獻。)" -#: ../../whatsnew/3.10.rst:1263 +#: ../../whatsnew/3.10.rst:1265 msgid "os.path" msgstr "os.path" -#: ../../whatsnew/3.10.rst:1265 +#: ../../whatsnew/3.10.rst:1267 msgid "" ":func:`os.path.realpath` now accepts a *strict* keyword-only argument. When " "set to ``True``, :exc:`OSError` is raised if a path doesn't exist or a " @@ -1816,11 +1818,11 @@ msgstr "" "``True`` 時,如果路徑不存在或遇到符號鏈接循環 (symlink loop),則會引發 :exc:" "`OSError`。(由 Barney Gale 在 :issue:`43757` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1271 +#: ../../whatsnew/3.10.rst:1273 msgid "pathlib" msgstr "pathlib" -#: ../../whatsnew/3.10.rst:1273 +#: ../../whatsnew/3.10.rst:1275 msgid "" "Add slice support to :attr:`PurePath.parents `. " "(Contributed by Joshua Cannon in :issue:`35498`.)" @@ -1828,7 +1830,7 @@ msgstr "" "新增 :attr:`PurePath.parents ` 對於切片的支援。 " "(由 Joshua Cannon 在 :issue:`35498` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1276 +#: ../../whatsnew/3.10.rst:1278 msgid "" "Add negative indexing support to :attr:`PurePath.parents `. (Contributed by Yaroslav Pankovych in :issue:`21041`.)" @@ -1836,18 +1838,18 @@ msgstr "" "向 :attr:`PurePath.parents ` 新增負索引支援。(由 " "Yaroslav Pankovych 在 :issue:`21041` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1280 +#: ../../whatsnew/3.10.rst:1282 msgid "" "Add :meth:`Path.hardlink_to ` method that " -"supersedes :meth:`~pathlib.Path.link_to`. The new method has the same " -"argument order as :meth:`~pathlib.Path.symlink_to`. (Contributed by Barney " -"Gale in :issue:`39950`.)" +"supersedes :meth:`!link_to`. The new method has the same argument order as :" +"meth:`~pathlib.Path.symlink_to`. (Contributed by Barney Gale in :issue:" +"`39950`.)" msgstr "" -"新增替代 :meth:`~pathlib.Path.link_to` 的 :meth:`Path.hardlink_to ` 方法。新方法與 :meth:`~pathlib.Path.symlink_to` 具有相同的" -"引數順序。(由 Barney Gale 在 :issue:`39950` 中貢獻。)" +"新增替代 :meth:`!link_to` 的 :meth:`Path.hardlink_to ` 方法。新方法與 :meth:`~pathlib.Path.symlink_to` 具有相同的引數" +"順序。(由 Barney Gale 在 :issue:`39950` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1285 +#: ../../whatsnew/3.10.rst:1287 msgid "" ":meth:`pathlib.Path.stat` and :meth:`~pathlib.Path.chmod` now accept a " "*follow_symlinks* keyword-only argument for consistency with corresponding " @@ -1858,11 +1860,11 @@ msgstr "" "*follow_symlinks* 僅限關鍵字引數,以與 :mod:`os` 模組中的相應函式保持一致。" "(由 Barney Gale 在 :issue:`39906` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1291 +#: ../../whatsnew/3.10.rst:1293 msgid "platform" msgstr "platform" -#: ../../whatsnew/3.10.rst:1293 +#: ../../whatsnew/3.10.rst:1295 msgid "" "Add :func:`platform.freedesktop_os_release()` to retrieve operation system " "identification from `freedesktop.org os-release `\\ 包含已棄用功能的列表。(由 Christian Heimes 在 :issue:`43880` " "中貢獻。)" -#: ../../whatsnew/3.10.rst:1374 +#: ../../whatsnew/3.10.rst:1376 msgid "" "The ssl module now has more secure default settings. Ciphers without forward " "secrecy or SHA-1 MAC are disabled by default. Security level 2 prohibits " @@ -2034,7 +2036,7 @@ msgstr "" "`~ssl.SSLContext` 預設為最低協議版本 TLS 1.2。設定基於 Hynek Schlawack 的研" "究。 (由 Christian Heimes 在 :issue:`43998` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1381 +#: ../../whatsnew/3.10.rst:1383 msgid "" "The deprecated protocols SSL 3.0, TLS 1.0, and TLS 1.1 are no longer " "officially supported. Python does not block them actively. However OpenSSL " @@ -2045,7 +2047,7 @@ msgstr "" "們。然而,OpenSSL 建置選項、發行版配置、發行商補丁和密碼套件可能會阻止交握的" "成功。" -#: ../../whatsnew/3.10.rst:1386 +#: ../../whatsnew/3.10.rst:1388 msgid "" "Add a *timeout* parameter to the :func:`ssl.get_server_certificate` " "function. (Contributed by Zackery Spytz in :issue:`31870`.)" @@ -2053,7 +2055,7 @@ msgstr "" "向 :func:`ssl.get_server_certificate` 函式新增 *timeout* 參數。(由 Zackery " "Spytz 在 :issue:`31870` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1389 +#: ../../whatsnew/3.10.rst:1391 msgid "" "The ssl module uses heap-types and multi-phase initialization. (Contributed " "by Christian Heimes in :issue:`42333`.)" @@ -2061,7 +2063,7 @@ msgstr "" "ssl 模組使用堆疊類型 (heap-types) 和多階段初始化 (multi-phase " "initialization)。(由 Christian Heimes 在 :issue:`42333` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1392 +#: ../../whatsnew/3.10.rst:1394 msgid "" "A new verify flag :const:`~ssl.VERIFY_X509_PARTIAL_CHAIN` has been added. " "(Contributed by l0x in :issue:`40849`.)" @@ -2069,11 +2071,11 @@ msgstr "" "新增驗證旗標 :const:`~ssl.VERIFY_X509_PARTIAL_CHAIN`。(由 l0x 在 :issue:" "`40849` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1396 +#: ../../whatsnew/3.10.rst:1398 msgid "sqlite3" msgstr "sqlite3" -#: ../../whatsnew/3.10.rst:1398 +#: ../../whatsnew/3.10.rst:1400 msgid "" "Add audit events for :func:`~sqlite3.connect/handle`, :meth:`~sqlite3." "Connection.enable_load_extension`, and :meth:`~sqlite3.Connection." @@ -2083,11 +2085,11 @@ msgstr "" "enable_load_extension` 和 :meth:`~sqlite3.Connection.load_extension` 的稽核事" "件。(由 Erlend E. Aasland 在 :issue:`43762` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1404 +#: ../../whatsnew/3.10.rst:1406 msgid "sys" msgstr "sys" -#: ../../whatsnew/3.10.rst:1406 +#: ../../whatsnew/3.10.rst:1408 msgid "" "Add :data:`sys.orig_argv` attribute: the list of the original command line " "arguments passed to the Python executable. (Contributed by Victor Stinner " @@ -2096,7 +2098,7 @@ msgstr "" "新增 :data:`sys.orig_argv` 屬性:傳遞給 Python 可執行檔案的原始命令列引數列" "表。(由 Victor Stinner 在 :issue:`23427` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1410 +#: ../../whatsnew/3.10.rst:1412 msgid "" "Add :data:`sys.stdlib_module_names`, containing the list of the standard " "library module names. (Contributed by Victor Stinner in :issue:`42955`.)" @@ -2104,11 +2106,11 @@ msgstr "" "新增 :data:`sys.stdlib_module_names`,其中包含標準函式庫模組的名稱列表。 " "(由 Victor Stinner 在 :issue:`42955` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1415 +#: ../../whatsnew/3.10.rst:1417 msgid "_thread" msgstr "_thread" -#: ../../whatsnew/3.10.rst:1417 +#: ../../whatsnew/3.10.rst:1419 msgid "" ":func:`_thread.interrupt_main` now takes an optional signal number to " "simulate (the default is still :const:`signal.SIGINT`). (Contributed by " @@ -2118,11 +2120,11 @@ msgstr "" "然是 :const:`signal.SIGINT`)。 (由 Antoine Pitrou 在 :issue:`43356` 中貢" "獻。)" -#: ../../whatsnew/3.10.rst:1422 +#: ../../whatsnew/3.10.rst:1424 msgid "threading" msgstr "threading" -#: ../../whatsnew/3.10.rst:1424 +#: ../../whatsnew/3.10.rst:1426 msgid "" "Add :func:`threading.gettrace` and :func:`threading.getprofile` to retrieve " "the functions set by :func:`threading.settrace` and :func:`threading." @@ -2132,7 +2134,7 @@ msgstr "" "func:`threading.settrace` 和 :func:`threading.setprofile` 設定的函式。(由 " "Mario Corchero 在 :issue:`42251` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1429 +#: ../../whatsnew/3.10.rst:1431 msgid "" "Add :data:`threading.__excepthook__` to allow retrieving the original value " "of :func:`threading.excepthook` in case it is set to a broken or a different " @@ -2142,11 +2144,11 @@ msgstr "" "excepthook` 的原始值,以防它被設定為損壞或不同的值。(由 Mario Corchero 在 :" "issue:`42308` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1435 +#: ../../whatsnew/3.10.rst:1437 msgid "traceback" msgstr "traceback" -#: ../../whatsnew/3.10.rst:1437 +#: ../../whatsnew/3.10.rst:1439 msgid "" "The :func:`~traceback.format_exception`, :func:`~traceback." "format_exception_only`, and :func:`~traceback.print_exception` functions can " @@ -2158,11 +2160,11 @@ msgstr "" "外物件作為僅限位置引數。(由 Zackery Spytz 和 Matthias Bussonnier 在 :issue:" "`26389` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1444 +#: ../../whatsnew/3.10.rst:1446 msgid "types" msgstr "types" -#: ../../whatsnew/3.10.rst:1446 +#: ../../whatsnew/3.10.rst:1448 msgid "" "Reintroduce the :data:`types.EllipsisType`, :data:`types.NoneType` and :data:" "`types.NotImplementedType` classes, providing a new set of types readily " @@ -2173,15 +2175,15 @@ msgstr "" "NotImplementedType` 類別,提供一組易於型別檢查器直譯的新型別。(由 Bas van " "Beek 在 :issue:`41810` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1452 +#: ../../whatsnew/3.10.rst:1454 msgid "typing" msgstr "typing" -#: ../../whatsnew/3.10.rst:1454 +#: ../../whatsnew/3.10.rst:1456 msgid "For major changes, see :ref:`new-feat-related-type-hints`." msgstr "有關重大更改,請參閱\\ :ref:`new-feat-related-type-hints`。" -#: ../../whatsnew/3.10.rst:1456 +#: ../../whatsnew/3.10.rst:1458 msgid "" "The behavior of :class:`typing.Literal` was changed to conform with :pep:" "`586` and to match the behavior of static type checkers specified in the PEP." @@ -2189,16 +2191,16 @@ msgstr "" ":class:`typing.Literal` 的行為已更改為符合 :pep:`586` 並匹配 PEP 中指定的靜態" "型別檢查器的行為。" -#: ../../whatsnew/3.10.rst:1459 +#: ../../whatsnew/3.10.rst:1461 msgid "``Literal`` now de-duplicates parameters." msgstr "``Literal`` 現在可以刪除重複參數。" -#: ../../whatsnew/3.10.rst:1460 +#: ../../whatsnew/3.10.rst:1462 msgid "" "Equality comparisons between ``Literal`` objects are now order independent." msgstr "``Literal`` 物件之間的相等性比較現在與順序無關。" -#: ../../whatsnew/3.10.rst:1461 +#: ../../whatsnew/3.10.rst:1463 msgid "" "``Literal`` comparisons now respect types. For example, ``Literal[0] == " "Literal[False]`` previously evaluated to ``True``. It is now ``False``. To " @@ -2209,7 +2211,7 @@ msgstr "" "Literal[False]`` 先前之求值為 ``True``,但現在它是 ``False``。為了支援此更" "改,內部使用的型別快取現在支援了型別的辨認。" -#: ../../whatsnew/3.10.rst:1465 +#: ../../whatsnew/3.10.rst:1467 msgid "" "``Literal`` objects will now raise a :exc:`TypeError` exception during " "equality comparisons if any of their parameters are not :term:`hashable`. " @@ -2220,11 +2222,11 @@ msgstr "" "在將在相等性比較期間引發 :exc:`TypeError` 例外。請注意,使用不可雜湊的參數宣" "告 ``Literal`` 不會引發錯誤:" -#: ../../whatsnew/3.10.rst:1477 +#: ../../whatsnew/3.10.rst:1479 msgid "(Contributed by Yurii Karabas in :issue:`42345`.)" msgstr "(由 Yurii Karabas 在 :issue:`42345` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1479 +#: ../../whatsnew/3.10.rst:1481 msgid "" "Add new function :func:`typing.is_typeddict` to introspect if an annotation " "is a :class:`typing.TypedDict`. (Contributed by Patrick Reader in :issue:" @@ -2233,7 +2235,7 @@ msgstr "" "新增函式 :func:`typing.is_typeddict` 來自我審查 (introspect) 註釋是否為 :" "class:`typing.TypedDict`。(由 Patrick Reader 在 :issue:`41792` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1483 +#: ../../whatsnew/3.10.rst:1485 msgid "" "Subclasses of ``typing.Protocol`` which only have data variables declared " "will now raise a ``TypeError`` when checked with ``isinstance`` unless they " @@ -2248,7 +2250,7 @@ msgstr "" "該使用 :func:`runtime_checkable` 裝飾器來裝飾其子類別。(由 Yurii Karabas " "在 :issue:`38908` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1491 +#: ../../whatsnew/3.10.rst:1493 msgid "" "Importing from the ``typing.io`` and ``typing.re`` submodules will now emit :" "exc:`DeprecationWarning`. These submodules have been deprecated since " @@ -2261,11 +2263,11 @@ msgstr "" "Python 中刪除。屬於這些子模組的任何內容都應該直接從 :mod:`typing` 引入。 " "(由 Sebastian Rittau 在 :issue:`38291` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1499 +#: ../../whatsnew/3.10.rst:1501 msgid "unittest" msgstr "unittest" -#: ../../whatsnew/3.10.rst:1501 +#: ../../whatsnew/3.10.rst:1503 msgid "" "Add new method :meth:`~unittest.TestCase.assertNoLogs` to complement the " "existing :meth:`~unittest.TestCase.assertLogs`. (Contributed by Kit Yan Choi " @@ -2275,11 +2277,11 @@ msgstr "" "`~unittest.TestCase.assertLogs`。(由 Kit Yan Choi 在 :issue:`39385` 中貢" "獻。)" -#: ../../whatsnew/3.10.rst:1506 +#: ../../whatsnew/3.10.rst:1508 msgid "urllib.parse" msgstr "urllib.parse" -#: ../../whatsnew/3.10.rst:1508 +#: ../../whatsnew/3.10.rst:1510 msgid "" "Python versions earlier than Python 3.10 allowed using both ``;`` and ``&`` " "as query parameter separators in :func:`urllib.parse.parse_qs` and :func:" @@ -2299,11 +2301,11 @@ msgstr "" "訊,請參閱各自的文件。(由 Adam Goldschmidt、Senthil Kumaran 和 Ken Jin 在 :" "issue:`42967` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1519 +#: ../../whatsnew/3.10.rst:1521 msgid "xml" msgstr "xml" -#: ../../whatsnew/3.10.rst:1521 +#: ../../whatsnew/3.10.rst:1523 msgid "" "Add a :class:`~xml.sax.handler.LexicalHandler` class to the :mod:`xml.sax." "handler` module. (Contributed by Jonathan Gossage and Zackery Spytz in :" @@ -2312,11 +2314,11 @@ msgstr "" "新增 :class:`~xml.sax.handler.LexicalHandler` 類別到 :mod:`xml.sax.handler` " "模組。(由 Jonathan Gossage 和 Zackery Spytz 在 :issue:`35018` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1526 +#: ../../whatsnew/3.10.rst:1528 msgid "zipimport" msgstr "zipimport" -#: ../../whatsnew/3.10.rst:1527 +#: ../../whatsnew/3.10.rst:1529 msgid "" "Add methods related to :pep:`451`: :meth:`~zipimport.zipimporter." "find_spec`, :meth:`zipimport.zipimporter.create_module`, and :meth:" @@ -2327,7 +2329,7 @@ msgstr "" "meth:`zipimport.zipimporter.create_module` 和 :meth:`zipimport.zipimporter." "exec_module`。(由 Brett Cannon 在 :issue:`42131` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1532 +#: ../../whatsnew/3.10.rst:1534 msgid "" "Add :meth:`~zipimport.zipimporter.invalidate_caches` method. (Contributed by " "Desmond Cheong in :issue:`14678`.)" @@ -2335,11 +2337,11 @@ msgstr "" "新增 :meth:`~zipimport.zipimporter.invalidate_caches` 方法。(由 Desmond " "Cheong 在 :issue:`14678` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1537 +#: ../../whatsnew/3.10.rst:1539 msgid "Optimizations" msgstr "最佳化" -#: ../../whatsnew/3.10.rst:1539 +#: ../../whatsnew/3.10.rst:1541 msgid "" "Constructors :func:`str`, :func:`bytes` and :func:`bytearray` are now faster " "(around 30--40% for small objects). (Contributed by Serhiy Storchaka in :" @@ -2348,7 +2350,7 @@ msgstr "" "建構函式 :func:`str`、:func:`bytes` 和 :func:`bytearray` 現在更快了(對於小型" "物件大約快了 30--40%)。(由 Serhiy Storchaka 在 :issue:`41334` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1543 +#: ../../whatsnew/3.10.rst:1545 msgid "" "The :mod:`runpy` module now imports fewer modules. The ``python3 -m module-" "name`` command startup time is 1.4x faster in average. On Linux, ``python3 -" @@ -2361,7 +2363,7 @@ msgstr "" "引入 69 個模組,而在 Python 3.10 上僅引入 51 個模組 (-18)。(由 Victor " "Stinner 在 :issue:`41006` 和 :issue:`41718` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1549 +#: ../../whatsnew/3.10.rst:1551 msgid "" "The ``LOAD_ATTR`` instruction now uses new \"per opcode cache\" mechanism. " "It is about 36% faster now for regular attributes and 44% faster for slots. " @@ -2374,7 +2376,7 @@ msgstr "" "Yury Selivanov 在 :issue:`42093` 中以及 Guido van Rossum 在 :issue:`42927` 中" "貢獻,基於最初在 PyPy 和 MicroPython 中實作的想法。)" -#: ../../whatsnew/3.10.rst:1555 +#: ../../whatsnew/3.10.rst:1557 msgid "" "When building Python with :option:`--enable-optimizations` now ``-fno-" "semantic-interposition`` is added to both the compile and link line. This " @@ -2391,7 +2393,7 @@ msgstr "" "linux-8-2-brings-faster-python-3-8-run-speeds/>`_ 以了解詳情。(由 Victor " "Stinner 和 Pablo Galindo 在 :issue:`38980` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1563 +#: ../../whatsnew/3.10.rst:1565 msgid "" "Use a new output buffer management code for :mod:`bz2` / :mod:`lzma` / :mod:" "`zlib` modules, and add ``.readall()`` function to ``_compression." @@ -2406,7 +2408,7 @@ msgstr "" "``GzipFile.read(-1)`` 速度提高了 1.11x ~ 1.18x。(由 Ma Lin 於 :issue:" "`41486` 貢獻、由 Gregory P. Smith 審閱)" -#: ../../whatsnew/3.10.rst:1569 +#: ../../whatsnew/3.10.rst:1571 msgid "" "When using stringized annotations, annotations dicts for functions are no " "longer created when the function is created. Instead, they are stored as a " @@ -2420,7 +2422,7 @@ msgstr "" "最佳化將定義帶有註釋的函式所需的 CPU 時間減少了一半。(由 Yurii Karabas 和 " "Inada Naoki 在 :issue:`42202` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1576 +#: ../../whatsnew/3.10.rst:1578 msgid "" "Substring search functions such as ``str1 in str2`` and ``str2.find(str1)`` " "now sometimes use Crochemore & Perrin's \"Two-Way\" string searching " @@ -2431,7 +2433,7 @@ msgstr "" "用 Crochemore & Perrin 的「雙向」字串搜索演算法來避免作用於長字串上時發生二次" "方行為 (quadratic behavior)。(由 Dennis Sweeney 在 :issue:`41972` 中貢獻)" -#: ../../whatsnew/3.10.rst:1581 +#: ../../whatsnew/3.10.rst:1583 msgid "" "Add micro-optimizations to ``_PyType_Lookup()`` to improve type attribute " "cache lookup performance in the common case of cache hits. This makes the " @@ -2442,7 +2444,7 @@ msgstr "" "查找性能。這使得直譯器平均速度提高了 1.04 倍。(由 Dino Viehland 在 :issue:" "`43452` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1585 +#: ../../whatsnew/3.10.rst:1587 msgid "" "The following built-in functions now support the faster :pep:`590` " "vectorcall calling convention: :func:`map`, :func:`filter`, :func:" @@ -2455,7 +2457,7 @@ msgstr "" "Na 和 Jeroen Demeyer 在 :issue:`43575`、:issue:`43287`、:issue:`41922`、:" "issue:`41873` 和 :issue:`41870` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1589 +#: ../../whatsnew/3.10.rst:1591 msgid "" ":class:`BZ2File` performance is improved by removing internal ``RLock``. " "This makes :class:`BZ2File` thread unsafe in the face of multiple " @@ -2467,11 +2469,11 @@ msgstr "" "`BZ2File` 在面對多個同時的讀取器或寫入器時執行緒不安全,就像 :mod:`gzip` 和 :" "mod:`lzma` 中的等效類別一樣。(由 Inada Naoki 在 :issue:`43785` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1597 ../../whatsnew/3.10.rst:2203 +#: ../../whatsnew/3.10.rst:1599 ../../whatsnew/3.10.rst:2205 msgid "Deprecated" msgstr "已棄用" -#: ../../whatsnew/3.10.rst:1599 +#: ../../whatsnew/3.10.rst:1601 msgid "" "Currently Python accepts numeric literals immediately followed by keywords, " "for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing and " @@ -2491,7 +2493,7 @@ msgstr "" "其中之一,則會引發棄用警告。在未來的版本中,它將被變更為語法警告,最後成為為" "語法錯誤。(由 Serhiy Storchaka 在 :issue:`43833` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1610 +#: ../../whatsnew/3.10.rst:1612 msgid "" "Starting in this release, there will be a concerted effort to begin cleaning " "up old import semantics that were kept for Python 2.7 compatibility. " @@ -2517,7 +2519,7 @@ msgstr "" "類別和方法)。將酌情引發 :exc:`ImportWarning` 和/或 :exc:" "`DeprecationWarning` 以幫助識別在此轉換期間需要更新的程式碼。" -#: ../../whatsnew/3.10.rst:1627 +#: ../../whatsnew/3.10.rst:1629 msgid "" "The entire ``distutils`` namespace is deprecated, to be removed in Python " "3.12. Refer to the :ref:`module changes ` section for " @@ -2526,7 +2528,7 @@ msgstr "" "整個 ``distutils`` 命名空間已棄用,將在 Python 3.12 中刪除。請參閱\\ :ref:`模" "組更改 ` 以獲取更多資訊。" -#: ../../whatsnew/3.10.rst:1631 +#: ../../whatsnew/3.10.rst:1633 msgid "" "Non-integer arguments to :func:`random.randrange` are deprecated. The :exc:" "`ValueError` is deprecated in favor of a :exc:`TypeError`. (Contributed by " @@ -2536,7 +2538,7 @@ msgstr "" "代之的是 :exc:`TypeError`。(由 Serhiy Storchaka 和 Raymond Hettinger 在 :" "issue:`37319` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1635 +#: ../../whatsnew/3.10.rst:1637 msgid "" "The various ``load_module()`` methods of :mod:`importlib` have been " "documented as deprecated since Python 3.6, but will now also trigger a :exc:" @@ -2547,7 +2549,7 @@ msgstr "" "用,但現在也會觸發 :exc:`DeprecationWarning`。請改用 :meth:`~importlib.abc." "Loader.exec_module`。(由 Brett Cannon 在 :issue:`26131` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1641 +#: ../../whatsnew/3.10.rst:1643 msgid "" ":meth:`zimport.zipimporter.load_module` has been deprecated in preference " "for :meth:`~zipimport.zipimporter.exec_module`. (Contributed by Brett Cannon " @@ -2556,7 +2558,7 @@ msgstr "" ":meth:`zimport.zipimporter.load_module` 已被棄用,請用 :meth:`~zipimport." "zipimporter.exec_module`。(由 Brett Cannon 在 :issue:`26131` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1645 +#: ../../whatsnew/3.10.rst:1647 msgid "" "The use of :meth:`~importlib.abc.Loader.load_module` by the import system " "now triggers an :exc:`ImportWarning` as :meth:`~importlib.abc.Loader." @@ -2566,7 +2568,7 @@ msgstr "" "`ImportWarning`,因為 :meth:`~importlib.abc.Loader.exec_module` 是當前首選。" "(由 Brett Cannon 在 :issue:`26131` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1650 +#: ../../whatsnew/3.10.rst:1652 msgid "" "The use of :meth:`!importlib.abc.MetaPathFinder.find_module` and :meth:`!" "importlib.abc.PathEntryFinder.find_module` by the import system now trigger " @@ -2582,7 +2584,7 @@ msgstr "" "util.spec_from_loader` 來幫助移植。(由 Brett Cannon 在 :issue:`42134` 中貢" "獻。)" -#: ../../whatsnew/3.10.rst:1659 +#: ../../whatsnew/3.10.rst:1661 msgid "" "The use of :meth:`!importlib.abc.PathEntryFinder.find_loader` by the import " "system now triggers an :exc:`ImportWarning` as :meth:`importlib.abc." @@ -2595,7 +2597,7 @@ msgstr "" "首選。你可以使用 :func:`importlib.util.spec_from_loader` 來幫助移植。(由 " "Brett Cannon 在 :issue:`43672` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1665 +#: ../../whatsnew/3.10.rst:1667 msgid "" "The various implementations of :meth:`!importlib.abc.MetaPathFinder." "find_module` ( :meth:`!importlib.machinery.BuiltinImporter.find_module`, :" @@ -2620,7 +2622,7 @@ msgstr "" "發 :exc:`DeprecationWarning` 並計劃在 Python 3.12 中刪除(之前它們已在 " "Python 3.4 中被記錄為已棄用)。(由 Brett Cannon 在 :issue:`42135` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1680 +#: ../../whatsnew/3.10.rst:1682 msgid "" ":class:`!importlib.abc.Finder` is deprecated (including its sole method, :" "meth:`!find_module`). Both :class:`importlib.abc.MetaPathFinder` and :class:" @@ -2633,7 +2635,7 @@ msgstr "" "abc.PathEntryFinder` 都不再從該類別繼承。使用者應該根據需求來選擇其一以繼承。" "(由 Brett Cannon 在 :issue:`42135` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1687 +#: ../../whatsnew/3.10.rst:1689 msgid "" "The deprecations of :mod:`!imp`, :func:`!importlib.find_loader`, :func:`!" "importlib.util.set_package_wrapper`, :func:`!importlib.util." @@ -2650,7 +2652,7 @@ msgstr "" "過去版本的 Python 中引發 :exc:`DeprecationWarning`) 。(由 Brett Cannon 在 :" "issue:`43720` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1697 +#: ../../whatsnew/3.10.rst:1699 msgid "" "The import system now uses the ``__spec__`` attribute on modules before " "falling back on :meth:`!module_repr` for a module's ``__repr__()`` method. " @@ -2661,7 +2663,7 @@ msgstr "" "module_repr` 作為模組的 ``__repr__()`` 方法。計劃在 Python 3.12 中刪除 " "``module_repr()`` 的使用。(由 Brett Cannon 在 :issue:`42137` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1703 +#: ../../whatsnew/3.10.rst:1705 msgid "" ":meth:`!importlib.abc.Loader.module_repr`, :meth:`!importlib.machinery." "FrozenLoader.module_repr`, and :meth:`!importlib.machinery.BuiltinLoader." @@ -2673,7 +2675,7 @@ msgstr "" "module_repr` 已棄用並計劃在 Python 3.12 中刪除。(由 Brett Cannon 在 :issue:" "`42136` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1709 +#: ../../whatsnew/3.10.rst:1711 msgid "" "``sqlite3.OptimizedUnicode`` has been undocumented and obsolete since Python " "3.3, when it was made an alias to :class:`str`. It is now deprecated, " @@ -2684,7 +2686,7 @@ msgstr "" "它被用作 :class:`str` 的別名。它現已被棄用,並計劃在 Python 3.12 中刪除。" "(由 Erlend E. Aasland 在 :issue:`42264` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1714 +#: ../../whatsnew/3.10.rst:1716 msgid "" "The undocumented built-in function ``sqlite3.enable_shared_cache`` is now " "deprecated, scheduled for removal in Python 3.12. Its use is strongly " @@ -2699,58 +2701,59 @@ msgstr "" "使用共享快取,請使用 ``cache=shared`` 查詢參數以 URI 模式打開資料庫。(由 " "Erlend E. Aasland 在 :issue:`24464` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1722 +#: ../../whatsnew/3.10.rst:1724 msgid "The following ``threading`` methods are now deprecated:" msgstr "以下 ``threading`` 方法現已棄用:" -#: ../../whatsnew/3.10.rst:1724 +#: ../../whatsnew/3.10.rst:1726 msgid "``threading.currentThread`` => :func:`threading.current_thread`" msgstr "``threading.currentThread`` => :func:`threading.current_thread`" -#: ../../whatsnew/3.10.rst:1726 +#: ../../whatsnew/3.10.rst:1728 msgid "``threading.activeCount`` => :func:`threading.active_count`" msgstr "``threading.activeCount`` => :func:`threading.active_count`" -#: ../../whatsnew/3.10.rst:1728 +#: ../../whatsnew/3.10.rst:1730 msgid "" "``threading.Condition.notifyAll`` => :meth:`threading.Condition.notify_all`" msgstr "" "``threading.Condition.notifyAll`` => :meth:`threading.Condition.notify_all`" -#: ../../whatsnew/3.10.rst:1731 +#: ../../whatsnew/3.10.rst:1733 msgid "``threading.Event.isSet`` => :meth:`threading.Event.is_set`" msgstr "``threading.Event.isSet`` => :meth:`threading.Event.is_set`" -#: ../../whatsnew/3.10.rst:1733 +#: ../../whatsnew/3.10.rst:1735 msgid "``threading.Thread.setName`` => :attr:`threading.Thread.name`" msgstr "``threading.Thread.setName`` => :attr:`threading.Thread.name`" -#: ../../whatsnew/3.10.rst:1735 +#: ../../whatsnew/3.10.rst:1737 msgid "``threading.thread.getName`` => :attr:`threading.Thread.name`" msgstr "``threading.thread.getName`` => :attr:`threading.Thread.name`" -#: ../../whatsnew/3.10.rst:1737 +#: ../../whatsnew/3.10.rst:1739 msgid "``threading.Thread.isDaemon`` => :attr:`threading.Thread.daemon`" msgstr "``threading.Thread.isDaemon`` => :attr:`threading.Thread.daemon`" -#: ../../whatsnew/3.10.rst:1739 +#: ../../whatsnew/3.10.rst:1741 msgid "``threading.Thread.setDaemon`` => :attr:`threading.Thread.daemon`" msgstr "``threading.Thread.setDaemon`` => :attr:`threading.Thread.daemon`" -#: ../../whatsnew/3.10.rst:1741 +#: ../../whatsnew/3.10.rst:1743 msgid "(Contributed by Jelle Zijlstra in :gh:`87889`.)" msgstr "(由 Jelle Zijlstra 在 :gh:`87889` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1743 +#: ../../whatsnew/3.10.rst:1745 msgid "" -":meth:`pathlib.Path.link_to` is deprecated and slated for removal in Python " +":meth:`!pathlib.Path.link_to` is deprecated and slated for removal in Python " "3.12. Use :meth:`pathlib.Path.hardlink_to` instead. (Contributed by Barney " "Gale in :issue:`39950`.)" msgstr "" -":meth:`pathlib.Path.link_to` 已棄用並計劃在 Python 3.12 中刪除。請改用 :meth:" -"`pathlib.Path.hardlink_to`。(由 Barney Gale 在 :issue:`39950` 中貢獻。)" +":meth:`!pathlib.Path.link_to` 已棄用並計劃在 Python 3.12 中刪除。請改用 :" +"meth:`pathlib.Path.hardlink_to`。(由 Barney Gale 在 :issue:`39950` 中貢" +"獻。)" -#: ../../whatsnew/3.10.rst:1747 +#: ../../whatsnew/3.10.rst:1749 msgid "" "``cgi.log()`` is deprecated and slated for removal in Python 3.12. " "(Contributed by Inada Naoki in :issue:`41139`.)" @@ -2758,7 +2761,7 @@ msgstr "" "``cgi.log()`` 已棄用並計劃在 Python 3.12 中刪除。(由 Inada Naoki 在 :issue:" "`41139` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1750 +#: ../../whatsnew/3.10.rst:1752 msgid "" "The following :mod:`ssl` features have been deprecated since Python 3.6, " "Python 3.7, or OpenSSL 1.1.0 and will be removed in 3.11:" @@ -2766,7 +2769,7 @@ msgstr "" "自 Python 3.6、Python 3.7 或 OpenSSL 1.1.0 起,以下 :mod:`ssl` 功能已被棄用," "並將在 3.11 中刪除:" -#: ../../whatsnew/3.10.rst:1753 +#: ../../whatsnew/3.10.rst:1755 msgid "" ":data:`~ssl.OP_NO_SSLv2`, :data:`~ssl.OP_NO_SSLv3`, :data:`~ssl." "OP_NO_TLSv1`, :data:`~ssl.OP_NO_TLSv1_1`, :data:`~ssl.OP_NO_TLSv1_2`, and :" @@ -2778,7 +2781,7 @@ msgstr "" "data:`~ssl.OP_NO_TLSv1_3` 已被替換為 :attr:`sslSSLContext.minimum_version` " "和 :attr:`sslSSLContext.maximum_version`。" -#: ../../whatsnew/3.10.rst:1759 +#: ../../whatsnew/3.10.rst:1761 msgid "" ":data:`~ssl.PROTOCOL_SSLv2`, :data:`~ssl.PROTOCOL_SSLv3`, :data:`~ssl." "PROTOCOL_SSLv23`, :data:`~ssl.PROTOCOL_TLSv1`, :data:`~ssl." @@ -2792,20 +2795,20 @@ msgstr "" "PROTOCOL_TLS` 已棄用,取而代之的是 :const:`~ssl.PROTOCOL_TLS_CLIENT` 和 :" "const:`~ssl.PROTOCOL_TLS_SERVER`" -#: ../../whatsnew/3.10.rst:1765 +#: ../../whatsnew/3.10.rst:1767 msgid "" ":func:`~ssl.wrap_socket` is replaced by :meth:`ssl.SSLContext.wrap_socket`" msgstr ":func:`~ssl.wrap_socket` 被替換為 :meth:`ssl.SSLContext.wrap_socket`" -#: ../../whatsnew/3.10.rst:1767 +#: ../../whatsnew/3.10.rst:1769 msgid ":func:`~ssl.match_hostname`" msgstr ":func:`~ssl.match_hostname`" -#: ../../whatsnew/3.10.rst:1769 +#: ../../whatsnew/3.10.rst:1771 msgid ":func:`~ssl.RAND_pseudo_bytes`, :func:`~ssl.RAND_egd`" msgstr ":func:`~ssl.RAND_pseudo_bytes`, :func:`~ssl.RAND_egd`" -#: ../../whatsnew/3.10.rst:1771 +#: ../../whatsnew/3.10.rst:1773 msgid "" "NPN features like :meth:`ssl.SSLSocket.selected_npn_protocol` and :meth:`ssl." "SSLContext.set_npn_protocols` are replaced by ALPN." @@ -2813,18 +2816,18 @@ msgstr "" "NPN 功能如 :meth:`ssl.SSLSocket.selected_npn_protocol` 和 :meth:`ssl." "SSLContext.set_npn_protocols` 已被 ALPN 取代。" -#: ../../whatsnew/3.10.rst:1774 +#: ../../whatsnew/3.10.rst:1776 msgid "" -"The threading debug (:envvar:`PYTHONTHREADDEBUG` environment variable) is " +"The threading debug (:envvar:`!PYTHONTHREADDEBUG` environment variable) is " "deprecated in Python 3.10 and will be removed in Python 3.12. This feature " "requires a :ref:`debug build of Python `. (Contributed by " "Victor Stinner in :issue:`44584`.)" msgstr "" -"執行緒除錯(:envvar:`PYTHONTHREADDEBUG` 環境變數)在 Python 3.10 中已棄用,並" -"將在 Python 3.12 中刪除。此功能需要一個 :ref:`Python 的除錯用建置版本 `。(由 Victor Stinner 在 :issue:`44584` 中貢獻。)" +"執行緒除錯(:envvar:`!PYTHONTHREADDEBUG` 環境變數)在 Python 3.10 中已棄用," +"並將在 Python 3.12 中刪除。此功能需要一個 :ref:`Python 的除錯用建置版本 " +"`。(由 Victor Stinner 在 :issue:`44584` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1779 +#: ../../whatsnew/3.10.rst:1781 msgid "" "Importing from the ``typing.io`` and ``typing.re`` submodules will now emit :" "exc:`DeprecationWarning`. These submodules will be removed in a future " @@ -2837,11 +2840,11 @@ msgstr "" "的任何內容都應該直接從 :mod:`typing` 引入。(由 Sebastian Rittau 在 :issue:" "`38291` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1788 ../../whatsnew/3.10.rst:2211 +#: ../../whatsnew/3.10.rst:1790 ../../whatsnew/3.10.rst:2213 msgid "Removed" msgstr "已刪除" -#: ../../whatsnew/3.10.rst:1790 +#: ../../whatsnew/3.10.rst:1792 msgid "" "Removed special methods ``__int__``, ``__float__``, ``__floordiv__``, " "``__mod__``, ``__divmod__``, ``__rfloordiv__``, ``__rmod__`` and " @@ -2853,7 +2856,7 @@ msgstr "" "``__rmod__`` 和 ``__rdivmod__`` 。它們都會引發 :exc:`TypeError`。(由 Serhiy " "Storchaka 在 :issue:`41974` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1796 +#: ../../whatsnew/3.10.rst:1798 msgid "" "The ``ParserBase.error()`` method from the private and undocumented " "``_markupbase`` module has been removed. :class:`html.parser.HTMLParser` is " @@ -2866,7 +2869,7 @@ msgstr "" "``error()`` 實作已在 Python 3.5 中刪除。(由 Berker Peksag 在 :issue:`31844` " "中貢獻。)" -#: ../../whatsnew/3.10.rst:1802 +#: ../../whatsnew/3.10.rst:1804 msgid "" "Removed the ``unicodedata.ucnhash_CAPI`` attribute which was an internal " "PyCapsule object. The related private ``_PyUnicode_Name_CAPI`` structure was " @@ -2877,7 +2880,7 @@ msgstr "" "私有 ``_PyUnicode_Name_CAPI`` 結構已移至內部 C API。(由 Victor Stinner 在 :" "issue:`42157` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1807 +#: ../../whatsnew/3.10.rst:1809 msgid "" "Removed the ``parser`` module, which was deprecated in 3.9 due to the switch " "to the new PEG parser, as well as all the C source and header files that " @@ -2888,7 +2891,7 @@ msgstr "" "析器使用的所有 C 原始碼和標頭檔也已被刪除,包括 ``node.h``、``parser.h``、" "``graminit.h`` 和 ``grammar.h``。" -#: ../../whatsnew/3.10.rst:1812 +#: ../../whatsnew/3.10.rst:1814 msgid "" "Removed the Public C API functions ``PyParser_SimpleParseStringFlags``, " "``PyParser_SimpleParseStringFlagsFilename``, " @@ -2900,7 +2903,7 @@ msgstr "" "``PyParser_SimpleParseFileFlags`` 和 ``PyNode_Compile``,這些函式由於切換到新" "的 PEG 剖析器而在 3.9 中被棄用。" -#: ../../whatsnew/3.10.rst:1817 +#: ../../whatsnew/3.10.rst:1819 msgid "" "Removed the ``formatter`` module, which was deprecated in Python 3.4. It is " "somewhat obsolete, little used, and not tested. It was originally scheduled " @@ -2913,7 +2916,7 @@ msgstr "" "Python 2.7 EOL 之後。現有使用者應該將他們使用的任何類別複製到他們的程式碼中。" "(由 Donghee Na 和 Terry J. Reedy 在 :issue:`42299` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1824 +#: ../../whatsnew/3.10.rst:1826 msgid "" "Removed the :c:func:`!PyModule_GetWarningsModule` function that was useless " "now due to the :mod:`!_warnings` module was converted to a builtin module in " @@ -2923,7 +2926,7 @@ msgstr "" "`!_warnings` 模組在 2.6 中已轉換為內建模組。(由 Hai Shi 在 :issue:`42599` 中" "貢獻。)" -#: ../../whatsnew/3.10.rst:1828 +#: ../../whatsnew/3.10.rst:1830 msgid "" "Remove deprecated aliases to :ref:`collections-abstract-base-classes` from " "the :mod:`collections` module. (Contributed by Victor Stinner in :issue:" @@ -2932,7 +2935,7 @@ msgstr "" "從 :mod:`collections` 模組中刪除已棄用的、對 :ref:`collections-abstract-base-" "classes` 的別名。(由 Victor Stinner 在 :issue:`37324` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1832 +#: ../../whatsnew/3.10.rst:1834 msgid "" "The ``loop`` parameter has been removed from most of :mod:`asyncio`\\ 's :" "doc:`high-level API <../library/asyncio-api-index>` following deprecation in " @@ -2941,11 +2944,11 @@ msgstr "" "在 Python 3.8 中棄用後,``loop`` 參數已從大多數 :mod:`asyncio` 的\\ :doc:`高" "階 API <../library/asyncio-api-index>` 中刪除。這一變化的背後動機是多方面的:" -#: ../../whatsnew/3.10.rst:1836 +#: ../../whatsnew/3.10.rst:1838 msgid "This simplifies the high-level API." msgstr "這簡化了高階 API。" -#: ../../whatsnew/3.10.rst:1837 +#: ../../whatsnew/3.10.rst:1839 msgid "" "The functions in the high-level API have been implicitly getting the current " "thread's running event loop since Python 3.7. There isn't a need to pass " @@ -2954,13 +2957,13 @@ msgstr "" "自 Python 3.7 以來,高階 API 中的函式一直隱式獲取當前執行緒正在運行的事件循" "環。在大多數正常用例中,不需要將事件循環傳遞給 API。" -#: ../../whatsnew/3.10.rst:1840 +#: ../../whatsnew/3.10.rst:1842 msgid "" "Event loop passing is error-prone especially when dealing with loops running " "in different threads." msgstr "事件循環的傳遞很容易出錯,尤其是在處理在不同執行緒中運行的循環時。" -#: ../../whatsnew/3.10.rst:1843 +#: ../../whatsnew/3.10.rst:1845 msgid "" "Note that the low-level API will still accept ``loop``. See :ref:`changes-" "python-api` for examples of how to replace existing code." @@ -2968,7 +2971,7 @@ msgstr "" "請注意,低階 API 仍會接受 ``loop``。有關如何替換現有程式碼的範例,請參閱 :" "ref:`changes-python-api`。" -#: ../../whatsnew/3.10.rst:1846 ../../whatsnew/3.10.rst:1918 +#: ../../whatsnew/3.10.rst:1848 ../../whatsnew/3.10.rst:1920 msgid "" "(Contributed by Yurii Karabas, Andrew Svetlov, Yury Selivanov and Kyle " "Stanley in :issue:`42392`.)" @@ -2976,21 +2979,21 @@ msgstr "" "(由 Yurii Karabas、Andrew Svetlov、Yury Selivanov 和 Kyle Stanley 在 :issue:" "`42392` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1851 ../../whatsnew/3.10.rst:2138 +#: ../../whatsnew/3.10.rst:1853 ../../whatsnew/3.10.rst:2140 msgid "Porting to Python 3.10" msgstr "移植到 Python 3.10" -#: ../../whatsnew/3.10.rst:1853 +#: ../../whatsnew/3.10.rst:1855 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." msgstr "本節列出了前面描述的更改以及可能需要更改程式碼的其他錯誤修復。" -#: ../../whatsnew/3.10.rst:1858 +#: ../../whatsnew/3.10.rst:1860 msgid "Changes in the Python syntax" msgstr "Python 語法的變化" -#: ../../whatsnew/3.10.rst:1860 +#: ../../whatsnew/3.10.rst:1862 msgid "" "Deprecation warning is now emitted when compiling previously valid syntax if " "the numeric literal is immediately followed by a keyword (like in ``0in " @@ -3004,11 +3007,11 @@ msgstr "" "要消除警告並使程式碼與未來版本相容,只需在數字字面值和以下關鍵字之間新增一個" "空格即可。(由 Serhiy Storchaka 在 :issue:`43833` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1871 +#: ../../whatsnew/3.10.rst:1873 msgid "Changes in the Python API" msgstr "Python API 的變化" -#: ../../whatsnew/3.10.rst:1873 +#: ../../whatsnew/3.10.rst:1875 msgid "" "The *etype* parameters of the :func:`~traceback.format_exception`, :func:" "`~traceback.format_exception_only`, and :func:`~traceback.print_exception` " @@ -3020,7 +3023,7 @@ msgstr "" "print_exception` 函式的 *etype* 參數已重命名為 *exc*。(由 Zackery Spytz 和 " "Matthias Bussonnier 在 :issue:`26389` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1879 +#: ../../whatsnew/3.10.rst:1881 msgid "" ":mod:`atexit`: At Python exit, if a callback registered with :func:`atexit." "register` fails, its exception is now logged. Previously, only some " @@ -3031,7 +3034,7 @@ msgstr "" "回呼 (callback) 失敗,該例外現在會被記錄下來。在以前只記錄一些例外,並且最後" "一個例外總是被默默地忽略。(由 Victor Stinner 在 :issue:`42639` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1885 +#: ../../whatsnew/3.10.rst:1887 msgid "" ":class:`collections.abc.Callable` generic now flattens type parameters, " "similar to what :data:`typing.Callable` currently does. This means that " @@ -3051,7 +3054,7 @@ msgstr "" "可能會引發 :exc:`TypeError`,而在 Python 3.9 中,該參數可能已被默默地傳遞。" "(由 Ken Jin 在 :issue:`42195` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1895 +#: ../../whatsnew/3.10.rst:1897 msgid "" ":meth:`socket.htons` and :meth:`socket.ntohs` now raise :exc:`OverflowError` " "instead of :exc:`DeprecationWarning` if the given parameter will not fit in " @@ -3063,7 +3066,7 @@ msgstr "" "是 :exc:`DeprecationWarning`。(由 Erlend E. Aasland 在 :issue:`42393` 中貢" "獻。)" -#: ../../whatsnew/3.10.rst:1900 +#: ../../whatsnew/3.10.rst:1902 msgid "" "The ``loop`` parameter has been removed from most of :mod:`asyncio`\\ 's :" "doc:`high-level API <../library/asyncio-api-index>` following deprecation in " @@ -3072,21 +3075,21 @@ msgstr "" "在 Python 3.8 中棄用後,``loop`` 參數已從大多數 :mod:`asyncio` 的\\ :doc:`高" "階 API <../library/asyncio-api-index>` 中刪除。" -#: ../../whatsnew/3.10.rst:1904 +#: ../../whatsnew/3.10.rst:1906 msgid "A coroutine that currently looks like this::" msgstr "" "目前如下所示的協程:\n" "\n" "::" -#: ../../whatsnew/3.10.rst:1909 +#: ../../whatsnew/3.10.rst:1911 msgid "Should be replaced with this::" msgstr "" "應替換為:\n" "\n" "::" -#: ../../whatsnew/3.10.rst:1914 +#: ../../whatsnew/3.10.rst:1916 msgid "" "If ``foo()`` was specifically designed *not* to run in the current thread's " "running event loop (e.g. running in another thread's event loop), consider " @@ -3095,7 +3098,7 @@ msgstr "" "如果 ``foo()`` 被專門設計為 *不* 在當前執行緒的事件循環中運行(例如在另一個執" "行緒的事件循環中運行),請考慮改用 :func:`asyncio.run_coroutine_threadsafe`。" -#: ../../whatsnew/3.10.rst:1921 +#: ../../whatsnew/3.10.rst:1923 msgid "" "The :data:`types.FunctionType` constructor now inherits the current builtins " "if the *globals* dictionary has no ``\"__builtins__\"`` key, rather than " @@ -3111,11 +3114,11 @@ msgstr "" "function(...): ...`` 定義函式不受影響,全域變數不能用此語法覆蓋:它也繼承當前" "的內建物件。 (由 Victor Stinner 在 :issue:`42990` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1930 +#: ../../whatsnew/3.10.rst:1932 msgid "Changes in the C API" msgstr "C API 中的改動" -#: ../../whatsnew/3.10.rst:1932 +#: ../../whatsnew/3.10.rst:1934 msgid "" "The C API functions ``PyParser_SimpleParseStringFlags``, " "``PyParser_SimpleParseStringFlagsFilename``, " @@ -3128,7 +3131,7 @@ msgstr "" "``PyParser_SimpleParseFileFlags``、``PyNode_Compile`` 和被這些函式使用的型別 " "``struct _node`` 被刪除。" -#: ../../whatsnew/3.10.rst:1938 +#: ../../whatsnew/3.10.rst:1940 msgid "" "Source should be now be compiled directly to a code object using, for " "example, :c:func:`Py_CompileString`. The resulting code object can then be " @@ -3138,11 +3141,11 @@ msgstr "" "件。然後可以(例如透過 :c:func:`PyEval_EvalCode`)為產生的程式碼物件求值 " "(evaluated)。" -#: ../../whatsnew/3.10.rst:1942 +#: ../../whatsnew/3.10.rst:1944 msgid "Specifically:" msgstr "具體來說:" -#: ../../whatsnew/3.10.rst:1944 +#: ../../whatsnew/3.10.rst:1946 msgid "" "A call to ``PyParser_SimpleParseStringFlags`` followed by ``PyNode_Compile`` " "can be replaced by calling :c:func:`Py_CompileString`." @@ -3150,7 +3153,7 @@ msgstr "" "後跟有 ``PyNode_Compile`` 呼叫的 ``PyParser_SimpleParseStringFlags`` 呼叫,可" "以替換為呼叫 :c:func:`Py_CompileString`。" -#: ../../whatsnew/3.10.rst:1947 +#: ../../whatsnew/3.10.rst:1949 msgid "" "There is no direct replacement for ``PyParser_SimpleParseFileFlags``. To " "compile code from a ``FILE *`` argument, you will need to read the file in C " @@ -3159,7 +3162,7 @@ msgstr "" "沒有 ``PyParser_SimpleParseFileFlags`` 的直接替代品。要從 ``FILE *`` 引數編譯" "程式碼,你需要用 C 讀取檔案並將結果緩衝區傳遞給 :c:func:`Py_CompileString`。" -#: ../../whatsnew/3.10.rst:1951 +#: ../../whatsnew/3.10.rst:1953 msgid "" "To compile a file given a ``char *`` filename, explicitly open the file, " "read it and compile the result. One way to do this is using the :py:mod:`io` " @@ -3172,7 +3175,7 @@ msgstr "" "`PyObject_CallMethod`、:c:func:`PyBytes_AsString` 和 :c:func:" "`Py_CompileString`,如下所示。(宣告和錯誤處理在此被省略。):" -#: ../../whatsnew/3.10.rst:1964 +#: ../../whatsnew/3.10.rst:1966 msgid "" "For ``FrameObject`` objects, the :attr:`~frame.f_lasti` member now " "represents a wordcode offset instead of a simple offset into the bytecode " @@ -3188,11 +3191,11 @@ msgstr "" "還要注意,``FrameObject`` 物件的 :attr:`!f_lasti` 成員不被認為是穩定的:請改" "用 :c:func:`PyFrame_GetLineNumber`。" -#: ../../whatsnew/3.10.rst:1972 +#: ../../whatsnew/3.10.rst:1974 msgid "CPython bytecode changes" msgstr "CPython 位元組碼更改" -#: ../../whatsnew/3.10.rst:1974 +#: ../../whatsnew/3.10.rst:1976 msgid "" "The ``MAKE_FUNCTION`` instruction now accepts either a dict or a tuple of " "strings as the function's annotations. (Contributed by Yurii Karabas and " @@ -3201,11 +3204,11 @@ msgstr "" "``MAKE_FUNCTION`` 指令現在接受字典或字串元組作為函式的註釋。(由 Yurii " "Karabas 和 Inada Naoki 在 :issue:`42202` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1979 +#: ../../whatsnew/3.10.rst:1981 msgid "Build Changes" msgstr "建置變更" -#: ../../whatsnew/3.10.rst:1981 +#: ../../whatsnew/3.10.rst:1983 msgid "" ":pep:`644`: Python now requires OpenSSL 1.1.1 or newer. OpenSSL 1.0.2 is no " "longer supported. (Contributed by Christian Heimes in :issue:`43669`.)" @@ -3213,7 +3216,7 @@ msgstr "" ":pep:`644`:Python 現在需要 OpenSSL 1.1.1 或更高版本。不再支援 OpenSSL " "1.0.2。(由 Christian Heimes 在 :issue:`43669` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1985 +#: ../../whatsnew/3.10.rst:1987 msgid "" "The C99 functions :c:func:`snprintf` and :c:func:`vsnprintf` are now " "required to build Python. (Contributed by Victor Stinner in :issue:`36020`.)" @@ -3221,7 +3224,7 @@ msgstr "" "現在需要 C99 函式 :c:func:`snprintf` 和 :c:func:`vsnprintf` 來建置 Python。 " "(由 Victor Stinner 在 :issue:`36020` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1989 +#: ../../whatsnew/3.10.rst:1991 msgid "" ":mod:`sqlite3` requires SQLite 3.7.15 or higher. (Contributed by Sergey " "Fedoseev and Erlend E. Aasland in :issue:`40744` and :issue:`40810`.)" @@ -3229,7 +3232,7 @@ msgstr "" ":mod:`sqlite3` 需要 SQLite 3.7.15 或更新版本。(由 Sergey Fedoseev 和 Erlend " "E. Aasland 在 :issue:`40744` 和 :issue:`40810` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1992 +#: ../../whatsnew/3.10.rst:1994 msgid "" "The :mod:`atexit` module must now always be built as a built-in module. " "(Contributed by Victor Stinner in :issue:`42639`.)" @@ -3237,7 +3240,7 @@ msgstr "" ":mod:`atexit` 模組現在必須都被建置為內建模組。(由 Victor Stinner 在 :issue:" "`42639` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1995 +#: ../../whatsnew/3.10.rst:1997 msgid "" "Add :option:`--disable-test-modules` option to the ``configure`` script: " "don't build nor install test modules. (Contributed by Xavier de Gaye, Thomas " @@ -3247,7 +3250,7 @@ msgstr "" "不安裝測試模組。(由 Xavier de Gaye、Thomas Petazzoni 和 Peixing Xin 在 :" "issue:`27640` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1999 +#: ../../whatsnew/3.10.rst:2001 msgid "" "Add :option:`--with-wheel-pkg-dir=PATH option <--with-wheel-pkg-dir>` to the " "``./configure`` script. If specified, the :mod:`ensurepip` module looks for " @@ -3260,7 +3263,7 @@ msgstr "" "``setuptools`` 和 ``pip`` wheel 套件:如果兩者都存在,則使用這些 wheel 套件而" "不是 ensurepip 捆綁的 wheel 套件。" -#: ../../whatsnew/3.10.rst:2005 +#: ../../whatsnew/3.10.rst:2007 msgid "" "Some Linux distribution packaging policies recommend against bundling " "dependencies. For example, Fedora installs wheel packages in the ``/usr/" @@ -3271,11 +3274,11 @@ msgstr "" "share/python-wheels/`` 目錄中安裝 wheel 套件,並且不安裝 ``ensurepip." "_bundled`` 套件。" -#: ../../whatsnew/3.10.rst:2010 +#: ../../whatsnew/3.10.rst:2012 msgid "(Contributed by Victor Stinner in :issue:`42856`.)" msgstr "(由 Victor Stinner 在 :issue:`42856` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2012 +#: ../../whatsnew/3.10.rst:2014 msgid "" "Add a new :option:`configure --without-static-libpython option <--without-" "static-libpython>` to not build the ``libpythonMAJOR.MINOR.a`` static " @@ -3285,11 +3288,11 @@ msgstr "" "libpython>` 以不建置 ``libpythonMAJOR.MINOR.a`` 靜態函式庫且不安裝 ``python." "o`` 目標檔案。" -#: ../../whatsnew/3.10.rst:2016 +#: ../../whatsnew/3.10.rst:2018 msgid "(Contributed by Victor Stinner in :issue:`43103`.)" msgstr "(由 Victor Stinner 在 :issue:`43103` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2018 +#: ../../whatsnew/3.10.rst:2020 msgid "" "The ``configure`` script now uses the ``pkg-config`` utility, if available, " "to detect the location of Tcl/Tk headers and libraries. As before, those " @@ -3302,7 +3305,7 @@ msgstr "" "includes`` 和 ``--with-tcltk-libs`` 配置選項顯式指定這些位置。(由 Manolis " "Stamatogiannakis 在 :issue:`42603` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2024 +#: ../../whatsnew/3.10.rst:2026 msgid "" "Add :option:`--with-openssl-rpath` option to ``configure`` script. The " "option simplifies building Python with a custom OpenSSL installation, e.g. " @@ -3314,15 +3317,15 @@ msgstr "" "openssl=/path/to/openssl --with-openssl-rpath=auto``。(由 Christian Heimes " "在 :issue:`43466` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2031 +#: ../../whatsnew/3.10.rst:2033 msgid "C API Changes" msgstr "C API 變更" -#: ../../whatsnew/3.10.rst:2034 +#: ../../whatsnew/3.10.rst:2036 msgid "PEP 652: Maintaining the Stable ABI" msgstr "PEP 652:維護穩定 ABI" -#: ../../whatsnew/3.10.rst:2036 +#: ../../whatsnew/3.10.rst:2038 msgid "" "The Stable ABI (Application Binary Interface) for extension modules or " "embedding Python is now explicitly defined. :ref:`stable` describes C API " @@ -3332,11 +3335,11 @@ msgstr "" "用於擴充模組或嵌入 Python 的穩定 ABI(應用程式二進位介面)現已明確定義。 :" "ref:`stable` 描述了 C API 和 ABI 穩定性保證以及使用穩定 ABI 的最佳實踐。" -#: ../../whatsnew/3.10.rst:2041 +#: ../../whatsnew/3.10.rst:2043 msgid "(Contributed by Petr Viktorin in :pep:`652` and :issue:`43795`.)" msgstr "(由 Petr Viktorin 在 :pep:`652` 和 :issue:`43795` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2046 +#: ../../whatsnew/3.10.rst:2048 msgid "" "The result of :c:func:`PyNumber_Index` now always has exact type :class:" "`int`. Previously, the result could have been an instance of a subclass of " @@ -3346,7 +3349,7 @@ msgstr "" "果可能是 ``int`` 子類別的實例。(由 Serhiy Storchaka 在 :issue:`40792` 中貢" "獻。)" -#: ../../whatsnew/3.10.rst:2050 +#: ../../whatsnew/3.10.rst:2052 msgid "" "Add a new :c:member:`~PyConfig.orig_argv` member to the :c:type:`PyConfig` " "structure: the list of the original command line arguments passed to the " @@ -3356,7 +3359,7 @@ msgstr "" "遞給 Python 可執行檔案的原始命令列參數列表。(由 Victor Stinner 在 :issue:" "`23427` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2055 +#: ../../whatsnew/3.10.rst:2057 msgid "" "The :c:func:`PyDateTime_DATE_GET_TZINFO` and :c:func:" "`PyDateTime_TIME_GET_TZINFO` macros have been added for accessing the " @@ -3368,7 +3371,7 @@ msgstr "" "class:`datetime.time` 物件的 ``tzinfo`` 屬性。(由 Zackery Spytz 在 :issue:" "`30155` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2061 +#: ../../whatsnew/3.10.rst:2063 msgid "" "Add a :c:func:`PyCodec_Unregister` function to unregister a codec search " "function. (Contributed by Hai Shi in :issue:`41842`.)" @@ -3376,7 +3379,7 @@ msgstr "" "新增 :c:func:`PyCodec_Unregister` 函式來取消註冊編解碼器搜索函式。(由 Hai " "Shi 在 :issue:`41842` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2065 +#: ../../whatsnew/3.10.rst:2067 msgid "" "The :c:func:`PyIter_Send` function was added to allow sending value into " "iterator without raising ``StopIteration`` exception. (Contributed by " @@ -3385,7 +3388,7 @@ msgstr "" "新增了 :c:func:`PyIter_Send` 函式,以允許將值發送到疊代器中,而不會引發 " "``StopIteration`` 例外。(由 Vladimir Matveev 在 :issue:`41756` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2069 +#: ../../whatsnew/3.10.rst:2071 msgid "" "Add :c:func:`PyUnicode_AsUTF8AndSize` to the limited C API. (Contributed by " "Alex Gaynor in :issue:`41784`.)" @@ -3393,7 +3396,7 @@ msgstr "" "將 :c:func:`PyUnicode_AsUTF8AndSize` 新增到受限 C API (limited C API) 中。" "(由 Alex Gaynor 在 :issue:`41784` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2072 +#: ../../whatsnew/3.10.rst:2074 msgid "" "Add :c:func:`PyModule_AddObjectRef` function: similar to :c:func:" "`PyModule_AddObject` but don't steal a reference to the value on success. " @@ -3403,7 +3406,7 @@ msgstr "" "`PyModule_AddObject` 但成功時不竊取對值的參照。(由 Victor Stinner 在 :issue:" "`1635741` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2077 +#: ../../whatsnew/3.10.rst:2079 msgid "" "Add :c:func:`Py_NewRef` and :c:func:`Py_XNewRef` functions to increment the " "reference count of an object and return the object. (Contributed by Victor " @@ -3412,7 +3415,7 @@ msgstr "" "新增 :c:func:`Py_NewRef` 和 :c:func:`Py_XNewRef` 函式來增加物件的參照計數並回" "傳物件。 (由 Victor Stinner 在 :issue:`42262` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2081 +#: ../../whatsnew/3.10.rst:2083 msgid "" "The :c:func:`PyType_FromSpecWithBases` and :c:func:" "`PyType_FromModuleAndSpec` functions now accept a single class as the " @@ -3422,7 +3425,7 @@ msgstr "" "現在接受單個類別作為 *bases* 引數。(由 Serhiy Storchaka 在 :issue:`42423` 中" "貢獻。)" -#: ../../whatsnew/3.10.rst:2085 +#: ../../whatsnew/3.10.rst:2087 msgid "" "The :c:func:`PyType_FromModuleAndSpec` function now accepts NULL ``tp_doc`` " "slot. (Contributed by Hai Shi in :issue:`41832`.)" @@ -3430,7 +3433,7 @@ msgstr "" ":c:func:`PyType_FromModuleAndSpec` 函式現在接受 NULL ``tp_doc`` 槽位。(由 " "Hai Shi 在 :issue:`41832` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2089 +#: ../../whatsnew/3.10.rst:2091 msgid "" "The :c:func:`PyType_GetSlot` function can accept :ref:`static types `. (Contributed by Hai Shi and Petr Viktorin in :issue:`41073`.)" @@ -3438,7 +3441,7 @@ msgstr "" ":c:func:`PyType_GetSlot` 函式可以接受\\ :ref:`靜態型別 (static type) `。(由 Hai Shi 和 Petr Viktorin 在 :issue:`41073` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2093 +#: ../../whatsnew/3.10.rst:2095 msgid "" "Add a new :c:func:`PySet_CheckExact` function to the C-API to check if an " "object is an instance of :class:`set` but not an instance of a subtype. " @@ -3447,7 +3450,7 @@ msgstr "" "向 C-API 新增 :c:func:`PySet_CheckExact` 函式,以檢查物件是否是 :class:`set` " "的實例而不是子型別的實例。(由 Pablo Galindo 在 :issue:`43277` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2097 +#: ../../whatsnew/3.10.rst:2099 msgid "" "Add :c:func:`PyErr_SetInterruptEx` which allows passing a signal number to " "simulate. (Contributed by Antoine Pitrou in :issue:`43356`.)" @@ -3455,7 +3458,7 @@ msgstr "" "新增 :c:func:`PyErr_SetInterruptEx`,它允許傳遞信號編號來進行模擬。 (由 " "Antoine Pitrou 在 :issue:`43356` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2101 +#: ../../whatsnew/3.10.rst:2103 msgid "" "The limited C API is now supported if :ref:`Python is built in debug mode " "` (if the ``Py_DEBUG`` macro is defined). In the limited C API, " @@ -3475,7 +3478,7 @@ msgstr "" "C API 成為可能,因為自 Python 3.8 以來,:c:type:`PyObject` 結構在發布和除錯模" "式下是相同的(請參閱:issue:`36465`)。" -#: ../../whatsnew/3.10.rst:2111 +#: ../../whatsnew/3.10.rst:2113 msgid "" "The limited C API is still not supported in the :option:`--with-trace-refs` " "special build (``Py_TRACE_REFS`` macro). (Contributed by Victor Stinner in :" @@ -3484,7 +3487,7 @@ msgstr "" ":option:`--with-trace-refs` 特殊建置(``Py_TRACE_REFS`` 巨集)仍不支援受限 C " "API。(由 Victor Stinner 在 :issue:`43688` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2115 +#: ../../whatsnew/3.10.rst:2117 msgid "" "Add the :c:func:`Py_Is(x, y) ` function to test if the *x* object is " "the *y* object, the same as ``x is y`` in Python. Add also the :c:func:" @@ -3499,7 +3502,7 @@ msgstr "" "``True`` 單例或 ``False`` 單例。(由 Victor Stinner 在 :issue:`43753` 中貢" "獻。)" -#: ../../whatsnew/3.10.rst:2122 +#: ../../whatsnew/3.10.rst:2124 msgid "" "Add new functions to control the garbage collector from C code: :c:func:" "`PyGC_Enable()`, :c:func:`PyGC_Disable()`, :c:func:`PyGC_IsEnabled()`. These " @@ -3510,7 +3513,7 @@ msgstr "" "`PyGC_Disable()`、:c:func:`PyGC_IsEnabled()`。這些函式使得能夠從 C 程式碼啟" "用、停用和查詢垃圾收集器的狀態,而無需引入 :mod:`gc` 模組。" -#: ../../whatsnew/3.10.rst:2129 +#: ../../whatsnew/3.10.rst:2131 msgid "" "Add a new :c:macro:`Py_TPFLAGS_DISALLOW_INSTANTIATION` type flag to disallow " "creating type instances. (Contributed by Victor Stinner in :issue:`43916`.)" @@ -3518,7 +3521,7 @@ msgstr "" "新增 :c:macro:`Py_TPFLAGS_DISALLOW_INSTANTIATION` 型別旗標以禁止建立型別實" "例。(由 Victor Stinner 在 :issue:`43916` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2133 +#: ../../whatsnew/3.10.rst:2135 msgid "" "Add a new :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` type flag for creating " "immutable type objects: type attributes cannot be set nor deleted. " @@ -3528,7 +3531,7 @@ msgstr "" "設定或刪除型別屬性。(由 Victor Stinner 和 Erlend E. Aasland 在 :issue:" "`43908` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2140 +#: ../../whatsnew/3.10.rst:2142 msgid "" "The ``PY_SSIZE_T_CLEAN`` macro must now be defined to use :c:func:" "`PyArg_ParseTuple` and :c:func:`Py_BuildValue` formats which use ``#``: " @@ -3541,7 +3544,7 @@ msgstr "" "``u#``、``y#``、``z#``、``U#`` 和 ``Z#``。請參閱 :ref:`arg-parsing` 和 :pep:" "`353`。(由 Victor Stinner 在 :issue:`40943` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2146 +#: ../../whatsnew/3.10.rst:2148 msgid "" "Since :c:func:`Py_REFCNT()` is changed to the inline static function, " "``Py_REFCNT(obj) = new_refcnt`` must be replaced with ``Py_SET_REFCNT(obj, " @@ -3553,11 +3556,11 @@ msgstr "" "new_refcnt)`` :參見 :c:func:`Py_SET_REFCNT()` (自 Python 3.9 起可用)。為了" "向後相容,可以使用該巨集:" -#: ../../whatsnew/3.10.rst:2155 +#: ../../whatsnew/3.10.rst:2157 msgid "(Contributed by Victor Stinner in :issue:`39573`.)" msgstr "(由 Victor Stinner 在 :issue:`39573` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2157 +#: ../../whatsnew/3.10.rst:2159 msgid "" "Calling :c:func:`PyDict_GetItem` without :term:`GIL` held had been allowed " "for historical reason. It is no longer allowed. (Contributed by Victor " @@ -3567,7 +3570,7 @@ msgstr "" "`PyDict_GetItem` 是被允許的。目前已被禁止。(由 Victor Stinner 在 :issue:" "`40839` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2161 +#: ../../whatsnew/3.10.rst:2163 msgid "" "``PyUnicode_FromUnicode(NULL, size)`` and " "``PyUnicode_FromStringAndSize(NULL, size)`` raise ``DeprecationWarning`` " @@ -3579,7 +3582,7 @@ msgstr "" "分配沒有初始資料的 Unicode 物件。(由 Inada Naoki 在 :issue:`36346` 中貢" "獻。)" -#: ../../whatsnew/3.10.rst:2166 +#: ../../whatsnew/3.10.rst:2168 msgid "" "The private ``_PyUnicode_Name_CAPI`` structure of the PyCapsule API " "``unicodedata.ucnhash_CAPI`` has been moved to the internal C API. " @@ -3588,7 +3591,7 @@ msgstr "" "PyCapsule API ``unicodedata.ucnhash_CAPI`` 的私有 ``_PyUnicode_Name_CAPI`` 結" "構已移至內部 C API。(由 Victor Stinner 在 :issue:`42157` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2170 +#: ../../whatsnew/3.10.rst:2172 msgid "" ":c:func:`Py_GetPath`, :c:func:`Py_GetPrefix`, :c:func:`Py_GetExecPrefix`, :c:" "func:`Py_GetProgramFullPath`, :c:func:`Py_GetPythonHome` and :c:func:" @@ -3603,7 +3606,7 @@ msgstr "" "`Py_GetProgramName` 現在會回傳 ``NULL``。使用新的 :ref:`init-config` API 來獲" "取 :ref:`init-path-config`。(由 Victor Stinner 在 :issue:`42260` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2177 +#: ../../whatsnew/3.10.rst:2179 msgid "" ":c:func:`PyList_SET_ITEM`, :c:func:`PyTuple_SET_ITEM` and :c:func:" "`PyCell_SET` macros can no longer be used as l-value or r-value. For " @@ -3618,7 +3621,7 @@ msgstr "" "現編譯器錯誤。它可以防止如 ``if (PyList_SET_ITEM (a, b, c) < 0) ...`` 測試之" "類的錯誤。(由 Zackery Spytz 和 Victor Stinner 在 :issue:`30459` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2184 +#: ../../whatsnew/3.10.rst:2186 msgid "" "The non-limited API files ``odictobject.h``, ``parser_interface.h``, " "``picklebufobject.h``, ``pyarena.h``, ``pyctype.h``, ``pydebug.h``, ``pyfpe." @@ -3634,7 +3637,7 @@ msgstr "" "``Python.h`` 中引入;請參閱 :ref:`api-includes`。如果直接引入它們,請考慮改為" "引入 ``Python.h``。(由 Nicholas Sim 在 :issue:`35134` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2192 +#: ../../whatsnew/3.10.rst:2194 msgid "" "Use the :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` type flag to create immutable " "type objects. Do not rely on :c:macro:`Py_TPFLAGS_HEAPTYPE` to decide if a " @@ -3647,7 +3650,7 @@ msgstr "" "了 :c:macro:`Py_TPFLAGS_IMMUTABLETYPE`。(由 Victor Stinner 和 Erlend E. " "Aasland 在 :issue:`35134` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2198 +#: ../../whatsnew/3.10.rst:2200 msgid "" "The undocumented function ``Py_FrozenMain`` has been removed from the " "limited API. The function is mainly useful for custom builds of Python. " @@ -3656,7 +3659,7 @@ msgstr "" "未以說明文件記錄的函式 ``Py_FrozenMain`` 已從受限 API 中刪除。該函式主要用於 " "Python 的自定義建置。(由 Petr Viktorin 在 :issue:`26241` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2205 +#: ../../whatsnew/3.10.rst:2207 msgid "" "The ``PyUnicode_InternImmortal()`` function is now deprecated and will be " "removed in Python 3.12: use :c:func:`PyUnicode_InternInPlace` instead. " @@ -3666,7 +3669,7 @@ msgstr "" "用 :c:func:`PyUnicode_InternInPlace`。(由 Victor Stinner 在 :issue:`41692` " "中貢獻。)" -#: ../../whatsnew/3.10.rst:2213 +#: ../../whatsnew/3.10.rst:2215 msgid "" "Removed ``Py_UNICODE_str*`` functions manipulating ``Py_UNICODE*`` strings. " "(Contributed by Inada Naoki in :issue:`41123`.)" @@ -3674,7 +3677,7 @@ msgstr "" "刪除了操作 ``Py_UNICODE*`` 字串的 ``Py_UNICODE_str*`` 函式。(由 Inada Naoki " "在 :issue:`41123` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2216 +#: ../../whatsnew/3.10.rst:2218 msgid "" "``Py_UNICODE_strlen``: use :c:func:`PyUnicode_GetLength` or :c:macro:" "`PyUnicode_GET_LENGTH`" @@ -3682,7 +3685,7 @@ msgstr "" "``Py_UNICODE_strlen``:使用 :c:func:`PyUnicode_GetLength` 或 :c:macro:" "`PyUnicode_GET_LENGTH`" -#: ../../whatsnew/3.10.rst:2218 +#: ../../whatsnew/3.10.rst:2220 msgid "" "``Py_UNICODE_strcat``: use :c:func:`PyUnicode_CopyCharacters` or :c:func:" "`PyUnicode_FromFormat`" @@ -3690,7 +3693,7 @@ msgstr "" "``Py_UNICODE_strcat``:使用 :c:func:`PyUnicode_CopyCharacters` 或 :c:func:" "`PyUnicode_FromFormat`" -#: ../../whatsnew/3.10.rst:2220 +#: ../../whatsnew/3.10.rst:2222 msgid "" "``Py_UNICODE_strcpy``, ``Py_UNICODE_strncpy``: use :c:func:" "`PyUnicode_CopyCharacters` or :c:func:`PyUnicode_Substring`" @@ -3698,15 +3701,15 @@ msgstr "" "``Py_UNICODE_strcpy``、``Py_UNICODE_strncpy``:使用 :c:func:" "`PyUnicode_CopyCharacters` 或 :c:func:`PyUnicode_Substring`" -#: ../../whatsnew/3.10.rst:2222 +#: ../../whatsnew/3.10.rst:2224 msgid "``Py_UNICODE_strcmp``: use :c:func:`PyUnicode_Compare`" msgstr "``Py_UNICODE_strcmp``:使用 :c:func:`PyUnicode_Compare`" -#: ../../whatsnew/3.10.rst:2223 +#: ../../whatsnew/3.10.rst:2225 msgid "``Py_UNICODE_strncmp``: use :c:func:`PyUnicode_Tailmatch`" msgstr "``Py_UNICODE_strncmp``:使用 :c:func:`PyUnicode_Tailmatch`" -#: ../../whatsnew/3.10.rst:2224 +#: ../../whatsnew/3.10.rst:2226 msgid "" "``Py_UNICODE_strchr``, ``Py_UNICODE_strrchr``: use :c:func:" "`PyUnicode_FindChar`" @@ -3714,7 +3717,7 @@ msgstr "" "``Py_UNICODE_strchr``、``Py_UNICODE_strrchr``:使用 :c:func:" "`PyUnicode_FindChar`" -#: ../../whatsnew/3.10.rst:2227 +#: ../../whatsnew/3.10.rst:2229 msgid "" "Removed ``PyUnicode_GetMax()``. Please migrate to new (:pep:`393`) APIs. " "(Contributed by Inada Naoki in :issue:`41103`.)" @@ -3722,7 +3725,7 @@ msgstr "" "刪除了 ``PyUnicode_GetMax()``。請改用新的 (:pep:`393`) API。(由 Inada Naoki " "在 :issue:`41103` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2230 +#: ../../whatsnew/3.10.rst:2232 msgid "" "Removed ``PyLong_FromUnicode()``. Please migrate to :c:func:" "`PyLong_FromUnicodeObject`. (Contributed by Inada Naoki in :issue:`41103`.)" @@ -3730,7 +3733,7 @@ msgstr "" "刪除了 ``PyLong_FromUnicode()``。請改用 :c:func:`PyLong_FromUnicodeObject`。" "(由 Inada Naoki 在 :issue:`41103` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2233 +#: ../../whatsnew/3.10.rst:2235 msgid "" "Removed ``PyUnicode_AsUnicodeCopy()``. Please use :c:func:" "`PyUnicode_AsUCS4Copy` or :c:func:`PyUnicode_AsWideCharString` (Contributed " @@ -3740,7 +3743,7 @@ msgstr "" "或 :c:func:`PyUnicode_AsWideCharString` (由 Inada Naoki 在 :issue:`41103` 中" "貢獻。)" -#: ../../whatsnew/3.10.rst:2237 +#: ../../whatsnew/3.10.rst:2239 msgid "" "Removed ``_Py_CheckRecursionLimit`` variable: it has been replaced by " "``ceval.recursion_limit`` of the :c:type:`PyInterpreterState` structure. " @@ -3750,7 +3753,7 @@ msgstr "" "結構的 ``ceval.recursion_limit`` 取代。(由 Victor Stinner 在 :issue:`41834` " "中貢獻。)" -#: ../../whatsnew/3.10.rst:2241 +#: ../../whatsnew/3.10.rst:2243 msgid "" "Removed undocumented macros ``Py_ALLOW_RECURSION`` and " "``Py_END_ALLOW_RECURSION`` and the ``recursion_critical`` field of the :c:" @@ -3761,7 +3764,7 @@ msgstr "" "``Py_END_ALLOW_RECURSION`` 以及 :c:type:`PyInterpreterState` 結構的 " "``recursion_ritic`` 欄位。(由 Serhiy Storchaka 在 :issue:`41936` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2246 +#: ../../whatsnew/3.10.rst:2248 msgid "" "Removed the undocumented ``PyOS_InitInterrupts()`` function. Initializing " "Python already implicitly installs signal handlers: see :c:member:`PyConfig." @@ -3771,7 +3774,7 @@ msgstr "" "式安裝信號處理程式:請參閱 :c:member:`PyConfig.install_signal_handlers`。" "(由 Victor Stinner 在 :issue:`41713` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2251 +#: ../../whatsnew/3.10.rst:2253 msgid "" "Remove the ``PyAST_Validate()`` function. It is no longer possible to build " "a AST object (``mod_ty`` type) with the public C API. The function was " @@ -3782,35 +3785,35 @@ msgstr "" "(``mod_ty`` 類型)。該函式已被排除在受限 C API 之外 (:pep:`384`)。(由 " "Victor Stinner 在 :issue:`43244` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2256 +#: ../../whatsnew/3.10.rst:2258 msgid "Remove the ``symtable.h`` header file and the undocumented functions:" msgstr "刪除 ``symtable.h`` 標頭檔和未被說明文件記錄的函式:" -#: ../../whatsnew/3.10.rst:2258 +#: ../../whatsnew/3.10.rst:2260 msgid "``PyST_GetScope()``" msgstr "``PyST_GetScope()``" -#: ../../whatsnew/3.10.rst:2259 +#: ../../whatsnew/3.10.rst:2261 msgid "``PySymtable_Build()``" msgstr "``PySymtable_Build()``" -#: ../../whatsnew/3.10.rst:2260 +#: ../../whatsnew/3.10.rst:2262 msgid "``PySymtable_BuildObject()``" msgstr "``PySymtable_BuildObject()``" -#: ../../whatsnew/3.10.rst:2261 +#: ../../whatsnew/3.10.rst:2263 msgid "``PySymtable_Free()``" msgstr "``PySymtable_Free()``" -#: ../../whatsnew/3.10.rst:2262 +#: ../../whatsnew/3.10.rst:2264 msgid "``Py_SymtableString()``" msgstr "``Py_SymtableString()``" -#: ../../whatsnew/3.10.rst:2263 +#: ../../whatsnew/3.10.rst:2265 msgid "``Py_SymtableStringObject()``" msgstr "``Py_SymtableStringObject()``" -#: ../../whatsnew/3.10.rst:2265 +#: ../../whatsnew/3.10.rst:2267 msgid "" "The ``Py_SymtableString()`` function was part the stable ABI by mistake but " "it could not be used, because the ``symtable.h`` header file was excluded " @@ -3819,7 +3822,7 @@ msgstr "" "``Py_SymtableString()`` 函式錯誤地成為穩定 ABI 的一部分,但它因為 ``symtable." "h`` 標頭檔被排除在受限 C API 之外而無法使用。" -#: ../../whatsnew/3.10.rst:2269 +#: ../../whatsnew/3.10.rst:2271 msgid "" "Use Python :mod:`symtable` module instead. (Contributed by Victor Stinner " "in :issue:`43244`.)" @@ -3827,7 +3830,7 @@ msgstr "" "請改用 Python :mod:`symtable` 模組。(由 Victor Stinner 在 :issue:`43244` 中" "貢獻。)" -#: ../../whatsnew/3.10.rst:2272 +#: ../../whatsnew/3.10.rst:2274 msgid "" "Remove :c:func:`PyOS_ReadlineFunctionPointer` from the limited C API headers " "and from ``python3.dll``, the library that provides the stable ABI on " @@ -3838,7 +3841,7 @@ msgstr "" "刪除 :c:func:`PyOS_ReadlineFunctionPointer`。由於該函式採用 FILE* 引數,因此" "無法保證其 ABI 穩定性。(由 Petr Viktorin 在 :issue:`43868` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2278 +#: ../../whatsnew/3.10.rst:2280 msgid "" "Remove ``ast.h``, ``asdl.h``, and ``Python-ast.h`` header files. These " "functions were undocumented and excluded from the limited C API. Most names " @@ -3854,54 +3857,54 @@ msgstr "" "Windows ```` 標頭使用的 ``Yield`` 有名稱衝突。請改用 Python :mod:" "`ast` 模組。(由 Victor Stinner 在 :issue:`43244` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2286 +#: ../../whatsnew/3.10.rst:2288 msgid "" "Remove the compiler and parser functions using ``struct _mod`` type, because " "the public AST C API was removed:" msgstr "" "刪除編譯器和使用 ``struct _mod`` 的剖析器函式,因為公開 AST C API 已被刪除:" -#: ../../whatsnew/3.10.rst:2289 +#: ../../whatsnew/3.10.rst:2291 msgid "``PyAST_Compile()``" msgstr "``PyAST_Compile()``" -#: ../../whatsnew/3.10.rst:2290 +#: ../../whatsnew/3.10.rst:2292 msgid "``PyAST_CompileEx()``" msgstr "``PyAST_CompileEx()``" -#: ../../whatsnew/3.10.rst:2291 +#: ../../whatsnew/3.10.rst:2293 msgid "``PyAST_CompileObject()``" msgstr "``PyAST_CompileObject()``" -#: ../../whatsnew/3.10.rst:2292 +#: ../../whatsnew/3.10.rst:2294 msgid "``PyFuture_FromAST()``" msgstr "``PyFuture_FromAST()``" -#: ../../whatsnew/3.10.rst:2293 +#: ../../whatsnew/3.10.rst:2295 msgid "``PyFuture_FromASTObject()``" msgstr "``PyFuture_FromASTObject()``" -#: ../../whatsnew/3.10.rst:2294 +#: ../../whatsnew/3.10.rst:2296 msgid "``PyParser_ASTFromFile()``" msgstr "``PyParser_ASTFromFile()``" -#: ../../whatsnew/3.10.rst:2295 +#: ../../whatsnew/3.10.rst:2297 msgid "``PyParser_ASTFromFileObject()``" msgstr "``PyParser_ASTFromFileObject()``" -#: ../../whatsnew/3.10.rst:2296 +#: ../../whatsnew/3.10.rst:2298 msgid "``PyParser_ASTFromFilename()``" msgstr "``PyParser_ASTFromFilename()``" -#: ../../whatsnew/3.10.rst:2297 +#: ../../whatsnew/3.10.rst:2299 msgid "``PyParser_ASTFromString()``" msgstr "``PyParser_ASTFromString()``" -#: ../../whatsnew/3.10.rst:2298 +#: ../../whatsnew/3.10.rst:2300 msgid "``PyParser_ASTFromStringObject()``" msgstr "``PyParser_ASTFromStringObject()``" -#: ../../whatsnew/3.10.rst:2300 +#: ../../whatsnew/3.10.rst:2302 msgid "" "These functions were undocumented and excluded from the limited C API. " "(Contributed by Victor Stinner in :issue:`43244`.)" @@ -3909,27 +3912,27 @@ msgstr "" "這些函式沒有文件記錄,並且被排除在受限 C API 之外。(由 Victor Stinner 在 :" "issue:`43244` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2303 +#: ../../whatsnew/3.10.rst:2305 msgid "Remove the ``pyarena.h`` header file with functions:" msgstr "刪除包含以下函式的 ``pyarena.h`` 標頭檔:" -#: ../../whatsnew/3.10.rst:2305 +#: ../../whatsnew/3.10.rst:2307 msgid "``PyArena_New()``" msgstr "``PyArena_New()``" -#: ../../whatsnew/3.10.rst:2306 +#: ../../whatsnew/3.10.rst:2308 msgid "``PyArena_Free()``" msgstr "``PyArena_Free()``" -#: ../../whatsnew/3.10.rst:2307 +#: ../../whatsnew/3.10.rst:2309 msgid "``PyArena_Malloc()``" msgstr "``PyArena_Malloc()``" -#: ../../whatsnew/3.10.rst:2308 +#: ../../whatsnew/3.10.rst:2310 msgid "``PyArena_AddPyObject()``" msgstr "``PyArena_AddPyObject()``" -#: ../../whatsnew/3.10.rst:2310 +#: ../../whatsnew/3.10.rst:2312 msgid "" "These functions were undocumented, excluded from the limited C API, and were " "only used internally by the compiler. (Contributed by Victor Stinner in :" @@ -3938,7 +3941,7 @@ msgstr "" "這些函式沒有文件記錄、被排除在受限 C API 之外,並僅被編譯器於內部使用。(由 " "Victor Stinner 在 :issue:`43244` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2314 +#: ../../whatsnew/3.10.rst:2316 msgid "" "The ``PyThreadState.use_tracing`` member has been removed to optimize " "Python. (Contributed by Mark Shannon in :issue:`43760`.)" diff --git a/whatsnew/3.11.po b/whatsnew/3.11.po index a681496d4f..374d44f758 100644 --- a/whatsnew/3.11.po +++ b/whatsnew/3.11.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-06 00:03+0000\n" +"POT-Creation-Date: 2024-01-03 20:44+0000\n" "PO-Revision-Date: 2023-05-28 18:21+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -3086,14 +3086,14 @@ msgstr "" #: ../../whatsnew/3.11.rst:1750 msgid "" -"The :mod:`asynchat`, :mod:`asyncore` and :mod:`smtpd` modules have been " +"The :mod:`!asynchat`, :mod:`!asyncore` and :mod:`!smtpd` modules have been " "deprecated since at least Python 3.6. Their documentation and deprecation " "warnings have now been updated to note they will be removed in Python 3.12. " "(Contributed by Hugo van Kemenade in :issue:`47022`.)" msgstr "" -":mod:`asynchat`、:mod:`asyncore` 和 :mod:`smtpd` 至少在 Python 3.6 以前就被棄" -"用,它們的文件與棄用警告現在已被更新為會提示它們即將於 Python 3.12 中移除。" -"(由 Hugo van Kemenade 於 :issue:`47022` 中貢獻。)" +":mod:`!asynchat`、:mod:`!asyncore` 和 :mod:`!smtpd` 至少在 Python 3.6 以前就" +"被棄用,它們的文件與棄用警告現在已被更新為會提示它們即將於 Python 3.12 中移" +"除。(由 Hugo van Kemenade 於 :issue:`47022` 中貢獻。)" #: ../../whatsnew/3.11.rst:1755 msgid "" @@ -3138,8 +3138,8 @@ msgid "the :attr:`!configparser.ParsingError.filename` property" msgstr ":attr:`!configparser.ParsingError.filename` 屬性" #: ../../whatsnew/3.11.rst:1776 -msgid "the :meth:`configparser.RawConfigParser.readfp` method" -msgstr ":meth:`configparser.RawConfigParser.readfp` 方法" +msgid "the :meth:`!configparser.RawConfigParser.readfp` method" +msgstr ":meth:`!configparser.RawConfigParser.readfp` 方法" #: ../../whatsnew/3.11.rst:1778 msgid "(Contributed by Hugo van Kemenade in :issue:`45173`.)" @@ -3345,10 +3345,10 @@ msgstr "(由 Erlend E. Aasland 於 :issue:`5846` 中所貢獻。)" #: ../../whatsnew/3.11.rst:1863 msgid "" -":meth:`~!unittest.TestProgram.usageExit` is marked deprecated, to be removed " +":meth:`!unittest.TestProgram.usageExit` is marked deprecated, to be removed " "in 3.13. (Contributed by Carlos Damázio in :gh:`67048`.)" msgstr "" -":meth:`~!unittest.TestProgram.usageExit` 被標記為已棄用,即將在 3.13 中移除" +":meth:`!unittest.TestProgram.usageExit` 被標記為已棄用,即將在 3.13 中移除" "(由 Carlos Damázio 在 :gh:`67048` 中貢獻。)" #: ../../whatsnew/3.11.rst:1872 ../../whatsnew/3.11.rst:2594 @@ -3370,12 +3370,12 @@ msgstr "" "removal>`。" #: ../../whatsnew/3.11.rst:1880 -msgid "The :mod:`asynchat` module" -msgstr ":mod:`asynchat` 模組" +msgid "The :mod:`!asynchat` module" +msgstr ":mod:`!asynchat` 模組" #: ../../whatsnew/3.11.rst:1881 -msgid "The :mod:`asyncore` module" -msgstr ":mod:`asyncore` 模組" +msgid "The :mod:`!asyncore` module" +msgstr ":mod:`!asyncore` 模組" #: ../../whatsnew/3.11.rst:1882 msgid "The :ref:`entire distutils package `" @@ -3383,7 +3383,7 @@ msgstr ":ref:`整個 distutils 套件 `" #: ../../whatsnew/3.11.rst:1883 msgid "The :mod:`!imp` module" -msgstr "" +msgstr ":mod:`!imp` 模組" #: ../../whatsnew/3.11.rst:1884 msgid "The :class:`typing.io ` namespace" @@ -3399,23 +3399,23 @@ msgstr ":func:`!cgi.log`" #: ../../whatsnew/3.11.rst:1887 msgid ":func:`!importlib.find_loader`" -msgstr "" +msgstr ":func:`!importlib.find_loader`" #: ../../whatsnew/3.11.rst:1888 msgid ":meth:`!importlib.abc.Loader.module_repr`" -msgstr "" +msgstr ":meth:`!importlib.abc.Loader.module_repr`" #: ../../whatsnew/3.11.rst:1889 msgid ":meth:`!importlib.abc.MetaPathFinder.find_module`" -msgstr "" +msgstr ":meth:`!importlib.abc.MetaPathFinder.find_module`" #: ../../whatsnew/3.11.rst:1890 msgid ":meth:`!importlib.abc.PathEntryFinder.find_loader`" -msgstr "" +msgstr ":meth:`!importlib.abc.PathEntryFinder.find_loader`" #: ../../whatsnew/3.11.rst:1891 msgid ":meth:`!importlib.abc.PathEntryFinder.find_module`" -msgstr "" +msgstr ":meth:`!importlib.abc.PathEntryFinder.find_module`" #: ../../whatsnew/3.11.rst:1892 msgid ":meth:`!importlib.machinery.BuiltinImporter.find_module`" @@ -3443,7 +3443,7 @@ msgstr ":meth:`!importlib.machinery.FrozenLoader.module_repr`" #: ../../whatsnew/3.11.rst:1898 msgid ":meth:`!importlib.machinery.PathFinder.find_module`" -msgstr "" +msgstr ":meth:`!importlib.machinery.PathFinder.find_module`" #: ../../whatsnew/3.11.rst:1899 msgid ":meth:`!importlib.machinery.WindowsRegistryFinder.find_module`" @@ -3451,7 +3451,7 @@ msgstr ":meth:`!importlib.machinery.WindowsRegistryFinder.find_module`" #: ../../whatsnew/3.11.rst:1900 msgid ":func:`!importlib.util.module_for_loader`" -msgstr "" +msgstr ":func:`!importlib.util.module_for_loader`" #: ../../whatsnew/3.11.rst:1901 msgid ":func:`!importlib.util.set_loader_wrapper`" @@ -3463,15 +3463,15 @@ msgstr ":func:`!importlib.util.set_package_wrapper`" #: ../../whatsnew/3.11.rst:1903 msgid ":class:`!pkgutil.ImpImporter`" -msgstr "" +msgstr ":class:`!pkgutil.ImpImporter`" #: ../../whatsnew/3.11.rst:1904 msgid ":class:`!pkgutil.ImpLoader`" -msgstr "" +msgstr ":class:`!pkgutil.ImpLoader`" #: ../../whatsnew/3.11.rst:1905 -msgid ":meth:`pathlib.Path.link_to`" -msgstr ":meth:`pathlib.Path.link_to`" +msgid ":meth:`!pathlib.Path.link_to`" +msgstr ":meth:`!pathlib.Path.link_to`" #: ../../whatsnew/3.11.rst:1906 msgid ":func:`!sqlite3.enable_shared_cache`" @@ -3482,8 +3482,8 @@ msgid ":func:`!sqlite3.OptimizedUnicode`" msgstr ":func:`!sqlite3.OptimizedUnicode`" #: ../../whatsnew/3.11.rst:1908 -msgid ":envvar:`PYTHONTHREADDEBUG` environment variable" -msgstr ":envvar:`PYTHONTHREADDEBUG` 環境變數" +msgid ":envvar:`!PYTHONTHREADDEBUG` environment variable" +msgstr ":envvar:`!PYTHONTHREADDEBUG` 環境變數" #: ../../whatsnew/3.11.rst:1909 msgid "The following deprecated aliases in :mod:`unittest`:" @@ -3785,11 +3785,11 @@ msgstr "" #: ../../whatsnew/3.11.rst:2010 msgid "" -"Removed the :class:`!MailmanProxy` class in the :mod:`smtpd` module, as it " +"Removed the :class:`!MailmanProxy` class in the :mod:`!smtpd` module, as it " "is unusable without the external :mod:`!mailman` package. (Contributed by " "Donghee Na in :issue:`35800`.)" msgstr "" -"移除 :mod:`smtpd` 模組中的 :class:`!MailmanProxy` 類別,因為它無法獨立於外部" +"移除 :mod:`!smtpd` 模組中的 :class:`!MailmanProxy` 類別,因為它無法獨立於外部" "套件 :mod:`!mailman` 使用。(由 Donghee Na 於 :issue:`35800` 貢獻。)" #: ../../whatsnew/3.11.rst:2014 diff --git a/whatsnew/3.12.po b/whatsnew/3.12.po index fc3ee49b47..68d8d5a7e8 100644 --- a/whatsnew/3.12.po +++ b/whatsnew/3.12.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-08 00:03+0000\n" +"POT-Creation-Date: 2024-01-19 00:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -257,7 +257,7 @@ msgid "" "`_." msgstr "" -#: ../../whatsnew/3.12.rst:176 ../../whatsnew/3.12.rst:1952 +#: ../../whatsnew/3.12.rst:176 ../../whatsnew/3.12.rst:1966 msgid "New Features" msgstr "新增特性" @@ -430,24 +430,24 @@ msgstr "" #: ../../whatsnew/3.12.rst:345 msgid "" "Use the new :c:func:`Py_NewInterpreterFromConfig` function to create an " -"interpreter with its own GIL::" +"interpreter with its own GIL:" msgstr "" -#: ../../whatsnew/3.12.rst:359 +#: ../../whatsnew/3.12.rst:361 msgid "" "For further examples how to use the C-API for sub-interpreters with a per-" "interpreter GIL, see :source:`Modules/_xxsubinterpretersmodule.c`." msgstr "" -#: ../../whatsnew/3.12.rst:362 +#: ../../whatsnew/3.12.rst:364 msgid "(Contributed by Eric Snow in :gh:`104210`, etc.)" msgstr "(由 Eric Snow 於 :gh:`104210` 等貢獻。)" -#: ../../whatsnew/3.12.rst:367 +#: ../../whatsnew/3.12.rst:369 msgid "PEP 669: Low impact monitoring for CPython" msgstr "" -#: ../../whatsnew/3.12.rst:369 +#: ../../whatsnew/3.12.rst:371 msgid "" ":pep:`669` defines a new :mod:`API ` for profilers, " "debuggers, and other tools to monitor events in CPython. It covers a wide " @@ -457,22 +457,22 @@ msgid "" "for details." msgstr "" -#: ../../whatsnew/3.12.rst:377 +#: ../../whatsnew/3.12.rst:379 msgid "(Contributed by Mark Shannon in :gh:`103082`.)" msgstr "(由 Mark Shannon 於 :gh:`103082` 中貢獻。)" -#: ../../whatsnew/3.12.rst:382 +#: ../../whatsnew/3.12.rst:384 msgid "PEP 688: Making the buffer protocol accessible in Python" msgstr "" -#: ../../whatsnew/3.12.rst:384 +#: ../../whatsnew/3.12.rst:386 msgid "" ":pep:`688` introduces a way to use the :ref:`buffer protocol " "` from Python code. Classes that implement the :meth:`~object." "__buffer__` method are now usable as buffer types." msgstr "" -#: ../../whatsnew/3.12.rst:388 +#: ../../whatsnew/3.12.rst:390 msgid "" "The new :class:`collections.abc.Buffer` ABC provides a standard way to " "represent buffer objects, for example in type annotations. The new :class:" @@ -480,11 +480,11 @@ msgid "" "customize buffer creation. (Contributed by Jelle Zijlstra in :gh:`102500`.)" msgstr "" -#: ../../whatsnew/3.12.rst:397 +#: ../../whatsnew/3.12.rst:399 msgid "PEP 709: Comprehension inlining" msgstr "" -#: ../../whatsnew/3.12.rst:399 +#: ../../whatsnew/3.12.rst:401 msgid "" "Dictionary, list, and set comprehensions are now inlined, rather than " "creating a new single-use function object for each execution of the " @@ -492,34 +492,34 @@ msgid "" "times. See :pep:`709` for further details." msgstr "" -#: ../../whatsnew/3.12.rst:404 +#: ../../whatsnew/3.12.rst:406 msgid "" "Comprehension iteration variables remain isolated and don't overwrite a " "variable of the same name in the outer scope, nor are they visible after the " "comprehension. Inlining does result in a few visible behavior changes:" msgstr "" -#: ../../whatsnew/3.12.rst:408 +#: ../../whatsnew/3.12.rst:410 msgid "" "There is no longer a separate frame for the comprehension in tracebacks, and " "tracing/profiling no longer shows the comprehension as a function call." msgstr "" -#: ../../whatsnew/3.12.rst:410 +#: ../../whatsnew/3.12.rst:412 msgid "" "The :mod:`symtable` module will no longer produce child symbol tables for " "each comprehension; instead, the comprehension's locals will be included in " "the parent function's symbol table." msgstr "" -#: ../../whatsnew/3.12.rst:413 +#: ../../whatsnew/3.12.rst:415 msgid "" "Calling :func:`locals` inside a comprehension now includes variables from " "outside the comprehension, and no longer includes the synthetic ``.0`` " "variable for the comprehension \"argument\"." msgstr "" -#: ../../whatsnew/3.12.rst:416 +#: ../../whatsnew/3.12.rst:418 msgid "" "A comprehension iterating directly over ``locals()`` (e.g. ``[k for k in " "locals()]``) may see \"RuntimeError: dictionary changed size during " @@ -529,22 +529,22 @@ msgid "" "[k for k in keys]``." msgstr "" -#: ../../whatsnew/3.12.rst:423 +#: ../../whatsnew/3.12.rst:425 msgid "(Contributed by Carl Meyer and Vladimir Matveev in :pep:`709`.)" msgstr "(由 Carl Meyer 和 Vladimir Matveev 於 :pep:`709` 中貢獻。)" -#: ../../whatsnew/3.12.rst:426 +#: ../../whatsnew/3.12.rst:428 msgid "Improved Error Messages" msgstr "" -#: ../../whatsnew/3.12.rst:428 +#: ../../whatsnew/3.12.rst:430 msgid "" "Modules from the standard library are now potentially suggested as part of " "the error messages displayed by the interpreter when a :exc:`NameError` is " "raised to the top level. (Contributed by Pablo Galindo in :gh:`98254`.)" msgstr "" -#: ../../whatsnew/3.12.rst:437 +#: ../../whatsnew/3.12.rst:439 msgid "" "Improve the error suggestion for :exc:`NameError` exceptions for instances. " "Now if a :exc:`NameError` is raised in a method and the instance has an " @@ -553,14 +553,14 @@ msgid "" "scope. (Contributed by Pablo Galindo in :gh:`99139`.)" msgstr "" -#: ../../whatsnew/3.12.rst:457 +#: ../../whatsnew/3.12.rst:459 msgid "" "Improve the :exc:`SyntaxError` error message when the user types ``import x " "from y`` instead of ``from y import x``. (Contributed by Pablo Galindo in :" "gh:`98931`.)" msgstr "" -#: ../../whatsnew/3.12.rst:467 +#: ../../whatsnew/3.12.rst:469 msgid "" ":exc:`ImportError` exceptions raised from failed ``from import " "`` statements now include suggestions for the value of ```` " @@ -568,46 +568,46 @@ msgid "" "in :gh:`91058`.)" msgstr "" -#: ../../whatsnew/3.12.rst:478 +#: ../../whatsnew/3.12.rst:480 msgid "New Features Related to Type Hints" msgstr "" -#: ../../whatsnew/3.12.rst:480 +#: ../../whatsnew/3.12.rst:482 msgid "" "This section covers major changes affecting :pep:`type hints <484>` and the :" "mod:`typing` module." msgstr "" -#: ../../whatsnew/3.12.rst:486 +#: ../../whatsnew/3.12.rst:488 msgid "PEP 692: Using ``TypedDict`` for more precise ``**kwargs`` typing" msgstr "" -#: ../../whatsnew/3.12.rst:488 +#: ../../whatsnew/3.12.rst:490 msgid "" "Typing ``**kwargs`` in a function signature as introduced by :pep:`484` " "allowed for valid annotations only in cases where all of the ``**kwargs`` " "were of the same type." msgstr "" -#: ../../whatsnew/3.12.rst:492 +#: ../../whatsnew/3.12.rst:494 msgid "" ":pep:`692` specifies a more precise way of typing ``**kwargs`` by relying on " "typed dictionaries::" msgstr "" -#: ../../whatsnew/3.12.rst:503 +#: ../../whatsnew/3.12.rst:505 msgid "See :pep:`692` for more details." msgstr "詳情請見 :pep:`692`。" -#: ../../whatsnew/3.12.rst:505 +#: ../../whatsnew/3.12.rst:507 msgid "(Contributed by Franek Magiera in :gh:`103629`.)" msgstr "(由 Franek Magiera 於 :gh:`103629` 中貢獻。)" -#: ../../whatsnew/3.12.rst:510 +#: ../../whatsnew/3.12.rst:512 msgid "PEP 698: Override Decorator for Static Typing" msgstr "" -#: ../../whatsnew/3.12.rst:512 +#: ../../whatsnew/3.12.rst:514 msgid "" "A new decorator :func:`typing.override` has been added to the :mod:`typing` " "module. It indicates to type checkers that the method is intended to " @@ -616,29 +616,29 @@ msgid "" "class does not in fact do so." msgstr "" -#: ../../whatsnew/3.12.rst:518 +#: ../../whatsnew/3.12.rst:520 msgid "Example::" msgstr "範例: ::" -#: ../../whatsnew/3.12.rst:536 +#: ../../whatsnew/3.12.rst:538 msgid "See :pep:`698` for more details." msgstr "詳情請見 :pep:`698`。" -#: ../../whatsnew/3.12.rst:538 +#: ../../whatsnew/3.12.rst:540 msgid "(Contributed by Steven Troxler in :gh:`101561`.)" msgstr "(由 Steven Troxler 於 :gh:`101561` 中貢獻。)" -#: ../../whatsnew/3.12.rst:541 +#: ../../whatsnew/3.12.rst:543 msgid "Other Language Changes" msgstr "其他語言更動" -#: ../../whatsnew/3.12.rst:543 +#: ../../whatsnew/3.12.rst:545 msgid "" "The parser now raises :exc:`SyntaxError` when parsing source code containing " "null bytes. (Contributed by Pablo Galindo in :gh:`96670`.)" msgstr "" -#: ../../whatsnew/3.12.rst:546 +#: ../../whatsnew/3.12.rst:548 msgid "" "A backslash-character pair that is not a valid escape sequence now generates " "a :exc:`SyntaxWarning`, instead of :exc:`DeprecationWarning`. For example, " @@ -649,7 +649,7 @@ msgid "" "`SyntaxWarning`. (Contributed by Victor Stinner in :gh:`98401`.)" msgstr "" -#: ../../whatsnew/3.12.rst:555 +#: ../../whatsnew/3.12.rst:557 msgid "" "Octal escapes with value larger than ``0o377`` (ex: ``\"\\477\"``), " "deprecated in Python 3.11, now produce a :exc:`SyntaxWarning`, instead of :" @@ -657,7 +657,7 @@ msgid "" "a :exc:`SyntaxError`. (Contributed by Victor Stinner in :gh:`98401`.)" msgstr "" -#: ../../whatsnew/3.12.rst:561 +#: ../../whatsnew/3.12.rst:563 msgid "" "Variables used in the target part of comprehensions that are not stored to " "can now be used in assignment expressions (``:=``). For example, in ``[(b := " @@ -667,14 +667,14 @@ msgid "" "(Contributed by Nikita Sobolev in :gh:`100581`.)" msgstr "" -#: ../../whatsnew/3.12.rst:568 +#: ../../whatsnew/3.12.rst:570 msgid "" "Exceptions raised in a class or type's ``__set_name__`` method are no longer " "wrapped by a :exc:`RuntimeError`. Context information is added to the " "exception as a :pep:`678` note. (Contributed by Irit Katriel in :gh:`77757`.)" msgstr "" -#: ../../whatsnew/3.12.rst:572 +#: ../../whatsnew/3.12.rst:574 msgid "" "When a ``try-except*`` construct handles the entire :exc:`ExceptionGroup` " "and raises one other exception, that exception is no longer wrapped in an :" @@ -682,7 +682,7 @@ msgid "" "Katriel in :gh:`103590`.)" msgstr "" -#: ../../whatsnew/3.12.rst:577 +#: ../../whatsnew/3.12.rst:579 msgid "" "The Garbage Collector now runs only on the eval breaker mechanism of the " "Python bytecode evaluation loop instead of object allocations. The GC can " @@ -692,41 +692,41 @@ msgid "" "`97922`.)" msgstr "" -#: ../../whatsnew/3.12.rst:584 +#: ../../whatsnew/3.12.rst:586 msgid "" "All builtin and extension callables expecting boolean parameters now accept " "arguments of any type instead of just :class:`bool` and :class:`int`. " "(Contributed by Serhiy Storchaka in :gh:`60203`.)" msgstr "" -#: ../../whatsnew/3.12.rst:588 +#: ../../whatsnew/3.12.rst:590 msgid "" ":class:`memoryview` now supports the half-float type (the \"e\" format " "code). (Contributed by Donghee Na and Antoine Pitrou in :gh:`90751`.)" msgstr "" -#: ../../whatsnew/3.12.rst:591 +#: ../../whatsnew/3.12.rst:593 msgid "" ":class:`slice` objects are now hashable, allowing them to be used as dict " "keys and set items. (Contributed by Will Bradshaw, Furkan Onder, and Raymond " "Hettinger in :gh:`101264`.)" msgstr "" -#: ../../whatsnew/3.12.rst:594 +#: ../../whatsnew/3.12.rst:596 msgid "" ":func:`sum` now uses Neumaier summation to improve accuracy and " "commutativity when summing floats or mixed ints and floats. (Contributed by " "Raymond Hettinger in :gh:`100425`.)" msgstr "" -#: ../../whatsnew/3.12.rst:598 +#: ../../whatsnew/3.12.rst:600 msgid "" ":func:`ast.parse` now raises :exc:`SyntaxError` instead of :exc:`ValueError` " "when parsing source code containing null bytes. (Contributed by Pablo " "Galindo in :gh:`96670`.)" msgstr "" -#: ../../whatsnew/3.12.rst:602 +#: ../../whatsnew/3.12.rst:604 msgid "" "The extraction methods in :mod:`tarfile`, and :func:`shutil.unpack_archive`, " "have a new a *filter* argument that allows limiting tar features than may be " @@ -736,13 +736,13 @@ msgid "" "(Contributed by Petr Viktorin in :pep:`706`.)" msgstr "" -#: ../../whatsnew/3.12.rst:610 +#: ../../whatsnew/3.12.rst:612 msgid "" ":class:`types.MappingProxyType` instances are now hashable if the underlying " "mapping is hashable. (Contributed by Serhiy Storchaka in :gh:`87995`.)" msgstr "" -#: ../../whatsnew/3.12.rst:614 +#: ../../whatsnew/3.12.rst:616 msgid "" "Add :ref:`support for the perf profiler ` through the new " "environment variable :envvar:`PYTHONPERFSUPPORT` and command-line option :" @@ -753,33 +753,33 @@ msgid "" "Gregory P. Smith [Google] and Mark Shannon in :gh:`96123`.)" msgstr "" -#: ../../whatsnew/3.12.rst:626 +#: ../../whatsnew/3.12.rst:628 msgid "New Modules" msgstr "新增模組" -#: ../../whatsnew/3.12.rst:628 +#: ../../whatsnew/3.12.rst:630 msgid "None." msgstr "" -#: ../../whatsnew/3.12.rst:632 +#: ../../whatsnew/3.12.rst:634 msgid "Improved Modules" msgstr "改進的模組" -#: ../../whatsnew/3.12.rst:635 +#: ../../whatsnew/3.12.rst:637 msgid "array" msgstr "array" -#: ../../whatsnew/3.12.rst:637 +#: ../../whatsnew/3.12.rst:639 msgid "" "The :class:`array.array` class now supports subscripting, making it a :term:" "`generic type`. (Contributed by Jelle Zijlstra in :gh:`98658`.)" msgstr "" -#: ../../whatsnew/3.12.rst:641 +#: ../../whatsnew/3.12.rst:643 msgid "asyncio" msgstr "asyncio" -#: ../../whatsnew/3.12.rst:643 +#: ../../whatsnew/3.12.rst:645 msgid "" "The performance of writing to sockets in :mod:`asyncio` has been " "significantly improved. ``asyncio`` now avoids unnecessary copying when " @@ -787,7 +787,7 @@ msgid "" "supports it. (Contributed by Kumar Aditya in :gh:`91166`.)" msgstr "" -#: ../../whatsnew/3.12.rst:648 +#: ../../whatsnew/3.12.rst:650 msgid "" "Add :func:`asyncio.eager_task_factory` and :func:`asyncio." "create_eager_task_factory` functions to allow opting an event loop in to " @@ -795,14 +795,14 @@ msgid "" "Jacob Bower & Itamar Oren in :gh:`102853`, :gh:`104140`, and :gh:`104138`)" msgstr "" -#: ../../whatsnew/3.12.rst:653 +#: ../../whatsnew/3.12.rst:655 msgid "" "On Linux, :mod:`asyncio` uses :class:`asyncio.PidfdChildWatcher` by default " "if :func:`os.pidfd_open` is available and functional instead of :class:" "`asyncio.ThreadedChildWatcher`. (Contributed by Kumar Aditya in :gh:`98024`.)" msgstr "" -#: ../../whatsnew/3.12.rst:658 +#: ../../whatsnew/3.12.rst:660 msgid "" "The event loop now uses the best available child watcher for each platform (:" "class:`asyncio.PidfdChildWatcher` if supported and :class:`asyncio." @@ -810,58 +810,58 @@ msgid "" "not recommended. (Contributed by Kumar Aditya in :gh:`94597`.)" msgstr "" -#: ../../whatsnew/3.12.rst:664 +#: ../../whatsnew/3.12.rst:666 msgid "" "Add *loop_factory* parameter to :func:`asyncio.run` to allow specifying a " "custom event loop factory. (Contributed by Kumar Aditya in :gh:`99388`.)" msgstr "" -#: ../../whatsnew/3.12.rst:668 +#: ../../whatsnew/3.12.rst:670 msgid "" "Add C implementation of :func:`asyncio.current_task` for 4x-6x speedup. " "(Contributed by Itamar Oren and Pranav Thulasiram Bhat in :gh:`100344`.)" msgstr "" -#: ../../whatsnew/3.12.rst:671 +#: ../../whatsnew/3.12.rst:673 msgid "" ":func:`asyncio.iscoroutine` now returns ``False`` for generators as :mod:" "`asyncio` does not support legacy generator-based coroutines. (Contributed " "by Kumar Aditya in :gh:`102748`.)" msgstr "" -#: ../../whatsnew/3.12.rst:675 +#: ../../whatsnew/3.12.rst:677 msgid "" ":func:`asyncio.wait` and :func:`asyncio.as_completed` now accepts generators " "yielding tasks. (Contributed by Kumar Aditya in :gh:`78530`.)" msgstr "" -#: ../../whatsnew/3.12.rst:680 +#: ../../whatsnew/3.12.rst:682 msgid "calendar" msgstr "calendar" -#: ../../whatsnew/3.12.rst:682 +#: ../../whatsnew/3.12.rst:684 msgid "" "Add enums :data:`calendar.Month` and :data:`calendar.Day` defining months of " "the year and days of the week. (Contributed by Prince Roshan in :gh:" "`103636`.)" msgstr "" -#: ../../whatsnew/3.12.rst:687 +#: ../../whatsnew/3.12.rst:689 msgid "csv" msgstr "csv" -#: ../../whatsnew/3.12.rst:689 +#: ../../whatsnew/3.12.rst:691 msgid "" "Add :const:`csv.QUOTE_NOTNULL` and :const:`csv.QUOTE_STRINGS` flags to " "provide finer grained control of ``None`` and empty strings by :class:`csv." "writer` objects." msgstr "" -#: ../../whatsnew/3.12.rst:694 +#: ../../whatsnew/3.12.rst:696 msgid "dis" msgstr "dis" -#: ../../whatsnew/3.12.rst:696 +#: ../../whatsnew/3.12.rst:698 msgid "" "Pseudo instruction opcodes (which are used by the compiler but do not appear " "in executable bytecode) are now exposed in the :mod:`dis` module. :opcode:" @@ -870,57 +870,57 @@ msgid "" "(Contributed by Irit Katriel in :gh:`94216`.)" msgstr "" -#: ../../whatsnew/3.12.rst:704 +#: ../../whatsnew/3.12.rst:706 msgid "" "Add the :data:`dis.hasexc` collection to signify instructions that set an " "exception handler. (Contributed by Irit Katriel in :gh:`94216`.)" msgstr "" -#: ../../whatsnew/3.12.rst:708 +#: ../../whatsnew/3.12.rst:710 msgid "fractions" msgstr "fractions" -#: ../../whatsnew/3.12.rst:710 +#: ../../whatsnew/3.12.rst:712 msgid "" "Objects of type :class:`fractions.Fraction` now support float-style " "formatting. (Contributed by Mark Dickinson in :gh:`100161`.)" msgstr "" -#: ../../whatsnew/3.12.rst:714 +#: ../../whatsnew/3.12.rst:716 msgid "importlib.resources" msgstr "importlib.resources" -#: ../../whatsnew/3.12.rst:716 +#: ../../whatsnew/3.12.rst:718 msgid "" ":func:`importlib.resources.as_file` now supports resource directories. " "(Contributed by Jason R. Coombs in :gh:`97930`.)" msgstr "" -#: ../../whatsnew/3.12.rst:719 +#: ../../whatsnew/3.12.rst:721 msgid "" "Rename first parameter of :func:`importlib.resources.files` to *anchor*. " "(Contributed by Jason R. Coombs in :gh:`100598`.)" msgstr "" -#: ../../whatsnew/3.12.rst:723 +#: ../../whatsnew/3.12.rst:725 msgid "inspect" msgstr "inspect" -#: ../../whatsnew/3.12.rst:725 +#: ../../whatsnew/3.12.rst:727 msgid "" "Add :func:`inspect.markcoroutinefunction` to mark sync functions that return " "a :term:`coroutine` for use with :func:`inspect.iscoroutinefunction`. " "(Contributed Carlton Gibson in :gh:`99247`.)" msgstr "" -#: ../../whatsnew/3.12.rst:729 +#: ../../whatsnew/3.12.rst:731 msgid "" "Add :func:`inspect.getasyncgenstate` and :func:`inspect.getasyncgenlocals` " "for determining the current state of asynchronous generators. (Contributed " "by Thomas Krennwallner in :gh:`79940`.)" msgstr "" -#: ../../whatsnew/3.12.rst:733 +#: ../../whatsnew/3.12.rst:735 msgid "" "The performance of :func:`inspect.getattr_static` has been considerably " "improved. Most calls to the function should be at least 2x faster than they " @@ -928,22 +928,22 @@ msgid "" "Waygood in :gh:`103193`.)" msgstr "" -#: ../../whatsnew/3.12.rst:739 +#: ../../whatsnew/3.12.rst:741 msgid "itertools" msgstr "itertools" -#: ../../whatsnew/3.12.rst:741 +#: ../../whatsnew/3.12.rst:743 msgid "" "Add :class:`itertools.batched()` for collecting into even-sized tuples where " "the last batch may be shorter than the rest. (Contributed by Raymond " "Hettinger in :gh:`98363`.)" msgstr "" -#: ../../whatsnew/3.12.rst:746 +#: ../../whatsnew/3.12.rst:748 msgid "math" msgstr "math" -#: ../../whatsnew/3.12.rst:748 +#: ../../whatsnew/3.12.rst:750 msgid "" "Add :func:`math.sumprod` for computing a sum of products. (Contributed by " "Raymond Hettinger in :gh:`100485`.)" @@ -951,39 +951,39 @@ msgstr "" "新增 :func:`math.sumprod` 以計算乘積總和。(由 Raymond Hettinger 於 :gh:" "`100485` 中貢獻。)" -#: ../../whatsnew/3.12.rst:751 +#: ../../whatsnew/3.12.rst:753 msgid "" "Extend :func:`math.nextafter` to include a *steps* argument for moving up or " "down multiple steps at a time. (By Matthias Goergens, Mark Dickinson, and " "Raymond Hettinger in :gh:`94906`.)" msgstr "" -#: ../../whatsnew/3.12.rst:756 +#: ../../whatsnew/3.12.rst:758 msgid "os" msgstr "os" -#: ../../whatsnew/3.12.rst:758 +#: ../../whatsnew/3.12.rst:760 msgid "" "Add :const:`os.PIDFD_NONBLOCK` to open a file descriptor for a process with :" "func:`os.pidfd_open` in non-blocking mode. (Contributed by Kumar Aditya in :" "gh:`93312`.)" msgstr "" -#: ../../whatsnew/3.12.rst:762 +#: ../../whatsnew/3.12.rst:764 msgid "" ":class:`os.DirEntry` now includes an :meth:`os.DirEntry.is_junction` method " "to check if the entry is a junction. (Contributed by Charles Machalow in :gh:" "`99547`.)" msgstr "" -#: ../../whatsnew/3.12.rst:766 +#: ../../whatsnew/3.12.rst:768 msgid "" "Add :func:`os.listdrives`, :func:`os.listvolumes` and :func:`os.listmounts` " "functions on Windows for enumerating drives, volumes and mount points. " "(Contributed by Steve Dower in :gh:`102519`.)" msgstr "" -#: ../../whatsnew/3.12.rst:770 +#: ../../whatsnew/3.12.rst:772 msgid "" ":func:`os.stat` and :func:`os.lstat` are now more accurate on Windows. The " "``st_birthtime`` field will now be filled with the creation time of the " @@ -996,27 +996,27 @@ msgid "" "`99726`.)" msgstr "" -#: ../../whatsnew/3.12.rst:781 +#: ../../whatsnew/3.12.rst:783 msgid "os.path" msgstr "os.path" -#: ../../whatsnew/3.12.rst:783 +#: ../../whatsnew/3.12.rst:785 msgid "" "Add :func:`os.path.isjunction` to check if a given path is a junction. " "(Contributed by Charles Machalow in :gh:`99547`.)" msgstr "" -#: ../../whatsnew/3.12.rst:786 +#: ../../whatsnew/3.12.rst:788 msgid "" "Add :func:`os.path.splitroot` to split a path into a triad ``(drive, root, " "tail)``. (Contributed by Barney Gale in :gh:`101000`.)" msgstr "" -#: ../../whatsnew/3.12.rst:790 +#: ../../whatsnew/3.12.rst:792 msgid "pathlib" msgstr "pathlib" -#: ../../whatsnew/3.12.rst:792 +#: ../../whatsnew/3.12.rst:794 msgid "" "Add support for subclassing :class:`pathlib.PurePath` and :class:`pathlib." "Path`, plus their Posix- and Windows-specific variants. Subclasses may " @@ -1024,14 +1024,14 @@ msgid "" "information between path instances." msgstr "" -#: ../../whatsnew/3.12.rst:797 +#: ../../whatsnew/3.12.rst:799 msgid "" "Add :meth:`pathlib.Path.walk` for walking the directory trees and generating " "all file or directory names within them, similar to :func:`os.walk`. " "(Contributed by Stanislav Zmiev in :gh:`90385`.)" msgstr "" -#: ../../whatsnew/3.12.rst:801 +#: ../../whatsnew/3.12.rst:803 msgid "" "Add *walk_up* optional parameter to :meth:`pathlib.PurePath.relative_to` to " "allow the insertion of ``..`` entries in the result; this behavior is more " @@ -1039,13 +1039,13 @@ msgid "" "gh:`84538`.)" msgstr "" -#: ../../whatsnew/3.12.rst:806 +#: ../../whatsnew/3.12.rst:808 msgid "" "Add :meth:`pathlib.Path.is_junction` as a proxy to :func:`os.path." "isjunction`. (Contributed by Charles Machalow in :gh:`99547`.)" msgstr "" -#: ../../whatsnew/3.12.rst:809 +#: ../../whatsnew/3.12.rst:811 msgid "" "Add *case_sensitive* optional parameter to :meth:`pathlib.Path.glob`, :meth:" "`pathlib.Path.rglob` and :meth:`pathlib.PurePath.match` for matching the " @@ -1053,22 +1053,22 @@ msgid "" "process." msgstr "" -#: ../../whatsnew/3.12.rst:814 +#: ../../whatsnew/3.12.rst:816 msgid "pdb" msgstr "pdb" -#: ../../whatsnew/3.12.rst:816 +#: ../../whatsnew/3.12.rst:818 msgid "" "Add convenience variables to hold values temporarily for debug session and " "provide quick access to values like the current frame or the return value. " "(Contributed by Tian Gao in :gh:`103693`.)" msgstr "" -#: ../../whatsnew/3.12.rst:822 +#: ../../whatsnew/3.12.rst:824 msgid "random" msgstr "random" -#: ../../whatsnew/3.12.rst:824 +#: ../../whatsnew/3.12.rst:826 msgid "" "Add :func:`random.binomialvariate`. (Contributed by Raymond Hettinger in :gh:" "`81620`.)" @@ -1076,17 +1076,17 @@ msgstr "" "新增 :func:`random.binomialvariate`。(由 Raymond Hettinger 於 :gh:`81620` 中" "貢獻。)" -#: ../../whatsnew/3.12.rst:827 +#: ../../whatsnew/3.12.rst:829 msgid "" "Add a default of ``lambd=1.0`` to :func:`random.expovariate`. (Contributed " "by Raymond Hettinger in :gh:`100234`.)" msgstr "" -#: ../../whatsnew/3.12.rst:831 +#: ../../whatsnew/3.12.rst:833 msgid "shutil" msgstr "shutil" -#: ../../whatsnew/3.12.rst:833 +#: ../../whatsnew/3.12.rst:835 msgid "" ":func:`shutil.make_archive` now passes the *root_dir* argument to custom " "archivers which support it. In this case it no longer temporarily changes " @@ -1094,7 +1094,7 @@ msgid "" "archiving. (Contributed by Serhiy Storchaka in :gh:`74696`.)" msgstr "" -#: ../../whatsnew/3.12.rst:839 +#: ../../whatsnew/3.12.rst:841 msgid "" ":func:`shutil.rmtree` now accepts a new argument *onexc* which is an error " "handler like *onerror* but which expects an exception instance rather than a " @@ -1102,14 +1102,14 @@ msgid "" "Katriel in :gh:`102828`.)" msgstr "" -#: ../../whatsnew/3.12.rst:844 +#: ../../whatsnew/3.12.rst:846 msgid "" ":func:`shutil.which` now consults the *PATHEXT* environment variable to find " "matches within *PATH* on Windows even when the given *cmd* includes a " "directory component. (Contributed by Charles Machalow in :gh:`103179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:849 +#: ../../whatsnew/3.12.rst:851 msgid "" ":func:`shutil.which` will call ``NeedCurrentDirectoryForExePathW`` when " "querying for executables on Windows to determine if the current working " @@ -1117,18 +1117,18 @@ msgid "" "Machalow in :gh:`103179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:854 +#: ../../whatsnew/3.12.rst:856 msgid "" ":func:`shutil.which` will return a path matching the *cmd* with a component " "from ``PATHEXT`` prior to a direct match elsewhere in the search path on " "Windows. (Contributed by Charles Machalow in :gh:`103179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:860 ../../whatsnew/3.12.rst:1655 +#: ../../whatsnew/3.12.rst:862 ../../whatsnew/3.12.rst:1669 msgid "sqlite3" msgstr "sqlite3" -#: ../../whatsnew/3.12.rst:862 +#: ../../whatsnew/3.12.rst:864 msgid "" "Add a :ref:`command-line interface `. (Contributed by Erlend E. " "Aasland in :gh:`77617`.)" @@ -1136,7 +1136,7 @@ msgstr "" "新增\\ :ref:`命令列介面 `。(由 Erlend E. Aasland 於 :gh:" "`77617` 中貢獻。)" -#: ../../whatsnew/3.12.rst:865 +#: ../../whatsnew/3.12.rst:867 msgid "" "Add the :attr:`sqlite3.Connection.autocommit` attribute to :class:`sqlite3." "Connection` and the *autocommit* parameter to :func:`sqlite3.connect` to " @@ -1144,43 +1144,43 @@ msgid "" "control-autocommit>`. (Contributed by Erlend E. Aasland in :gh:`83638`.)" msgstr "" -#: ../../whatsnew/3.12.rst:872 +#: ../../whatsnew/3.12.rst:874 msgid "" "Add *entrypoint* keyword-only parameter to :meth:`sqlite3.Connection." "load_extension`, for overriding the SQLite extension entry point. " "(Contributed by Erlend E. Aasland in :gh:`103015`.)" msgstr "" -#: ../../whatsnew/3.12.rst:877 +#: ../../whatsnew/3.12.rst:879 msgid "" "Add :meth:`sqlite3.Connection.getconfig` and :meth:`sqlite3.Connection." "setconfig` to :class:`sqlite3.Connection` to make configuration changes to a " "database connection. (Contributed by Erlend E. Aasland in :gh:`103489`.)" msgstr "" -#: ../../whatsnew/3.12.rst:883 +#: ../../whatsnew/3.12.rst:885 msgid "statistics" msgstr "statistics" -#: ../../whatsnew/3.12.rst:885 +#: ../../whatsnew/3.12.rst:887 msgid "" "Extend :func:`statistics.correlation` to include as a ``ranked`` method for " "computing the Spearman correlation of ranked data. (Contributed by Raymond " "Hettinger in :gh:`95861`.)" msgstr "" -#: ../../whatsnew/3.12.rst:890 +#: ../../whatsnew/3.12.rst:892 msgid "sys" msgstr "sys" -#: ../../whatsnew/3.12.rst:892 +#: ../../whatsnew/3.12.rst:894 msgid "" "Add the :mod:`sys.monitoring` namespace to expose the new :ref:`PEP 669 " "` monitoring API. (Contributed by Mark Shannon in :gh:" "`103082`.)" msgstr "" -#: ../../whatsnew/3.12.rst:896 +#: ../../whatsnew/3.12.rst:898 msgid "" "Add :func:`sys.activate_stack_trampoline` and :func:`sys." "deactivate_stack_trampoline` for activating and deactivating stack profiler " @@ -1190,7 +1190,7 @@ msgid "" "Shannon in :gh:`96123`.)" msgstr "" -#: ../../whatsnew/3.12.rst:905 +#: ../../whatsnew/3.12.rst:907 msgid "" "Add :data:`sys.last_exc` which holds the last unhandled exception that was " "raised (for post-mortem debugging use cases). Deprecate the three fields " @@ -1199,14 +1199,14 @@ msgid "" "Katriel in :gh:`102778`.)" msgstr "" -#: ../../whatsnew/3.12.rst:911 ../../whatsnew/3.12.rst:1851 +#: ../../whatsnew/3.12.rst:913 ../../whatsnew/3.12.rst:1865 msgid "" ":func:`sys._current_exceptions` now returns a mapping from thread-id to an " "exception instance, rather than to a ``(typ, exc, tb)`` tuple. (Contributed " "by Irit Katriel in :gh:`103176`.)" msgstr "" -#: ../../whatsnew/3.12.rst:915 +#: ../../whatsnew/3.12.rst:917 msgid "" ":func:`sys.setrecursionlimit` and :func:`sys.getrecursionlimit`. The " "recursion limit now applies only to Python code. Builtin functions do not " @@ -1214,27 +1214,27 @@ msgid "" "prevents recursion from causing a virtual machine crash." msgstr "" -#: ../../whatsnew/3.12.rst:921 +#: ../../whatsnew/3.12.rst:923 msgid "tempfile" msgstr "tempfile" -#: ../../whatsnew/3.12.rst:923 +#: ../../whatsnew/3.12.rst:925 msgid "" "The :class:`tempfile.NamedTemporaryFile` function has a new optional " "parameter *delete_on_close* (Contributed by Evgeny Zorin in :gh:`58451`.)" msgstr "" -#: ../../whatsnew/3.12.rst:925 +#: ../../whatsnew/3.12.rst:927 msgid "" ":func:`tempfile.mkdtemp` now always returns an absolute path, even if the " "argument provided to the *dir* parameter is a relative path." msgstr "" -#: ../../whatsnew/3.12.rst:931 +#: ../../whatsnew/3.12.rst:933 msgid "threading" msgstr "threading" -#: ../../whatsnew/3.12.rst:933 +#: ../../whatsnew/3.12.rst:935 msgid "" "Add :func:`threading.settrace_all_threads` and :func:`threading." "setprofile_all_threads` that allow to set tracing and profiling functions in " @@ -1242,11 +1242,11 @@ msgid "" "Galindo in :gh:`93503`.)" msgstr "" -#: ../../whatsnew/3.12.rst:939 +#: ../../whatsnew/3.12.rst:941 msgid "tkinter" msgstr "tkinter" -#: ../../whatsnew/3.12.rst:941 +#: ../../whatsnew/3.12.rst:943 msgid "" "``tkinter.Canvas.coords()`` now flattens its arguments. It now accepts not " "only coordinates as separate arguments (``x1, y1, x2, y2, ...``) and a " @@ -1256,11 +1256,11 @@ msgid "" "in :gh:`94473`.)" msgstr "" -#: ../../whatsnew/3.12.rst:950 +#: ../../whatsnew/3.12.rst:952 msgid "tokenize" msgstr "tokenize" -#: ../../whatsnew/3.12.rst:952 +#: ../../whatsnew/3.12.rst:954 msgid "" "The :mod:`tokenize` module includes the changes introduced in :pep:`701`. " "(Contributed by Marta Gómez Macías and Pablo Galindo in :gh:`102856`.) See :" @@ -1268,22 +1268,22 @@ msgid "" "to the :mod:`tokenize` module." msgstr "" -#: ../../whatsnew/3.12.rst:958 +#: ../../whatsnew/3.12.rst:960 msgid "types" msgstr "types" -#: ../../whatsnew/3.12.rst:960 +#: ../../whatsnew/3.12.rst:962 msgid "" "Add :func:`types.get_original_bases` to allow for further introspection of :" "ref:`user-defined-generics` when subclassed. (Contributed by James Hilton-" "Balfe and Alex Waygood in :gh:`101827`.)" msgstr "" -#: ../../whatsnew/3.12.rst:965 +#: ../../whatsnew/3.12.rst:967 msgid "typing" msgstr "typing" -#: ../../whatsnew/3.12.rst:967 +#: ../../whatsnew/3.12.rst:969 msgid "" ":func:`isinstance` checks against :func:`runtime-checkable protocols ` now use :func:`inspect.getattr_static` rather than :func:" @@ -1296,7 +1296,7 @@ msgid "" "affected by this change. (Contributed by Alex Waygood in :gh:`102433`.)" msgstr "" -#: ../../whatsnew/3.12.rst:978 +#: ../../whatsnew/3.12.rst:980 msgid "" "The members of a runtime-checkable protocol are now considered \"frozen\" at " "runtime as soon as the class has been created. Monkey-patching attributes " @@ -1304,13 +1304,13 @@ msgid "" "on :func:`isinstance` checks comparing objects to the protocol. For example::" msgstr "" -#: ../../whatsnew/3.12.rst:1000 +#: ../../whatsnew/3.12.rst:1002 msgid "" "This change was made in order to speed up ``isinstance()`` checks against " "runtime-checkable protocols." msgstr "" -#: ../../whatsnew/3.12.rst:1003 +#: ../../whatsnew/3.12.rst:1005 msgid "" "The performance profile of :func:`isinstance` checks against :func:`runtime-" "checkable protocols ` has changed significantly. " @@ -1321,71 +1321,71 @@ msgid "" "in :gh:`74690` and :gh:`103193`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1011 +#: ../../whatsnew/3.12.rst:1013 msgid "" "All :data:`typing.TypedDict` and :data:`typing.NamedTuple` classes now have " "the ``__orig_bases__`` attribute. (Contributed by Adrian Garcia Badaracco " "in :gh:`103699`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1015 +#: ../../whatsnew/3.12.rst:1017 msgid "" "Add ``frozen_default`` parameter to :func:`typing.dataclass_transform`. " "(Contributed by Erik De Bonte in :gh:`99957`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1019 +#: ../../whatsnew/3.12.rst:1021 msgid "unicodedata" msgstr "unicodedata" -#: ../../whatsnew/3.12.rst:1021 +#: ../../whatsnew/3.12.rst:1023 msgid "" "The Unicode database has been updated to version 15.0.0. (Contributed by " "Benjamin Peterson in :gh:`96734`)." msgstr "" -#: ../../whatsnew/3.12.rst:1025 ../../whatsnew/3.12.rst:1696 +#: ../../whatsnew/3.12.rst:1027 ../../whatsnew/3.12.rst:1710 msgid "unittest" msgstr "unittest" -#: ../../whatsnew/3.12.rst:1027 +#: ../../whatsnew/3.12.rst:1029 msgid "" "Add a ``--durations`` command line option, showing the N slowest test cases::" msgstr "" -#: ../../whatsnew/3.12.rst:1043 +#: ../../whatsnew/3.12.rst:1045 msgid "(Contributed by Giampaolo Rodola in :gh:`48330`)" msgstr "" -#: ../../whatsnew/3.12.rst:1046 +#: ../../whatsnew/3.12.rst:1048 msgid "uuid" msgstr "uuid" -#: ../../whatsnew/3.12.rst:1048 +#: ../../whatsnew/3.12.rst:1050 msgid "" "Add a :ref:`command-line interface `. (Contributed by Adam Chhina " "in :gh:`88597`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1053 +#: ../../whatsnew/3.12.rst:1055 msgid "Optimizations" msgstr "最佳化" -#: ../../whatsnew/3.12.rst:1055 +#: ../../whatsnew/3.12.rst:1057 msgid "" "Remove ``wstr`` and ``wstr_length`` members from Unicode objects. It reduces " "object size by 8 or 16 bytes on 64bit platform. (:pep:`623`) (Contributed by " "Inada Naoki in :gh:`92536`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1059 +#: ../../whatsnew/3.12.rst:1061 msgid "" "Add experimental support for using the BOLT binary optimizer in the build " "process, which improves performance by 1-5%. (Contributed by Kevin " "Modzelewski in :gh:`90536` and tuned by Donghee Na in :gh:`101525`)" msgstr "" -#: ../../whatsnew/3.12.rst:1063 +#: ../../whatsnew/3.12.rst:1065 msgid "" "Speed up the regular expression substitution (functions :func:`re.sub` and :" "func:`re.subn` and corresponding :class:`!re.Pattern` methods) for " @@ -1393,13 +1393,13 @@ msgid "" "by Serhiy Storchaka in :gh:`91524`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1068 +#: ../../whatsnew/3.12.rst:1070 msgid "" "Speed up :class:`asyncio.Task` creation by deferring expensive string " "formatting. (Contributed by Itamar Oren in :gh:`103793`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1071 +#: ../../whatsnew/3.12.rst:1073 msgid "" "The :func:`tokenize.tokenize` and :func:`tokenize.generate_tokens` functions " "are up to 64% faster as a side effect of the changes required to cover :pep:" @@ -1407,18 +1407,18 @@ msgid "" "Pablo Galindo in :gh:`102856`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1076 +#: ../../whatsnew/3.12.rst:1078 msgid "" "Speed up :func:`super` method calls and attribute loads via the new :opcode:" "`LOAD_SUPER_ATTR` instruction. (Contributed by Carl Meyer and Vladimir " "Matveev in :gh:`103497`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1082 +#: ../../whatsnew/3.12.rst:1084 msgid "CPython bytecode changes" -msgstr "" +msgstr "CPython 位元組碼變更" -#: ../../whatsnew/3.12.rst:1084 +#: ../../whatsnew/3.12.rst:1086 msgid "" "Remove the :opcode:`!LOAD_METHOD` instruction. It has been merged into :" "opcode:`LOAD_ATTR`. :opcode:`LOAD_ATTR` will now behave like the old :opcode:" @@ -1426,62 +1426,62 @@ msgid "" "by Ken Jin in :gh:`93429`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1089 +#: ../../whatsnew/3.12.rst:1091 msgid "" "Remove the :opcode:`!JUMP_IF_FALSE_OR_POP` and :opcode:`!" "JUMP_IF_TRUE_OR_POP` instructions. (Contributed by Irit Katriel in :gh:" "`102859`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1092 +#: ../../whatsnew/3.12.rst:1094 msgid "" "Remove the :opcode:`!PRECALL` instruction. (Contributed by Mark Shannon in :" "gh:`92925`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1095 +#: ../../whatsnew/3.12.rst:1097 msgid "" "Add the :opcode:`BINARY_SLICE` and :opcode:`STORE_SLICE` instructions. " "(Contributed by Mark Shannon in :gh:`94163`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1098 +#: ../../whatsnew/3.12.rst:1100 msgid "" "Add the :opcode:`CALL_INTRINSIC_1` instructions. (Contributed by Mark " "Shannon in :gh:`99005`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1101 +#: ../../whatsnew/3.12.rst:1103 msgid "" "Add the :opcode:`CALL_INTRINSIC_2` instruction. (Contributed by Irit Katriel " "in :gh:`101799`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1104 +#: ../../whatsnew/3.12.rst:1106 msgid "" "Add the :opcode:`CLEANUP_THROW` instruction. (Contributed by Brandt Bucher " "in :gh:`90997`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1107 +#: ../../whatsnew/3.12.rst:1109 msgid "" "Add the :opcode:`!END_SEND` instruction. (Contributed by Mark Shannon in :gh:" "`103082`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1110 +#: ../../whatsnew/3.12.rst:1112 msgid "" "Add the :opcode:`LOAD_FAST_AND_CLEAR` instruction as part of the " "implementation of :pep:`709`. (Contributed by Carl Meyer in :gh:`101441`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1113 +#: ../../whatsnew/3.12.rst:1115 msgid "" "Add the :opcode:`LOAD_FAST_CHECK` instruction. (Contributed by Dennis " "Sweeney in :gh:`93143`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1116 +#: ../../whatsnew/3.12.rst:1118 msgid "" "Add the :opcode:`LOAD_FROM_DICT_OR_DEREF`, :opcode:" "`LOAD_FROM_DICT_OR_GLOBALS`, and :opcode:`LOAD_LOCALS` opcodes as part of " @@ -1490,48 +1490,48 @@ msgid "" "`LOAD_FROM_DICT_OR_DEREF`. (Contributed by Jelle Zijlstra in :gh:`103764`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1122 +#: ../../whatsnew/3.12.rst:1124 msgid "" "Add the :opcode:`LOAD_SUPER_ATTR` instruction. (Contributed by Carl Meyer " "and Vladimir Matveev in :gh:`103497`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1125 +#: ../../whatsnew/3.12.rst:1127 msgid "" "Add the :opcode:`RETURN_CONST` instruction. (Contributed by Wenyang Wang in :" "gh:`101632`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1128 +#: ../../whatsnew/3.12.rst:1130 msgid "Demos and Tools" msgstr "" -#: ../../whatsnew/3.12.rst:1130 +#: ../../whatsnew/3.12.rst:1132 msgid "" "Remove the ``Tools/demo/`` directory which contained old demo scripts. A " "copy can be found in the `old-demos project `_. (Contributed by Victor Stinner in :gh:`97681`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1135 +#: ../../whatsnew/3.12.rst:1137 msgid "" "Remove outdated example scripts of the ``Tools/scripts/`` directory. A copy " "can be found in the `old-demos project `_. (Contributed by Victor Stinner in :gh:`97669`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1142 ../../whatsnew/3.12.rst:2254 +#: ../../whatsnew/3.12.rst:1144 ../../whatsnew/3.12.rst:2268 msgid "Deprecated" msgstr "已棄用" -#: ../../whatsnew/3.12.rst:1144 +#: ../../whatsnew/3.12.rst:1146 msgid "" ":mod:`argparse`: The *type*, *choices*, and *metavar* parameters of :class:`!" "argparse.BooleanOptionalAction` are deprecated and will be removed in 3.14. " "(Contributed by Nikita Sobolev in :gh:`92248`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1149 +#: ../../whatsnew/3.12.rst:1151 msgid "" ":mod:`ast`: The following :mod:`ast` features have been deprecated in " "documentation since Python 3.8, now cause a :exc:`DeprecationWarning` to be " @@ -1539,37 +1539,37 @@ msgid "" "Python 3.14:" msgstr "" -#: ../../whatsnew/3.12.rst:1153 ../../whatsnew/3.12.rst:1387 +#: ../../whatsnew/3.12.rst:1155 ../../whatsnew/3.12.rst:1401 msgid ":class:`!ast.Num`" msgstr ":class:`!ast.Num`" -#: ../../whatsnew/3.12.rst:1154 ../../whatsnew/3.12.rst:1388 +#: ../../whatsnew/3.12.rst:1156 ../../whatsnew/3.12.rst:1402 msgid ":class:`!ast.Str`" msgstr ":class:`!ast.Str`" -#: ../../whatsnew/3.12.rst:1155 ../../whatsnew/3.12.rst:1389 +#: ../../whatsnew/3.12.rst:1157 ../../whatsnew/3.12.rst:1403 msgid ":class:`!ast.Bytes`" msgstr ":class:`!ast.Bytes`" -#: ../../whatsnew/3.12.rst:1156 ../../whatsnew/3.12.rst:1390 +#: ../../whatsnew/3.12.rst:1158 ../../whatsnew/3.12.rst:1404 msgid ":class:`!ast.NameConstant`" msgstr ":class:`!ast.NameConstant`" -#: ../../whatsnew/3.12.rst:1157 ../../whatsnew/3.12.rst:1391 +#: ../../whatsnew/3.12.rst:1159 ../../whatsnew/3.12.rst:1405 msgid ":class:`!ast.Ellipsis`" msgstr ":class:`!ast.Ellipsis`" -#: ../../whatsnew/3.12.rst:1159 +#: ../../whatsnew/3.12.rst:1161 msgid "" "Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka in :gh:" "`90953`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1162 ../../whatsnew/3.12.rst:1393 +#: ../../whatsnew/3.12.rst:1164 ../../whatsnew/3.12.rst:1407 msgid ":mod:`asyncio`:" msgstr ":mod:`asyncio`:" -#: ../../whatsnew/3.12.rst:1164 +#: ../../whatsnew/3.12.rst:1166 msgid "" "The child watcher classes :class:`asyncio.MultiLoopChildWatcher`, :class:" "`asyncio.FastChildWatcher`, :class:`asyncio.AbstractChildWatcher` and :class:" @@ -1577,7 +1577,7 @@ msgid "" "3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1170 +#: ../../whatsnew/3.12.rst:1172 msgid "" ":func:`asyncio.set_child_watcher`, :func:`asyncio.get_child_watcher`, :meth:" "`asyncio.AbstractEventLoopPolicy.set_child_watcher` and :meth:`asyncio." @@ -1585,7 +1585,7 @@ msgid "" "removed in Python 3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1176 +#: ../../whatsnew/3.12.rst:1178 msgid "" "The :meth:`~asyncio.get_event_loop` method of the default event loop policy " "now emits a :exc:`DeprecationWarning` if there is no current event loop set " @@ -1593,14 +1593,14 @@ msgid "" "Rossum in :gh:`100160`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1181 +#: ../../whatsnew/3.12.rst:1183 msgid "" ":mod:`calendar`: ``calendar.January`` and ``calendar.February`` constants " "are deprecated and replaced by :data:`calendar.JANUARY` and :data:`calendar." "FEBRUARY`. (Contributed by Prince Roshan in :gh:`103636`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1185 +#: ../../whatsnew/3.12.rst:1187 msgid "" ":mod:`collections.abc`: Deprecated :class:`collections.abc.ByteString`. " "Prefer :class:`Sequence` or :class:`collections.abc.Buffer`. For use in " @@ -1608,7 +1608,7 @@ msgid "" "abc.Buffer`. (Contributed by Shantanu Jain in :gh:`91896`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1190 +#: ../../whatsnew/3.12.rst:1192 msgid "" ":mod:`datetime`: :class:`datetime.datetime`'s :meth:`~datetime.datetime." "utcnow` and :meth:`~datetime.datetime.utcfromtimestamp` are deprecated and " @@ -1618,47 +1618,49 @@ msgid "" "set to :const:`datetime.UTC`. (Contributed by Paul Ganssle in :gh:`103857`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1198 +#: ../../whatsnew/3.12.rst:1200 msgid "" ":mod:`email`: Deprecate the *isdst* parameter in :func:`email.utils." "localtime`. (Contributed by Alan Williams in :gh:`72346`.)" msgstr "" +":mod:`email`:棄用 :func:`email.utils.localtime` 中的 *isdst* 參數。(由 " +"Alan Williams 於 :gh:`72346` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1201 +#: ../../whatsnew/3.12.rst:1203 msgid "" ":mod:`importlib.abc`: Deprecated the following classes, scheduled for " "removal in Python 3.14:" -msgstr "" +msgstr ":mod:`importlib.abc`:棄用下列類別,預定於 Python 3.14 中移除:" -#: ../../whatsnew/3.12.rst:1204 ../../whatsnew/3.12.rst:1410 +#: ../../whatsnew/3.12.rst:1206 ../../whatsnew/3.12.rst:1424 msgid ":class:`!importlib.abc.ResourceReader`" msgstr ":class:`!importlib.abc.ResourceReader`" -#: ../../whatsnew/3.12.rst:1205 ../../whatsnew/3.12.rst:1411 +#: ../../whatsnew/3.12.rst:1207 ../../whatsnew/3.12.rst:1425 msgid ":class:`!importlib.abc.Traversable`" msgstr ":class:`!importlib.abc.Traversable`" -#: ../../whatsnew/3.12.rst:1206 ../../whatsnew/3.12.rst:1412 +#: ../../whatsnew/3.12.rst:1208 ../../whatsnew/3.12.rst:1426 msgid ":class:`!importlib.abc.TraversableResources`" msgstr ":class:`!importlib.abc.TraversableResources`" -#: ../../whatsnew/3.12.rst:1208 +#: ../../whatsnew/3.12.rst:1210 msgid "Use :mod:`importlib.resources.abc` classes instead:" msgstr "請改用 :mod:`importlib.resources.abc` 類別:" -#: ../../whatsnew/3.12.rst:1210 +#: ../../whatsnew/3.12.rst:1212 msgid ":class:`importlib.resources.abc.Traversable`" msgstr ":class:`importlib.resources.abc.Traversable`" -#: ../../whatsnew/3.12.rst:1211 +#: ../../whatsnew/3.12.rst:1213 msgid ":class:`importlib.resources.abc.TraversableResources`" msgstr ":class:`importlib.resources.abc.TraversableResources`" -#: ../../whatsnew/3.12.rst:1213 +#: ../../whatsnew/3.12.rst:1215 msgid "(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)" msgstr "(由 Jason R. Coombs 和 Hugo van Kemenade 於 :gh:`93963` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1215 +#: ../../whatsnew/3.12.rst:1217 msgid "" ":mod:`itertools`: Deprecate the support for copy, deepcopy, and pickle " "operations, which is undocumented, inefficient, historically buggy, and " @@ -1667,7 +1669,7 @@ msgid "" "`101588`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1221 +#: ../../whatsnew/3.12.rst:1223 msgid "" ":mod:`multiprocessing`: In Python 3.14, the default :mod:`multiprocessing` " "start method will change to a safer one on Linux, BSDs, and other non-macOS " @@ -1679,14 +1681,14 @@ msgid "" "methods `." msgstr "" -#: ../../whatsnew/3.12.rst:1231 +#: ../../whatsnew/3.12.rst:1233 msgid "" ":mod:`pkgutil`: :func:`pkgutil.find_loader` and :func:`pkgutil.get_loader` " "are deprecated and will be removed in Python 3.14; use :func:`importlib.util." "find_spec` instead. (Contributed by Nikita Sobolev in :gh:`97850`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1236 +#: ../../whatsnew/3.12.rst:1238 msgid "" ":mod:`pty`: The module has two undocumented ``master_open()`` and " "``slave_open()`` functions that have been deprecated since Python 2 but only " @@ -1694,11 +1696,11 @@ msgid "" "(Contributed by Soumendra Ganguly and Gregory P. Smith in :gh:`85984`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1241 +#: ../../whatsnew/3.12.rst:1243 msgid ":mod:`os`:" msgstr ":mod:`os`:" -#: ../../whatsnew/3.12.rst:1243 +#: ../../whatsnew/3.12.rst:1245 msgid "" "The ``st_ctime`` fields return by :func:`os.stat` and :func:`os.lstat` on " "Windows are deprecated. In a future release, they will contain the last " @@ -1707,7 +1709,7 @@ msgid "" "``st_birthtime`` field. (Contributed by Steve Dower in :gh:`99726`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1249 +#: ../../whatsnew/3.12.rst:1251 msgid "" "On POSIX platforms, :func:`os.fork` can now raise a :exc:" "`DeprecationWarning` when it can detect being called from a multithreaded " @@ -1720,14 +1722,14 @@ msgid "" "longstanding platform compatibility problem to developers." msgstr "" -#: ../../whatsnew/3.12.rst:1259 +#: ../../whatsnew/3.12.rst:1261 msgid "" "When this warning appears due to usage of :mod:`multiprocessing` or :mod:" "`concurrent.futures` the fix is to use a different :mod:`multiprocessing` " "start method such as ``\"spawn\"`` or ``\"forkserver\"``." msgstr "" -#: ../../whatsnew/3.12.rst:1263 +#: ../../whatsnew/3.12.rst:1265 msgid "" ":mod:`shutil`: The *onerror* argument of :func:`shutil.rmtree` is " "deprecated; use *onexc* instead. (Contributed by Irit Katriel in :gh:" @@ -1736,18 +1738,18 @@ msgstr "" ":mod:`shutil`::func:`shutil.rmtree` 的 *onerror* 引數已被棄用,請改用 " "*onexc*。(由 Irit Katriel 於 :gh:`102828` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1266 +#: ../../whatsnew/3.12.rst:1268 msgid ":mod:`sqlite3`:" msgstr ":mod:`sqlite3`:" -#: ../../whatsnew/3.12.rst:1268 +#: ../../whatsnew/3.12.rst:1270 msgid "" ":ref:`default adapters and converters ` are now " "deprecated. Instead, use the :ref:`sqlite3-adapter-converter-recipes` and " "tailor them to your needs. (Contributed by Erlend E. Aasland in :gh:`90016`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1274 +#: ../../whatsnew/3.12.rst:1276 msgid "" "In :meth:`~sqlite3.Cursor.execute`, :exc:`DeprecationWarning` is now emitted " "when :ref:`named placeholders ` are used together with " @@ -1757,39 +1759,39 @@ msgid "" "Erlend E. Aasland in :gh:`101698`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1281 +#: ../../whatsnew/3.12.rst:1283 msgid "" ":mod:`sys`: The :data:`sys.last_type`, :data:`sys.last_value` and :data:`sys." "last_traceback` fields are deprecated. Use :data:`sys.last_exc` instead. " "(Contributed by Irit Katriel in :gh:`102778`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1285 +#: ../../whatsnew/3.12.rst:1287 msgid "" ":mod:`tarfile`: Extracting tar archives without specifying *filter* is " "deprecated until Python 3.14, when ``'data'`` filter will become the " "default. See :ref:`tarfile-extraction-filter` for details." msgstr "" -#: ../../whatsnew/3.12.rst:1289 +#: ../../whatsnew/3.12.rst:1291 msgid ":mod:`typing`:" -msgstr "" +msgstr ":mod:`typing`:" -#: ../../whatsnew/3.12.rst:1291 +#: ../../whatsnew/3.12.rst:1293 msgid "" ":class:`typing.Hashable` and :class:`typing.Sized`, aliases for :class:" "`collections.abc.Hashable` and :class:`collections.abc.Sized` respectively, " "are deprecated. (:gh:`94309`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1295 +#: ../../whatsnew/3.12.rst:1297 msgid "" ":class:`typing.ByteString`, deprecated since Python 3.9, now causes a :exc:" "`DeprecationWarning` to be emitted when it is used. (Contributed by Alex " "Waygood in :gh:`91896`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1299 +#: ../../whatsnew/3.12.rst:1301 msgid "" ":mod:`xml.etree.ElementTree`: The module now emits :exc:`DeprecationWarning` " "when testing the truth value of an :class:`xml.etree.ElementTree.Element`. " @@ -1797,7 +1799,7 @@ msgid "" "implementation emitted nothing. (Contributed by Jacob Walls in :gh:`83122`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1305 +#: ../../whatsnew/3.12.rst:1307 msgid "" "The 3-arg signatures (type, value, traceback) of :meth:`coroutine throw() " "`, :meth:`generator throw() ` and :meth:" @@ -1806,21 +1808,21 @@ msgid "" "instead. (Contributed by Ofey Chan in :gh:`89874`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1311 +#: ../../whatsnew/3.12.rst:1313 msgid "" ":exc:`DeprecationWarning` is now raised when ``__package__`` on a module " "differs from ``__spec__.parent`` (previously it was :exc:`ImportWarning`). " "(Contributed by Brett Cannon in :gh:`65961`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1316 +#: ../../whatsnew/3.12.rst:1318 msgid "" "Setting ``__package__`` or ``__cached__`` on a module is deprecated, and " "will cease to be set or taken into consideration by the import system in " "Python 3.14. (Contributed by Brett Cannon in :gh:`65961`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1320 +#: ../../whatsnew/3.12.rst:1322 msgid "" "The bitwise inversion operator (``~``) on bool is deprecated. It will throw " "an error in Python 3.14. Use ``not`` for logical negation of bools instead. " @@ -1829,7 +1831,7 @@ msgid "" "Tim Hoffmann in :gh:`103487`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1326 +#: ../../whatsnew/3.12.rst:1328 msgid "" "Accessing :attr:`~codeobject.co_lnotab` on code objects was deprecated in " "Python 3.10 via :pep:`626`, but it only got a proper :exc:" @@ -1837,289 +1839,328 @@ msgid "" "(Contributed by Nikita Sobolev in :gh:`101866`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1333 +#: ../../whatsnew/3.12.rst:1335 msgid "Pending Removal in Python 3.13" msgstr "Python 3.13 中待決議的移除項目" -#: ../../whatsnew/3.12.rst:1335 +#: ../../whatsnew/3.12.rst:1337 msgid "" "The following modules and APIs have been deprecated in earlier Python " "releases, and will be removed in Python 3.13." msgstr "" -#: ../../whatsnew/3.12.rst:1338 +#: ../../whatsnew/3.12.rst:1340 msgid "Modules (see :pep:`594`):" msgstr "" -#: ../../whatsnew/3.12.rst:1340 +#: ../../whatsnew/3.12.rst:1342 msgid ":mod:`aifc`" msgstr ":mod:`aifc`" -#: ../../whatsnew/3.12.rst:1341 +#: ../../whatsnew/3.12.rst:1343 msgid ":mod:`audioop`" msgstr ":mod:`audioop`" -#: ../../whatsnew/3.12.rst:1342 +#: ../../whatsnew/3.12.rst:1344 msgid ":mod:`cgi`" msgstr ":mod:`cgi`" -#: ../../whatsnew/3.12.rst:1343 +#: ../../whatsnew/3.12.rst:1345 msgid ":mod:`cgitb`" msgstr ":mod:`cgitb`" -#: ../../whatsnew/3.12.rst:1344 +#: ../../whatsnew/3.12.rst:1346 msgid ":mod:`chunk`" msgstr ":mod:`chunk`" -#: ../../whatsnew/3.12.rst:1345 +#: ../../whatsnew/3.12.rst:1347 msgid ":mod:`crypt`" msgstr ":mod:`crypt`" -#: ../../whatsnew/3.12.rst:1346 +#: ../../whatsnew/3.12.rst:1348 msgid ":mod:`imghdr`" msgstr ":mod:`imghdr`" -#: ../../whatsnew/3.12.rst:1347 +#: ../../whatsnew/3.12.rst:1349 msgid ":mod:`mailcap`" msgstr ":mod:`mailcap`" -#: ../../whatsnew/3.12.rst:1348 +#: ../../whatsnew/3.12.rst:1350 msgid ":mod:`msilib`" msgstr ":mod:`msilib`" -#: ../../whatsnew/3.12.rst:1349 +#: ../../whatsnew/3.12.rst:1351 msgid ":mod:`nis`" msgstr ":mod:`nis`" -#: ../../whatsnew/3.12.rst:1350 +#: ../../whatsnew/3.12.rst:1352 msgid ":mod:`nntplib`" msgstr ":mod:`nntplib`" -#: ../../whatsnew/3.12.rst:1351 +#: ../../whatsnew/3.12.rst:1353 msgid ":mod:`ossaudiodev`" msgstr ":mod:`ossaudiodev`" -#: ../../whatsnew/3.12.rst:1352 +#: ../../whatsnew/3.12.rst:1354 msgid ":mod:`pipes`" msgstr ":mod:`pipes`" -#: ../../whatsnew/3.12.rst:1353 +#: ../../whatsnew/3.12.rst:1355 msgid ":mod:`sndhdr`" msgstr ":mod:`sndhdr`" -#: ../../whatsnew/3.12.rst:1354 +#: ../../whatsnew/3.12.rst:1356 msgid ":mod:`spwd`" msgstr ":mod:`spwd`" -#: ../../whatsnew/3.12.rst:1355 +#: ../../whatsnew/3.12.rst:1357 msgid ":mod:`sunau`" msgstr ":mod:`sunau`" -#: ../../whatsnew/3.12.rst:1356 +#: ../../whatsnew/3.12.rst:1358 msgid ":mod:`telnetlib`" msgstr ":mod:`telnetlib`" -#: ../../whatsnew/3.12.rst:1357 +#: ../../whatsnew/3.12.rst:1359 msgid ":mod:`uu`" msgstr ":mod:`uu`" -#: ../../whatsnew/3.12.rst:1358 +#: ../../whatsnew/3.12.rst:1360 msgid ":mod:`xdrlib`" msgstr ":mod:`xdrlib`" -#: ../../whatsnew/3.12.rst:1360 +#: ../../whatsnew/3.12.rst:1362 msgid "Other modules:" msgstr "其他模組:" -#: ../../whatsnew/3.12.rst:1362 +#: ../../whatsnew/3.12.rst:1364 msgid ":mod:`!lib2to3`, and the :program:`2to3` program (:gh:`84540`)" -msgstr "" +msgstr ":mod:`!lib2to3` 以及 :program:`2to3` 程式 (:gh:`84540`)" -#: ../../whatsnew/3.12.rst:1364 ../../whatsnew/3.12.rst:1442 +#: ../../whatsnew/3.12.rst:1366 ../../whatsnew/3.12.rst:1456 msgid "APIs:" -msgstr "" +msgstr "API:" -#: ../../whatsnew/3.12.rst:1366 +#: ../../whatsnew/3.12.rst:1368 msgid ":class:`!configparser.LegacyInterpolation` (:gh:`90765`)" msgstr ":class:`!configparser.LegacyInterpolation` (:gh:`90765`)" -#: ../../whatsnew/3.12.rst:1367 +#: ../../whatsnew/3.12.rst:1369 msgid "``locale.resetlocale()`` (:gh:`90817`)" msgstr "``locale.resetlocale()`` (:gh:`90817`)" -#: ../../whatsnew/3.12.rst:1368 +#: ../../whatsnew/3.12.rst:1370 msgid ":meth:`!turtle.RawTurtle.settiltangle` (:gh:`50096`)" msgstr ":meth:`!turtle.RawTurtle.settiltangle` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1369 +#: ../../whatsnew/3.12.rst:1371 msgid ":func:`!unittest.findTestCases` (:gh:`50096`)" msgstr ":func:`!unittest.findTestCases` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1370 +#: ../../whatsnew/3.12.rst:1372 msgid ":func:`!unittest.getTestCaseNames` (:gh:`50096`)" msgstr ":func:`!unittest.getTestCaseNames` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1371 +#: ../../whatsnew/3.12.rst:1373 msgid ":func:`!unittest.makeSuite` (:gh:`50096`)" msgstr ":func:`!unittest.makeSuite` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1372 +#: ../../whatsnew/3.12.rst:1374 msgid ":meth:`!unittest.TestProgram.usageExit` (:gh:`67048`)" msgstr ":meth:`!unittest.TestProgram.usageExit` (:gh:`67048`)" -#: ../../whatsnew/3.12.rst:1373 +#: ../../whatsnew/3.12.rst:1375 msgid ":class:`!webbrowser.MacOSX` (:gh:`86421`)" msgstr ":class:`!webbrowser.MacOSX` (:gh:`86421`)" -#: ../../whatsnew/3.12.rst:1374 +#: ../../whatsnew/3.12.rst:1376 msgid ":class:`classmethod` descriptor chaining (:gh:`89519`)" +msgstr ":class:`classmethod` 描述器鏈結 (:gh:`89519`)" + +#: ../../whatsnew/3.12.rst:1377 +msgid ":mod:`importlib.resources` deprecated methods:" +msgstr ":mod:`importlib.resources` 中被棄用的方法:" + +#: ../../whatsnew/3.12.rst:1379 +msgid "``contents()``" +msgstr "``contents()``" + +#: ../../whatsnew/3.12.rst:1380 +msgid "``is_resource()``" +msgstr "``is_resource()``" + +#: ../../whatsnew/3.12.rst:1381 +msgid "``open_binary()``" +msgstr "``open_binary()``" + +#: ../../whatsnew/3.12.rst:1382 +msgid "``open_text()``" +msgstr "``open_text()``" + +#: ../../whatsnew/3.12.rst:1383 +msgid "``path()``" +msgstr "``path()``" + +#: ../../whatsnew/3.12.rst:1384 +msgid "``read_binary()``" +msgstr "``read_binary()``" + +#: ../../whatsnew/3.12.rst:1385 +msgid "``read_text()``" +msgstr "``read_text()``" + +#: ../../whatsnew/3.12.rst:1387 +msgid "" +"Use :func:`importlib.resources.files()` instead. Refer to `importlib-" +"resources: Migrating from Legacy `_ (:gh:`106531`)" msgstr "" -#: ../../whatsnew/3.12.rst:1377 ../../whatsnew/3.12.rst:2341 +#: ../../whatsnew/3.12.rst:1391 ../../whatsnew/3.12.rst:2355 msgid "Pending Removal in Python 3.14" msgstr "Python 3.14 中待決議的移除項目" -#: ../../whatsnew/3.12.rst:1379 +#: ../../whatsnew/3.12.rst:1393 msgid "" "The following APIs have been deprecated and will be removed in Python 3.14." -msgstr "" +msgstr "以下 API 已被棄用並將在 Python 3.14 中移除。" -#: ../../whatsnew/3.12.rst:1382 +#: ../../whatsnew/3.12.rst:1396 msgid "" ":mod:`argparse`: The *type*, *choices*, and *metavar* parameters of :class:`!" "argparse.BooleanOptionalAction`" msgstr "" -#: ../../whatsnew/3.12.rst:1385 +#: ../../whatsnew/3.12.rst:1399 msgid ":mod:`ast`:" msgstr ":mod:`ast`:" -#: ../../whatsnew/3.12.rst:1395 +#: ../../whatsnew/3.12.rst:1409 msgid ":class:`!asyncio.MultiLoopChildWatcher`" msgstr ":class:`!asyncio.MultiLoopChildWatcher`" -#: ../../whatsnew/3.12.rst:1396 +#: ../../whatsnew/3.12.rst:1410 msgid ":class:`!asyncio.FastChildWatcher`" msgstr ":class:`!asyncio.FastChildWatcher`" -#: ../../whatsnew/3.12.rst:1397 +#: ../../whatsnew/3.12.rst:1411 msgid ":class:`!asyncio.AbstractChildWatcher`" msgstr ":class:`!asyncio.AbstractChildWatcher`" -#: ../../whatsnew/3.12.rst:1398 +#: ../../whatsnew/3.12.rst:1412 msgid ":class:`!asyncio.SafeChildWatcher`" msgstr ":class:`!asyncio.SafeChildWatcher`" -#: ../../whatsnew/3.12.rst:1399 +#: ../../whatsnew/3.12.rst:1413 msgid ":func:`!asyncio.set_child_watcher`" msgstr ":func:`!asyncio.set_child_watcher`" -#: ../../whatsnew/3.12.rst:1400 +#: ../../whatsnew/3.12.rst:1414 msgid ":func:`!asyncio.get_child_watcher`," msgstr ":func:`!asyncio.get_child_watcher`、" -#: ../../whatsnew/3.12.rst:1401 +#: ../../whatsnew/3.12.rst:1415 msgid ":meth:`!asyncio.AbstractEventLoopPolicy.set_child_watcher`" msgstr ":meth:`!asyncio.AbstractEventLoopPolicy.set_child_watcher`" -#: ../../whatsnew/3.12.rst:1402 +#: ../../whatsnew/3.12.rst:1416 msgid ":meth:`!asyncio.AbstractEventLoopPolicy.get_child_watcher`" msgstr ":meth:`!asyncio.AbstractEventLoopPolicy.get_child_watcher`" -#: ../../whatsnew/3.12.rst:1404 +#: ../../whatsnew/3.12.rst:1418 msgid ":mod:`collections.abc`: :class:`!collections.abc.ByteString`." msgstr ":mod:`collections.abc`: :class:`!collections.abc.ByteString`。" -#: ../../whatsnew/3.12.rst:1406 +#: ../../whatsnew/3.12.rst:1420 msgid ":mod:`email`: the *isdst* parameter in :func:`email.utils.localtime`." msgstr "" -#: ../../whatsnew/3.12.rst:1408 +#: ../../whatsnew/3.12.rst:1422 msgid ":mod:`importlib.abc`:" msgstr ":mod:`importlib.abc`:" -#: ../../whatsnew/3.12.rst:1414 +#: ../../whatsnew/3.12.rst:1428 msgid ":mod:`itertools`: Support for copy, deepcopy, and pickle operations." msgstr "" -#: ../../whatsnew/3.12.rst:1416 +#: ../../whatsnew/3.12.rst:1430 msgid ":mod:`pkgutil`:" msgstr ":mod:`pkgutil`:" -#: ../../whatsnew/3.12.rst:1418 +#: ../../whatsnew/3.12.rst:1432 msgid ":func:`!pkgutil.find_loader`" msgstr ":func:`!pkgutil.find_loader`" -#: ../../whatsnew/3.12.rst:1419 +#: ../../whatsnew/3.12.rst:1433 msgid ":func:`!pkgutil.get_loader`." msgstr ":func:`!pkgutil.get_loader`。" -#: ../../whatsnew/3.12.rst:1421 +#: ../../whatsnew/3.12.rst:1435 msgid ":mod:`pty`:" msgstr ":mod:`pty`:" -#: ../../whatsnew/3.12.rst:1423 +#: ../../whatsnew/3.12.rst:1437 msgid ":func:`!pty.master_open`" msgstr ":func:`!pty.master_open`" -#: ../../whatsnew/3.12.rst:1424 +#: ../../whatsnew/3.12.rst:1438 msgid ":func:`!pty.slave_open`" msgstr ":func:`!pty.slave_open`" -#: ../../whatsnew/3.12.rst:1426 +#: ../../whatsnew/3.12.rst:1440 msgid ":mod:`shutil`: The *onerror* argument of :func:`shutil.rmtree`" msgstr "" -#: ../../whatsnew/3.12.rst:1428 +#: ../../whatsnew/3.12.rst:1442 msgid ":mod:`typing`: :class:`!typing.ByteString`" msgstr ":mod:`typing`::class:`!typing.ByteString`" -#: ../../whatsnew/3.12.rst:1430 +#: ../../whatsnew/3.12.rst:1444 msgid "" ":mod:`xml.etree.ElementTree`: Testing the truth value of an :class:`xml." "etree.ElementTree.Element`." msgstr "" -#: ../../whatsnew/3.12.rst:1432 +#: ../../whatsnew/3.12.rst:1446 msgid "The ``__package__`` and ``__cached__`` attributes on module objects." msgstr "" -#: ../../whatsnew/3.12.rst:1434 +#: ../../whatsnew/3.12.rst:1448 msgid "The :attr:`~codeobject.co_lnotab` attribute of code objects." msgstr "" -#: ../../whatsnew/3.12.rst:1437 ../../whatsnew/3.12.rst:2378 +#: ../../whatsnew/3.12.rst:1451 ../../whatsnew/3.12.rst:2392 msgid "Pending Removal in Python 3.15" msgstr "Python 3.15 中待決議的移除項目" -#: ../../whatsnew/3.12.rst:1439 +#: ../../whatsnew/3.12.rst:1453 msgid "" "The following APIs have been deprecated and will be removed in Python 3.15." msgstr "" -#: ../../whatsnew/3.12.rst:1444 +#: ../../whatsnew/3.12.rst:1458 msgid ":func:`locale.getdefaultlocale` (:gh:`90817`)" msgstr ":func:`locale.getdefaultlocale` (:gh:`90817`)" -#: ../../whatsnew/3.12.rst:1448 ../../whatsnew/3.12.rst:2396 +#: ../../whatsnew/3.12.rst:1462 ../../whatsnew/3.12.rst:2410 msgid "Pending Removal in Future Versions" msgstr "未來版本中待決議的移除項目" -#: ../../whatsnew/3.12.rst:1450 +#: ../../whatsnew/3.12.rst:1464 msgid "" "The following APIs were deprecated in earlier Python versions and will be " "removed, although there is currently no date scheduled for their removal." msgstr "" -#: ../../whatsnew/3.12.rst:1453 +#: ../../whatsnew/3.12.rst:1467 msgid ":mod:`array`'s ``'u'`` format code (:gh:`57281`)" msgstr "" -#: ../../whatsnew/3.12.rst:1455 +#: ../../whatsnew/3.12.rst:1469 msgid ":class:`typing.Text` (:gh:`92332`)" msgstr ":class:`typing.Text` (:gh:`92332`)" -#: ../../whatsnew/3.12.rst:1457 +#: ../../whatsnew/3.12.rst:1471 msgid "" "Currently Python accepts numeric literals immediately followed by keywords, " "for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing and " @@ -2131,54 +2172,54 @@ msgid "" "syntax error. (:gh:`87999`)" msgstr "" -#: ../../whatsnew/3.12.rst:1468 ../../whatsnew/3.12.rst:2428 +#: ../../whatsnew/3.12.rst:1482 ../../whatsnew/3.12.rst:2442 msgid "Removed" msgstr "已移除" -#: ../../whatsnew/3.12.rst:1471 +#: ../../whatsnew/3.12.rst:1485 msgid "asynchat and asyncore" msgstr "asynchat 和 asyncore" -#: ../../whatsnew/3.12.rst:1473 +#: ../../whatsnew/3.12.rst:1487 msgid "" "These two modules have been removed according to the schedule in :pep:`594`, " "having been deprecated in Python 3.6. Use :mod:`asyncio` instead. " "(Contributed by Nikita Sobolev in :gh:`96580`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1480 +#: ../../whatsnew/3.12.rst:1494 msgid "configparser" msgstr "configparser" -#: ../../whatsnew/3.12.rst:1482 +#: ../../whatsnew/3.12.rst:1496 msgid "" "Several names deprecated in the :mod:`configparser` way back in 3.2 have " "been removed per :gh:`89336`:" msgstr "" -#: ../../whatsnew/3.12.rst:1485 +#: ../../whatsnew/3.12.rst:1499 msgid "" ":class:`configparser.ParsingError` no longer has a ``filename`` attribute or " "argument. Use the ``source`` attribute and argument instead." msgstr "" -#: ../../whatsnew/3.12.rst:1487 +#: ../../whatsnew/3.12.rst:1501 msgid "" ":mod:`configparser` no longer has a ``SafeConfigParser`` class. Use the " "shorter :class:`~configparser.ConfigParser` name instead." msgstr "" -#: ../../whatsnew/3.12.rst:1489 +#: ../../whatsnew/3.12.rst:1503 msgid "" ":class:`configparser.ConfigParser` no longer has a ``readfp`` method. Use :" "meth:`~configparser.ConfigParser.read_file` instead." msgstr "" -#: ../../whatsnew/3.12.rst:1493 +#: ../../whatsnew/3.12.rst:1507 msgid "distutils" msgstr "distutils" -#: ../../whatsnew/3.12.rst:1495 +#: ../../whatsnew/3.12.rst:1509 msgid "" "Remove the :py:mod:`!distutils` package. It was deprecated in Python 3.10 " "by :pep:`632` \"Deprecate distutils module\". For projects still using " @@ -2187,17 +2228,17 @@ msgid "" "Victor Stinner in :gh:`92584`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1502 +#: ../../whatsnew/3.12.rst:1516 msgid "ensurepip" msgstr "ensurepip" -#: ../../whatsnew/3.12.rst:1504 +#: ../../whatsnew/3.12.rst:1518 msgid "" "Remove the bundled setuptools wheel from :mod:`ensurepip`, and stop " "installing setuptools in environments created by :mod:`venv`." msgstr "" -#: ../../whatsnew/3.12.rst:1507 +#: ../../whatsnew/3.12.rst:1521 msgid "" "``pip (>= 22.1)`` does not require setuptools to be installed in the " "environment. ``setuptools``-based (and ``distutils``-based) packages can " @@ -2205,7 +2246,7 @@ msgid "" "the build environment it uses for building a package." msgstr "" -#: ../../whatsnew/3.12.rst:1513 +#: ../../whatsnew/3.12.rst:1527 msgid "" "``easy_install``, ``pkg_resources``, ``setuptools`` and ``distutils`` are no " "longer provided by default in environments created with ``venv`` or " @@ -2215,35 +2256,37 @@ msgid "" "(typically, using pip)." msgstr "" -#: ../../whatsnew/3.12.rst:1520 +#: ../../whatsnew/3.12.rst:1534 msgid "(Contributed by Pradyun Gedam in :gh:`95299`.)" msgstr "(由 Pradyun Gedam 於 :gh:`95299` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1523 +#: ../../whatsnew/3.12.rst:1537 msgid "enum" msgstr "enum" -#: ../../whatsnew/3.12.rst:1525 +#: ../../whatsnew/3.12.rst:1539 msgid "" "Remove :mod:`enum`'s ``EnumMeta.__getattr__``, which is no longer needed for " "enum attribute access. (Contributed by Ethan Furman in :gh:`95083`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1530 +#: ../../whatsnew/3.12.rst:1544 msgid "ftplib" msgstr "ftplib" -#: ../../whatsnew/3.12.rst:1532 +#: ../../whatsnew/3.12.rst:1546 msgid "" "Remove :mod:`ftplib`'s ``FTP_TLS.ssl_version`` class attribute: use the " "*context* parameter instead. (Contributed by Victor Stinner in :gh:`94172`.)" msgstr "" +"移除 :mod:`ftplib` 的 ``FTP_TLS.ssl_version`` 類別屬性:請改用 *context* 參" +"數。(由 Victor Stinner 於 :gh:`94172` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1537 +#: ../../whatsnew/3.12.rst:1551 msgid "gzip" msgstr "gzip" -#: ../../whatsnew/3.12.rst:1539 +#: ../../whatsnew/3.12.rst:1553 msgid "" "Remove the ``filename`` attribute of :mod:`gzip`'s :class:`gzip.GzipFile`, " "deprecated since Python 2.6, use the :attr:`~gzip.GzipFile.name` attribute " @@ -2252,11 +2295,11 @@ msgid "" "`94196`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1546 +#: ../../whatsnew/3.12.rst:1560 msgid "hashlib" msgstr "hashlib" -#: ../../whatsnew/3.12.rst:1548 +#: ../../whatsnew/3.12.rst:1562 msgid "" "Remove the pure Python implementation of :mod:`hashlib`'s :func:`hashlib." "pbkdf2_hmac()`, deprecated in Python 3.10. Python 3.10 and newer requires " @@ -2265,191 +2308,194 @@ msgid "" "Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1555 ../../whatsnew/3.12.rst:1582 +#: ../../whatsnew/3.12.rst:1569 ../../whatsnew/3.12.rst:1596 msgid "importlib" msgstr "importlib" -#: ../../whatsnew/3.12.rst:1557 +#: ../../whatsnew/3.12.rst:1571 msgid "" "Many previously deprecated cleanups in :mod:`importlib` have now been " "completed:" msgstr "" -#: ../../whatsnew/3.12.rst:1560 +#: ../../whatsnew/3.12.rst:1574 msgid "" "References to, and support for :meth:`!module_repr()` has been removed. " "(Contributed by Barry Warsaw in :gh:`97850`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1563 +#: ../../whatsnew/3.12.rst:1577 msgid "" "``importlib.util.set_package``, ``importlib.util.set_loader`` and " "``importlib.util.module_for_loader`` have all been removed. (Contributed by " "Brett Cannon and Nikita Sobolev in :gh:`65961` and :gh:`97850`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1567 +#: ../../whatsnew/3.12.rst:1581 msgid "" "Support for ``find_loader()`` and ``find_module()`` APIs have been removed. " "(Contributed by Barry Warsaw in :gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1570 +#: ../../whatsnew/3.12.rst:1584 msgid "" "``importlib.abc.Finder``, ``pkgutil.ImpImporter``, and ``pkgutil.ImpLoader`` " "have been removed. (Contributed by Barry Warsaw in :gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1574 ../../whatsnew/3.12.rst:1582 +#: ../../whatsnew/3.12.rst:1588 ../../whatsnew/3.12.rst:1596 msgid "imp" msgstr "imp" -#: ../../whatsnew/3.12.rst:1576 +#: ../../whatsnew/3.12.rst:1590 msgid "" "The :mod:`!imp` module has been removed. (Contributed by Barry Warsaw in :" "gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1579 +#: ../../whatsnew/3.12.rst:1593 msgid "To migrate, consult the following correspondence table:" msgstr "" -#: ../../whatsnew/3.12.rst:1584 +#: ../../whatsnew/3.12.rst:1598 msgid "``imp.NullImporter``" msgstr "``imp.NullImporter``" -#: ../../whatsnew/3.12.rst:1584 +#: ../../whatsnew/3.12.rst:1598 msgid "Insert ``None`` into ``sys.path_importer_cache``" msgstr "將 ``None`` 插入 ``sys.path_importer_cache``" -#: ../../whatsnew/3.12.rst:1585 +#: ../../whatsnew/3.12.rst:1599 msgid "``imp.cache_from_source()``" msgstr "``imp.cache_from_source()``" -#: ../../whatsnew/3.12.rst:1585 +#: ../../whatsnew/3.12.rst:1599 msgid ":func:`importlib.util.cache_from_source`" msgstr ":func:`importlib.util.cache_from_source`" -#: ../../whatsnew/3.12.rst:1586 +#: ../../whatsnew/3.12.rst:1600 msgid "``imp.find_module()``" msgstr "``imp.find_module()``" -#: ../../whatsnew/3.12.rst:1586 +#: ../../whatsnew/3.12.rst:1600 msgid ":func:`importlib.util.find_spec`" msgstr ":func:`importlib.util.find_spec`" -#: ../../whatsnew/3.12.rst:1587 +#: ../../whatsnew/3.12.rst:1601 msgid "``imp.get_magic()``" msgstr "``imp.get_magic()``" -#: ../../whatsnew/3.12.rst:1587 +#: ../../whatsnew/3.12.rst:1601 msgid ":attr:`importlib.util.MAGIC_NUMBER`" msgstr ":attr:`importlib.util.MAGIC_NUMBER`" -#: ../../whatsnew/3.12.rst:1588 +#: ../../whatsnew/3.12.rst:1602 msgid "``imp.get_suffixes()``" msgstr "``imp.get_suffixes()``" -#: ../../whatsnew/3.12.rst:1588 +#: ../../whatsnew/3.12.rst:1602 msgid "" ":attr:`importlib.machinery.SOURCE_SUFFIXES`, :attr:`importlib.machinery." "EXTENSION_SUFFIXES`, and :attr:`importlib.machinery.BYTECODE_SUFFIXES`" msgstr "" -#: ../../whatsnew/3.12.rst:1589 +#: ../../whatsnew/3.12.rst:1603 msgid "``imp.get_tag()``" msgstr "``imp.get_tag()``" -#: ../../whatsnew/3.12.rst:1589 +#: ../../whatsnew/3.12.rst:1603 msgid ":attr:`sys.implementation.cache_tag `" msgstr ":attr:`sys.implementation.cache_tag `" -#: ../../whatsnew/3.12.rst:1590 +#: ../../whatsnew/3.12.rst:1604 msgid "``imp.load_module()``" msgstr "``imp.load_module()``" -#: ../../whatsnew/3.12.rst:1590 +#: ../../whatsnew/3.12.rst:1604 msgid ":func:`importlib.import_module`" msgstr ":func:`importlib.import_module`" -#: ../../whatsnew/3.12.rst:1591 +#: ../../whatsnew/3.12.rst:1605 msgid "``imp.new_module(name)``" msgstr "``imp.new_module(name)``" -#: ../../whatsnew/3.12.rst:1591 +#: ../../whatsnew/3.12.rst:1605 msgid "``types.ModuleType(name)``" msgstr "``types.ModuleType(name)``" -#: ../../whatsnew/3.12.rst:1592 +#: ../../whatsnew/3.12.rst:1606 msgid "``imp.reload()``" msgstr "``imp.reload()``" -#: ../../whatsnew/3.12.rst:1592 +#: ../../whatsnew/3.12.rst:1606 msgid ":func:`importlib.reload`" msgstr ":func:`importlib.reload`" -#: ../../whatsnew/3.12.rst:1593 +#: ../../whatsnew/3.12.rst:1607 msgid "``imp.source_from_cache()``" msgstr "``imp.source_from_cache()``" -#: ../../whatsnew/3.12.rst:1593 +#: ../../whatsnew/3.12.rst:1607 msgid ":func:`importlib.util.source_from_cache`" msgstr ":func:`importlib.util.source_from_cache`" -#: ../../whatsnew/3.12.rst:1594 +#: ../../whatsnew/3.12.rst:1608 msgid "``imp.load_source()``" msgstr "``imp.load_source()``" -#: ../../whatsnew/3.12.rst:1594 +#: ../../whatsnew/3.12.rst:1608 msgid "*See below*" msgstr "" -#: ../../whatsnew/3.12.rst:1597 +#: ../../whatsnew/3.12.rst:1611 msgid "Replace ``imp.load_source()`` with::" msgstr "" -#: ../../whatsnew/3.12.rst:1612 +#: ../../whatsnew/3.12.rst:1626 msgid "Remove :mod:`!imp` functions and attributes with no replacements:" msgstr "" -#: ../../whatsnew/3.12.rst:1614 +#: ../../whatsnew/3.12.rst:1628 msgid "Undocumented functions:" msgstr "未以文件記錄的函式:" -#: ../../whatsnew/3.12.rst:1616 +#: ../../whatsnew/3.12.rst:1630 msgid "``imp.init_builtin()``" msgstr "``imp.init_builtin()``" -#: ../../whatsnew/3.12.rst:1617 +#: ../../whatsnew/3.12.rst:1631 msgid "``imp.load_compiled()``" msgstr "``imp.load_compiled()``" -#: ../../whatsnew/3.12.rst:1618 +#: ../../whatsnew/3.12.rst:1632 msgid "``imp.load_dynamic()``" msgstr "``imp.load_dynamic()``" -#: ../../whatsnew/3.12.rst:1619 +#: ../../whatsnew/3.12.rst:1633 msgid "``imp.load_package()``" msgstr "``imp.load_package()``" -#: ../../whatsnew/3.12.rst:1621 +#: ../../whatsnew/3.12.rst:1635 msgid "" "``imp.lock_held()``, ``imp.acquire_lock()``, ``imp.release_lock()``: the " "locking scheme has changed in Python 3.3 to per-module locks." msgstr "" -#: ../../whatsnew/3.12.rst:1623 +#: ../../whatsnew/3.12.rst:1637 msgid "" "``imp.find_module()`` constants: ``SEARCH_ERROR``, ``PY_SOURCE``, " "``PY_COMPILED``, ``C_EXTENSION``, ``PY_RESOURCE``, ``PKG_DIRECTORY``, " "``C_BUILTIN``, ``PY_FROZEN``, ``PY_CODERESOURCE``, ``IMP_HOOK``." msgstr "" +"``imp.find_module()`` 常數:``SEARCH_ERROR``、``PY_SOURCE``、" +"``PY_COMPILED``、``C_EXTENSION``、``PY_RESOURCE``、``PKG_DIRECTORY``、" +"``C_BUILTIN``、``PY_FROZEN``、``PY_CODERESOURCE``、``IMP_HOOK``。" -#: ../../whatsnew/3.12.rst:1628 +#: ../../whatsnew/3.12.rst:1642 msgid "io" msgstr "io" -#: ../../whatsnew/3.12.rst:1630 +#: ../../whatsnew/3.12.rst:1644 msgid "" "Remove :mod:`io`'s ``io.OpenWrapper`` and ``_pyio.OpenWrapper``, deprecated " "in Python 3.10: just use :func:`open` instead. The :func:`open` (:func:`io." @@ -2458,22 +2504,22 @@ msgid "" "`94169`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1637 +#: ../../whatsnew/3.12.rst:1651 msgid "locale" msgstr "locale" -#: ../../whatsnew/3.12.rst:1639 +#: ../../whatsnew/3.12.rst:1653 msgid "" "Remove :mod:`locale`'s :func:`!locale.format` function, deprecated in Python " "3.7: use :func:`locale.format_string` instead. (Contributed by Victor " "Stinner in :gh:`94226`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1644 +#: ../../whatsnew/3.12.rst:1658 msgid "smtpd" -msgstr "" +msgstr "smtpd" -#: ../../whatsnew/3.12.rst:1646 +#: ../../whatsnew/3.12.rst:1660 msgid "" "The ``smtpd`` module has been removed according to the schedule in :pep:" "`594`, having been deprecated in Python 3.4.7 and 3.5.4. Use aiosmtpd_ PyPI " @@ -2481,27 +2527,27 @@ msgid "" "Oleg Iarygin in :gh:`93243`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1657 +#: ../../whatsnew/3.12.rst:1671 msgid "" "The following undocumented :mod:`sqlite3` features, deprecated in Python " "3.10, are now removed:" msgstr "" -#: ../../whatsnew/3.12.rst:1660 +#: ../../whatsnew/3.12.rst:1674 msgid "``sqlite3.enable_shared_cache()``" msgstr "``sqlite3.enable_shared_cache()``" -#: ../../whatsnew/3.12.rst:1661 +#: ../../whatsnew/3.12.rst:1675 msgid "``sqlite3.OptimizedUnicode``" msgstr "``sqlite3.OptimizedUnicode``" -#: ../../whatsnew/3.12.rst:1663 +#: ../../whatsnew/3.12.rst:1677 msgid "" "If a shared cache must be used, open the database in URI mode using the " "``cache=shared`` query parameter." msgstr "" -#: ../../whatsnew/3.12.rst:1666 +#: ../../whatsnew/3.12.rst:1680 msgid "" "The ``sqlite3.OptimizedUnicode`` text factory has been an alias for :class:" "`str` since Python 3.3. Code that previously set the text factory to " @@ -2509,22 +2555,22 @@ msgid "" "default value which is also ``str``." msgstr "" -#: ../../whatsnew/3.12.rst:1671 +#: ../../whatsnew/3.12.rst:1685 msgid "(Contributed by Erlend E. Aasland in :gh:`92548`.)" msgstr "(由 Erlend E. Aasland 於 :gh:`92548` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1674 +#: ../../whatsnew/3.12.rst:1688 msgid "ssl" msgstr "ssl" -#: ../../whatsnew/3.12.rst:1676 +#: ../../whatsnew/3.12.rst:1690 msgid "" "Remove :mod:`ssl`'s :func:`!ssl.RAND_pseudo_bytes` function, deprecated in " "Python 3.6: use :func:`os.urandom` or :func:`ssl.RAND_bytes` instead. " "(Contributed by Victor Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1680 +#: ../../whatsnew/3.12.rst:1694 msgid "" "Remove the :func:`!ssl.match_hostname` function. It was deprecated in Python " "3.7. OpenSSL performs hostname matching since Python 3.7, Python no longer " @@ -2532,7 +2578,7 @@ msgid "" "Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1686 +#: ../../whatsnew/3.12.rst:1700 msgid "" "Remove the :func:`!ssl.wrap_socket` function, deprecated in Python 3.7: " "instead, create a :class:`ssl.SSLContext` object and call its :class:`ssl." @@ -2543,189 +2589,189 @@ msgid "" "Validation. (Contributed by Victor Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1698 +#: ../../whatsnew/3.12.rst:1712 msgid "Remove many long-deprecated :mod:`unittest` features:" -msgstr "" +msgstr "移除許多 :mod:`unittest` 中被棄用已久的功能:" -#: ../../whatsnew/3.12.rst:1702 +#: ../../whatsnew/3.12.rst:1716 msgid "A number of :class:`~unittest.TestCase` method aliases:" msgstr "" -#: ../../whatsnew/3.12.rst:1705 +#: ../../whatsnew/3.12.rst:1719 msgid "Deprecated alias" msgstr "已棄用的別名" -#: ../../whatsnew/3.12.rst:1705 +#: ../../whatsnew/3.12.rst:1719 msgid "Method Name" msgstr "方法名稱" -#: ../../whatsnew/3.12.rst:1705 +#: ../../whatsnew/3.12.rst:1719 msgid "Deprecated in" msgstr "" -#: ../../whatsnew/3.12.rst:1707 +#: ../../whatsnew/3.12.rst:1721 msgid "``failUnless``" msgstr "``failUnless``" -#: ../../whatsnew/3.12.rst:1707 ../../whatsnew/3.12.rst:1714 +#: ../../whatsnew/3.12.rst:1721 ../../whatsnew/3.12.rst:1728 msgid ":meth:`.assertTrue`" msgstr ":meth:`.assertTrue`" -#: ../../whatsnew/3.12.rst:1707 ../../whatsnew/3.12.rst:1708 -#: ../../whatsnew/3.12.rst:1709 ../../whatsnew/3.12.rst:1710 -#: ../../whatsnew/3.12.rst:1711 ../../whatsnew/3.12.rst:1712 -#: ../../whatsnew/3.12.rst:1713 +#: ../../whatsnew/3.12.rst:1721 ../../whatsnew/3.12.rst:1722 +#: ../../whatsnew/3.12.rst:1723 ../../whatsnew/3.12.rst:1724 +#: ../../whatsnew/3.12.rst:1725 ../../whatsnew/3.12.rst:1726 +#: ../../whatsnew/3.12.rst:1727 msgid "3.1" msgstr "3.1" -#: ../../whatsnew/3.12.rst:1708 +#: ../../whatsnew/3.12.rst:1722 msgid "``failIf``" msgstr "``failIf``" -#: ../../whatsnew/3.12.rst:1708 +#: ../../whatsnew/3.12.rst:1722 msgid ":meth:`.assertFalse`" msgstr ":meth:`.assertFalse`" -#: ../../whatsnew/3.12.rst:1709 +#: ../../whatsnew/3.12.rst:1723 msgid "``failUnlessEqual``" msgstr "``failUnlessEqual``" -#: ../../whatsnew/3.12.rst:1709 ../../whatsnew/3.12.rst:1715 +#: ../../whatsnew/3.12.rst:1723 ../../whatsnew/3.12.rst:1729 msgid ":meth:`.assertEqual`" msgstr ":meth:`.assertEqual`" -#: ../../whatsnew/3.12.rst:1710 +#: ../../whatsnew/3.12.rst:1724 msgid "``failIfEqual``" msgstr "``failIfEqual``" -#: ../../whatsnew/3.12.rst:1710 ../../whatsnew/3.12.rst:1716 +#: ../../whatsnew/3.12.rst:1724 ../../whatsnew/3.12.rst:1730 msgid ":meth:`.assertNotEqual`" msgstr ":meth:`.assertNotEqual`" -#: ../../whatsnew/3.12.rst:1711 +#: ../../whatsnew/3.12.rst:1725 msgid "``failUnlessAlmostEqual``" msgstr "``failUnlessAlmostEqual``" -#: ../../whatsnew/3.12.rst:1711 ../../whatsnew/3.12.rst:1717 +#: ../../whatsnew/3.12.rst:1725 ../../whatsnew/3.12.rst:1731 msgid ":meth:`.assertAlmostEqual`" msgstr ":meth:`.assertAlmostEqual`" -#: ../../whatsnew/3.12.rst:1712 +#: ../../whatsnew/3.12.rst:1726 msgid "``failIfAlmostEqual``" msgstr "``failIfAlmostEqual``" -#: ../../whatsnew/3.12.rst:1712 ../../whatsnew/3.12.rst:1718 +#: ../../whatsnew/3.12.rst:1726 ../../whatsnew/3.12.rst:1732 msgid ":meth:`.assertNotAlmostEqual`" msgstr ":meth:`.assertNotAlmostEqual`" -#: ../../whatsnew/3.12.rst:1713 +#: ../../whatsnew/3.12.rst:1727 msgid "``failUnlessRaises``" msgstr "``failUnlessRaises``" -#: ../../whatsnew/3.12.rst:1713 +#: ../../whatsnew/3.12.rst:1727 msgid ":meth:`.assertRaises`" msgstr ":meth:`.assertRaises`" -#: ../../whatsnew/3.12.rst:1714 +#: ../../whatsnew/3.12.rst:1728 msgid "``assert_``" msgstr "``assert_``" -#: ../../whatsnew/3.12.rst:1714 ../../whatsnew/3.12.rst:1715 -#: ../../whatsnew/3.12.rst:1716 ../../whatsnew/3.12.rst:1717 -#: ../../whatsnew/3.12.rst:1718 ../../whatsnew/3.12.rst:1719 -#: ../../whatsnew/3.12.rst:1720 +#: ../../whatsnew/3.12.rst:1728 ../../whatsnew/3.12.rst:1729 +#: ../../whatsnew/3.12.rst:1730 ../../whatsnew/3.12.rst:1731 +#: ../../whatsnew/3.12.rst:1732 ../../whatsnew/3.12.rst:1733 +#: ../../whatsnew/3.12.rst:1734 msgid "3.2" msgstr "3.2" -#: ../../whatsnew/3.12.rst:1715 +#: ../../whatsnew/3.12.rst:1729 msgid "``assertEquals``" msgstr "``assertEquals``" -#: ../../whatsnew/3.12.rst:1716 +#: ../../whatsnew/3.12.rst:1730 msgid "``assertNotEquals``" msgstr "``assertNotEquals``" -#: ../../whatsnew/3.12.rst:1717 +#: ../../whatsnew/3.12.rst:1731 msgid "``assertAlmostEquals``" msgstr "``assertAlmostEquals``" -#: ../../whatsnew/3.12.rst:1718 +#: ../../whatsnew/3.12.rst:1732 msgid "``assertNotAlmostEquals``" msgstr "``assertNotAlmostEquals``" -#: ../../whatsnew/3.12.rst:1719 +#: ../../whatsnew/3.12.rst:1733 msgid "``assertRegexpMatches``" msgstr "``assertRegexpMatches``" -#: ../../whatsnew/3.12.rst:1719 +#: ../../whatsnew/3.12.rst:1733 msgid ":meth:`.assertRegex`" msgstr ":meth:`.assertRegex`" -#: ../../whatsnew/3.12.rst:1720 +#: ../../whatsnew/3.12.rst:1734 msgid "``assertRaisesRegexp``" msgstr "``assertRaisesRegexp``" -#: ../../whatsnew/3.12.rst:1720 +#: ../../whatsnew/3.12.rst:1734 msgid ":meth:`.assertRaisesRegex`" msgstr ":meth:`.assertRaisesRegex`" -#: ../../whatsnew/3.12.rst:1721 +#: ../../whatsnew/3.12.rst:1735 msgid "``assertNotRegexpMatches``" msgstr "``assertNotRegexpMatches``" -#: ../../whatsnew/3.12.rst:1721 +#: ../../whatsnew/3.12.rst:1735 msgid ":meth:`.assertNotRegex`" msgstr ":meth:`.assertNotRegex`" -#: ../../whatsnew/3.12.rst:1721 +#: ../../whatsnew/3.12.rst:1735 msgid "3.5" msgstr "3.5" -#: ../../whatsnew/3.12.rst:1724 +#: ../../whatsnew/3.12.rst:1738 msgid "" "You can use https://github.com/isidentical/teyit to automatically modernise " "your unit tests." msgstr "" -#: ../../whatsnew/3.12.rst:1727 +#: ../../whatsnew/3.12.rst:1741 msgid "" "Undocumented and broken :class:`~unittest.TestCase` method " "``assertDictContainsSubset`` (deprecated in Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1730 +#: ../../whatsnew/3.12.rst:1744 msgid "" "Undocumented :meth:`TestLoader.loadTestsFromModule ` parameter *use_load_tests* (deprecated and ignored " "since Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1734 +#: ../../whatsnew/3.12.rst:1748 msgid "" "An alias of the :class:`~unittest.TextTestResult` class: ``_TextTestResult`` " "(deprecated in Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1737 +#: ../../whatsnew/3.12.rst:1751 msgid "(Contributed by Serhiy Storchaka in :gh:`89325`.)" msgstr "(由 Serhiy Storchaka 於 :gh:`89325` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1740 +#: ../../whatsnew/3.12.rst:1754 msgid "webbrowser" msgstr "webbrowser" -#: ../../whatsnew/3.12.rst:1742 +#: ../../whatsnew/3.12.rst:1756 msgid "" "Remove support for obsolete browsers from :mod:`webbrowser`. The removed " "browsers include: Grail, Mosaic, Netscape, Galeon, Skipstone, Iceape, " "Firebird, and Firefox versions 35 and below (:gh:`102871`)." msgstr "" -#: ../../whatsnew/3.12.rst:1747 +#: ../../whatsnew/3.12.rst:1761 msgid "xml.etree.ElementTree" msgstr "xml.etree.ElementTree" -#: ../../whatsnew/3.12.rst:1749 +#: ../../whatsnew/3.12.rst:1763 msgid "" "Remove the ``ElementTree.Element.copy()`` method of the pure Python " "implementation, deprecated in Python 3.10, use the :func:`copy.copy` " @@ -2734,22 +2780,22 @@ msgid "" "Stinner in :gh:`94383`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1756 +#: ../../whatsnew/3.12.rst:1770 msgid "zipimport" msgstr "zipimport" -#: ../../whatsnew/3.12.rst:1758 +#: ../../whatsnew/3.12.rst:1772 msgid "" "Remove :mod:`zipimport`'s ``find_loader()`` and ``find_module()`` methods, " "deprecated in Python 3.10: use the ``find_spec()`` method instead. See :pep:" "`451` for the rationale. (Contributed by Victor Stinner in :gh:`94379`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1764 +#: ../../whatsnew/3.12.rst:1778 msgid "Others" msgstr "其他" -#: ../../whatsnew/3.12.rst:1766 +#: ../../whatsnew/3.12.rst:1780 msgid "" "Remove the ``suspicious`` rule from the documentation :file:`Makefile` and :" "file:`Doc/tools/rstlint.py`, both in favor of `sphinx-lint `, " "intended for low-level tools like debuggers and JIT compilers. This API may " @@ -3023,84 +3069,84 @@ msgid "" "contents are marked by the ``PyUnstable_`` prefix in names." msgstr "" -#: ../../whatsnew/3.12.rst:1962 +#: ../../whatsnew/3.12.rst:1976 msgid "Code object constructors:" msgstr "" -#: ../../whatsnew/3.12.rst:1964 +#: ../../whatsnew/3.12.rst:1978 msgid "``PyUnstable_Code_New()`` (renamed from ``PyCode_New``)" msgstr "" -#: ../../whatsnew/3.12.rst:1965 +#: ../../whatsnew/3.12.rst:1979 msgid "" "``PyUnstable_Code_NewWithPosOnlyArgs()`` (renamed from " "``PyCode_NewWithPosOnlyArgs``)" msgstr "" -#: ../../whatsnew/3.12.rst:1967 +#: ../../whatsnew/3.12.rst:1981 msgid "Extra storage for code objects (:pep:`523`):" msgstr "" -#: ../../whatsnew/3.12.rst:1969 +#: ../../whatsnew/3.12.rst:1983 msgid "" "``PyUnstable_Eval_RequestCodeExtraIndex()`` (renamed from " "``_PyEval_RequestCodeExtraIndex``)" msgstr "" -#: ../../whatsnew/3.12.rst:1970 +#: ../../whatsnew/3.12.rst:1984 msgid "``PyUnstable_Code_GetExtra()`` (renamed from ``_PyCode_GetExtra``)" msgstr "" -#: ../../whatsnew/3.12.rst:1971 +#: ../../whatsnew/3.12.rst:1985 msgid "``PyUnstable_Code_SetExtra()`` (renamed from ``_PyCode_SetExtra``)" msgstr "" -#: ../../whatsnew/3.12.rst:1973 +#: ../../whatsnew/3.12.rst:1987 msgid "" "The original names will continue to be available until the respective API " "changes." msgstr "" -#: ../../whatsnew/3.12.rst:1976 +#: ../../whatsnew/3.12.rst:1990 msgid "(Contributed by Petr Viktorin in :gh:`101101`.)" msgstr "(由 Petr Viktorin 於 :gh:`101101` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1978 +#: ../../whatsnew/3.12.rst:1992 msgid "" ":pep:`697`: Add an API for extending types whose instance memory layout is " "opaque:" msgstr "" -#: ../../whatsnew/3.12.rst:1981 +#: ../../whatsnew/3.12.rst:1995 msgid "" ":c:member:`PyType_Spec.basicsize` can be zero or negative to specify " "inheriting or extending the base class size." msgstr "" -#: ../../whatsnew/3.12.rst:1983 +#: ../../whatsnew/3.12.rst:1997 msgid "" ":c:func:`PyObject_GetTypeData` and :c:func:`PyType_GetTypeDataSize` added to " "allow access to subclass-specific instance data." msgstr "" -#: ../../whatsnew/3.12.rst:1985 +#: ../../whatsnew/3.12.rst:1999 msgid "" ":c:macro:`Py_TPFLAGS_ITEMS_AT_END` and :c:func:`PyObject_GetItemData` added " "to allow safely extending certain variable-sized types, including :c:var:" "`PyType_Type`." msgstr "" -#: ../../whatsnew/3.12.rst:1988 +#: ../../whatsnew/3.12.rst:2002 msgid "" ":c:macro:`Py_RELATIVE_OFFSET` added to allow defining :c:type:`members " "` in terms of a subclass-specific struct." msgstr "" -#: ../../whatsnew/3.12.rst:1991 +#: ../../whatsnew/3.12.rst:2005 msgid "(Contributed by Petr Viktorin in :gh:`103509`.)" msgstr "(由 Petr Viktorin 於 :gh:`103509` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1993 +#: ../../whatsnew/3.12.rst:2007 msgid "" "Add the new :ref:`limited C API ` function :c:func:" "`PyType_FromMetaclass`, which generalizes the existing :c:func:" @@ -3108,29 +3154,29 @@ msgid "" "(Contributed by Wenzel Jakob in :gh:`93012`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1998 +#: ../../whatsnew/3.12.rst:2012 msgid "" "API for creating objects that can be called using :ref:`the vectorcall " "protocol ` was added to the :ref:`Limited API `:" msgstr "" -#: ../../whatsnew/3.12.rst:2002 +#: ../../whatsnew/3.12.rst:2016 msgid ":c:macro:`Py_TPFLAGS_HAVE_VECTORCALL`" msgstr ":c:macro:`Py_TPFLAGS_HAVE_VECTORCALL`" -#: ../../whatsnew/3.12.rst:2003 +#: ../../whatsnew/3.12.rst:2017 msgid ":c:func:`PyVectorcall_NARGS`" msgstr ":c:func:`PyVectorcall_NARGS`" -#: ../../whatsnew/3.12.rst:2004 +#: ../../whatsnew/3.12.rst:2018 msgid ":c:func:`PyVectorcall_Call`" msgstr ":c:func:`PyVectorcall_Call`" -#: ../../whatsnew/3.12.rst:2005 +#: ../../whatsnew/3.12.rst:2019 msgid ":c:type:`vectorcallfunc`" msgstr ":c:type:`vectorcallfunc`" -#: ../../whatsnew/3.12.rst:2007 +#: ../../whatsnew/3.12.rst:2021 msgid "" "The :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` flag is now removed from a class " "when the class's :py:meth:`~object.__call__` method is reassigned. This " @@ -3141,7 +3187,7 @@ msgid "" "`93274`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2015 +#: ../../whatsnew/3.12.rst:2029 msgid "" "The :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" "`Py_TPFLAGS_MANAGED_WEAKREF` flags have been added. This allows extensions " @@ -3149,32 +3195,32 @@ msgid "" "using less memory and with faster access." msgstr "" -#: ../../whatsnew/3.12.rst:2020 +#: ../../whatsnew/3.12.rst:2034 msgid "" "API for performing calls using :ref:`the vectorcall protocol ` " "was added to the :ref:`Limited API `:" msgstr "" -#: ../../whatsnew/3.12.rst:2024 +#: ../../whatsnew/3.12.rst:2038 msgid ":c:func:`PyObject_Vectorcall`" msgstr ":c:func:`PyObject_Vectorcall`" -#: ../../whatsnew/3.12.rst:2025 +#: ../../whatsnew/3.12.rst:2039 msgid ":c:func:`PyObject_VectorcallMethod`" msgstr ":c:func:`PyObject_VectorcallMethod`" -#: ../../whatsnew/3.12.rst:2026 +#: ../../whatsnew/3.12.rst:2040 msgid ":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`" msgstr ":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`" -#: ../../whatsnew/3.12.rst:2028 +#: ../../whatsnew/3.12.rst:2042 msgid "" "This means that both the incoming and outgoing ends of the vector call " "protocol are now available in the :ref:`Limited API `. (Contributed " "by Wenzel Jakob in :gh:`98586`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2032 +#: ../../whatsnew/3.12.rst:2046 msgid "" "Add two new public functions, :c:func:`PyEval_SetProfileAllThreads` and :c:" "func:`PyEval_SetTraceAllThreads`, that allow to set tracing and profiling " @@ -3182,14 +3228,14 @@ msgid "" "(Contributed by Pablo Galindo in :gh:`93503`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2038 +#: ../../whatsnew/3.12.rst:2052 msgid "" "Add new function :c:func:`PyFunction_SetVectorcall` to the C API which sets " "the vectorcall field of a given :c:type:`PyFunctionObject`. (Contributed by " "Andrew Frost in :gh:`92257`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2042 +#: ../../whatsnew/3.12.rst:2056 msgid "" "The C API now permits registering callbacks via :c:func:" "`PyDict_AddWatcher`, :c:func:`PyDict_Watch` and related APIs to be called " @@ -3198,28 +3244,28 @@ msgid "" "`91052`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2048 +#: ../../whatsnew/3.12.rst:2062 msgid "" "Add :c:func:`PyType_AddWatcher` and :c:func:`PyType_Watch` API to register " "callbacks to receive notification on changes to a type. (Contributed by Carl " "Meyer in :gh:`91051`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2052 +#: ../../whatsnew/3.12.rst:2066 msgid "" "Add :c:func:`PyCode_AddWatcher` and :c:func:`PyCode_ClearWatcher` APIs to " "register callbacks to receive notification on creation and destruction of " "code objects. (Contributed by Itamar Oren in :gh:`91054`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2057 +#: ../../whatsnew/3.12.rst:2071 msgid "" "Add :c:func:`PyFrame_GetVar` and :c:func:`PyFrame_GetVarString` functions to " "get a frame variable by its name. (Contributed by Victor Stinner in :gh:" "`91248`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2061 +#: ../../whatsnew/3.12.rst:2075 msgid "" "Add :c:func:`PyErr_GetRaisedException` and :c:func:" "`PyErr_SetRaisedException` for saving and restoring the current exception. " @@ -3229,14 +3275,14 @@ msgid "" "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2069 +#: ../../whatsnew/3.12.rst:2083 msgid "" "Add ``_PyErr_ChainExceptions1``, which takes an exception instance, to " "replace the legacy-API ``_PyErr_ChainExceptions``, which is now deprecated. " "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2073 +#: ../../whatsnew/3.12.rst:2087 msgid "" "Add :c:func:`PyException_GetArgs` and :c:func:`PyException_SetArgs` as " "convenience functions for retrieving and modifying the :attr:`~BaseException." @@ -3244,71 +3290,71 @@ msgid "" "in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2078 +#: ../../whatsnew/3.12.rst:2092 msgid "" "Add :c:func:`PyErr_DisplayException`, which takes an exception instance, to " "replace the legacy-api :c:func:`!PyErr_Display`. (Contributed by Irit " "Katriel in :gh:`102755`)." msgstr "" -#: ../../whatsnew/3.12.rst:2084 +#: ../../whatsnew/3.12.rst:2098 msgid "" ":pep:`683`: Introduce *Immortal Objects*, which allows objects to bypass " "reference counts, and related changes to the C-API:" msgstr "" -#: ../../whatsnew/3.12.rst:2087 +#: ../../whatsnew/3.12.rst:2101 msgid "``_Py_IMMORTAL_REFCNT``: The reference count that defines an object" msgstr "" -#: ../../whatsnew/3.12.rst:2088 +#: ../../whatsnew/3.12.rst:2102 msgid "as immortal." msgstr "" -#: ../../whatsnew/3.12.rst:2089 +#: ../../whatsnew/3.12.rst:2103 msgid "" "``_Py_IsImmortal`` Checks if an object has the immortal reference count." msgstr "" -#: ../../whatsnew/3.12.rst:2090 +#: ../../whatsnew/3.12.rst:2104 msgid "``PyObject_HEAD_INIT`` This will now initialize reference count to" msgstr "" -#: ../../whatsnew/3.12.rst:2091 +#: ../../whatsnew/3.12.rst:2105 msgid "``_Py_IMMORTAL_REFCNT`` when used with ``Py_BUILD_CORE``." msgstr "" -#: ../../whatsnew/3.12.rst:2092 +#: ../../whatsnew/3.12.rst:2106 msgid "``SSTATE_INTERNED_IMMORTAL`` An identifier for interned unicode objects" msgstr "" -#: ../../whatsnew/3.12.rst:2093 +#: ../../whatsnew/3.12.rst:2107 msgid "that are immortal." msgstr "" -#: ../../whatsnew/3.12.rst:2094 +#: ../../whatsnew/3.12.rst:2108 msgid "``SSTATE_INTERNED_IMMORTAL_STATIC`` An identifier for interned unicode" msgstr "" -#: ../../whatsnew/3.12.rst:2095 +#: ../../whatsnew/3.12.rst:2109 msgid "objects that are immortal and static" msgstr "" -#: ../../whatsnew/3.12.rst:2098 +#: ../../whatsnew/3.12.rst:2112 msgid "``sys.getunicodeinternedsize`` This returns the total number of unicode" msgstr "" -#: ../../whatsnew/3.12.rst:2097 +#: ../../whatsnew/3.12.rst:2111 msgid "" "objects that have been interned. This is now needed for :file:`refleak.py` " "to correctly track reference counts and allocated blocks" msgstr "" -#: ../../whatsnew/3.12.rst:2100 +#: ../../whatsnew/3.12.rst:2114 msgid "(Contributed by Eddie Elizondo in :gh:`84436`.)" msgstr "(由 Eddie Elizondo 於 :gh:`84436` 中貢獻。)" -#: ../../whatsnew/3.12.rst:2102 +#: ../../whatsnew/3.12.rst:2116 msgid "" ":pep:`684`: Add the new :c:func:`Py_NewInterpreterFromConfig` function and :" "c:type:`PyInterpreterConfig`, which may be used to create sub-interpreters " @@ -3316,27 +3362,27 @@ msgid "" "(Contributed by Eric Snow in :gh:`104110`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2108 +#: ../../whatsnew/3.12.rst:2122 msgid "" "In the limited C API version 3.12, :c:func:`Py_INCREF` and :c:func:" "`Py_DECREF` functions are now implemented as opaque function calls to hide " "implementation details. (Contributed by Victor Stinner in :gh:`105387`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2116 +#: ../../whatsnew/3.12.rst:2130 msgid "" "Legacy Unicode APIs based on ``Py_UNICODE*`` representation has been " "removed. Please migrate to APIs based on UTF-8 or ``wchar_t*``." msgstr "" -#: ../../whatsnew/3.12.rst:2119 +#: ../../whatsnew/3.12.rst:2133 msgid "" "Argument parsing functions like :c:func:`PyArg_ParseTuple` doesn't support " "``Py_UNICODE*`` based format (e.g. ``u``, ``Z``) anymore. Please migrate to " "other formats for Unicode like ``s``, ``z``, ``es``, and ``U``." msgstr "" -#: ../../whatsnew/3.12.rst:2123 +#: ../../whatsnew/3.12.rst:2137 msgid "" "``tp_weaklist`` for all static builtin types is always ``NULL``. This is an " "internal-only field on ``PyTypeObject`` but we're pointing out the change in " @@ -3345,7 +3391,7 @@ msgid "" "necessary, the (internal-only) ``_PyObject_GET_WEAKREFS_LISTPTR()`` macro." msgstr "" -#: ../../whatsnew/3.12.rst:2130 +#: ../../whatsnew/3.12.rst:2144 msgid "" "This internal-only :c:member:`PyTypeObject.tp_subclasses` may now not be a " "valid object pointer. Its type was changed to :c:expr:`void *` to reflect " @@ -3353,13 +3399,13 @@ msgid "" "only field directly." msgstr "" -#: ../../whatsnew/3.12.rst:2135 +#: ../../whatsnew/3.12.rst:2149 msgid "" "To get a list of subclasses, call the Python method :py:meth:`~class." "__subclasses__` (using :c:func:`PyObject_CallMethod`, for example)." msgstr "" -#: ../../whatsnew/3.12.rst:2139 +#: ../../whatsnew/3.12.rst:2153 msgid "" "Add support of more formatting options (left aligning, octals, uppercase " "hexadecimals, :c:type:`intmax_t`, :c:type:`ptrdiff_t`, :c:type:`wchar_t` C " @@ -3368,7 +3414,7 @@ msgid "" "`98836`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2145 +#: ../../whatsnew/3.12.rst:2159 msgid "" "An unrecognized format character in :c:func:`PyUnicode_FromFormat` and :c:" "func:`PyUnicode_FromFormatV` now sets a :exc:`SystemError`. In previous " @@ -3377,13 +3423,13 @@ msgid "" "Storchaka in :gh:`95781`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2151 +#: ../../whatsnew/3.12.rst:2165 msgid "" "Fix wrong sign placement in :c:func:`PyUnicode_FromFormat` and :c:func:" "`PyUnicode_FromFormatV`. (Contributed by Philip Georgi in :gh:`95504`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2155 +#: ../../whatsnew/3.12.rst:2169 msgid "" "Extension classes wanting to add a ``__dict__`` or weak reference slot " "should use :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" @@ -3397,7 +3443,7 @@ msgid "" "func:`PyObject_ClearWeakRefs`, as before." msgstr "" -#: ../../whatsnew/3.12.rst:2167 +#: ../../whatsnew/3.12.rst:2181 msgid "" "The :c:func:`PyUnicode_FSDecoder` function no longer accepts bytes-like " "paths, like :class:`bytearray` and :class:`memoryview` types: only the " @@ -3405,7 +3451,7 @@ msgid "" "Victor Stinner in :gh:`98393`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2172 +#: ../../whatsnew/3.12.rst:2186 msgid "" "The :c:macro:`Py_CLEAR`, :c:macro:`Py_SETREF` and :c:macro:`Py_XSETREF` " "macros now only evaluate their arguments once. If an argument has side " @@ -3413,7 +3459,7 @@ msgid "" "Stinner in :gh:`98724`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2177 +#: ../../whatsnew/3.12.rst:2191 msgid "" "The interpreter's error indicator is now always normalized. This means that :" "c:func:`PyErr_SetObject`, :c:func:`PyErr_SetString` and the other functions " @@ -3421,7 +3467,7 @@ msgid "" "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2182 +#: ../../whatsnew/3.12.rst:2196 msgid "" "``_Py_RefTotal`` is no longer authoritative and only kept around for ABI " "compatibility. Note that it is an internal global and only available on " @@ -3429,25 +3475,25 @@ msgid "" "``_Py_GetGlobalRefTotal()``." msgstr "" -#: ../../whatsnew/3.12.rst:2187 +#: ../../whatsnew/3.12.rst:2201 msgid "" "The following functions now select an appropriate metaclass for the newly " "created type:" msgstr "" -#: ../../whatsnew/3.12.rst:2190 +#: ../../whatsnew/3.12.rst:2204 msgid ":c:func:`PyType_FromSpec`" msgstr ":c:func:`PyType_FromSpec`" -#: ../../whatsnew/3.12.rst:2191 +#: ../../whatsnew/3.12.rst:2205 msgid ":c:func:`PyType_FromSpecWithBases`" msgstr ":c:func:`PyType_FromSpecWithBases`" -#: ../../whatsnew/3.12.rst:2192 +#: ../../whatsnew/3.12.rst:2206 msgid ":c:func:`PyType_FromModuleAndSpec`" msgstr ":c:func:`PyType_FromModuleAndSpec`" -#: ../../whatsnew/3.12.rst:2194 +#: ../../whatsnew/3.12.rst:2208 msgid "" "Creating classes whose metaclass overrides :c:member:`~PyTypeObject.tp_new` " "is deprecated, and in Python 3.14+ it will be disallowed. Note that these " @@ -3455,14 +3501,14 @@ msgid "" "initialization." msgstr "" -#: ../../whatsnew/3.12.rst:2199 +#: ../../whatsnew/3.12.rst:2213 msgid "" "Note that :c:func:`PyType_FromMetaclass` (added in Python 3.12) already " "disallows creating classes whose metaclass overrides ``tp_new`` (:meth:" "`~object.__new__` in Python)." msgstr "" -#: ../../whatsnew/3.12.rst:2203 +#: ../../whatsnew/3.12.rst:2217 msgid "" "Since ``tp_new`` overrides almost everything ``PyType_From*`` functions do, " "the two are incompatible with each other. The existing behavior -- ignoring " @@ -3471,17 +3517,17 @@ msgid "" "general workaround. One of the following may work for you:" msgstr "" -#: ../../whatsnew/3.12.rst:2210 +#: ../../whatsnew/3.12.rst:2224 msgid "If you control the metaclass, avoid using ``tp_new`` in it:" msgstr "" -#: ../../whatsnew/3.12.rst:2212 +#: ../../whatsnew/3.12.rst:2226 msgid "" "If initialization can be skipped, it can be done in :c:member:`~PyTypeObject." "tp_init` instead." msgstr "" -#: ../../whatsnew/3.12.rst:2214 +#: ../../whatsnew/3.12.rst:2228 msgid "" "If the metaclass doesn't need to be instantiated from Python, set its " "``tp_new`` to ``NULL`` using the :c:macro:" @@ -3489,20 +3535,20 @@ msgid "" "``PyType_From*`` functions." msgstr "" -#: ../../whatsnew/3.12.rst:2219 +#: ../../whatsnew/3.12.rst:2233 msgid "" "Avoid ``PyType_From*`` functions: if you don't need C-specific features " "(slots or setting the instance size), create types by :ref:`calling ` " "the metaclass." msgstr "" -#: ../../whatsnew/3.12.rst:2223 +#: ../../whatsnew/3.12.rst:2237 msgid "" "If you *know* the ``tp_new`` can be skipped safely, filter the deprecation " "warning out using :func:`warnings.catch_warnings` from Python." msgstr "" -#: ../../whatsnew/3.12.rst:2226 +#: ../../whatsnew/3.12.rst:2240 msgid "" ":c:var:`PyOS_InputHook` and :c:var:`PyOS_ReadlineFunctionPointer` are no " "longer called in :ref:`subinterpreters `. This is " @@ -3510,14 +3556,14 @@ msgid "" "callbacks have no way of recovering extension module state)." msgstr "" -#: ../../whatsnew/3.12.rst:2231 +#: ../../whatsnew/3.12.rst:2245 msgid "" "This also avoids situations where extensions may find themselves running in " "a subinterpreter that they don't support (or haven't yet been loaded in). " "See :gh:`104668` for more info." msgstr "" -#: ../../whatsnew/3.12.rst:2235 +#: ../../whatsnew/3.12.rst:2249 msgid "" ":c:struct:`PyLongObject` has had its internals changed for better " "performance. Although the internals of :c:struct:`PyLongObject` are private, " @@ -3528,15 +3574,15 @@ msgid "" "a single machine word:" msgstr "" -#: ../../whatsnew/3.12.rst:2243 +#: ../../whatsnew/3.12.rst:2257 msgid ":c:func:`PyUnstable_Long_IsCompact`" msgstr ":c:func:`PyUnstable_Long_IsCompact`" -#: ../../whatsnew/3.12.rst:2244 +#: ../../whatsnew/3.12.rst:2258 msgid ":c:func:`PyUnstable_Long_CompactValue`" msgstr ":c:func:`PyUnstable_Long_CompactValue`" -#: ../../whatsnew/3.12.rst:2246 +#: ../../whatsnew/3.12.rst:2260 msgid "" "Custom allocators, set via :c:func:`PyMem_SetAllocator`, are now required to " "be thread-safe, regardless of memory domain. Allocators that don't have " @@ -3545,7 +3591,7 @@ msgid "" "create a new GitHub issue and CC ``@ericsnowcurrently``." msgstr "" -#: ../../whatsnew/3.12.rst:2256 +#: ../../whatsnew/3.12.rst:2270 msgid "" "In accordance with :pep:`699`, the ``ma_version_tag`` field in :c:type:" "`PyDictObject` is deprecated for extension modules. Accessing this field " @@ -3554,76 +3600,76 @@ msgid "" "PEP by Ken Jin.)" msgstr "" -#: ../../whatsnew/3.12.rst:2261 +#: ../../whatsnew/3.12.rst:2275 msgid "Deprecate global configuration variable:" msgstr "" -#: ../../whatsnew/3.12.rst:2263 ../../whatsnew/3.12.rst:2348 +#: ../../whatsnew/3.12.rst:2277 ../../whatsnew/3.12.rst:2362 msgid ":c:var:`Py_DebugFlag`: use :c:member:`PyConfig.parser_debug`" msgstr ":c:var:`Py_DebugFlag`: 請改用 :c:member:`PyConfig.parser_debug`" -#: ../../whatsnew/3.12.rst:2264 ../../whatsnew/3.12.rst:2349 +#: ../../whatsnew/3.12.rst:2278 ../../whatsnew/3.12.rst:2363 msgid ":c:var:`Py_VerboseFlag`: use :c:member:`PyConfig.verbose`" msgstr ":c:var:`Py_VerboseFlag`: 請改用 :c:member:`PyConfig.verbose`" -#: ../../whatsnew/3.12.rst:2265 ../../whatsnew/3.12.rst:2350 +#: ../../whatsnew/3.12.rst:2279 ../../whatsnew/3.12.rst:2364 msgid ":c:var:`Py_QuietFlag`: use :c:member:`PyConfig.quiet`" msgstr ":c:var:`Py_QuietFlag`: 請改用 :c:member:`PyConfig.quiet`" -#: ../../whatsnew/3.12.rst:2266 ../../whatsnew/3.12.rst:2351 +#: ../../whatsnew/3.12.rst:2280 ../../whatsnew/3.12.rst:2365 msgid ":c:var:`Py_InteractiveFlag`: use :c:member:`PyConfig.interactive`" msgstr ":c:var:`Py_InteractiveFlag`: 請改用 :c:member:`PyConfig.interactive`" -#: ../../whatsnew/3.12.rst:2267 ../../whatsnew/3.12.rst:2352 +#: ../../whatsnew/3.12.rst:2281 ../../whatsnew/3.12.rst:2366 msgid ":c:var:`Py_InspectFlag`: use :c:member:`PyConfig.inspect`" msgstr ":c:var:`Py_InspectFlag`: 請改用 :c:member:`PyConfig.inspect`" -#: ../../whatsnew/3.12.rst:2268 ../../whatsnew/3.12.rst:2353 +#: ../../whatsnew/3.12.rst:2282 ../../whatsnew/3.12.rst:2367 msgid ":c:var:`Py_OptimizeFlag`: use :c:member:`PyConfig.optimization_level`" msgstr "" ":c:var:`Py_OptimizeFlag`: 請改用 :c:member:`PyConfig.optimization_level`" -#: ../../whatsnew/3.12.rst:2269 ../../whatsnew/3.12.rst:2354 +#: ../../whatsnew/3.12.rst:2283 ../../whatsnew/3.12.rst:2368 msgid ":c:var:`Py_NoSiteFlag`: use :c:member:`PyConfig.site_import`" msgstr ":c:var:`Py_NoSiteFlag`: 請改用 :c:member:`PyConfig.site_import`" -#: ../../whatsnew/3.12.rst:2270 ../../whatsnew/3.12.rst:2355 +#: ../../whatsnew/3.12.rst:2284 ../../whatsnew/3.12.rst:2369 msgid ":c:var:`Py_BytesWarningFlag`: use :c:member:`PyConfig.bytes_warning`" msgstr "" ":c:var:`Py_BytesWarningFlag`: 請改用 :c:member:`PyConfig.bytes_warning`" -#: ../../whatsnew/3.12.rst:2271 ../../whatsnew/3.12.rst:2356 +#: ../../whatsnew/3.12.rst:2285 ../../whatsnew/3.12.rst:2370 msgid ":c:var:`Py_FrozenFlag`: use :c:member:`PyConfig.pathconfig_warnings`" msgstr "" ":c:var:`Py_FrozenFlag`: 請改用 :c:member:`PyConfig.pathconfig_warnings`" -#: ../../whatsnew/3.12.rst:2272 ../../whatsnew/3.12.rst:2357 +#: ../../whatsnew/3.12.rst:2286 ../../whatsnew/3.12.rst:2371 msgid "" ":c:var:`Py_IgnoreEnvironmentFlag`: use :c:member:`PyConfig.use_environment`" msgstr "" ":c:var:`Py_IgnoreEnvironmentFlag`: 請改用 :c:member:`PyConfig." "use_environment`" -#: ../../whatsnew/3.12.rst:2273 ../../whatsnew/3.12.rst:2358 +#: ../../whatsnew/3.12.rst:2287 ../../whatsnew/3.12.rst:2372 msgid "" ":c:var:`Py_DontWriteBytecodeFlag`: use :c:member:`PyConfig.write_bytecode`" msgstr "" ":c:var:`Py_DontWriteBytecodeFlag`: 請改用 :c:member:`PyConfig.write_bytecode`" -#: ../../whatsnew/3.12.rst:2274 ../../whatsnew/3.12.rst:2359 +#: ../../whatsnew/3.12.rst:2288 ../../whatsnew/3.12.rst:2373 msgid "" ":c:var:`Py_NoUserSiteDirectory`: use :c:member:`PyConfig.user_site_directory`" msgstr "" ":c:var:`Py_NoUserSiteDirectory`: 請改用 :c:member:`PyConfig." "user_site_directory`" -#: ../../whatsnew/3.12.rst:2275 ../../whatsnew/3.12.rst:2360 +#: ../../whatsnew/3.12.rst:2289 ../../whatsnew/3.12.rst:2374 msgid "" ":c:var:`Py_UnbufferedStdioFlag`: use :c:member:`PyConfig.buffered_stdio`" msgstr "" ":c:var:`Py_UnbufferedStdioFlag`: 請改用 :c:member:`PyConfig.buffered_stdio`" -#: ../../whatsnew/3.12.rst:2276 ../../whatsnew/3.12.rst:2361 +#: ../../whatsnew/3.12.rst:2290 ../../whatsnew/3.12.rst:2375 msgid "" ":c:var:`Py_HashRandomizationFlag`: use :c:member:`PyConfig.use_hash_seed` " "and :c:member:`PyConfig.hash_seed`" @@ -3631,11 +3677,11 @@ msgstr "" ":c:var:`Py_HashRandomizationFlag`: 請改用 :c:member:`PyConfig.use_hash_seed` " "和 :c:member:`PyConfig.hash_seed`" -#: ../../whatsnew/3.12.rst:2278 ../../whatsnew/3.12.rst:2363 +#: ../../whatsnew/3.12.rst:2292 ../../whatsnew/3.12.rst:2377 msgid ":c:var:`Py_IsolatedFlag`: use :c:member:`PyConfig.isolated`" msgstr ":c:var:`Py_IsolatedFlag`: 請改用 :c:member:`PyConfig.isolated`" -#: ../../whatsnew/3.12.rst:2279 ../../whatsnew/3.12.rst:2364 +#: ../../whatsnew/3.12.rst:2293 ../../whatsnew/3.12.rst:2378 msgid "" ":c:var:`Py_LegacyWindowsFSEncodingFlag`: use :c:member:`PyPreConfig." "legacy_windows_fs_encoding`" @@ -3643,7 +3689,7 @@ msgstr "" ":c:var:`Py_LegacyWindowsFSEncodingFlag`: 請改用 :c:member:`PyPreConfig." "legacy_windows_fs_encoding`" -#: ../../whatsnew/3.12.rst:2280 ../../whatsnew/3.12.rst:2365 +#: ../../whatsnew/3.12.rst:2294 ../../whatsnew/3.12.rst:2379 msgid "" ":c:var:`Py_LegacyWindowsStdioFlag`: use :c:member:`PyConfig." "legacy_windows_stdio`" @@ -3651,7 +3697,7 @@ msgstr "" ":c:var:`Py_LegacyWindowsStdioFlag`: 請改用 :c:member:`PyConfig." "legacy_windows_stdio`" -#: ../../whatsnew/3.12.rst:2281 ../../whatsnew/3.12.rst:2366 +#: ../../whatsnew/3.12.rst:2295 ../../whatsnew/3.12.rst:2380 msgid "" ":c:var:`!Py_FileSystemDefaultEncoding`: use :c:member:`PyConfig." "filesystem_encoding`" @@ -3659,7 +3705,7 @@ msgstr "" ":c:var:`!Py_FileSystemDefaultEncoding`: 請改用 :c:member:`PyConfig." "filesystem_encoding`" -#: ../../whatsnew/3.12.rst:2282 ../../whatsnew/3.12.rst:2367 +#: ../../whatsnew/3.12.rst:2296 ../../whatsnew/3.12.rst:2381 msgid "" ":c:var:`!Py_HasFileSystemDefaultEncoding`: use :c:member:`PyConfig." "filesystem_encoding`" @@ -3667,7 +3713,7 @@ msgstr "" ":c:var:`!Py_HasFileSystemDefaultEncoding`: 請改用 :c:member:`PyConfig." "filesystem_encoding`" -#: ../../whatsnew/3.12.rst:2283 ../../whatsnew/3.12.rst:2368 +#: ../../whatsnew/3.12.rst:2297 ../../whatsnew/3.12.rst:2382 msgid "" ":c:var:`!Py_FileSystemDefaultEncodeErrors`: use :c:member:`PyConfig." "filesystem_errors`" @@ -3675,7 +3721,7 @@ msgstr "" ":c:var:`!Py_FileSystemDefaultEncodeErrors`: 請改用 :c:member:`PyConfig." "filesystem_errors`" -#: ../../whatsnew/3.12.rst:2284 ../../whatsnew/3.12.rst:2369 +#: ../../whatsnew/3.12.rst:2298 ../../whatsnew/3.12.rst:2383 msgid "" ":c:var:`!Py_UTF8Mode`: use :c:member:`PyPreConfig.utf8_mode` (see :c:func:" "`Py_PreInitialize`)" @@ -3683,7 +3729,7 @@ msgstr "" ":c:var:`!Py_UTF8Mode`: 請改用 :c:member:`PyPreConfig.utf8_mode`\\ (參見 :c:" "func:`Py_PreInitialize`)" -#: ../../whatsnew/3.12.rst:2286 +#: ../../whatsnew/3.12.rst:2300 msgid "" "The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" "`PyConfig` instead. (Contributed by Victor Stinner in :gh:`77782`.)" @@ -3691,25 +3737,25 @@ msgstr "" ":c:func:`Py_InitializeFromConfig` API 應改為與 :c:type:`PyConfig` 一起使用。" "(由 Victor Stinner 於 :gh:`77782` 中貢獻。)" -#: ../../whatsnew/3.12.rst:2290 +#: ../../whatsnew/3.12.rst:2304 msgid "" "Creating :c:data:`immutable types ` with mutable " "bases is deprecated and will be disabled in Python 3.14. (:gh:`95388`)" msgstr "" -#: ../../whatsnew/3.12.rst:2293 +#: ../../whatsnew/3.12.rst:2307 msgid "" "The :file:`structmember.h` header is deprecated, though it continues to be " "available and there are no plans to remove it." msgstr ":file:`structmember.h` 標頭已棄用,但仍可使用,且還沒有移除它的計畫。" -#: ../../whatsnew/3.12.rst:2296 +#: ../../whatsnew/3.12.rst:2310 msgid "" "Its contents are now available just by including :file:`Python.h`, with a " "``Py`` prefix added if it was missing:" msgstr "" -#: ../../whatsnew/3.12.rst:2299 +#: ../../whatsnew/3.12.rst:2313 msgid "" ":c:struct:`PyMemberDef`, :c:func:`PyMember_GetOne` and :c:func:" "`PyMember_SetOne`" @@ -3717,13 +3763,13 @@ msgstr "" ":c:struct:`PyMemberDef`、:c:func:`PyMember_GetOne` 和 :c:func:" "`PyMember_SetOne`" -#: ../../whatsnew/3.12.rst:2301 +#: ../../whatsnew/3.12.rst:2315 msgid "" "Type macros like :c:macro:`Py_T_INT`, :c:macro:`Py_T_DOUBLE`, etc. " "(previously ``T_INT``, ``T_DOUBLE``, etc.)" msgstr "" -#: ../../whatsnew/3.12.rst:2303 +#: ../../whatsnew/3.12.rst:2317 msgid "" "The flags :c:macro:`Py_READONLY` (previously ``READONLY``) and :c:macro:" "`Py_AUDIT_READ` (previously all uppercase)" @@ -3731,23 +3777,23 @@ msgstr "" ":c:macro:`Py_READONLY`\\ (先前為 ``READONLY``)和 :c:macro:" "`Py_AUDIT_READ`\\ (先前全大寫)旗標" -#: ../../whatsnew/3.12.rst:2306 +#: ../../whatsnew/3.12.rst:2320 msgid "Several items are not exposed from :file:`Python.h`:" msgstr "數個項目不再從 :file:`Python.h` 中公開:" -#: ../../whatsnew/3.12.rst:2308 +#: ../../whatsnew/3.12.rst:2322 msgid ":c:macro:`T_OBJECT` (use :c:macro:`Py_T_OBJECT_EX`)" msgstr ":c:macro:`T_OBJECT`\\ (請改用 :c:macro:`Py_T_OBJECT_EX`)" -#: ../../whatsnew/3.12.rst:2309 +#: ../../whatsnew/3.12.rst:2323 msgid ":c:macro:`T_NONE` (previously undocumented, and pretty quirky)" msgstr ":c:macro:`T_NONE`\\ (先前未記錄於文件上,且相當古怪)" -#: ../../whatsnew/3.12.rst:2310 +#: ../../whatsnew/3.12.rst:2324 msgid "The macro ``WRITE_RESTRICTED`` which does nothing." msgstr "不做任何事的巨集 ``WRITE_RESTRICTED``。" -#: ../../whatsnew/3.12.rst:2311 +#: ../../whatsnew/3.12.rst:2325 msgid "" "The macros ``RESTRICTED`` and ``READ_RESTRICTED``, equivalents of :c:macro:" "`Py_AUDIT_READ`." @@ -3755,33 +3801,33 @@ msgstr "" "``RESTRICTED`` 和 ``READ_RESTRICTED`` 這兩個巨集,相當於 :c:macro:" "`Py_AUDIT_READ`。" -#: ../../whatsnew/3.12.rst:2313 +#: ../../whatsnew/3.12.rst:2327 msgid "" "In some configurations, ```` is not included from :file:`Python." "h`. It should be included manually when using ``offsetof()``." msgstr "" -#: ../../whatsnew/3.12.rst:2316 +#: ../../whatsnew/3.12.rst:2330 msgid "" "The deprecated header continues to provide its original contents under the " "original names. Your old code can stay unchanged, unless the extra include " "and non-namespaced macros bother you greatly." msgstr "" -#: ../../whatsnew/3.12.rst:2321 +#: ../../whatsnew/3.12.rst:2335 msgid "" "(Contributed in :gh:`47146` by Petr Viktorin, based on earlier work by " "Alexander Belopolsky and Matthias Braun.)" msgstr "" -#: ../../whatsnew/3.12.rst:2324 +#: ../../whatsnew/3.12.rst:2338 msgid "" ":c:func:`PyErr_Fetch` and :c:func:`PyErr_Restore` are deprecated. Use :c:" "func:`PyErr_GetRaisedException` and :c:func:`PyErr_SetRaisedException` " "instead. (Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2329 +#: ../../whatsnew/3.12.rst:2343 msgid "" ":c:func:`!PyErr_Display` is deprecated. Use :c:func:`PyErr_DisplayException` " "instead. (Contributed by Irit Katriel in :gh:`102755`)." @@ -3789,7 +3835,7 @@ msgstr "" ":c:func:`!PyErr_Display` 已棄用,請改用 :c:func:`PyErr_DisplayException`。" "(由 Irit Katriel 於 :gh:`102755` 中貢獻。)" -#: ../../whatsnew/3.12.rst:2332 +#: ../../whatsnew/3.12.rst:2346 msgid "" "``_PyErr_ChainExceptions`` is deprecated. Use ``_PyErr_ChainExceptions1`` " "instead. (Contributed by Irit Katriel in :gh:`102192`.)" @@ -3797,56 +3843,56 @@ msgstr "" "``_PyErr_ChainExceptions`` 已棄用,請改用 ``_PyErr_ChainExceptions1``。(由 " "Irit Katriel 於 :gh:`102192` 中貢獻。)" -#: ../../whatsnew/3.12.rst:2335 +#: ../../whatsnew/3.12.rst:2349 msgid "" "Using :c:func:`PyType_FromSpec`, :c:func:`PyType_FromSpecWithBases` or :c:" "func:`PyType_FromModuleAndSpec` to create a class whose metaclass overrides :" "c:member:`~PyTypeObject.tp_new` is deprecated. Call the metaclass instead." msgstr "" -#: ../../whatsnew/3.12.rst:2343 +#: ../../whatsnew/3.12.rst:2357 msgid "" "The ``ma_version_tag`` field in :c:type:`PyDictObject` for extension modules " "(:pep:`699`; :gh:`101193`)." msgstr "" -#: ../../whatsnew/3.12.rst:2346 +#: ../../whatsnew/3.12.rst:2360 msgid "Global configuration variables:" msgstr "" -#: ../../whatsnew/3.12.rst:2371 +#: ../../whatsnew/3.12.rst:2385 msgid "" "The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" "`PyConfig` instead." msgstr "" ":c:func:`Py_InitializeFromConfig` API 應改為與 :c:type:`PyConfig` 一起使用。" -#: ../../whatsnew/3.12.rst:2374 +#: ../../whatsnew/3.12.rst:2388 msgid "" "Creating :c:data:`immutable types ` with mutable " "bases (:gh:`95388`)." msgstr "" -#: ../../whatsnew/3.12.rst:2380 +#: ../../whatsnew/3.12.rst:2394 msgid "" ":c:func:`PyImport_ImportModuleNoBlock`: use :c:func:`PyImport_ImportModule`" msgstr "" ":c:func:`PyImport_ImportModuleNoBlock`:請改用 :c:func:" "`PyImport_ImportModule`" -#: ../../whatsnew/3.12.rst:2381 +#: ../../whatsnew/3.12.rst:2395 msgid ":c:type:`!Py_UNICODE_WIDE` type: use :c:type:`wchar_t`" msgstr ":c:type:`!Py_UNICODE_WIDE` 型別:請改用 :c:type:`wchar_t`" -#: ../../whatsnew/3.12.rst:2382 +#: ../../whatsnew/3.12.rst:2396 msgid ":c:type:`Py_UNICODE` type: use :c:type:`wchar_t`" msgstr ":c:type:`Py_UNICODE` 型別:請改用 :c:type:`wchar_t`" -#: ../../whatsnew/3.12.rst:2383 +#: ../../whatsnew/3.12.rst:2397 msgid "Python initialization functions:" msgstr "Python 初始化函式:" -#: ../../whatsnew/3.12.rst:2385 +#: ../../whatsnew/3.12.rst:2399 msgid "" ":c:func:`PySys_ResetWarnOptions`: clear :data:`sys.warnoptions` and :data:`!" "warnings.filters`" @@ -3854,27 +3900,27 @@ msgstr "" ":c:func:`PySys_ResetWarnOptions`:清除 :data:`sys.warnoptions` 和 :data:`!" "warnings.filters`" -#: ../../whatsnew/3.12.rst:2387 +#: ../../whatsnew/3.12.rst:2401 msgid ":c:func:`Py_GetExecPrefix`: get :data:`sys.exec_prefix`" msgstr ":c:func:`Py_GetExecPrefix`:取得 :data:`sys.exec_prefix`" -#: ../../whatsnew/3.12.rst:2388 +#: ../../whatsnew/3.12.rst:2402 msgid ":c:func:`Py_GetPath`: get :data:`sys.path`" msgstr ":c:func:`Py_GetPath`:取得 :data:`sys.path`" -#: ../../whatsnew/3.12.rst:2389 +#: ../../whatsnew/3.12.rst:2403 msgid ":c:func:`Py_GetPrefix`: get :data:`sys.prefix`" msgstr ":c:func:`Py_GetPrefix`:取得 :data:`sys.prefix`" -#: ../../whatsnew/3.12.rst:2390 +#: ../../whatsnew/3.12.rst:2404 msgid ":c:func:`Py_GetProgramFullPath`: get :data:`sys.executable`" msgstr ":c:func:`Py_GetProgramFullPath`:取得 :data:`sys.executable`" -#: ../../whatsnew/3.12.rst:2391 +#: ../../whatsnew/3.12.rst:2405 msgid ":c:func:`Py_GetProgramName`: get :data:`sys.executable`" msgstr ":c:func:`Py_GetProgramName`:取得 :data:`sys.executable`" -#: ../../whatsnew/3.12.rst:2392 +#: ../../whatsnew/3.12.rst:2406 msgid "" ":c:func:`Py_GetPythonHome`: get :c:member:`PyConfig.home` or the :envvar:" "`PYTHONHOME` environment variable" @@ -3882,41 +3928,41 @@ msgstr "" ":c:func:`Py_GetPythonHome`:取得 :c:member:`PyConfig.home` 或 :envvar:" "`PYTHONHOME` 環境變數" -#: ../../whatsnew/3.12.rst:2398 +#: ../../whatsnew/3.12.rst:2412 msgid "" "The following APIs are deprecated and will be removed, although there is " "currently no date scheduled for their removal." msgstr "以下 API 已棄用,且將會被移除,雖目前尚未定下移除日期。" -#: ../../whatsnew/3.12.rst:2401 +#: ../../whatsnew/3.12.rst:2415 msgid ":c:macro:`Py_TPFLAGS_HAVE_FINALIZE`: unneeded since Python 3.8" msgstr ":c:macro:`Py_TPFLAGS_HAVE_FINALIZE`:自 Python 3.8 起不再需要" -#: ../../whatsnew/3.12.rst:2402 +#: ../../whatsnew/3.12.rst:2416 msgid ":c:func:`PyErr_Fetch`: use :c:func:`PyErr_GetRaisedException`" msgstr ":c:func:`PyErr_Fetch`:請改用 :c:func:`PyErr_GetRaisedException`" -#: ../../whatsnew/3.12.rst:2403 +#: ../../whatsnew/3.12.rst:2417 msgid "" ":c:func:`PyErr_NormalizeException`: use :c:func:`PyErr_GetRaisedException`" msgstr "" ":c:func:`PyErr_NormalizeException`:請改用 :c:func:`PyErr_GetRaisedException`" -#: ../../whatsnew/3.12.rst:2404 +#: ../../whatsnew/3.12.rst:2418 msgid ":c:func:`PyErr_Restore`: use :c:func:`PyErr_SetRaisedException`" msgstr ":c:func:`PyErr_Restore`:請改用 :c:func:`PyErr_SetRaisedException`" -#: ../../whatsnew/3.12.rst:2405 +#: ../../whatsnew/3.12.rst:2419 msgid "" ":c:func:`PyModule_GetFilename`: use :c:func:`PyModule_GetFilenameObject`" msgstr "" ":c:func:`PyModule_GetFilename`:請改用 :c:func:`PyModule_GetFilenameObject`" -#: ../../whatsnew/3.12.rst:2406 +#: ../../whatsnew/3.12.rst:2420 msgid ":c:func:`PyOS_AfterFork`: use :c:func:`PyOS_AfterFork_Child`" msgstr ":c:func:`PyOS_AfterFork`:請改用 :c:func:`PyOS_AfterFork_Child`" -#: ../../whatsnew/3.12.rst:2407 +#: ../../whatsnew/3.12.rst:2421 msgid "" ":c:func:`PySlice_GetIndicesEx`: use :c:func:`PySlice_Unpack` and :c:func:" "`PySlice_AdjustIndices`" @@ -3924,122 +3970,122 @@ msgstr "" ":c:func:`PySlice_GetIndicesEx`:請改用 :c:func:`PySlice_Unpack` 和 :c:func:" "`PySlice_AdjustIndices`" -#: ../../whatsnew/3.12.rst:2408 +#: ../../whatsnew/3.12.rst:2422 msgid ":c:func:`!PyUnicode_AsDecodedObject`: use :c:func:`PyCodec_Decode`" msgstr ":c:func:`!PyUnicode_AsDecodedObject`:請改用 :c:func:`PyCodec_Decode`" -#: ../../whatsnew/3.12.rst:2409 +#: ../../whatsnew/3.12.rst:2423 msgid ":c:func:`!PyUnicode_AsDecodedUnicode`: use :c:func:`PyCodec_Decode`" msgstr ":c:func:`!PyUnicode_AsDecodedUnicode`:請改用 :c:func:`PyCodec_Decode`" -#: ../../whatsnew/3.12.rst:2410 +#: ../../whatsnew/3.12.rst:2424 msgid ":c:func:`!PyUnicode_AsEncodedObject`: use :c:func:`PyCodec_Encode`" msgstr ":c:func:`!PyUnicode_AsEncodedObject`:請改用 :c:func:`PyCodec_Encode`" -#: ../../whatsnew/3.12.rst:2411 +#: ../../whatsnew/3.12.rst:2425 msgid ":c:func:`!PyUnicode_AsEncodedUnicode`: use :c:func:`PyCodec_Encode`" msgstr ":c:func:`!PyUnicode_AsEncodedUnicode`:請改用 :c:func:`PyCodec_Encode`" -#: ../../whatsnew/3.12.rst:2412 +#: ../../whatsnew/3.12.rst:2426 msgid ":c:func:`PyUnicode_READY`: unneeded since Python 3.12" msgstr ":c:func:`PyUnicode_READY`:自 Python 3.12 起不再需要" -#: ../../whatsnew/3.12.rst:2413 +#: ../../whatsnew/3.12.rst:2427 msgid ":c:func:`!PyErr_Display`: use :c:func:`PyErr_DisplayException`" msgstr ":c:func:`!PyErr_Display`:請改用 :c:func:`PyErr_DisplayException`" -#: ../../whatsnew/3.12.rst:2414 +#: ../../whatsnew/3.12.rst:2428 msgid ":c:func:`!_PyErr_ChainExceptions`: use ``_PyErr_ChainExceptions1``" msgstr ":c:func:`!_PyErr_ChainExceptions`:請改用 ``_PyErr_ChainExceptions1``" -#: ../../whatsnew/3.12.rst:2415 +#: ../../whatsnew/3.12.rst:2429 msgid "" ":c:member:`!PyBytesObject.ob_shash` member: call :c:func:`PyObject_Hash` " "instead" msgstr "" ":c:member:`!PyBytesObject.ob_shash` 成員:請改用 :c:func:`PyObject_Hash`" -#: ../../whatsnew/3.12.rst:2417 +#: ../../whatsnew/3.12.rst:2431 msgid ":c:member:`!PyDictObject.ma_version_tag` member" msgstr ":c:member:`!PyDictObject.ma_version_tag` 成員" -#: ../../whatsnew/3.12.rst:2418 +#: ../../whatsnew/3.12.rst:2432 msgid "Thread Local Storage (TLS) API:" msgstr "" -#: ../../whatsnew/3.12.rst:2420 +#: ../../whatsnew/3.12.rst:2434 msgid ":c:func:`PyThread_create_key`: use :c:func:`PyThread_tss_alloc`" msgstr ":c:func:`PyThread_create_key`:請改用 :c:func:`PyThread_tss_alloc`" -#: ../../whatsnew/3.12.rst:2421 +#: ../../whatsnew/3.12.rst:2435 msgid ":c:func:`PyThread_delete_key`: use :c:func:`PyThread_tss_free`" msgstr ":c:func:`PyThread_delete_key`:請改用 :c:func:`PyThread_tss_free`" -#: ../../whatsnew/3.12.rst:2422 +#: ../../whatsnew/3.12.rst:2436 msgid ":c:func:`PyThread_set_key_value`: use :c:func:`PyThread_tss_set`" msgstr ":c:func:`PyThread_set_key_value`:請改用 :c:func:`PyThread_tss_set`" -#: ../../whatsnew/3.12.rst:2423 +#: ../../whatsnew/3.12.rst:2437 msgid ":c:func:`PyThread_get_key_value`: use :c:func:`PyThread_tss_get`" msgstr ":c:func:`PyThread_get_key_value`:請改用 :c:func:`PyThread_tss_get`" -#: ../../whatsnew/3.12.rst:2424 +#: ../../whatsnew/3.12.rst:2438 msgid ":c:func:`PyThread_delete_key_value`: use :c:func:`PyThread_tss_delete`" msgstr "" ":c:func:`PyThread_delete_key_value`:請改用 :c:func:`PyThread_tss_delete`" -#: ../../whatsnew/3.12.rst:2425 +#: ../../whatsnew/3.12.rst:2439 msgid ":c:func:`PyThread_ReInitTLS`: unneeded since Python 3.7" msgstr ":c:func:`PyThread_ReInitTLS`:自 Python 3.7 起不再需要" -#: ../../whatsnew/3.12.rst:2430 +#: ../../whatsnew/3.12.rst:2444 msgid "" "Remove the :file:`token.h` header file. There was never any public tokenizer " "C API. The :file:`token.h` header file was only designed to be used by " "Python internals. (Contributed by Victor Stinner in :gh:`92651`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2435 +#: ../../whatsnew/3.12.rst:2449 msgid "Legacy Unicode APIs have been removed. See :pep:`623` for detail." msgstr "" -#: ../../whatsnew/3.12.rst:2437 +#: ../../whatsnew/3.12.rst:2451 msgid ":c:macro:`!PyUnicode_WCHAR_KIND`" msgstr ":c:macro:`!PyUnicode_WCHAR_KIND`" -#: ../../whatsnew/3.12.rst:2438 +#: ../../whatsnew/3.12.rst:2452 msgid ":c:func:`!PyUnicode_AS_UNICODE`" msgstr ":c:func:`!PyUnicode_AS_UNICODE`" -#: ../../whatsnew/3.12.rst:2439 +#: ../../whatsnew/3.12.rst:2453 msgid ":c:func:`!PyUnicode_AsUnicode`" msgstr ":c:func:`!PyUnicode_AsUnicode`" -#: ../../whatsnew/3.12.rst:2440 +#: ../../whatsnew/3.12.rst:2454 msgid ":c:func:`!PyUnicode_AsUnicodeAndSize`" msgstr ":c:func:`!PyUnicode_AsUnicodeAndSize`" -#: ../../whatsnew/3.12.rst:2441 +#: ../../whatsnew/3.12.rst:2455 msgid ":c:func:`!PyUnicode_AS_DATA`" msgstr ":c:func:`!PyUnicode_AS_DATA`" -#: ../../whatsnew/3.12.rst:2442 +#: ../../whatsnew/3.12.rst:2456 msgid ":c:func:`!PyUnicode_FromUnicode`" msgstr ":c:func:`!PyUnicode_FromUnicode`" -#: ../../whatsnew/3.12.rst:2443 +#: ../../whatsnew/3.12.rst:2457 msgid ":c:func:`!PyUnicode_GET_SIZE`" msgstr ":c:func:`!PyUnicode_GET_SIZE`" -#: ../../whatsnew/3.12.rst:2444 +#: ../../whatsnew/3.12.rst:2458 msgid ":c:func:`!PyUnicode_GetSize`" msgstr ":c:func:`!PyUnicode_GetSize`" -#: ../../whatsnew/3.12.rst:2445 +#: ../../whatsnew/3.12.rst:2459 msgid ":c:func:`!PyUnicode_GET_DATA_SIZE`" msgstr ":c:func:`!PyUnicode_GET_DATA_SIZE`" -#: ../../whatsnew/3.12.rst:2447 +#: ../../whatsnew/3.12.rst:2461 msgid "" "Remove the ``PyUnicode_InternImmortal()`` function macro. (Contributed by " "Victor Stinner in :gh:`85858`.)" diff --git a/whatsnew/3.2.po b/whatsnew/3.2.po index 3b1d98fc7c..ae3ebb26ac 100644 --- a/whatsnew/3.2.po +++ b/whatsnew/3.2.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-13 00:03+0000\n" +"POT-Creation-Date: 2024-01-03 20:44+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -140,7 +140,7 @@ msgstr "" msgid "" "The :mod:`logging` module provided two kinds of configuration, one style " "with function calls for each option or another style driven by an external " -"file saved in a :mod:`ConfigParser` format. Those options did not provide " +"file saved in a :mod:`configparser` format. Those options did not provide " "the flexibility to create configurations from JSON or YAML files, nor did " "they support incremental configuration, which is needed for specifying " "logger options from a command line." @@ -2127,12 +2127,11 @@ msgstr "asyncore" #: ../../whatsnew/3.2.rst:1861 msgid "" -":class:`asyncore.dispatcher` now provides a :meth:`~asyncore.dispatcher." -"handle_accepted()` method returning a ``(sock, addr)`` pair which is called " -"when a connection has actually been established with a new remote endpoint. " -"This is supposed to be used as a replacement for old :meth:`~asyncore." -"dispatcher.handle_accept()` and avoids the user to call :meth:`~asyncore." -"dispatcher.accept()` directly." +":class:`!asyncore.dispatcher` now provides a :meth:`!handle_accepted()` " +"method returning a ``(sock, addr)`` pair which is called when a connection " +"has actually been established with a new remote endpoint. This is supposed " +"to be used as a replacement for old :meth:`!handle_accept()` and avoids the " +"user to call :meth:`!accept()` directly." msgstr "" #: ../../whatsnew/3.2.rst:1868 @@ -2398,10 +2397,11 @@ msgstr "configparser" msgid "" "The :mod:`configparser` module was modified to improve usability and " "predictability of the default parser and its supported INI syntax. The old :" -"class:`ConfigParser` class was removed in favor of :class:`SafeConfigParser` " -"which has in turn been renamed to :class:`~configparser.ConfigParser`. " -"Support for inline comments is now turned off by default and section or " -"option duplicates are not allowed in a single configuration source." +"class:`!ConfigParser` class was removed in favor of :class:`!" +"SafeConfigParser` which has in turn been renamed to :class:`~configparser." +"ConfigParser`. Support for inline comments is now turned off by default and " +"section or option duplicates are not allowed in a single configuration " +"source." msgstr "" #: ../../whatsnew/3.2.rst:2142 @@ -2719,8 +2719,9 @@ msgid "" "implementation (:issue:`1569291` by Alexander Belopolsky). The :class:" "`BaseHTTPRequestHandler` has more efficient buffering (:issue:`3709` by " "Andrew Schaaf). The :func:`operator.attrgetter` function has been sped-up (:" -"issue:`10160` by Christos Georgiou). And :class:`ConfigParser` loads multi-" -"line arguments a bit faster (:issue:`7113` by Łukasz Langa)." +"issue:`10160` by Christos Georgiou). And :class:`~configparser." +"ConfigParser` loads multi-line arguments a bit faster (:issue:`7113` by " +"Łukasz Langa)." msgstr "" #: ../../whatsnew/3.2.rst:2422 @@ -3055,8 +3056,8 @@ msgstr "" #: ../../whatsnew/3.2.rst:2616 msgid "" "The :mod:`configparser` module has a number of clean-ups. The major change " -"is to replace the old :class:`ConfigParser` class with long-standing " -"preferred alternative :class:`SafeConfigParser`. In addition there are a " +"is to replace the old :class:`!ConfigParser` class with long-standing " +"preferred alternative :class:`!SafeConfigParser`. In addition there are a " "number of smaller incompatibilities:" msgstr "" @@ -3260,8 +3261,8 @@ msgstr "" #: ../../whatsnew/3.2.rst:2740 msgid "" -"Due to security risks, :func:`asyncore.handle_accept` has been deprecated, " -"and a new function, :func:`asyncore.handle_accepted`, was added to replace " +"Due to security risks, :func:`!asyncore.handle_accept` has been deprecated, " +"and a new function, :func:`!asyncore.handle_accepted`, was added to replace " "it." msgstr "" diff --git a/whatsnew/3.3.po b/whatsnew/3.3.po index 615ebdc8c2..e7ba840fc5 100644 --- a/whatsnew/3.3.po +++ b/whatsnew/3.3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2024-01-11 00:04+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -251,7 +251,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:176 msgid "" "Arbitrary slicing of any 1-D arrays type is supported. For example, it is " -"now possible to reverse a memoryview in O(1) by using a negative step." +"now possible to reverse a memoryview in *O*\\ (1) by using a negative step." msgstr "" #: ../../whatsnew/3.3.rst:180 ../../whatsnew/3.3.rst:1133 @@ -2692,7 +2692,7 @@ msgstr "smtpd" #: ../../whatsnew/3.3.rst:1848 msgid "" -"The :mod:`smtpd` module now supports :rfc:`5321` (extended SMTP) and :rfc:" +"The :mod:`!smtpd` module now supports :rfc:`5321` (extended SMTP) and :rfc:" "`1870` (size extension). Per the standard, these extensions are enabled if " "and only if the client initiates the session with an ``EHLO`` command." msgstr "" diff --git a/whatsnew/3.4.po b/whatsnew/3.4.po index 9f20d728e6..c18f91e0f4 100644 --- a/whatsnew/3.4.po +++ b/whatsnew/3.4.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-13 13:14+0000\n" +"POT-Creation-Date: 2024-01-03 20:44+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1860,9 +1860,9 @@ msgstr "smtpd" #: ../../whatsnew/3.4.rst:1372 msgid "" -"The :class:`~smtpd.SMTPServer` and :class:`~smtpd.SMTPChannel` classes now " -"accept a *map* keyword argument which, if specified, is passed in to :class:" -"`asynchat.async_chat` as its *map* argument. This allows an application to " +"The :class:`!SMTPServer` and :class:`!SMTPChannel` classes now accept a " +"*map* keyword argument which, if specified, is passed in to :class:`!" +"asynchat.async_chat` as its *map* argument. This allows an application to " "avoid affecting the global socket map. (Contributed by Vinay Sajip in :" "issue:`11959`.)" msgstr "" diff --git a/whatsnew/3.5.po b/whatsnew/3.5.po index d427bed216..53f552f310 100644 --- a/whatsnew/3.5.po +++ b/whatsnew/3.5.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-10 00:03+0000\n" +"POT-Creation-Date: 2024-01-03 20:44+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2022,43 +2022,40 @@ msgstr "smtpd" #: ../../whatsnew/3.5.rst:1666 msgid "" -"Both the :class:`~smtpd.SMTPServer` and :class:`~smtpd.SMTPChannel` classes " -"now accept a *decode_data* keyword argument to determine if the ``DATA`` " -"portion of the SMTP transaction is decoded using the ``\"utf-8\"`` codec or " -"is instead provided to the :meth:`SMTPServer.process_message() ` method as a byte string. The default is " -"``True`` for backward compatibility reasons, but will change to ``False`` in " -"Python 3.6. If *decode_data* is set to ``False``, the ``process_message`` " -"method must be prepared to accept keyword arguments. (Contributed by Maciej " -"Szulik in :issue:`19662`.)" +"Both the :class:`!SMTPServer` and :class:`!SMTPChannel` classes now accept a " +"*decode_data* keyword argument to determine if the ``DATA`` portion of the " +"SMTP transaction is decoded using the ``\"utf-8\"`` codec or is instead " +"provided to the :meth:`!SMTPServer.process_message()` method as a byte " +"string. The default is ``True`` for backward compatibility reasons, but " +"will change to ``False`` in Python 3.6. If *decode_data* is set to " +"``False``, the ``process_message`` method must be prepared to accept keyword " +"arguments. (Contributed by Maciej Szulik in :issue:`19662`.)" msgstr "" #: ../../whatsnew/3.5.rst:1677 msgid "" -"The :class:`~smtpd.SMTPServer` class now advertises the ``8BITMIME`` " -"extension (:rfc:`6152`) if *decode_data* has been set ``True``. If the " -"client specifies ``BODY=8BITMIME`` on the ``MAIL`` command, it is passed to :" -"meth:`SMTPServer.process_message() ` via " -"the *mail_options* keyword. (Contributed by Milan Oberkirch and R. David " -"Murray in :issue:`21795`.)" +"The :class:`!SMTPServer` class now advertises the ``8BITMIME`` extension (:" +"rfc:`6152`) if *decode_data* has been set ``True``. If the client specifies " +"``BODY=8BITMIME`` on the ``MAIL`` command, it is passed to :meth:`!" +"SMTPServer.process_message()` via the *mail_options* keyword. (Contributed " +"by Milan Oberkirch and R. David Murray in :issue:`21795`.)" msgstr "" #: ../../whatsnew/3.5.rst:1684 msgid "" -"The :class:`~smtpd.SMTPServer` class now also supports the ``SMTPUTF8`` " -"extension (:rfc:`6531`: Internationalized Email). If the client specified " -"``SMTPUTF8 BODY=8BITMIME`` on the ``MAIL`` command, they are passed to :meth:" -"`SMTPServer.process_message() ` via the " -"*mail_options* keyword. It is the responsibility of the ``process_message`` " -"method to correctly handle the ``SMTPUTF8`` data. (Contributed by Milan " -"Oberkirch in :issue:`21725`.)" +"The :class:`!SMTPServer` class now also supports the ``SMTPUTF8`` extension " +"(:rfc:`6531`: Internationalized Email). If the client specified ``SMTPUTF8 " +"BODY=8BITMIME`` on the ``MAIL`` command, they are passed to :meth:`!" +"SMTPServer.process_message()` via the *mail_options* keyword. It is the " +"responsibility of the ``process_message`` method to correctly handle the " +"``SMTPUTF8`` data. (Contributed by Milan Oberkirch in :issue:`21725`.)" msgstr "" #: ../../whatsnew/3.5.rst:1692 msgid "" "It is now possible to provide, directly or via name resolution, IPv6 " -"addresses in the :class:`~smtpd.SMTPServer` constructor, and have it " -"successfully connect. (Contributed by Milan Oberkirch in :issue:`14758`.)" +"addresses in the :class:`!SMTPServer` constructor, and have it successfully " +"connect. (Contributed by Milan Oberkirch in :issue:`14758`.)" msgstr "" #: ../../whatsnew/3.5.rst:1698 @@ -2954,11 +2951,11 @@ msgstr "" #: ../../whatsnew/3.5.rst:2299 msgid "" -"The :mod:`smtpd` module has in the past always decoded the DATA portion of " +"The :mod:`!smtpd` module has in the past always decoded the DATA portion of " "email messages using the ``utf-8`` codec. This can now be controlled by the " -"new *decode_data* keyword to :class:`~smtpd.SMTPServer`. The default value " -"is ``True``, but this default is deprecated. Specify the *decode_data* " -"keyword with an appropriate value to avoid the deprecation warning." +"new *decode_data* keyword to :class:`!SMTPServer`. The default value is " +"``True``, but this default is deprecated. Specify the *decode_data* keyword " +"with an appropriate value to avoid the deprecation warning." msgstr "" #: ../../whatsnew/3.5.rst:2305 diff --git a/whatsnew/3.6.po b/whatsnew/3.6.po index fdef7d49a5..0e776e4e55 100644 --- a/whatsnew/3.6.po +++ b/whatsnew/3.6.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-07 00:03+0000\n" +"POT-Creation-Date: 2024-01-03 20:44+0000\n" "PO-Revision-Date: 2018-07-15 18:56+0800\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -2563,7 +2563,7 @@ msgstr "asynchat" #: ../../whatsnew/3.6.rst:1964 msgid "" -"The :mod:`asynchat` has been deprecated in favor of :mod:`asyncio`. " +"The :mod:`!asynchat` has been deprecated in favor of :mod:`asyncio`. " "(Contributed by Mariatta in :issue:`25002`.)" msgstr "" @@ -2573,7 +2573,7 @@ msgstr "asyncore" #: ../../whatsnew/3.6.rst:1971 msgid "" -"The :mod:`asyncore` has been deprecated in favor of :mod:`asyncio`. " +"The :mod:`!asyncore` has been deprecated in favor of :mod:`asyncio`. " "(Contributed by Mariatta in :issue:`25002`.)" msgstr "" @@ -2864,7 +2864,7 @@ msgid "" "attributes to match the documented APIs: :mod:`calendar`, :mod:`cgi`, :mod:" "`csv`, :mod:`~xml.etree.ElementTree`, :mod:`enum`, :mod:`fileinput`, :mod:" "`ftplib`, :mod:`logging`, :mod:`mailbox`, :mod:`mimetypes`, :mod:" -"`optparse`, :mod:`plistlib`, :mod:`smtpd`, :mod:`subprocess`, :mod:" +"`optparse`, :mod:`plistlib`, :mod:`!smtpd`, :mod:`subprocess`, :mod:" "`tarfile`, :mod:`threading` and :mod:`wave`. This means they will export " "new symbols when ``import *`` is used. (Contributed by Joel Taddei and Jacek " "Kołodziej in :issue:`23883`.)" @@ -2910,12 +2910,12 @@ msgstr "" #: ../../whatsnew/3.6.rst:2222 msgid "" -"The *decode_data* argument for the :class:`smtpd.SMTPChannel` and :class:" -"`smtpd.SMTPServer` constructors is now ``False`` by default. This means that " -"the argument passed to :meth:`~smtpd.SMTPServer.process_message` is now a " -"bytes object by default, and ``process_message()`` will be passed keyword " -"arguments. Code that has already been updated in accordance with the " -"deprecation warning generated by 3.5 will not be affected." +"The *decode_data* argument for the :class:`!smtpd.SMTPChannel` and :class:`!" +"smtpd.SMTPServer` constructors is now ``False`` by default. This means that " +"the argument passed to :meth:`!process_message` is now a bytes object by " +"default, and :meth:`!process_message` will be passed keyword arguments. Code " +"that has already been updated in accordance with the deprecation warning " +"generated by 3.5 will not be affected." msgstr "" #: ../../whatsnew/3.6.rst:2230 diff --git a/whatsnew/3.7.po b/whatsnew/3.7.po index c4b1822b01..cb2bd407b2 100644 --- a/whatsnew/3.7.po +++ b/whatsnew/3.7.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-10 00:03+0000\n" +"POT-Creation-Date: 2024-01-03 20:44+0000\n" "PO-Revision-Date: 2018-07-15 18:56+0800\n" "Last-Translator: \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2834,13 +2834,12 @@ msgstr "" #: ../../whatsnew/3.7.rst:2006 msgid "" -"Methods :meth:`MetaPathFinder.find_module() ` (replaced by :meth:`MetaPathFinder.find_spec() `) and :meth:`PathEntryFinder.find_loader() ` (replaced by :meth:" -"`PathEntryFinder.find_spec() `) " -"both deprecated in Python 3.4 now emit :exc:`DeprecationWarning`. " -"(Contributed by Matthias Bussonnier in :issue:`29576`)" +"Methods :meth:`!MetaPathFinder.find_module()` (replaced by :meth:" +"`MetaPathFinder.find_spec() `) and :" +"meth:`!PathEntryFinder.find_loader()` (replaced by :meth:`PathEntryFinder." +"find_spec() `) both deprecated in " +"Python 3.4 now emit :exc:`DeprecationWarning`. (Contributed by Matthias " +"Bussonnier in :issue:`29576`.)" msgstr "" #: ../../whatsnew/3.7.rst:2017 @@ -3248,7 +3247,7 @@ msgstr "" #: ../../whatsnew/3.7.rst:2307 msgid "" ":func:`~cgi.parse_multipart` now accepts the *encoding* and *errors* " -"arguments and returns the same results as :class:`~FieldStorage`: for non-" +"arguments and returns the same results as :class:`!FieldStorage`: for non-" "file fields, the value associated to a key is a list of strings, not bytes. " "(Contributed by Pierre Quentel in :issue:`29979`.)" msgstr "" diff --git a/whatsnew/3.8.po b/whatsnew/3.8.po index 527c4fa812..3d4ee41429 100644 --- a/whatsnew/3.8.po +++ b/whatsnew/3.8.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-14 00:03+0000\n" +"POT-Creation-Date: 2024-01-03 20:44+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1344,8 +1344,8 @@ msgstr "" #: ../../whatsnew/3.8.rst:1089 msgid "" -"Added :meth:`pathlib.Path.link_to()` which creates a hard link pointing to a " -"path. (Contributed by Joannah Nanjekye in :issue:`26978`) Note that " +"Added :meth:`!pathlib.Path.link_to()` which creates a hard link pointing to " +"a path. (Contributed by Joannah Nanjekye in :issue:`26978`) Note that " "``link_to`` was deprecated in 3.10 and removed in 3.12 in favor of a " "``hardlink_to`` method added in 3.10 which matches the semantics of the " "existing ``symlink_to`` method." diff --git a/whatsnew/3.9.po b/whatsnew/3.9.po index 4b22ebcf8a..3b38a6f09f 100644 --- a/whatsnew/3.9.po +++ b/whatsnew/3.9.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2024-01-03 20:44+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1338,7 +1338,7 @@ msgstr "" #: ../../whatsnew/3.9.rst:934 msgid "" -":func:`smtpd.MailmanProxy` is now deprecated as it is unusable without an " +":func:`!smtpd.MailmanProxy` is now deprecated as it is unusable without an " "external module, ``mailman``. (Contributed by Samuel Colvin in :issue:" "`35800`.)" msgstr ""