diff --git a/.scripts/poetry.lock b/.scripts/poetry.lock index 5f06f9c25c..7b17f463ce 100644 --- a/.scripts/poetry.lock +++ b/.scripts/poetry.lock @@ -1,9 +1,10 @@ -# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.4.2 and should not be changed by hand. [[package]] name = "certifi" version = "2024.8.30" description = "Python package for providing Mozilla's CA Bundle." +category = "main" optional = false python-versions = ">=3.6" files = [ @@ -15,6 +16,7 @@ files = [ name = "chardet" version = "3.0.4" description = "Universal encoding detector for Python 2 and 3" +category = "main" optional = false python-versions = "*" files = [ @@ -24,107 +26,124 @@ files = [ [[package]] name = "charset-normalizer" -version = "3.3.2" +version = "3.4.0" description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." +category = "main" optional = false python-versions = ">=3.7.0" files = [ - {file = "charset-normalizer-3.3.2.tar.gz", hash = "sha256:f30c3cb33b24454a82faecaf01b19c18562b1e89558fb6c56de4d9118a032fd5"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:25baf083bf6f6b341f4121c2f3c548875ee6f5339300e08be3f2b2ba1721cdd3"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:06435b539f889b1f6f4ac1758871aae42dc3a8c0e24ac9e60c2384973ad73027"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9063e24fdb1e498ab71cb7419e24622516c4a04476b17a2dab57e8baa30d6e03"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6897af51655e3691ff853668779c7bad41579facacf5fd7253b0133308cf000d"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1d3193f4a680c64b4b6a9115943538edb896edc190f0b222e73761716519268e"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:cd70574b12bb8a4d2aaa0094515df2463cb429d8536cfb6c7ce983246983e5a6"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8465322196c8b4d7ab6d1e049e4c5cb460d0394da4a27d23cc242fbf0034b6b5"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a9a8e9031d613fd2009c182b69c7b2c1ef8239a0efb1df3f7c8da66d5dd3d537"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:beb58fe5cdb101e3a055192ac291b7a21e3b7ef4f67fa1d74e331a7f2124341c"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:e06ed3eb3218bc64786f7db41917d4e686cc4856944f53d5bdf83a6884432e12"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:2e81c7b9c8979ce92ed306c249d46894776a909505d8f5a4ba55b14206e3222f"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:572c3763a264ba47b3cf708a44ce965d98555f618ca42c926a9c1616d8f34269"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:fd1abc0d89e30cc4e02e4064dc67fcc51bd941eb395c502aac3ec19fab46b519"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-win32.whl", hash = "sha256:3d47fa203a7bd9c5b6cee4736ee84ca03b8ef23193c0d1ca99b5089f72645c73"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-win_amd64.whl", hash = "sha256:10955842570876604d404661fbccbc9c7e684caf432c09c715ec38fbae45ae09"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:802fe99cca7457642125a8a88a084cef28ff0cf9407060f7b93dca5aa25480db"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:573f6eac48f4769d667c4442081b1794f52919e7edada77495aaed9236d13a96"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:549a3a73da901d5bc3ce8d24e0600d1fa85524c10287f6004fbab87672bf3e1e"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f27273b60488abe721a075bcca6d7f3964f9f6f067c8c4c605743023d7d3944f"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1ceae2f17a9c33cb48e3263960dc5fc8005351ee19db217e9b1bb15d28c02574"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:65f6f63034100ead094b8744b3b97965785388f308a64cf8d7c34f2f2e5be0c4"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:753f10e867343b4511128c6ed8c82f7bec3bd026875576dfd88483c5c73b2fd8"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4a78b2b446bd7c934f5dcedc588903fb2f5eec172f3d29e52a9096a43722adfc"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:e537484df0d8f426ce2afb2d0f8e1c3d0b114b83f8850e5f2fbea0e797bd82ae"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:eb6904c354526e758fda7167b33005998fb68c46fbc10e013ca97f21ca5c8887"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:deb6be0ac38ece9ba87dea880e438f25ca3eddfac8b002a2ec3d9183a454e8ae"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:4ab2fe47fae9e0f9dee8c04187ce5d09f48eabe611be8259444906793ab7cbce"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:80402cd6ee291dcb72644d6eac93785fe2c8b9cb30893c1af5b8fdd753b9d40f"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-win32.whl", hash = "sha256:7cd13a2e3ddeed6913a65e66e94b51d80a041145a026c27e6bb76c31a853c6ab"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-win_amd64.whl", hash = "sha256:663946639d296df6a2bb2aa51b60a2454ca1cb29835324c640dafb5ff2131a77"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:0b2b64d2bb6d3fb9112bafa732def486049e63de9618b5843bcdd081d8144cd8"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:ddbb2551d7e0102e7252db79ba445cdab71b26640817ab1e3e3648dad515003b"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:55086ee1064215781fff39a1af09518bc9255b50d6333f2e4c74ca09fac6a8f6"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8f4a014bc36d3c57402e2977dada34f9c12300af536839dc38c0beab8878f38a"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a10af20b82360ab00827f916a6058451b723b4e65030c5a18577c8b2de5b3389"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8d756e44e94489e49571086ef83b2bb8ce311e730092d2c34ca8f7d925cb20aa"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:90d558489962fd4918143277a773316e56c72da56ec7aa3dc3dbbe20fdfed15b"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6ac7ffc7ad6d040517be39eb591cac5ff87416c2537df6ba3cba3bae290c0fed"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:7ed9e526742851e8d5cc9e6cf41427dfc6068d4f5a3bb03659444b4cabf6bc26"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:8bdb58ff7ba23002a4c5808d608e4e6c687175724f54a5dade5fa8c67b604e4d"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:6b3251890fff30ee142c44144871185dbe13b11bab478a88887a639655be1068"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_s390x.whl", hash = "sha256:b4a23f61ce87adf89be746c8a8974fe1c823c891d8f86eb218bb957c924bb143"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:efcb3f6676480691518c177e3b465bcddf57cea040302f9f4e6e191af91174d4"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-win32.whl", hash = "sha256:d965bba47ddeec8cd560687584e88cf699fd28f192ceb452d1d7ee807c5597b7"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-win_amd64.whl", hash = "sha256:96b02a3dc4381e5494fad39be677abcb5e6634bf7b4fa83a6dd3112607547001"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:95f2a5796329323b8f0512e09dbb7a1860c46a39da62ecb2324f116fa8fdc85c"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c002b4ffc0be611f0d9da932eb0f704fe2602a9a949d1f738e4c34c75b0863d5"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a981a536974bbc7a512cf44ed14938cf01030a99e9b3a06dd59578882f06f985"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3287761bc4ee9e33561a7e058c72ac0938c4f57fe49a09eae428fd88aafe7bb6"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:42cb296636fcc8b0644486d15c12376cb9fa75443e00fb25de0b8602e64c1714"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0a55554a2fa0d408816b3b5cedf0045f4b8e1a6065aec45849de2d6f3f8e9786"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:c083af607d2515612056a31f0a8d9e0fcb5876b7bfc0abad3ecd275bc4ebc2d5"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:87d1351268731db79e0f8e745d92493ee2841c974128ef629dc518b937d9194c"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:bd8f7df7d12c2db9fab40bdd87a7c09b1530128315d047a086fa3ae3435cb3a8"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:c180f51afb394e165eafe4ac2936a14bee3eb10debc9d9e4db8958fe36afe711"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:8c622a5fe39a48f78944a87d4fb8a53ee07344641b0562c540d840748571b811"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-win32.whl", hash = "sha256:db364eca23f876da6f9e16c9da0df51aa4f104a972735574842618b8c6d999d4"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-win_amd64.whl", hash = "sha256:86216b5cee4b06df986d214f664305142d9c76df9b6512be2738aa72a2048f99"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:6463effa3186ea09411d50efc7d85360b38d5f09b870c48e4600f63af490e56a"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:6c4caeef8fa63d06bd437cd4bdcf3ffefe6738fb1b25951440d80dc7df8c03ac"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:37e55c8e51c236f95b033f6fb391d7d7970ba5fe7ff453dad675e88cf303377a"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fb69256e180cb6c8a894fee62b3afebae785babc1ee98b81cdf68bbca1987f33"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ae5f4161f18c61806f411a13b0310bea87f987c7d2ecdbdaad0e94eb2e404238"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b2b0a0c0517616b6869869f8c581d4eb2dd83a4d79e0ebcb7d373ef9956aeb0a"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:45485e01ff4d3630ec0d9617310448a8702f70e9c01906b0d0118bdf9d124cf2"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:eb00ed941194665c332bf8e078baf037d6c35d7c4f3102ea2d4f16ca94a26dc8"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:2127566c664442652f024c837091890cb1942c30937add288223dc895793f898"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:a50aebfa173e157099939b17f18600f72f84eed3049e743b68ad15bd69b6bf99"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:4d0d1650369165a14e14e1e47b372cfcb31d6ab44e6e33cb2d4e57265290044d"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:923c0c831b7cfcb071580d3f46c4baf50f174be571576556269530f4bbd79d04"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:06a81e93cd441c56a9b65d8e1d043daeb97a3d0856d177d5c90ba85acb3db087"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-win32.whl", hash = "sha256:6ef1d82a3af9d3eecdba2321dc1b3c238245d890843e040e41e470ffa64c3e25"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-win_amd64.whl", hash = "sha256:eb8821e09e916165e160797a6c17edda0679379a4be5c716c260e836e122f54b"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:c235ebd9baae02f1b77bcea61bce332cb4331dc3617d254df3323aa01ab47bd4"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:5b4c145409bef602a690e7cfad0a15a55c13320ff7a3ad7ca59c13bb8ba4d45d"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:68d1f8a9e9e37c1223b656399be5d6b448dea850bed7d0f87a8311f1ff3dabb0"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:22afcb9f253dac0696b5a4be4a1c0f8762f8239e21b99680099abd9b2b1b2269"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e27ad930a842b4c5eb8ac0016b0a54f5aebbe679340c26101df33424142c143c"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1f79682fbe303db92bc2b1136016a38a42e835d932bab5b3b1bfcfbf0640e519"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b261ccdec7821281dade748d088bb6e9b69e6d15b30652b74cbbac25e280b796"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:122c7fa62b130ed55f8f285bfd56d5f4b4a5b503609d181f9ad85e55c89f4185"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:d0eccceffcb53201b5bfebb52600a5fb483a20b61da9dbc885f8b103cbe7598c"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:9f96df6923e21816da7e0ad3fd47dd8f94b2a5ce594e00677c0013018b813458"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:7f04c839ed0b6b98b1a7501a002144b76c18fb1c1850c8b98d458ac269e26ed2"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:34d1c8da1e78d2e001f363791c98a272bb734000fcef47a491c1e3b0505657a8"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:ff8fa367d09b717b2a17a052544193ad76cd49979c805768879cb63d9ca50561"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-win32.whl", hash = "sha256:aed38f6e4fb3f5d6bf81bfa990a07806be9d83cf7bacef998ab1a9bd660a581f"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-win_amd64.whl", hash = "sha256:b01b88d45a6fcb69667cd6d2f7a9aeb4bf53760d7fc536bf679ec94fe9f3ff3d"}, - {file = "charset_normalizer-3.3.2-py3-none-any.whl", hash = "sha256:3e4d1f6587322d2788836a99c69062fbb091331ec940e02d12d179c1d53e25fc"}, + {file = "charset_normalizer-3.4.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:4f9fc98dad6c2eaa32fc3af1417d95b5e3d08aff968df0cd320066def971f9a6"}, + {file = "charset_normalizer-3.4.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:0de7b687289d3c1b3e8660d0741874abe7888100efe14bd0f9fd7141bcbda92b"}, + {file = "charset_normalizer-3.4.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:5ed2e36c3e9b4f21dd9422f6893dec0abf2cca553af509b10cd630f878d3eb99"}, + {file = "charset_normalizer-3.4.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:40d3ff7fc90b98c637bda91c89d51264a3dcf210cade3a2c6f838c7268d7a4ca"}, + {file = "charset_normalizer-3.4.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1110e22af8ca26b90bd6364fe4c763329b0ebf1ee213ba32b68c73de5752323d"}, + {file = "charset_normalizer-3.4.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:86f4e8cca779080f66ff4f191a685ced73d2f72d50216f7112185dc02b90b9b7"}, + {file = "charset_normalizer-3.4.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7f683ddc7eedd742e2889d2bfb96d69573fde1d92fcb811979cdb7165bb9c7d3"}, + {file = "charset_normalizer-3.4.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:27623ba66c183eca01bf9ff833875b459cad267aeeb044477fedac35e19ba907"}, + {file = "charset_normalizer-3.4.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:f606a1881d2663630ea5b8ce2efe2111740df4b687bd78b34a8131baa007f79b"}, + {file = "charset_normalizer-3.4.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:0b309d1747110feb25d7ed6b01afdec269c647d382c857ef4663bbe6ad95a912"}, + {file = "charset_normalizer-3.4.0-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:136815f06a3ae311fae551c3df1f998a1ebd01ddd424aa5603a4336997629e95"}, + {file = "charset_normalizer-3.4.0-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:14215b71a762336254351b00ec720a8e85cada43b987da5a042e4ce3e82bd68e"}, + {file = "charset_normalizer-3.4.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:79983512b108e4a164b9c8d34de3992f76d48cadc9554c9e60b43f308988aabe"}, + {file = "charset_normalizer-3.4.0-cp310-cp310-win32.whl", hash = "sha256:c94057af19bc953643a33581844649a7fdab902624d2eb739738a30e2b3e60fc"}, + {file = "charset_normalizer-3.4.0-cp310-cp310-win_amd64.whl", hash = "sha256:55f56e2ebd4e3bc50442fbc0888c9d8c94e4e06a933804e2af3e89e2f9c1c749"}, + {file = "charset_normalizer-3.4.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:0d99dd8ff461990f12d6e42c7347fd9ab2532fb70e9621ba520f9e8637161d7c"}, + {file = "charset_normalizer-3.4.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c57516e58fd17d03ebe67e181a4e4e2ccab1168f8c2976c6a334d4f819fe5944"}, + {file = "charset_normalizer-3.4.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:6dba5d19c4dfab08e58d5b36304b3f92f3bd5d42c1a3fa37b5ba5cdf6dfcbcee"}, + {file = "charset_normalizer-3.4.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bf4475b82be41b07cc5e5ff94810e6a01f276e37c2d55571e3fe175e467a1a1c"}, + {file = "charset_normalizer-3.4.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ce031db0408e487fd2775d745ce30a7cd2923667cf3b69d48d219f1d8f5ddeb6"}, + {file = "charset_normalizer-3.4.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8ff4e7cdfdb1ab5698e675ca622e72d58a6fa2a8aa58195de0c0061288e6e3ea"}, + {file = "charset_normalizer-3.4.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3710a9751938947e6327ea9f3ea6332a09bf0ba0c09cae9cb1f250bd1f1549bc"}, + {file = "charset_normalizer-3.4.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:82357d85de703176b5587dbe6ade8ff67f9f69a41c0733cf2425378b49954de5"}, + {file = "charset_normalizer-3.4.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:47334db71978b23ebcf3c0f9f5ee98b8d65992b65c9c4f2d34c2eaf5bcaf0594"}, + {file = "charset_normalizer-3.4.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:8ce7fd6767a1cc5a92a639b391891bf1c268b03ec7e021c7d6d902285259685c"}, + {file = "charset_normalizer-3.4.0-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:f1a2f519ae173b5b6a2c9d5fa3116ce16e48b3462c8b96dfdded11055e3d6365"}, + {file = "charset_normalizer-3.4.0-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:63bc5c4ae26e4bc6be6469943b8253c0fd4e4186c43ad46e713ea61a0ba49129"}, + {file = "charset_normalizer-3.4.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:bcb4f8ea87d03bc51ad04add8ceaf9b0f085ac045ab4d74e73bbc2dc033f0236"}, + {file = "charset_normalizer-3.4.0-cp311-cp311-win32.whl", hash = "sha256:9ae4ef0b3f6b41bad6366fb0ea4fc1d7ed051528e113a60fa2a65a9abb5b1d99"}, + {file = "charset_normalizer-3.4.0-cp311-cp311-win_amd64.whl", hash = "sha256:cee4373f4d3ad28f1ab6290684d8e2ebdb9e7a1b74fdc39e4c211995f77bec27"}, + {file = "charset_normalizer-3.4.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:0713f3adb9d03d49d365b70b84775d0a0d18e4ab08d12bc46baa6132ba78aaf6"}, + {file = "charset_normalizer-3.4.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:de7376c29d95d6719048c194a9cf1a1b0393fbe8488a22008610b0361d834ecf"}, + {file = "charset_normalizer-3.4.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:4a51b48f42d9358460b78725283f04bddaf44a9358197b889657deba38f329db"}, + {file = "charset_normalizer-3.4.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b295729485b06c1a0683af02a9e42d2caa9db04a373dc38a6a58cdd1e8abddf1"}, + {file = "charset_normalizer-3.4.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ee803480535c44e7f5ad00788526da7d85525cfefaf8acf8ab9a310000be4b03"}, + {file = "charset_normalizer-3.4.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3d59d125ffbd6d552765510e3f31ed75ebac2c7470c7274195b9161a32350284"}, + {file = "charset_normalizer-3.4.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8cda06946eac330cbe6598f77bb54e690b4ca93f593dee1568ad22b04f347c15"}, + {file = "charset_normalizer-3.4.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:07afec21bbbbf8a5cc3651aa96b980afe2526e7f048fdfb7f1014d84acc8b6d8"}, + {file = "charset_normalizer-3.4.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:6b40e8d38afe634559e398cc32b1472f376a4099c75fe6299ae607e404c033b2"}, + {file = "charset_normalizer-3.4.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:b8dcd239c743aa2f9c22ce674a145e0a25cb1566c495928440a181ca1ccf6719"}, + {file = "charset_normalizer-3.4.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:84450ba661fb96e9fd67629b93d2941c871ca86fc38d835d19d4225ff946a631"}, + {file = "charset_normalizer-3.4.0-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:44aeb140295a2f0659e113b31cfe92c9061622cadbc9e2a2f7b8ef6b1e29ef4b"}, + {file = "charset_normalizer-3.4.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:1db4e7fefefd0f548d73e2e2e041f9df5c59e178b4c72fbac4cc6f535cfb1565"}, + {file = "charset_normalizer-3.4.0-cp312-cp312-win32.whl", hash = "sha256:5726cf76c982532c1863fb64d8c6dd0e4c90b6ece9feb06c9f202417a31f7dd7"}, + {file = "charset_normalizer-3.4.0-cp312-cp312-win_amd64.whl", hash = "sha256:b197e7094f232959f8f20541ead1d9862ac5ebea1d58e9849c1bf979255dfac9"}, + {file = "charset_normalizer-3.4.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:dd4eda173a9fcccb5f2e2bd2a9f423d180194b1bf17cf59e3269899235b2a114"}, + {file = "charset_normalizer-3.4.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:e9e3c4c9e1ed40ea53acf11e2a386383c3304212c965773704e4603d589343ed"}, + {file = "charset_normalizer-3.4.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:92a7e36b000bf022ef3dbb9c46bfe2d52c047d5e3f3343f43204263c5addc250"}, + {file = "charset_normalizer-3.4.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:54b6a92d009cbe2fb11054ba694bc9e284dad30a26757b1e372a1fdddaf21920"}, + {file = "charset_normalizer-3.4.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1ffd9493de4c922f2a38c2bf62b831dcec90ac673ed1ca182fe11b4d8e9f2a64"}, + {file = "charset_normalizer-3.4.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:35c404d74c2926d0287fbd63ed5d27eb911eb9e4a3bb2c6d294f3cfd4a9e0c23"}, + {file = "charset_normalizer-3.4.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4796efc4faf6b53a18e3d46343535caed491776a22af773f366534056c4e1fbc"}, + {file = "charset_normalizer-3.4.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e7fdd52961feb4c96507aa649550ec2a0d527c086d284749b2f582f2d40a2e0d"}, + {file = "charset_normalizer-3.4.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:92db3c28b5b2a273346bebb24857fda45601aef6ae1c011c0a997106581e8a88"}, + {file = "charset_normalizer-3.4.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:ab973df98fc99ab39080bfb0eb3a925181454d7c3ac8a1e695fddfae696d9e90"}, + {file = "charset_normalizer-3.4.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:4b67fdab07fdd3c10bb21edab3cbfe8cf5696f453afce75d815d9d7223fbe88b"}, + {file = "charset_normalizer-3.4.0-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:aa41e526a5d4a9dfcfbab0716c7e8a1b215abd3f3df5a45cf18a12721d31cb5d"}, + {file = "charset_normalizer-3.4.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:ffc519621dce0c767e96b9c53f09c5d215578e10b02c285809f76509a3931482"}, + {file = "charset_normalizer-3.4.0-cp313-cp313-win32.whl", hash = "sha256:f19c1585933c82098c2a520f8ec1227f20e339e33aca8fa6f956f6691b784e67"}, + {file = "charset_normalizer-3.4.0-cp313-cp313-win_amd64.whl", hash = "sha256:707b82d19e65c9bd28b81dde95249b07bf9f5b90ebe1ef17d9b57473f8a64b7b"}, + {file = "charset_normalizer-3.4.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:dbe03226baf438ac4fda9e2d0715022fd579cb641c4cf639fa40d53b2fe6f3e2"}, + {file = "charset_normalizer-3.4.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dd9a8bd8900e65504a305bf8ae6fa9fbc66de94178c420791d0293702fce2df7"}, + {file = "charset_normalizer-3.4.0-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b8831399554b92b72af5932cdbbd4ddc55c55f631bb13ff8fe4e6536a06c5c51"}, + {file = "charset_normalizer-3.4.0-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a14969b8691f7998e74663b77b4c36c0337cb1df552da83d5c9004a93afdb574"}, + {file = "charset_normalizer-3.4.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dcaf7c1524c0542ee2fc82cc8ec337f7a9f7edee2532421ab200d2b920fc97cf"}, + {file = "charset_normalizer-3.4.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:425c5f215d0eecee9a56cdb703203dda90423247421bf0d67125add85d0c4455"}, + {file = "charset_normalizer-3.4.0-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:d5b054862739d276e09928de37c79ddeec42a6e1bfc55863be96a36ba22926f6"}, + {file = "charset_normalizer-3.4.0-cp37-cp37m-musllinux_1_2_i686.whl", hash = "sha256:f3e73a4255342d4eb26ef6df01e3962e73aa29baa3124a8e824c5d3364a65748"}, + {file = "charset_normalizer-3.4.0-cp37-cp37m-musllinux_1_2_ppc64le.whl", hash = "sha256:2f6c34da58ea9c1a9515621f4d9ac379871a8f21168ba1b5e09d74250de5ad62"}, + {file = "charset_normalizer-3.4.0-cp37-cp37m-musllinux_1_2_s390x.whl", hash = "sha256:f09cb5a7bbe1ecae6e87901a2eb23e0256bb524a79ccc53eb0b7629fbe7677c4"}, + {file = "charset_normalizer-3.4.0-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:0099d79bdfcf5c1f0c2c72f91516702ebf8b0b8ddd8905f97a8aecf49712c621"}, + {file = "charset_normalizer-3.4.0-cp37-cp37m-win32.whl", hash = "sha256:9c98230f5042f4945f957d006edccc2af1e03ed5e37ce7c373f00a5a4daa6149"}, + {file = "charset_normalizer-3.4.0-cp37-cp37m-win_amd64.whl", hash = "sha256:62f60aebecfc7f4b82e3f639a7d1433a20ec32824db2199a11ad4f5e146ef5ee"}, + {file = "charset_normalizer-3.4.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:af73657b7a68211996527dbfeffbb0864e043d270580c5aef06dc4b659a4b578"}, + {file = "charset_normalizer-3.4.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:cab5d0b79d987c67f3b9e9c53f54a61360422a5a0bc075f43cab5621d530c3b6"}, + {file = "charset_normalizer-3.4.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:9289fd5dddcf57bab41d044f1756550f9e7cf0c8e373b8cdf0ce8773dc4bd417"}, + {file = "charset_normalizer-3.4.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6b493a043635eb376e50eedf7818f2f322eabbaa974e948bd8bdd29eb7ef2a51"}, + {file = "charset_normalizer-3.4.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9fa2566ca27d67c86569e8c85297aaf413ffab85a8960500f12ea34ff98e4c41"}, + {file = "charset_normalizer-3.4.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a8e538f46104c815be19c975572d74afb53f29650ea2025bbfaef359d2de2f7f"}, + {file = "charset_normalizer-3.4.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6fd30dc99682dc2c603c2b315bded2799019cea829f8bf57dc6b61efde6611c8"}, + {file = "charset_normalizer-3.4.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2006769bd1640bdf4d5641c69a3d63b71b81445473cac5ded39740a226fa88ab"}, + {file = "charset_normalizer-3.4.0-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:dc15e99b2d8a656f8e666854404f1ba54765871104e50c8e9813af8a7db07f12"}, + {file = "charset_normalizer-3.4.0-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:ab2e5bef076f5a235c3774b4f4028a680432cded7cad37bba0fd90d64b187d19"}, + {file = "charset_normalizer-3.4.0-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:4ec9dd88a5b71abfc74e9df5ebe7921c35cbb3b641181a531ca65cdb5e8e4dea"}, + {file = "charset_normalizer-3.4.0-cp38-cp38-musllinux_1_2_s390x.whl", hash = "sha256:43193c5cda5d612f247172016c4bb71251c784d7a4d9314677186a838ad34858"}, + {file = "charset_normalizer-3.4.0-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:aa693779a8b50cd97570e5a0f343538a8dbd3e496fa5dcb87e29406ad0299654"}, + {file = "charset_normalizer-3.4.0-cp38-cp38-win32.whl", hash = "sha256:7706f5850360ac01d80c89bcef1640683cc12ed87f42579dab6c5d3ed6888613"}, + {file = "charset_normalizer-3.4.0-cp38-cp38-win_amd64.whl", hash = "sha256:c3e446d253bd88f6377260d07c895816ebf33ffffd56c1c792b13bff9c3e1ade"}, + {file = "charset_normalizer-3.4.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:980b4f289d1d90ca5efcf07958d3eb38ed9c0b7676bf2831a54d4f66f9c27dfa"}, + {file = "charset_normalizer-3.4.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:f28f891ccd15c514a0981f3b9db9aa23d62fe1a99997512b0491d2ed323d229a"}, + {file = "charset_normalizer-3.4.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:a8aacce6e2e1edcb6ac625fb0f8c3a9570ccc7bfba1f63419b3769ccf6a00ed0"}, + {file = "charset_normalizer-3.4.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bd7af3717683bea4c87acd8c0d3d5b44d56120b26fd3f8a692bdd2d5260c620a"}, + {file = "charset_normalizer-3.4.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5ff2ed8194587faf56555927b3aa10e6fb69d931e33953943bc4f837dfee2242"}, + {file = "charset_normalizer-3.4.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e91f541a85298cf35433bf66f3fab2a4a2cff05c127eeca4af174f6d497f0d4b"}, + {file = "charset_normalizer-3.4.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:309a7de0a0ff3040acaebb35ec45d18db4b28232f21998851cfa709eeff49d62"}, + {file = "charset_normalizer-3.4.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:285e96d9d53422efc0d7a17c60e59f37fbf3dfa942073f666db4ac71e8d726d0"}, + {file = "charset_normalizer-3.4.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:5d447056e2ca60382d460a604b6302d8db69476fd2015c81e7c35417cfabe4cd"}, + {file = "charset_normalizer-3.4.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:20587d20f557fe189b7947d8e7ec5afa110ccf72a3128d61a2a387c3313f46be"}, + {file = "charset_normalizer-3.4.0-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:130272c698667a982a5d0e626851ceff662565379baf0ff2cc58067b81d4f11d"}, + {file = "charset_normalizer-3.4.0-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:ab22fbd9765e6954bc0bcff24c25ff71dcbfdb185fcdaca49e81bac68fe724d3"}, + {file = "charset_normalizer-3.4.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:7782afc9b6b42200f7362858f9e73b1f8316afb276d316336c0ec3bd73312742"}, + {file = "charset_normalizer-3.4.0-cp39-cp39-win32.whl", hash = "sha256:2de62e8801ddfff069cd5c504ce3bc9672b23266597d4e4f50eda28846c322f2"}, + {file = "charset_normalizer-3.4.0-cp39-cp39-win_amd64.whl", hash = "sha256:95c3c157765b031331dd4db3c775e58deaee050a3042fcad72cbc4189d7c8dca"}, + {file = "charset_normalizer-3.4.0-py3-none-any.whl", hash = "sha256:fe9f97feb71aa9896b81973a7bbada8c49501dc73e58a10fcef6663af95e5079"}, + {file = "charset_normalizer-3.4.0.tar.gz", hash = "sha256:223217c3d4f82c3ac5e29032b3f1c2eb0fb591b72161f86d93f5719079dae93e"}, ] [[package]] name = "googletrans" version = "3.1.0a0" description = "Free Google Translate API for Python. Translates totally free of charge." +category = "main" optional = false python-versions = ">=3.6" files = [ @@ -138,6 +157,7 @@ httpx = "0.13.3" name = "h11" version = "0.9.0" description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1" +category = "main" optional = false python-versions = "*" files = [ @@ -149,6 +169,7 @@ files = [ name = "h2" version = "3.2.0" description = "HTTP/2 State-Machine based protocol implementation" +category = "main" optional = false python-versions = "*" files = [ @@ -164,6 +185,7 @@ hyperframe = ">=5.2.0,<6" name = "hpack" version = "3.0.0" description = "Pure-Python HPACK header compression" +category = "main" optional = false python-versions = "*" files = [ @@ -175,6 +197,7 @@ files = [ name = "hstspreload" version = "2024.10.1" description = "Chromium HSTS Preload list as a Python package" +category = "main" optional = false python-versions = ">=3.6" files = [ @@ -186,6 +209,7 @@ files = [ name = "httpcore" version = "0.9.1" description = "A minimal low-level HTTP client." +category = "main" optional = false python-versions = ">=3.6" files = [ @@ -195,13 +219,14 @@ files = [ [package.dependencies] h11 = ">=0.8,<0.10" -h2 = "==3.*" -sniffio = "==1.*" +h2 = ">=3.0.0,<4.0.0" +sniffio = ">=1.0.0,<2.0.0" [[package]] name = "httpx" version = "0.13.3" description = "The next generation HTTP client." +category = "main" optional = false python-versions = ">=3.6" files = [ @@ -211,10 +236,10 @@ files = [ [package.dependencies] certifi = "*" -chardet = "==3.*" +chardet = ">=3.0.0,<4.0.0" hstspreload = "*" -httpcore = "==0.9.*" -idna = "==2.*" +httpcore = ">=0.9.0,<0.10.0" +idna = ">=2.0.0,<3.0.0" rfc3986 = ">=1.3,<2" sniffio = "*" @@ -222,6 +247,7 @@ sniffio = "*" name = "hyperframe" version = "5.2.0" description = "HTTP/2 framing layer for Python" +category = "main" optional = false python-versions = "*" files = [ @@ -233,6 +259,7 @@ files = [ name = "idna" version = "2.10" description = "Internationalized Domain Names in Applications (IDNA)" +category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" files = [ @@ -244,6 +271,7 @@ files = [ name = "lxml" version = "5.3.0" description = "Powerful and Pythonic XML processing library combining libxml2/libxslt with the ElementTree API." +category = "main" optional = false python-versions = ">=3.6" files = [ @@ -398,6 +426,7 @@ source = ["Cython (>=3.0.11)"] name = "polib" version = "1.1.1" description = "A library to manipulate gettext files (po and mo files)." +category = "main" optional = false python-versions = "*" files = [ @@ -409,6 +438,7 @@ files = [ name = "requests" version = "2.31.0" description = "Python HTTP for Humans." +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -430,6 +460,7 @@ use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] name = "rfc3986" version = "1.5.0" description = "Validating URI References per RFC 3986" +category = "main" optional = false python-versions = "*" files = [ @@ -444,6 +475,7 @@ idna2008 = ["idna"] name = "sniffio" version = "1.3.1" description = "Sniff out which async library your code is running under" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -455,6 +487,7 @@ files = [ name = "translate-toolkit" version = "3.8.1" description = "Tools and API for translation and localization engineering." +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -485,6 +518,7 @@ yaml = ["ruamel.yaml (==0.17.21)"] name = "urllib3" version = "2.2.3" description = "HTTP library with thread-safe connection pooling, file post, and more." +category = "main" optional = false python-versions = ">=3.8" files = [ diff --git a/c-api/code.po b/c-api/code.po index 79fec6db3e..19d27d2885 100644 --- a/c-api/code.po +++ b/c-api/code.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-09 00:13+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -48,123 +48,127 @@ msgid "" msgstr "" #: ../../c-api/code.rst:35 -msgid "Return the number of free variables in a code object." +msgid "" +"Return the number of :term:`free (closure) variables ` in " +"a code object." msgstr "" -#: ../../c-api/code.rst:39 -msgid "Return the position of the first free variable in a code object." +#: ../../c-api/code.rst:40 +msgid "" +"Return the position of the first :term:`free (closure) variable ` in a code object." msgstr "" -#: ../../c-api/code.rst:43 +#: ../../c-api/code.rst:45 msgid "" "Renamed from ``PyCode_GetFirstFree`` as part of :ref:`unstable-c-api`. The " "old name is deprecated, but will remain available until the signature " "changes again." msgstr "" -#: ../../c-api/code.rst:49 +#: ../../c-api/code.rst:51 msgid "" "Return a new code object. If you need a dummy code object to create a " "frame, use :c:func:`PyCode_NewEmpty` instead." msgstr "" -#: ../../c-api/code.rst:52 +#: ../../c-api/code.rst:54 msgid "" "Since the definition of the bytecode changes often, calling :c:func:" "`PyUnstable_Code_New` directly can bind you to a precise Python version." msgstr "" -#: ../../c-api/code.rst:55 +#: ../../c-api/code.rst:57 msgid "" "The many arguments of this function are inter-dependent in complex ways, " "meaning that subtle changes to values are likely to result in incorrect " "execution or VM crashes. Use this function only with extreme care." msgstr "" -#: ../../c-api/code.rst:59 +#: ../../c-api/code.rst:61 msgid "Added ``qualname`` and ``exceptiontable`` parameters." msgstr "新增 ``qualname`` 和 ``exceptiontable`` 參數。" -#: ../../c-api/code.rst:66 +#: ../../c-api/code.rst:68 msgid "" "Renamed from ``PyCode_New`` as part of :ref:`unstable-c-api`. The old name " "is deprecated, but will remain available until the signature changes again." msgstr "" -#: ../../c-api/code.rst:72 +#: ../../c-api/code.rst:74 msgid "" "Similar to :c:func:`PyUnstable_Code_New`, but with an extra " "\"posonlyargcount\" for positional-only arguments. The same caveats that " "apply to ``PyUnstable_Code_New`` also apply to this function." msgstr "" -#: ../../c-api/code.rst:77 +#: ../../c-api/code.rst:79 msgid "as ``PyCode_NewWithPosOnlyArgs``" msgstr "" -#: ../../c-api/code.rst:79 +#: ../../c-api/code.rst:81 msgid "Added ``qualname`` and ``exceptiontable`` parameters." msgstr "新增 ``qualname`` 和 ``exceptiontable`` 參數。" -#: ../../c-api/code.rst:84 +#: ../../c-api/code.rst:86 msgid "" "Renamed to ``PyUnstable_Code_NewWithPosOnlyArgs``. The old name is " "deprecated, but will remain available until the signature changes again." msgstr "" -#: ../../c-api/code.rst:90 +#: ../../c-api/code.rst:92 msgid "" "Return a new empty code object with the specified filename, function name, " "and first line number. The resulting code object will raise an ``Exception`` " "if executed." msgstr "" -#: ../../c-api/code.rst:96 +#: ../../c-api/code.rst:98 msgid "" "Return the line number of the instruction that occurs on or before " "``byte_offset`` and ends after it. If you just need the line number of a " "frame, use :c:func:`PyFrame_GetLineNumber` instead." msgstr "" -#: ../../c-api/code.rst:99 +#: ../../c-api/code.rst:101 msgid "" "For efficiently iterating over the line numbers in a code object, use :pep:" "`the API described in PEP 626 <0626#out-of-process-debuggers-and-profilers>`." msgstr "" -#: ../../c-api/code.rst:104 +#: ../../c-api/code.rst:106 msgid "" "Sets the passed ``int`` pointers to the source code line and column numbers " "for the instruction at ``byte_offset``. Sets the value to ``0`` when " "information is not available for any particular element." msgstr "" -#: ../../c-api/code.rst:108 +#: ../../c-api/code.rst:110 msgid "Returns ``1`` if the function succeeds and 0 otherwise." msgstr "" -#: ../../c-api/code.rst:114 +#: ../../c-api/code.rst:116 msgid "" "Equivalent to the Python code ``getattr(co, 'co_code')``. Returns a strong " "reference to a :c:type:`PyBytesObject` representing the bytecode in a code " "object. On error, ``NULL`` is returned and an exception is raised." msgstr "" -#: ../../c-api/code.rst:119 +#: ../../c-api/code.rst:121 msgid "" "This ``PyBytesObject`` may be created on-demand by the interpreter and does " "not necessarily represent the bytecode actually executed by CPython. The " "primary use case for this function is debuggers and profilers." msgstr "" -#: ../../c-api/code.rst:127 +#: ../../c-api/code.rst:129 msgid "" "Equivalent to the Python code ``getattr(co, 'co_varnames')``. Returns a new " "reference to a :c:type:`PyTupleObject` containing the names of the local " "variables. On error, ``NULL`` is returned and an exception is raised." msgstr "" -#: ../../c-api/code.rst:136 +#: ../../c-api/code.rst:138 msgid "" "Equivalent to the Python code ``getattr(co, 'co_cellvars')``. Returns a new " "reference to a :c:type:`PyTupleObject` containing the names of the local " @@ -172,14 +176,15 @@ msgid "" "returned and an exception is raised." msgstr "" -#: ../../c-api/code.rst:145 +#: ../../c-api/code.rst:147 msgid "" "Equivalent to the Python code ``getattr(co, 'co_freevars')``. Returns a new " -"reference to a :c:type:`PyTupleObject` containing the names of the free " -"variables. On error, ``NULL`` is returned and an exception is raised." +"reference to a :c:type:`PyTupleObject` containing the names of the :term:" +"`free (closure) variables `. On error, ``NULL`` is " +"returned and an exception is raised." msgstr "" -#: ../../c-api/code.rst:153 +#: ../../c-api/code.rst:156 msgid "" "Register *callback* as a code object watcher for the current interpreter. " "Return an ID which may be passed to :c:func:`PyCode_ClearWatcher`. In case " @@ -187,7 +192,7 @@ msgid "" "exception." msgstr "" -#: ../../c-api/code.rst:162 +#: ../../c-api/code.rst:165 msgid "" "Clear watcher identified by *watcher_id* previously returned from :c:func:" "`PyCode_AddWatcher` for the current interpreter. Return ``0`` on success, or " @@ -195,17 +200,17 @@ msgid "" "never registered.)" msgstr "" -#: ../../c-api/code.rst:171 +#: ../../c-api/code.rst:174 msgid "" "Enumeration of possible code object watcher events: - " "``PY_CODE_EVENT_CREATE`` - ``PY_CODE_EVENT_DESTROY``" msgstr "" -#: ../../c-api/code.rst:179 +#: ../../c-api/code.rst:182 msgid "Type of a code object watcher callback function." msgstr "" -#: ../../c-api/code.rst:181 +#: ../../c-api/code.rst:184 msgid "" "If *event* is ``PY_CODE_EVENT_CREATE``, then the callback is invoked after " "`co` has been fully initialized. Otherwise, the callback is invoked before " @@ -213,7 +218,7 @@ msgid "" "inspected." msgstr "" -#: ../../c-api/code.rst:186 +#: ../../c-api/code.rst:189 msgid "" "If *event* is ``PY_CODE_EVENT_DESTROY``, taking a reference in the callback " "to the about-to-be-destroyed code object will resurrect it and prevent it " @@ -221,7 +226,7 @@ msgid "" "later, any watcher callbacks active at that time will be called again." msgstr "" -#: ../../c-api/code.rst:191 +#: ../../c-api/code.rst:194 msgid "" "Users of this API should not rely on internal runtime implementation " "details. Such details may include, but are not limited to, the exact order " @@ -231,14 +236,14 @@ msgid "" "the Python code being executed." msgstr "" -#: ../../c-api/code.rst:198 +#: ../../c-api/code.rst:201 msgid "" "If the callback sets an exception, it must return ``-1``; this exception " "will be printed as an unraisable exception using :c:func:" "`PyErr_WriteUnraisable`. Otherwise it should return ``0``." msgstr "" -#: ../../c-api/code.rst:202 +#: ../../c-api/code.rst:205 msgid "" "There may already be a pending exception set on entry to the callback. In " "this case, the callback should return ``0`` with the same exception still " @@ -247,85 +252,85 @@ msgid "" "it before returning." msgstr "" -#: ../../c-api/code.rst:212 +#: ../../c-api/code.rst:215 msgid "Extra information" msgstr "" -#: ../../c-api/code.rst:214 +#: ../../c-api/code.rst:217 msgid "" "To support low-level extensions to frame evaluation, such as external just-" "in-time compilers, it is possible to attach arbitrary extra data to code " "objects." msgstr "" -#: ../../c-api/code.rst:218 +#: ../../c-api/code.rst:221 msgid "" "These functions are part of the unstable C API tier: this functionality is a " "CPython implementation detail, and the API may change without deprecation " "warnings." msgstr "" -#: ../../c-api/code.rst:224 +#: ../../c-api/code.rst:227 msgid "Return a new an opaque index value used to adding data to code objects." msgstr "" -#: ../../c-api/code.rst:226 +#: ../../c-api/code.rst:229 msgid "" "You generally call this function once (per interpreter) and use the result " "with ``PyCode_GetExtra`` and ``PyCode_SetExtra`` to manipulate data on " "individual code objects." msgstr "" -#: ../../c-api/code.rst:230 +#: ../../c-api/code.rst:233 msgid "" "If *free* is not ``NULL``: when a code object is deallocated, *free* will be " "called on non-``NULL`` data stored under the new index. Use :c:func:" "`Py_DecRef` when storing :c:type:`PyObject`." msgstr "" -#: ../../c-api/code.rst:236 +#: ../../c-api/code.rst:239 msgid "as ``_PyEval_RequestCodeExtraIndex``" msgstr "" -#: ../../c-api/code.rst:240 +#: ../../c-api/code.rst:243 msgid "" "Renamed to ``PyUnstable_Eval_RequestCodeExtraIndex``. The old private name " "is deprecated, but will be available until the API changes." msgstr "" -#: ../../c-api/code.rst:246 +#: ../../c-api/code.rst:249 msgid "" "Set *extra* to the extra data stored under the given index. Return 0 on " "success. Set an exception and return -1 on failure." msgstr "" -#: ../../c-api/code.rst:249 +#: ../../c-api/code.rst:252 msgid "" "If no data was set under the index, set *extra* to ``NULL`` and return 0 " "without setting an exception." msgstr "" -#: ../../c-api/code.rst:254 +#: ../../c-api/code.rst:257 msgid "as ``_PyCode_GetExtra``" msgstr "" -#: ../../c-api/code.rst:258 +#: ../../c-api/code.rst:261 msgid "" "Renamed to ``PyUnstable_Code_GetExtra``. The old private name is deprecated, " "but will be available until the API changes." msgstr "" -#: ../../c-api/code.rst:264 +#: ../../c-api/code.rst:267 msgid "" "Set the extra data stored under the given index to *extra*. Return 0 on " "success. Set an exception and return -1 on failure." msgstr "" -#: ../../c-api/code.rst:269 +#: ../../c-api/code.rst:272 msgid "as ``_PyCode_SetExtra``" msgstr "" -#: ../../c-api/code.rst:273 +#: ../../c-api/code.rst:276 msgid "" "Renamed to ``PyUnstable_Code_SetExtra``. The old private name is deprecated, " "but will be available until the API changes." @@ -343,22 +348,22 @@ msgstr "code(程式碼)" msgid "code object" msgstr "code object(程式碼物件)" -#: ../../c-api/code.rst:62 +#: ../../c-api/code.rst:64 msgid "PyCode_New (C function)" msgstr "PyCode_New(C 函式)" -#: ../../c-api/code.rst:75 +#: ../../c-api/code.rst:77 msgid "PyCode_NewWithPosOnlyArgs (C function)" msgstr "PyCode_NewWithPosOnlyArgs(C 函式)" -#: ../../c-api/code.rst:234 +#: ../../c-api/code.rst:237 msgid "_PyEval_RequestCodeExtraIndex (C function)" msgstr "_PyEval_RequestCodeExtraIndex(C 函式)" -#: ../../c-api/code.rst:252 +#: ../../c-api/code.rst:255 msgid "_PyCode_GetExtra (C function)" msgstr "_PyCode_GetExtra(C 函式)" -#: ../../c-api/code.rst:267 +#: ../../c-api/code.rst:270 msgid "_PyCode_SetExtra (C function)" msgstr "_PyCode_SetExtra(C 函式)" diff --git a/c-api/exceptions.po b/c-api/exceptions.po index faaa283f82..a2e93cc598 100644 --- a/c-api/exceptions.po +++ b/c-api/exceptions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-27 00:14+0000\n" +"POT-Creation-Date: 2024-10-11 00:13+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-" @@ -267,8 +267,8 @@ msgstr "" #: ../../c-api/exceptions.rst:234 ../../c-api/exceptions.rst:242 #: ../../c-api/exceptions.rst:253 ../../c-api/exceptions.rst:263 #: ../../c-api/exceptions.rst:271 ../../c-api/exceptions.rst:281 -msgid ":ref:`Availability `: Windows." -msgstr ":ref:`適用 `:Windows。" +msgid "Availability" +msgstr "" #: ../../c-api/exceptions.rst:239 msgid "" diff --git a/c-api/import.po b/c-api/import.po index 96b3529885..8f830d9e96 100644 --- a/c-api/import.po +++ b/c-api/import.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-10 00:13+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-" @@ -159,17 +159,17 @@ msgstr "" #: ../../c-api/import.rst:139 msgid "" -"The module's :attr:`__spec__` and :attr:`__loader__` will be set, if not set " -"already, with the appropriate values. The spec's loader will be set to the " -"module's ``__loader__`` (if set) and to an instance of :class:`~importlib." -"machinery.SourceFileLoader` otherwise." +"The module's :attr:`~module.__spec__` and :attr:`~module.__loader__` will be " +"set, if not set already, with the appropriate values. The spec's loader " +"will be set to the module's :attr:`!__loader__` (if set) and to an instance " +"of :class:`~importlib.machinery.SourceFileLoader` otherwise." msgstr "" #: ../../c-api/import.rst:144 msgid "" -"The module's :attr:`__file__` attribute will be set to the code object's :" -"attr:`~codeobject.co_filename`. If applicable, :attr:`__cached__` will also " -"be set." +"The module's :attr:`~module.__file__` attribute will be set to the code " +"object's :attr:`~codeobject.co_filename`. If applicable, :attr:`~module." +"__cached__` will also be set." msgstr "" #: ../../c-api/import.rst:148 @@ -192,14 +192,14 @@ msgstr "" #: ../../c-api/import.rst:157 msgid "" -"The setting of :attr:`__cached__` and :attr:`__loader__` is deprecated. See :" -"class:`~importlib.machinery.ModuleSpec` for alternatives." +"The setting of :attr:`~module.__cached__` and :attr:`~module.__loader__` is " +"deprecated. See :class:`~importlib.machinery.ModuleSpec` for alternatives." msgstr "" #: ../../c-api/import.rst:165 msgid "" -"Like :c:func:`PyImport_ExecCodeModule`, but the :attr:`__file__` attribute " -"of the module object is set to *pathname* if it is non-``NULL``." +"Like :c:func:`PyImport_ExecCodeModule`, but the :attr:`~module.__file__` " +"attribute of the module object is set to *pathname* if it is non-``NULL``." msgstr "" #: ../../c-api/import.rst:168 @@ -208,15 +208,15 @@ msgstr "也請見 :c:func:`PyImport_ExecCodeModuleWithPathnames`。" #: ../../c-api/import.rst:173 msgid "" -"Like :c:func:`PyImport_ExecCodeModuleEx`, but the :attr:`__cached__` " +"Like :c:func:`PyImport_ExecCodeModuleEx`, but the :attr:`~module.__cached__` " "attribute of the module object is set to *cpathname* if it is non-``NULL``. " "Of the three functions, this is the preferred one to use." msgstr "" #: ../../c-api/import.rst:179 msgid "" -"Setting :attr:`__cached__` is deprecated. See :class:`~importlib.machinery." -"ModuleSpec` for alternatives." +"Setting :attr:`~module.__cached__` is deprecated. See :class:`~importlib." +"machinery.ModuleSpec` for alternatives." msgstr "" #: ../../c-api/import.rst:186 diff --git a/c-api/init.po b/c-api/init.po index f06d0dbb97..4dbcd74843 100644 --- a/c-api/init.po +++ b/c-api/init.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 00:13+0000\n" +"POT-Creation-Date: 2024-10-11 00:13+0000\n" "PO-Revision-Date: 2023-04-24 20:49+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -25,14 +25,18 @@ msgid "Initialization, Finalization, and Threads" msgstr "" #: ../../c-api/init.rst:10 -msgid "See also :ref:`Python Initialization Configuration `." -msgstr "也請參見 :ref:`Python 初始化設定 `。" +msgid "" +"See :ref:`Python Initialization Configuration ` for details on " +"how to configure the interpreter prior to initialization." +msgstr "" +"關於如何在初始化之前設定直譯器的細節,請參見 :ref:`Python 初始化設定 `。" -#: ../../c-api/init.rst:15 +#: ../../c-api/init.rst:16 msgid "Before Python Initialization" msgstr "Python 初始化之前" -#: ../../c-api/init.rst:17 +#: ../../c-api/init.rst:18 msgid "" "In an application embedding Python, the :c:func:`Py_Initialize` function " "must be called before using any other Python/C API functions; with the " @@ -40,148 +44,186 @@ msgid "" "`." msgstr "" -#: ../../c-api/init.rst:22 +#: ../../c-api/init.rst:23 msgid "" "The following functions can be safely called before Python is initialized:" msgstr "" -#: ../../c-api/init.rst:24 +#: ../../c-api/init.rst:25 +msgid "Functions that initialize the interpreter:" +msgstr "" + +#: ../../c-api/init.rst:27 +msgid ":c:func:`Py_Initialize`" +msgstr ":c:func:`Py_Initialize`" + +#: ../../c-api/init.rst:28 +msgid ":c:func:`Py_InitializeEx`" +msgstr ":c:func:`Py_InitializeEx`" + +#: ../../c-api/init.rst:29 +msgid ":c:func:`Py_InitializeFromConfig`" +msgstr ":c:func:`Py_InitializeFromConfig`" + +#: ../../c-api/init.rst:30 +msgid ":c:func:`Py_BytesMain`" +msgstr ":c:func:`Py_BytesMain`" + +#: ../../c-api/init.rst:31 +msgid ":c:func:`Py_Main`" +msgstr ":c:func:`Py_Main`" + +#: ../../c-api/init.rst:32 +msgid "the runtime pre-initialization functions covered in :ref:`init-config`" +msgstr "" + +#: ../../c-api/init.rst:34 msgid "Configuration functions:" msgstr "" -#: ../../c-api/init.rst:26 +#: ../../c-api/init.rst:36 msgid ":c:func:`PyImport_AppendInittab`" msgstr ":c:func:`PyImport_AppendInittab`" -#: ../../c-api/init.rst:27 +#: ../../c-api/init.rst:37 msgid ":c:func:`PyImport_ExtendInittab`" msgstr ":c:func:`PyImport_ExtendInittab`" -#: ../../c-api/init.rst:28 +#: ../../c-api/init.rst:38 msgid ":c:func:`!PyInitFrozenExtensions`" msgstr ":c:func:`!PyInitFrozenExtensions`" -#: ../../c-api/init.rst:29 +#: ../../c-api/init.rst:39 msgid ":c:func:`PyMem_SetAllocator`" msgstr ":c:func:`PyMem_SetAllocator`" -#: ../../c-api/init.rst:30 +#: ../../c-api/init.rst:40 msgid ":c:func:`PyMem_SetupDebugHooks`" msgstr ":c:func:`PyMem_SetupDebugHooks`" -#: ../../c-api/init.rst:31 +#: ../../c-api/init.rst:41 msgid ":c:func:`PyObject_SetArenaAllocator`" msgstr ":c:func:`PyObject_SetArenaAllocator`" -#: ../../c-api/init.rst:32 +#: ../../c-api/init.rst:42 msgid ":c:func:`Py_SetProgramName`" msgstr ":c:func:`Py_SetProgramName`" -#: ../../c-api/init.rst:33 +#: ../../c-api/init.rst:43 msgid ":c:func:`Py_SetPythonHome`" msgstr ":c:func:`Py_SetPythonHome`" -#: ../../c-api/init.rst:34 +#: ../../c-api/init.rst:44 msgid ":c:func:`PySys_ResetWarnOptions`" msgstr ":c:func:`PySys_ResetWarnOptions`" -#: ../../c-api/init.rst:36 +#: ../../c-api/init.rst:45 +msgid "the configuration functions covered in :ref:`init-config`" +msgstr "" + +#: ../../c-api/init.rst:47 msgid "Informative functions:" msgstr "" -#: ../../c-api/init.rst:38 +#: ../../c-api/init.rst:49 ../../c-api/init.rst:57 msgid ":c:func:`Py_IsInitialized`" msgstr ":c:func:`Py_IsInitialized`" -#: ../../c-api/init.rst:39 +#: ../../c-api/init.rst:50 msgid ":c:func:`PyMem_GetAllocator`" msgstr ":c:func:`PyMem_GetAllocator`" -#: ../../c-api/init.rst:40 +#: ../../c-api/init.rst:51 msgid ":c:func:`PyObject_GetArenaAllocator`" msgstr ":c:func:`PyObject_GetArenaAllocator`" -#: ../../c-api/init.rst:41 +#: ../../c-api/init.rst:52 msgid ":c:func:`Py_GetBuildInfo`" msgstr ":c:func:`Py_GetBuildInfo`" -#: ../../c-api/init.rst:42 +#: ../../c-api/init.rst:53 msgid ":c:func:`Py_GetCompiler`" msgstr ":c:func:`Py_GetCompiler`" -#: ../../c-api/init.rst:43 +#: ../../c-api/init.rst:54 msgid ":c:func:`Py_GetCopyright`" msgstr ":c:func:`Py_GetCopyright`" -#: ../../c-api/init.rst:44 +#: ../../c-api/init.rst:55 msgid ":c:func:`Py_GetPlatform`" msgstr ":c:func:`Py_GetPlatform`" -#: ../../c-api/init.rst:45 +#: ../../c-api/init.rst:56 msgid ":c:func:`Py_GetVersion`" msgstr ":c:func:`Py_GetVersion`" -#: ../../c-api/init.rst:47 +#: ../../c-api/init.rst:59 msgid "Utilities:" msgstr "" -#: ../../c-api/init.rst:49 +#: ../../c-api/init.rst:61 msgid ":c:func:`Py_DecodeLocale`" msgstr ":c:func:`Py_DecodeLocale`" -#: ../../c-api/init.rst:51 +#: ../../c-api/init.rst:62 +msgid "" +"the status reporting and utility functions covered in :ref:`init-config`" +msgstr "" + +#: ../../c-api/init.rst:64 msgid "Memory allocators:" msgstr "" -#: ../../c-api/init.rst:53 +#: ../../c-api/init.rst:66 msgid ":c:func:`PyMem_RawMalloc`" msgstr ":c:func:`PyMem_RawMalloc`" -#: ../../c-api/init.rst:54 +#: ../../c-api/init.rst:67 msgid ":c:func:`PyMem_RawRealloc`" msgstr ":c:func:`PyMem_RawRealloc`" -#: ../../c-api/init.rst:55 +#: ../../c-api/init.rst:68 msgid ":c:func:`PyMem_RawCalloc`" msgstr ":c:func:`PyMem_RawCalloc`" -#: ../../c-api/init.rst:56 +#: ../../c-api/init.rst:69 msgid ":c:func:`PyMem_RawFree`" msgstr ":c:func:`PyMem_RawFree`" -#: ../../c-api/init.rst:58 +#: ../../c-api/init.rst:71 msgid "Synchronization:" msgstr "" -#: ../../c-api/init.rst:60 +#: ../../c-api/init.rst:73 msgid ":c:func:`PyMutex_Lock`" msgstr ":c:func:`PyMutex_Lock`" -#: ../../c-api/init.rst:61 +#: ../../c-api/init.rst:74 msgid ":c:func:`PyMutex_Unlock`" msgstr ":c:func:`PyMutex_Unlock`" -#: ../../c-api/init.rst:65 +#: ../../c-api/init.rst:78 msgid "" -"The following functions **should not be called** before :c:func:" -"`Py_Initialize`: :c:func:`Py_EncodeLocale`, :c:func:`Py_GetPath`, :c:func:" +"Despite their apparent similarity to some of the functions listed above, the " +"following functions **should not be called** before the interpreter has been " +"initialized: :c:func:`Py_EncodeLocale`, :c:func:`Py_GetPath`, :c:func:" "`Py_GetPrefix`, :c:func:`Py_GetExecPrefix`, :c:func:" "`Py_GetProgramFullPath`, :c:func:`Py_GetPythonHome`, :c:func:" -"`Py_GetProgramName` and :c:func:`PyEval_InitThreads`." +"`Py_GetProgramName`, :c:func:`PyEval_InitThreads`, and :c:func:`Py_RunMain`." msgstr "" -#: ../../c-api/init.rst:75 +#: ../../c-api/init.rst:90 msgid "Global configuration variables" msgstr "" -#: ../../c-api/init.rst:77 +#: ../../c-api/init.rst:92 msgid "" "Python has variables for the global configuration to control different " "features and options. By default, these flags are controlled by :ref:" "`command line options `." msgstr "" -#: ../../c-api/init.rst:81 +#: ../../c-api/init.rst:96 msgid "" "When a flag is set by an option, the value of the flag is the number of " "times that the option was set. For example, ``-b`` sets :c:data:" @@ -189,108 +231,108 @@ msgid "" "2." msgstr "" -#: ../../c-api/init.rst:87 +#: ../../c-api/init.rst:102 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "bytes_warning` should be used instead, see :ref:`Python Initialization " "Configuration `." msgstr "" -#: ../../c-api/init.rst:91 +#: ../../c-api/init.rst:106 msgid "" "Issue a warning when comparing :class:`bytes` or :class:`bytearray` with :" "class:`str` or :class:`bytes` with :class:`int`. Issue an error if greater " "or equal to ``2``." msgstr "" -#: ../../c-api/init.rst:95 +#: ../../c-api/init.rst:110 msgid "Set by the :option:`-b` option." msgstr "由 :option:`-b` 選項設定。" -#: ../../c-api/init.rst:101 +#: ../../c-api/init.rst:116 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "parser_debug` should be used instead, see :ref:`Python Initialization " "Configuration `." msgstr "" -#: ../../c-api/init.rst:105 +#: ../../c-api/init.rst:120 msgid "" "Turn on parser debugging output (for expert only, depending on compilation " "options)." msgstr "" -#: ../../c-api/init.rst:108 +#: ../../c-api/init.rst:123 msgid "" "Set by the :option:`-d` option and the :envvar:`PYTHONDEBUG` environment " "variable." msgstr "由 :option:`-d` 選項與 :envvar:`PYTHONDEBUG` 環境變數設定。" -#: ../../c-api/init.rst:115 +#: ../../c-api/init.rst:130 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "write_bytecode` should be used instead, see :ref:`Python Initialization " "Configuration `." msgstr "" -#: ../../c-api/init.rst:119 +#: ../../c-api/init.rst:134 msgid "" "If set to non-zero, Python won't try to write ``.pyc`` files on the import " "of source modules." msgstr "" -#: ../../c-api/init.rst:122 +#: ../../c-api/init.rst:137 msgid "" "Set by the :option:`-B` option and the :envvar:`PYTHONDONTWRITEBYTECODE` " "environment variable." msgstr "" "由 :option:`-B` 選項與 :envvar:`PYTHONDONTWRITEBYTECODE` 環境變數設定。" -#: ../../c-api/init.rst:129 +#: ../../c-api/init.rst:144 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "pathconfig_warnings` should be used instead, see :ref:`Python Initialization " "Configuration `." msgstr "" -#: ../../c-api/init.rst:133 +#: ../../c-api/init.rst:148 msgid "" "Suppress error messages when calculating the module search path in :c:func:" "`Py_GetPath`." msgstr "" -#: ../../c-api/init.rst:136 +#: ../../c-api/init.rst:151 msgid "Private flag used by ``_freeze_module`` and ``frozenmain`` programs." msgstr "" -#: ../../c-api/init.rst:142 +#: ../../c-api/init.rst:157 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "hash_seed` and :c:member:`PyConfig.use_hash_seed` should be used instead, " "see :ref:`Python Initialization Configuration `." msgstr "" -#: ../../c-api/init.rst:147 +#: ../../c-api/init.rst:162 msgid "" "Set to ``1`` if the :envvar:`PYTHONHASHSEED` environment variable is set to " "a non-empty string." msgstr "" "如果環境變數 :envvar:`PYTHONHASHSEED` 被設定為一個非空字串則設為 ``1``。" -#: ../../c-api/init.rst:150 +#: ../../c-api/init.rst:165 msgid "" "If the flag is non-zero, read the :envvar:`PYTHONHASHSEED` environment " "variable to initialize the secret hash seed." msgstr "" -#: ../../c-api/init.rst:157 +#: ../../c-api/init.rst:172 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "use_environment` should be used instead, see :ref:`Python Initialization " "Configuration `." msgstr "" -#: ../../c-api/init.rst:161 +#: ../../c-api/init.rst:176 msgid "" "Ignore all :envvar:`!PYTHON*` environment variables, e.g. :envvar:" "`PYTHONPATH` and :envvar:`PYTHONHOME`, that might be set." @@ -298,73 +340,73 @@ msgstr "" "忽略所有可能被設定的 :envvar:`!PYTHON*` 環境變數,例如 :envvar:`PYTHONPATH` " "與 :envvar:`PYTHONHOME`。" -#: ../../c-api/init.rst:164 +#: ../../c-api/init.rst:179 msgid "Set by the :option:`-E` and :option:`-I` options." msgstr "由 :option:`-E` 與 :option:`-I` 選項設定。" -#: ../../c-api/init.rst:170 +#: ../../c-api/init.rst:185 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "inspect` should be used instead, see :ref:`Python Initialization " "Configuration `." msgstr "" -#: ../../c-api/init.rst:174 +#: ../../c-api/init.rst:189 msgid "" "When a script is passed as first argument or the :option:`-c` option is " "used, enter interactive mode after executing the script or the command, even " "when :data:`sys.stdin` does not appear to be a terminal." msgstr "" -#: ../../c-api/init.rst:178 +#: ../../c-api/init.rst:193 msgid "" "Set by the :option:`-i` option and the :envvar:`PYTHONINSPECT` environment " "variable." msgstr "由 :option:`-i` 選項與 :envvar:`PYTHONINSPECT` 環境變數設定。" -#: ../../c-api/init.rst:185 +#: ../../c-api/init.rst:200 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "interactive` should be used instead, see :ref:`Python Initialization " "Configuration `." msgstr "" -#: ../../c-api/init.rst:189 +#: ../../c-api/init.rst:204 msgid "Set by the :option:`-i` option." msgstr "由 :option:`-i` 選項設定。" -#: ../../c-api/init.rst:195 +#: ../../c-api/init.rst:210 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "isolated` should be used instead, see :ref:`Python Initialization " "Configuration `." msgstr "" -#: ../../c-api/init.rst:199 +#: ../../c-api/init.rst:214 msgid "" "Run Python in isolated mode. In isolated mode :data:`sys.path` contains " "neither the script's directory nor the user's site-packages directory." msgstr "" -#: ../../c-api/init.rst:202 +#: ../../c-api/init.rst:217 msgid "Set by the :option:`-I` option." msgstr "由 :option:`-i` 選項設定。" -#: ../../c-api/init.rst:210 +#: ../../c-api/init.rst:225 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyPreConfig." "legacy_windows_fs_encoding` should be used instead, see :ref:`Python " "Initialization Configuration `." msgstr "" -#: ../../c-api/init.rst:214 +#: ../../c-api/init.rst:229 msgid "" "If the flag is non-zero, use the ``mbcs`` encoding with ``replace`` error " "handler, instead of the UTF-8 encoding with ``surrogatepass`` error handler, " "for the :term:`filesystem encoding and error handler`." msgstr "" -#: ../../c-api/init.rst:218 +#: ../../c-api/init.rst:233 msgid "" "Set to ``1`` if the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` environment " "variable is set to a non-empty string." @@ -372,45 +414,45 @@ msgstr "" "如果環境變數 :envvar:`PYTHONLEGACYWINDOWSFSENCODING` 被設定為一個非空字串則設" "為 ``1``。" -#: ../../c-api/init.rst:221 +#: ../../c-api/init.rst:236 msgid "See :pep:`529` for more details." msgstr "更多詳情請見 :pep:`529`。" -#: ../../c-api/init.rst:223 ../../c-api/init.rst:241 -msgid ":ref:`Availability `: Windows." -msgstr ":ref:`適用 `:Windows。" +#: ../../c-api/init.rst:238 ../../c-api/init.rst:256 +msgid "Availability" +msgstr "" -#: ../../c-api/init.rst:229 +#: ../../c-api/init.rst:244 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "legacy_windows_stdio` should be used instead, see :ref:`Python " "Initialization Configuration `." msgstr "" -#: ../../c-api/init.rst:233 +#: ../../c-api/init.rst:248 msgid "" "If the flag is non-zero, use :class:`io.FileIO` instead of :class:`!io." "_WindowsConsoleIO` for :mod:`sys` standard streams." msgstr "" -#: ../../c-api/init.rst:236 +#: ../../c-api/init.rst:251 msgid "" "Set to ``1`` if the :envvar:`PYTHONLEGACYWINDOWSSTDIO` environment variable " "is set to a non-empty string." msgstr "" -#: ../../c-api/init.rst:239 +#: ../../c-api/init.rst:254 msgid "See :pep:`528` for more details." msgstr "更多詳情請見 :pep:`528`。" -#: ../../c-api/init.rst:247 +#: ../../c-api/init.rst:262 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "site_import` should be used instead, see :ref:`Python Initialization " "Configuration `." msgstr "" -#: ../../c-api/init.rst:251 +#: ../../c-api/init.rst:266 msgid "" "Disable the import of the module :mod:`site` and the site-dependent " "manipulations of :data:`sys.path` that it entails. Also disable these " @@ -418,24 +460,24 @@ msgid "" "main` if you want them to be triggered)." msgstr "" -#: ../../c-api/init.rst:256 +#: ../../c-api/init.rst:271 msgid "Set by the :option:`-S` option." msgstr "由 :option:`-S` 選項設定。" -#: ../../c-api/init.rst:262 +#: ../../c-api/init.rst:277 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "user_site_directory` should be used instead, see :ref:`Python Initialization " "Configuration `." msgstr "" -#: ../../c-api/init.rst:266 +#: ../../c-api/init.rst:281 msgid "" "Don't add the :data:`user site-packages directory ` to :data:" "`sys.path`." msgstr "" -#: ../../c-api/init.rst:269 +#: ../../c-api/init.rst:284 msgid "" "Set by the :option:`-s` and :option:`-I` options, and the :envvar:" "`PYTHONNOUSERSITE` environment variable." @@ -443,60 +485,60 @@ msgstr "" "由 :option:`-s` 選項、:option:`-I` 選項與 :envvar:`PYTHONNOUSERSITE` 環境變數" "設定。" -#: ../../c-api/init.rst:276 +#: ../../c-api/init.rst:291 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "optimization_level` should be used instead, see :ref:`Python Initialization " "Configuration `." msgstr "" -#: ../../c-api/init.rst:280 +#: ../../c-api/init.rst:295 msgid "" "Set by the :option:`-O` option and the :envvar:`PYTHONOPTIMIZE` environment " "variable." msgstr "由 :option:`-O` 選項與 :envvar:`PYTHONOPTIMIZE` 環境變數設定。" -#: ../../c-api/init.rst:287 +#: ../../c-api/init.rst:302 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "quiet` should be used instead, see :ref:`Python Initialization Configuration " "`." msgstr "" -#: ../../c-api/init.rst:291 +#: ../../c-api/init.rst:306 msgid "" "Don't display the copyright and version messages even in interactive mode." msgstr "" -#: ../../c-api/init.rst:293 +#: ../../c-api/init.rst:308 msgid "Set by the :option:`-q` option." msgstr "由 :option:`-q` 選項設定。" -#: ../../c-api/init.rst:301 +#: ../../c-api/init.rst:316 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "buffered_stdio` should be used instead, see :ref:`Python Initialization " "Configuration `." msgstr "" -#: ../../c-api/init.rst:305 +#: ../../c-api/init.rst:320 msgid "Force the stdout and stderr streams to be unbuffered." msgstr "" -#: ../../c-api/init.rst:307 +#: ../../c-api/init.rst:322 msgid "" "Set by the :option:`-u` option and the :envvar:`PYTHONUNBUFFERED` " "environment variable." msgstr "由 :option:`-u` 選項與 :envvar:`PYTHONUNBUFFERED` 環境變數設定。" -#: ../../c-api/init.rst:314 +#: ../../c-api/init.rst:329 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "verbose` should be used instead, see :ref:`Python Initialization " "Configuration `." msgstr "" -#: ../../c-api/init.rst:318 +#: ../../c-api/init.rst:333 msgid "" "Print a message each time a module is initialized, showing the place " "(filename or built-in module) from which it is loaded. If greater or equal " @@ -504,67 +546,81 @@ msgid "" "for a module. Also provides information on module cleanup at exit." msgstr "" -#: ../../c-api/init.rst:323 +#: ../../c-api/init.rst:338 msgid "" "Set by the :option:`-v` option and the :envvar:`PYTHONVERBOSE` environment " "variable." msgstr "由 :option:`-v` 選項與 :envvar:`PYTHONVERBOSE` 環境變數設定。" -#: ../../c-api/init.rst:330 +#: ../../c-api/init.rst:345 msgid "Initializing and finalizing the interpreter" msgstr "" -#: ../../c-api/init.rst:345 +#: ../../c-api/init.rst:360 msgid "" "Initialize the Python interpreter. In an application embedding Python, " "this should be called before using any other Python/C API functions; see :" "ref:`Before Python Initialization ` for the few exceptions." msgstr "" -#: ../../c-api/init.rst:349 +#: ../../c-api/init.rst:364 msgid "" "This initializes the table of loaded modules (``sys.modules``), and creates " -"the fundamental modules :mod:`builtins`, :mod:`__main__` and :mod:`sys`. It " +"the fundamental modules :mod:`builtins`, :mod:`__main__` and :mod:`sys`. It " "also initializes the module search path (``sys.path``). It does not set " -"``sys.argv``; use the new :c:type:`PyConfig` API of the :ref:`Python " -"Initialization Configuration ` for that. This is a no-op when " -"called for a second time (without calling :c:func:`Py_FinalizeEx` first). " -"There is no return value; it is a fatal error if the initialization fails." +"``sys.argv``; use the :ref:`Python Initialization Configuration ` API for that. This is a no-op when called for a second time " +"(without calling :c:func:`Py_FinalizeEx` first). There is no return value; " +"it is a fatal error if the initialization fails." msgstr "" -#: ../../c-api/init.rst:359 ../../c-api/init.rst:373 +#: ../../c-api/init.rst:372 ../../c-api/init.rst:386 msgid "" -"Use the :c:func:`Py_InitializeFromConfig` function to customize the :ref:" -"`Python Initialization Configuration `." +"Use :c:func:`Py_InitializeFromConfig` to customize the :ref:`Python " +"Initialization Configuration `." msgstr "" -#: ../../c-api/init.rst:363 +#: ../../c-api/init.rst:376 msgid "" "On Windows, changes the console mode from ``O_TEXT`` to ``O_BINARY``, which " "will also affect non-Python uses of the console using the C Runtime." msgstr "" -#: ../../c-api/init.rst:369 +#: ../../c-api/init.rst:382 msgid "" "This function works like :c:func:`Py_Initialize` if *initsigs* is ``1``. If " "*initsigs* is ``0``, it skips initialization registration of signal " -"handlers, which might be useful when Python is embedded." +"handlers, which may be useful when CPython is embedded as part of a larger " +"application." +msgstr "" + +#: ../../c-api/init.rst:392 +msgid "" +"Initialize Python from *config* configuration, as described in :ref:`init-" +"from-config`." +msgstr "" + +#: ../../c-api/init.rst:395 +msgid "" +"See the :ref:`init-config` section for details on pre-initializing the " +"interpreter, populating the runtime configuration structure, and querying " +"the returned status structure." msgstr "" -#: ../../c-api/init.rst:379 +#: ../../c-api/init.rst:402 msgid "" "Return true (nonzero) when the Python interpreter has been initialized, " "false (zero) if not. After :c:func:`Py_FinalizeEx` is called, this returns " "false until :c:func:`Py_Initialize` is called again." msgstr "" -#: ../../c-api/init.rst:386 +#: ../../c-api/init.rst:409 msgid "" "Return true (non-zero) if the main Python interpreter is :term:`shutting " "down `. Return false (zero) otherwise." msgstr "" -#: ../../c-api/init.rst:394 +#: ../../c-api/init.rst:417 msgid "" "Undo all initializations made by :c:func:`Py_Initialize` and subsequent use " "of Python/C API functions, and destroy all sub-interpreters (see :c:func:" @@ -574,7 +630,7 @@ msgid "" "second time (without calling :c:func:`Py_Initialize` again first)." msgstr "" -#: ../../c-api/init.rst:401 +#: ../../c-api/init.rst:424 msgid "" "Since this is the reverse of :c:func:`Py_Initialize`, it should be called in " "the same thread with the same interpreter active. That means the main " @@ -582,13 +638,13 @@ msgid "" "`Py_RunMain` is running." msgstr "" -#: ../../c-api/init.rst:406 +#: ../../c-api/init.rst:429 msgid "" "Normally the return value is ``0``. If there were errors during finalization " "(flushing buffered data), ``-1`` is returned." msgstr "" -#: ../../c-api/init.rst:410 +#: ../../c-api/init.rst:433 msgid "" "This function is provided for a number of reasons. An embedding application " "might want to restart Python without having to restart the application " @@ -599,7 +655,7 @@ msgid "" "Python before exiting from the application." msgstr "" -#: ../../c-api/init.rst:418 +#: ../../c-api/init.rst:441 msgid "" "**Bugs and caveats:** The destruction of modules and objects in modules is " "done in random order; this may cause destructors (:meth:`~object.__del__` " @@ -614,7 +670,7 @@ msgid "" "more than once." msgstr "" -#: ../../c-api/init.rst:429 +#: ../../c-api/init.rst:452 msgid "" "Raises an :ref:`auditing event ` ``cpython." "_PySys_ClearAuditHooks`` with no arguments." @@ -622,24 +678,154 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``cpython." "_PySys_ClearAuditHooks``。" -#: ../../c-api/init.rst:435 +#: ../../c-api/init.rst:459 msgid "" "This is a backwards-compatible version of :c:func:`Py_FinalizeEx` that " "disregards the return value." msgstr "" -#: ../../c-api/init.rst:440 +#: ../../c-api/init.rst:465 +msgid "" +"Similar to :c:func:`Py_Main` but *argv* is an array of bytes strings, " +"allowing the calling application to delegate the text decoding step to the " +"CPython runtime." +msgstr "" + +#: ../../c-api/init.rst:474 +msgid "" +"The main program for the standard interpreter, encapsulating a full " +"initialization/finalization cycle, as well as additional behaviour to " +"implement reading configurations settings from the environment and command " +"line, and then executing ``__main__`` in accordance with :ref:`using-on-" +"cmdline`." +msgstr "" + +#: ../../c-api/init.rst:480 +msgid "" +"This is made available for programs which wish to support the full CPython " +"command line interface, rather than just embedding a Python runtime in a " +"larger application." +msgstr "" + +#: ../../c-api/init.rst:484 +msgid "" +"The *argc* and *argv* parameters are similar to those which are passed to a " +"C program's :c:func:`main` function, except that the *argv* entries are " +"first converted to ``wchar_t`` using :c:func:`Py_DecodeLocale`. It is also " +"important to note that the argument list entries may be modified to point to " +"strings other than those passed in (however, the contents of the strings " +"pointed to by the argument list are not modified)." +msgstr "" + +#: ../../c-api/init.rst:491 +msgid "" +"The return value will be ``0`` if the interpreter exits normally (i.e., " +"without an exception), ``1`` if the interpreter exits due to an exception, " +"or ``2`` if the argument list does not represent a valid Python command line." +msgstr "" + +#: ../../c-api/init.rst:496 +msgid "" +"Note that if an otherwise unhandled :exc:`SystemExit` is raised, this " +"function will not return ``1``, but exit the process, as long as " +"``Py_InspectFlag`` is not set. If ``Py_InspectFlag`` is set, execution will " +"drop into the interactive Python prompt, at which point a second otherwise " +"unhandled :exc:`SystemExit` will still exit the process, while any other " +"means of exiting will set the return value as described above." +msgstr "" + +#: ../../c-api/init.rst:503 +msgid "" +"In terms of the CPython runtime configuration APIs documented in the :ref:" +"`runtime configuration ` section (and without accounting for " +"error handling), ``Py_Main`` is approximately equivalent to::" +msgstr "" + +#: ../../c-api/init.rst:507 +msgid "" +"PyConfig config;\n" +"PyConfig_InitPythonConfig(&config);\n" +"PyConfig_SetArgv(&config, argc, argv);\n" +"Py_InitializeFromConfig(&config);\n" +"PyConfig_Clear(&config);\n" +"\n" +"Py_RunMain();" +msgstr "" + +#: ../../c-api/init.rst:515 +msgid "" +"In normal usage, an embedding application will call this function *instead* " +"of calling :c:func:`Py_Initialize`, :c:func:`Py_InitializeEx` or :c:func:" +"`Py_InitializeFromConfig` directly, and all settings will be applied as " +"described elsewhere in this documentation. If this function is instead " +"called *after* a preceding runtime initialization API call, then exactly " +"which environmental and command line configuration settings will be updated " +"is version dependent (as it depends on which settings correctly support " +"being modified after they have already been set once when the runtime was " +"first initialized)." +msgstr "" + +#: ../../c-api/init.rst:528 +msgid "Executes the main module in a fully configured CPython runtime." +msgstr "" + +#: ../../c-api/init.rst:530 +msgid "" +"Executes the command (:c:member:`PyConfig.run_command`), the script (:c:" +"member:`PyConfig.run_filename`) or the module (:c:member:`PyConfig." +"run_module`) specified on the command line or in the configuration. If none " +"of these values are set, runs the interactive Python prompt (REPL) using the " +"``__main__`` module's global namespace." +msgstr "" + +#: ../../c-api/init.rst:536 +msgid "" +"If :c:member:`PyConfig.inspect` is not set (the default), the return value " +"will be ``0`` if the interpreter exits normally (that is, without raising an " +"exception), or ``1`` if the interpreter exits due to an exception. If an " +"otherwise unhandled :exc:`SystemExit` is raised, the function will " +"immediately exit the process instead of returning ``1``." +msgstr "" + +#: ../../c-api/init.rst:542 +msgid "" +"If :c:member:`PyConfig.inspect` is set (such as when the :option:`-i` option " +"is used), rather than returning when the interpreter exits, execution will " +"instead resume in an interactive Python prompt (REPL) using the ``__main__`` " +"module's global namespace. If the interpreter exited with an exception, it " +"is immediately raised in the REPL session. The function return value is then " +"determined by the way the *REPL session* terminates: returning ``0`` if the " +"session terminates without raising an unhandled exception, exiting " +"immediately for an unhandled :exc:`SystemExit`, and returning ``1`` for any " +"other unhandled exception." +msgstr "" + +#: ../../c-api/init.rst:552 +msgid "" +"This function always finalizes the Python interpreter regardless of whether " +"it returns a value or immediately exits the process due to an unhandled :exc:" +"`SystemExit` exception." +msgstr "" + +#: ../../c-api/init.rst:556 +msgid "" +"See :ref:`Python Configuration ` for an example of a " +"customized Python that always runs in isolated mode using :c:func:" +"`Py_RunMain`." +msgstr "" + +#: ../../c-api/init.rst:562 msgid "Process-wide parameters" msgstr "" -#: ../../c-api/init.rst:450 +#: ../../c-api/init.rst:572 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "program_name` should be used instead, see :ref:`Python Initialization " "Configuration `." msgstr "" -#: ../../c-api/init.rst:454 +#: ../../c-api/init.rst:576 msgid "" "This function should be called before :c:func:`Py_Initialize` is called for " "the first time, if it is called at all. It tells the interpreter the value " @@ -653,37 +839,37 @@ msgid "" "this storage." msgstr "" -#: ../../c-api/init.rst:465 ../../c-api/init.rst:704 ../../c-api/init.rst:740 -#: ../../c-api/init.rst:766 +#: ../../c-api/init.rst:587 ../../c-api/init.rst:826 ../../c-api/init.rst:862 +#: ../../c-api/init.rst:888 msgid "" "Use :c:func:`Py_DecodeLocale` to decode a bytes string to get a :c:expr:" "`wchar_*` string." msgstr "" -#: ../../c-api/init.rst:473 +#: ../../c-api/init.rst:595 msgid "" "Return the program name set with :c:member:`PyConfig.program_name`, or the " "default. The returned string points into static storage; the caller should " "not modify its value." msgstr "" -#: ../../c-api/init.rst:477 ../../c-api/init.rst:499 ../../c-api/init.rst:543 -#: ../../c-api/init.rst:564 ../../c-api/init.rst:590 ../../c-api/init.rst:778 +#: ../../c-api/init.rst:599 ../../c-api/init.rst:621 ../../c-api/init.rst:665 +#: ../../c-api/init.rst:686 ../../c-api/init.rst:712 ../../c-api/init.rst:900 msgid "" "This function should not be called before :c:func:`Py_Initialize`, otherwise " "it returns ``NULL``." msgstr "此函式不應該在 :c:func:`Py_Initialize` 之前呼叫,否則會回傳 ``NULL``。" -#: ../../c-api/init.rst:480 ../../c-api/init.rst:502 ../../c-api/init.rst:546 -#: ../../c-api/init.rst:567 ../../c-api/init.rst:595 ../../c-api/init.rst:781 +#: ../../c-api/init.rst:602 ../../c-api/init.rst:624 ../../c-api/init.rst:668 +#: ../../c-api/init.rst:689 ../../c-api/init.rst:717 ../../c-api/init.rst:903 msgid "It now returns ``NULL`` if called before :c:func:`Py_Initialize`." msgstr "如果在 :c:func:`Py_Initialize` 之前呼叫,現在會回傳 ``NULL``。" -#: ../../c-api/init.rst:483 ../../c-api/init.rst:570 +#: ../../c-api/init.rst:605 ../../c-api/init.rst:692 msgid "Get :data:`sys.executable` instead." msgstr "" -#: ../../c-api/init.rst:489 +#: ../../c-api/init.rst:611 msgid "" "Return the *prefix* for installed platform-independent files. This is " "derived through a number of complicated rules from the program name set " @@ -697,11 +883,11 @@ msgid "" "also the next function." msgstr "" -#: ../../c-api/init.rst:505 +#: ../../c-api/init.rst:627 msgid "Get :data:`sys.prefix` instead." msgstr "" -#: ../../c-api/init.rst:511 +#: ../../c-api/init.rst:633 msgid "" "Return the *exec-prefix* for installed platform-*dependent* files. This is " "derived through a number of complicated rules from the program name set " @@ -715,7 +901,7 @@ msgid "" "on Unix." msgstr "" -#: ../../c-api/init.rst:521 +#: ../../c-api/init.rst:643 msgid "" "Background: The exec-prefix differs from the prefix when platform dependent " "files (such as executables and shared libraries) are installed in a " @@ -724,7 +910,7 @@ msgid "" "independent may be installed in :file:`/usr/local`." msgstr "" -#: ../../c-api/init.rst:527 +#: ../../c-api/init.rst:649 msgid "" "Generally speaking, a platform is a combination of hardware and software " "families, e.g. Sparc machines running the Solaris 2.x operating system are " @@ -738,7 +924,7 @@ msgid "" "independent from the Python version by which they were compiled!)." msgstr "" -#: ../../c-api/init.rst:538 +#: ../../c-api/init.rst:660 msgid "" "System administrators will know how to configure the :program:`mount` or :" "program:`automount` programs to share :file:`/usr/local` between platforms " @@ -746,11 +932,11 @@ msgid "" "platform." msgstr "" -#: ../../c-api/init.rst:549 +#: ../../c-api/init.rst:671 msgid "Get :data:`sys.exec_prefix` instead." msgstr "" -#: ../../c-api/init.rst:558 +#: ../../c-api/init.rst:680 msgid "" "Return the full program name of the Python executable; this is computed as " "a side-effect of deriving the default module search path from the program " @@ -759,7 +945,7 @@ msgid "" "available to Python code as ``sys.executable``." msgstr "" -#: ../../c-api/init.rst:580 +#: ../../c-api/init.rst:702 msgid "" "Return the default module search path; this is computed from the program " "name (set by :c:member:`PyConfig.program_name`) and some environment " @@ -772,21 +958,21 @@ msgid "" "for loading modules." msgstr "" -#: ../../c-api/init.rst:598 +#: ../../c-api/init.rst:720 msgid "Get :data:`sys.path` instead." msgstr "" -#: ../../c-api/init.rst:604 +#: ../../c-api/init.rst:726 msgid "" "Return the version of this Python interpreter. This is a string that looks " "something like ::" msgstr "" -#: ../../c-api/init.rst:607 +#: ../../c-api/init.rst:729 msgid "\"3.0a5+ (py3k:63103M, May 12 2008, 00:53:55) \\n[GCC 4.2.3]\"" msgstr "\"3.0a5+ (py3k:63103M, May 12 2008, 00:53:55) \\n[GCC 4.2.3]\"" -#: ../../c-api/init.rst:611 +#: ../../c-api/init.rst:733 msgid "" "The first word (up to the first space character) is the current Python " "version; the first characters are the major and minor version separated by a " @@ -795,11 +981,11 @@ msgid "" "version`." msgstr "" -#: ../../c-api/init.rst:616 +#: ../../c-api/init.rst:738 msgid "See also the :c:var:`Py_Version` constant." msgstr "" -#: ../../c-api/init.rst:623 +#: ../../c-api/init.rst:745 msgid "" "Return the platform identifier for the current platform. On Unix, this is " "formed from the \"official\" name of the operating system, converted to " @@ -810,50 +996,50 @@ msgid "" "available to Python code as ``sys.platform``." msgstr "" -#: ../../c-api/init.rst:634 +#: ../../c-api/init.rst:756 msgid "" "Return the official copyright string for the current Python version, for " "example" msgstr "" -#: ../../c-api/init.rst:636 +#: ../../c-api/init.rst:758 msgid "``'Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam'``" msgstr "``'Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam'``" -#: ../../c-api/init.rst:640 +#: ../../c-api/init.rst:762 msgid "" "The returned string points into static storage; the caller should not modify " "its value. The value is available to Python code as ``sys.copyright``." msgstr "" -#: ../../c-api/init.rst:646 +#: ../../c-api/init.rst:768 msgid "" "Return an indication of the compiler used to build the current Python " "version, in square brackets, for example::" msgstr "" -#: ../../c-api/init.rst:649 +#: ../../c-api/init.rst:771 msgid "\"[GCC 2.7.2.2]\"" msgstr "\"[GCC 2.7.2.2]\"" -#: ../../c-api/init.rst:653 ../../c-api/init.rst:667 +#: ../../c-api/init.rst:775 ../../c-api/init.rst:789 msgid "" "The returned string points into static storage; the caller should not modify " "its value. The value is available to Python code as part of the variable " "``sys.version``." msgstr "" -#: ../../c-api/init.rst:660 +#: ../../c-api/init.rst:782 msgid "" "Return information about the sequence number and build date and time of the " "current Python interpreter instance, for example ::" msgstr "" -#: ../../c-api/init.rst:663 +#: ../../c-api/init.rst:785 msgid "\"#67, Aug 1 1997, 22:34:28\"" msgstr "\"#67, Aug 1 1997, 22:34:28\"" -#: ../../c-api/init.rst:679 +#: ../../c-api/init.rst:801 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "argv`, :c:member:`PyConfig.parse_argv` and :c:member:`PyConfig.safe_path` " @@ -861,7 +1047,7 @@ msgid "" "config>`." msgstr "" -#: ../../c-api/init.rst:684 +#: ../../c-api/init.rst:806 msgid "" "Set :data:`sys.argv` based on *argc* and *argv*. These parameters are " "similar to those passed to the program's :c:func:`main` function with the " @@ -872,84 +1058,84 @@ msgid "" "fatal condition is signalled using :c:func:`Py_FatalError`." msgstr "" -#: ../../c-api/init.rst:692 +#: ../../c-api/init.rst:814 msgid "" "If *updatepath* is zero, this is all the function does. If *updatepath* is " "non-zero, the function also modifies :data:`sys.path` according to the " "following algorithm:" msgstr "" -#: ../../c-api/init.rst:696 +#: ../../c-api/init.rst:818 msgid "" "If the name of an existing script is passed in ``argv[0]``, the absolute " "path of the directory where the script is located is prepended to :data:`sys." "path`." msgstr "" -#: ../../c-api/init.rst:699 +#: ../../c-api/init.rst:821 msgid "" "Otherwise (that is, if *argc* is ``0`` or ``argv[0]`` doesn't point to an " "existing file name), an empty string is prepended to :data:`sys.path`, which " "is the same as prepending the current working directory (``\".\"``)." msgstr "" -#: ../../c-api/init.rst:707 ../../c-api/init.rst:743 +#: ../../c-api/init.rst:829 ../../c-api/init.rst:865 msgid "" "See also :c:member:`PyConfig.orig_argv` and :c:member:`PyConfig.argv` " "members of the :ref:`Python Initialization Configuration `." msgstr "" -#: ../../c-api/init.rst:711 +#: ../../c-api/init.rst:833 msgid "" "It is recommended that applications embedding the Python interpreter for " "purposes other than executing a single script pass ``0`` as *updatepath*, " "and update :data:`sys.path` themselves if desired. See :cve:`2008-5983`." msgstr "" -#: ../../c-api/init.rst:716 +#: ../../c-api/init.rst:838 msgid "" "On versions before 3.1.3, you can achieve the same effect by manually " "popping the first :data:`sys.path` element after having called :c:func:" "`PySys_SetArgv`, for example using::" msgstr "" -#: ../../c-api/init.rst:720 +#: ../../c-api/init.rst:842 msgid "PyRun_SimpleString(\"import sys; sys.path.pop(0)\\n\");" msgstr "PyRun_SimpleString(\"import sys; sys.path.pop(0)\\n\");" -#: ../../c-api/init.rst:732 +#: ../../c-api/init.rst:854 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "argv` and :c:member:`PyConfig.parse_argv` should be used instead, see :ref:" "`Python Initialization Configuration `." msgstr "" -#: ../../c-api/init.rst:736 +#: ../../c-api/init.rst:858 msgid "" "This function works like :c:func:`PySys_SetArgvEx` with *updatepath* set to " "``1`` unless the :program:`python` interpreter was started with the :option:" "`-I`." msgstr "" -#: ../../c-api/init.rst:746 +#: ../../c-api/init.rst:868 msgid "The *updatepath* value depends on :option:`-I`." msgstr "" -#: ../../c-api/init.rst:753 +#: ../../c-api/init.rst:875 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "home` should be used instead, see :ref:`Python Initialization Configuration " "`." msgstr "" -#: ../../c-api/init.rst:757 +#: ../../c-api/init.rst:879 msgid "" "Set the default \"home\" directory, that is, the location of the standard " "Python libraries. See :envvar:`PYTHONHOME` for the meaning of the argument " "string." msgstr "" -#: ../../c-api/init.rst:761 +#: ../../c-api/init.rst:883 msgid "" "The argument should point to a zero-terminated character string in static " "storage whose contents will not change for the duration of the program's " @@ -957,24 +1143,24 @@ msgid "" "this storage." msgstr "" -#: ../../c-api/init.rst:774 +#: ../../c-api/init.rst:896 msgid "" "Return the default \"home\", that is, the value set by :c:member:`PyConfig." "home`, or the value of the :envvar:`PYTHONHOME` environment variable if it " "is set." msgstr "" -#: ../../c-api/init.rst:784 +#: ../../c-api/init.rst:906 msgid "" "Get :c:member:`PyConfig.home` or :envvar:`PYTHONHOME` environment variable " "instead." msgstr "改為取得 :c:member:`PyConfig.home` 或 :envvar:`PYTHONHOME` 環境變數。" -#: ../../c-api/init.rst:792 +#: ../../c-api/init.rst:914 msgid "Thread State and the Global Interpreter Lock" msgstr "" -#: ../../c-api/init.rst:799 +#: ../../c-api/init.rst:921 msgid "" "The Python interpreter is not fully thread-safe. In order to support multi-" "threaded Python programs, there's a global lock, called the :term:`global " @@ -986,7 +1172,7 @@ msgid "" "once instead of twice." msgstr "" -#: ../../c-api/init.rst:809 +#: ../../c-api/init.rst:931 msgid "" "Therefore, the rule exists that only the thread that has acquired the :term:" "`GIL` may operate on Python objects or call Python/C API functions. In order " @@ -996,7 +1182,7 @@ msgid "" "a file, so that other Python threads can run in the meantime." msgstr "" -#: ../../c-api/init.rst:819 +#: ../../c-api/init.rst:941 msgid "" "The Python interpreter keeps some thread-specific bookkeeping information " "inside a data structure called :c:type:`PyThreadState`. There's also one " @@ -1004,17 +1190,17 @@ msgid "" "retrieved using :c:func:`PyThreadState_Get`." msgstr "" -#: ../../c-api/init.rst:825 +#: ../../c-api/init.rst:947 msgid "Releasing the GIL from extension code" msgstr "" -#: ../../c-api/init.rst:827 +#: ../../c-api/init.rst:949 msgid "" "Most extension code manipulating the :term:`GIL` has the following simple " "structure::" msgstr "" -#: ../../c-api/init.rst:830 +#: ../../c-api/init.rst:952 msgid "" "Save the thread state in a local variable.\n" "Release the global interpreter lock.\n" @@ -1023,29 +1209,29 @@ msgid "" "Restore the thread state from the local variable." msgstr "" -#: ../../c-api/init.rst:836 +#: ../../c-api/init.rst:958 msgid "This is so common that a pair of macros exists to simplify it::" msgstr "" -#: ../../c-api/init.rst:838 +#: ../../c-api/init.rst:960 msgid "" "Py_BEGIN_ALLOW_THREADS\n" "... Do some blocking I/O operation ...\n" "Py_END_ALLOW_THREADS" msgstr "" -#: ../../c-api/init.rst:846 +#: ../../c-api/init.rst:968 msgid "" "The :c:macro:`Py_BEGIN_ALLOW_THREADS` macro opens a new block and declares a " "hidden local variable; the :c:macro:`Py_END_ALLOW_THREADS` macro closes the " "block." msgstr "" -#: ../../c-api/init.rst:850 +#: ../../c-api/init.rst:972 msgid "The block above expands to the following code::" msgstr "" -#: ../../c-api/init.rst:852 +#: ../../c-api/init.rst:974 msgid "" "PyThreadState *_save;\n" "\n" @@ -1054,7 +1240,7 @@ msgid "" "PyEval_RestoreThread(_save);" msgstr "" -#: ../../c-api/init.rst:862 +#: ../../c-api/init.rst:984 msgid "" "Here is how these functions work: the global interpreter lock is used to " "protect the pointer to the current thread state. When releasing the lock " @@ -1065,7 +1251,7 @@ msgid "" "state, the lock must be acquired before storing the thread state pointer." msgstr "" -#: ../../c-api/init.rst:871 +#: ../../c-api/init.rst:993 msgid "" "Calling system I/O functions is the most common use case for releasing the " "GIL, but it can also be useful before calling long-running computations " @@ -1075,11 +1261,11 @@ msgid "" "compressing or hashing data." msgstr "" -#: ../../c-api/init.rst:882 +#: ../../c-api/init.rst:1004 msgid "Non-Python created threads" msgstr "" -#: ../../c-api/init.rst:884 +#: ../../c-api/init.rst:1006 msgid "" "When threads are created using the dedicated Python APIs (such as the :mod:" "`threading` module), a thread state is automatically associated to them and " @@ -1089,7 +1275,7 @@ msgid "" "for them." msgstr "" -#: ../../c-api/init.rst:891 +#: ../../c-api/init.rst:1013 msgid "" "If you need to call Python code from these threads (often this will be part " "of a callback API provided by the aforementioned third-party library), you " @@ -1100,14 +1286,14 @@ msgid "" "finally free the thread state data structure." msgstr "" -#: ../../c-api/init.rst:899 +#: ../../c-api/init.rst:1021 msgid "" "The :c:func:`PyGILState_Ensure` and :c:func:`PyGILState_Release` functions " "do all of the above automatically. The typical idiom for calling into " "Python from a C thread is::" msgstr "" -#: ../../c-api/init.rst:903 +#: ../../c-api/init.rst:1025 msgid "" "PyGILState_STATE gstate;\n" "gstate = PyGILState_Ensure();\n" @@ -1120,7 +1306,7 @@ msgid "" "PyGILState_Release(gstate);" msgstr "" -#: ../../c-api/init.rst:913 +#: ../../c-api/init.rst:1035 msgid "" "Note that the ``PyGILState_*`` functions assume there is only one global " "interpreter (created automatically by :c:func:`Py_Initialize`). Python " @@ -1129,11 +1315,11 @@ msgid "" "``PyGILState_*`` API is unsupported." msgstr "" -#: ../../c-api/init.rst:923 +#: ../../c-api/init.rst:1045 msgid "Cautions about fork()" msgstr "" -#: ../../c-api/init.rst:925 +#: ../../c-api/init.rst:1047 msgid "" "Another important thing to note about threads is their behaviour in the face " "of the C :c:func:`fork` call. On most systems with :c:func:`fork`, after a " @@ -1142,7 +1328,7 @@ msgid "" "CPython's runtime." msgstr "" -#: ../../c-api/init.rst:931 +#: ../../c-api/init.rst:1053 msgid "" "The fact that only the \"current\" thread remains means any locks held by " "other threads will never be released. Python solves this for :func:`os.fork` " @@ -1159,7 +1345,7 @@ msgid "" "locks, but is not always able to." msgstr "" -#: ../../c-api/init.rst:946 +#: ../../c-api/init.rst:1068 msgid "" "The fact that all other threads go away also means that CPython's runtime " "state there must be cleaned up properly, which :func:`os.fork` does. This " @@ -1172,17 +1358,17 @@ msgid "" "called immediately after." msgstr "" -#: ../../c-api/init.rst:959 +#: ../../c-api/init.rst:1081 msgid "High-level API" msgstr "高階 API" -#: ../../c-api/init.rst:961 +#: ../../c-api/init.rst:1083 msgid "" "These are the most commonly used types and functions when writing C " "extension code, or when embedding the Python interpreter:" msgstr "" -#: ../../c-api/init.rst:966 +#: ../../c-api/init.rst:1088 msgid "" "This data structure represents the state shared by a number of cooperating " "threads. Threads belonging to the same interpreter share their module " @@ -1190,7 +1376,7 @@ msgid "" "in this structure." msgstr "" -#: ../../c-api/init.rst:971 +#: ../../c-api/init.rst:1093 msgid "" "Threads belonging to different interpreters initially share nothing, except " "process state like available memory, open file descriptors and such. The " @@ -1198,41 +1384,41 @@ msgid "" "which interpreter they belong." msgstr "" -#: ../../c-api/init.rst:979 +#: ../../c-api/init.rst:1101 msgid "" "This data structure represents the state of a single thread. The only " "public data member is:" msgstr "" -#: ../../c-api/init.rst:984 +#: ../../c-api/init.rst:1106 msgid "This thread's interpreter state." msgstr "" -#: ../../c-api/init.rst:995 +#: ../../c-api/init.rst:1117 msgid "Deprecated function which does nothing." msgstr "" -#: ../../c-api/init.rst:997 +#: ../../c-api/init.rst:1119 msgid "" "In Python 3.6 and older, this function created the GIL if it didn't exist." msgstr "" -#: ../../c-api/init.rst:999 +#: ../../c-api/init.rst:1121 msgid "The function now does nothing." msgstr "此函式現在不會做任何事情。" -#: ../../c-api/init.rst:1002 +#: ../../c-api/init.rst:1124 msgid "" "This function is now called by :c:func:`Py_Initialize()`, so you don't have " "to call it yourself anymore." msgstr "" -#: ../../c-api/init.rst:1006 +#: ../../c-api/init.rst:1128 msgid "" "This function cannot be called before :c:func:`Py_Initialize()` anymore." msgstr "" -#: ../../c-api/init.rst:1016 +#: ../../c-api/init.rst:1138 msgid "" "Release the global interpreter lock (if it has been created) and reset the " "thread state to ``NULL``, returning the previous thread state (which is not " @@ -1240,7 +1426,7 @@ msgid "" "acquired it." msgstr "" -#: ../../c-api/init.rst:1024 +#: ../../c-api/init.rst:1146 msgid "" "Acquire the global interpreter lock (if it has been created) and set the " "thread state to *tstate*, which must not be ``NULL``. If the lock has been " @@ -1248,8 +1434,8 @@ msgid "" "ensues." msgstr "" -#: ../../c-api/init.rst:1030 ../../c-api/init.rst:1089 -#: ../../c-api/init.rst:1371 +#: ../../c-api/init.rst:1152 ../../c-api/init.rst:1211 +#: ../../c-api/init.rst:1493 msgid "" "Calling this function from a thread when the runtime is finalizing will " "terminate the thread, even if the thread was not created by Python. You can " @@ -1258,44 +1444,44 @@ msgid "" "avoid unwanted termination." msgstr "" -#: ../../c-api/init.rst:1038 +#: ../../c-api/init.rst:1160 msgid "" "Return the current thread state. The global interpreter lock must be held. " "When the current thread state is ``NULL``, this issues a fatal error (so " "that the caller needn't check for ``NULL``)." msgstr "" -#: ../../c-api/init.rst:1042 +#: ../../c-api/init.rst:1164 msgid "See also :c:func:`PyThreadState_GetUnchecked`." msgstr "也請見 :c:func:`PyThreadState_GetUnchecked`。" -#: ../../c-api/init.rst:1047 +#: ../../c-api/init.rst:1169 msgid "" "Similar to :c:func:`PyThreadState_Get`, but don't kill the process with a " "fatal error if it is NULL. The caller is responsible to check if the result " "is NULL." msgstr "" -#: ../../c-api/init.rst:1051 +#: ../../c-api/init.rst:1173 msgid "" "In Python 3.5 to 3.12, the function was private and known as " "``_PyThreadState_UncheckedGet()``." msgstr "" -#: ../../c-api/init.rst:1058 +#: ../../c-api/init.rst:1180 msgid "" "Swap the current thread state with the thread state given by the argument " "*tstate*, which may be ``NULL``. The global interpreter lock must be held " "and is not released." msgstr "" -#: ../../c-api/init.rst:1063 +#: ../../c-api/init.rst:1185 msgid "" "The following functions use thread-local storage, and are not compatible " "with sub-interpreters:" msgstr "" -#: ../../c-api/init.rst:1068 +#: ../../c-api/init.rst:1190 msgid "" "Ensure that the current thread is ready to call the Python C API regardless " "of the current state of Python, or of the global interpreter lock. This may " @@ -1308,7 +1494,7 @@ msgid "" "is acceptable." msgstr "" -#: ../../c-api/init.rst:1078 +#: ../../c-api/init.rst:1200 msgid "" "The return value is an opaque \"handle\" to the thread state when :c:func:" "`PyGILState_Ensure` was called, and must be passed to :c:func:" @@ -1318,13 +1504,13 @@ msgid "" "func:`PyGILState_Release`." msgstr "" -#: ../../c-api/init.rst:1085 +#: ../../c-api/init.rst:1207 msgid "" "When the function returns, the current thread will hold the GIL and be able " "to call arbitrary Python code. Failure is a fatal error." msgstr "" -#: ../../c-api/init.rst:1097 +#: ../../c-api/init.rst:1219 msgid "" "Release any resources previously acquired. After this call, Python's state " "will be the same as it was prior to the corresponding :c:func:" @@ -1332,13 +1518,13 @@ msgid "" "caller, hence the use of the GILState API)." msgstr "" -#: ../../c-api/init.rst:1102 +#: ../../c-api/init.rst:1224 msgid "" "Every call to :c:func:`PyGILState_Ensure` must be matched by a call to :c:" "func:`PyGILState_Release` on the same thread." msgstr "" -#: ../../c-api/init.rst:1108 +#: ../../c-api/init.rst:1230 msgid "" "Get the current thread state for this thread. May return ``NULL`` if no " "GILState API has been used on the current thread. Note that the main thread " @@ -1346,7 +1532,7 @@ msgid "" "made on the main thread. This is mainly a helper/diagnostic function." msgstr "" -#: ../../c-api/init.rst:1116 +#: ../../c-api/init.rst:1238 msgid "" "Return ``1`` if the current thread is holding the GIL and ``0`` otherwise. " "This function can be called from any thread at any time. Only if it has had " @@ -1357,13 +1543,13 @@ msgid "" "otherwise behave differently." msgstr "" -#: ../../c-api/init.rst:1128 +#: ../../c-api/init.rst:1250 msgid "" "The following macros are normally used without a trailing semicolon; look " "for example usage in the Python source distribution." msgstr "" -#: ../../c-api/init.rst:1134 +#: ../../c-api/init.rst:1256 msgid "" "This macro expands to ``{ PyThreadState *_save; _save = PyEval_SaveThread();" "``. Note that it contains an opening brace; it must be matched with a " @@ -1371,7 +1557,7 @@ msgid "" "discussion of this macro." msgstr "" -#: ../../c-api/init.rst:1142 +#: ../../c-api/init.rst:1264 msgid "" "This macro expands to ``PyEval_RestoreThread(_save); }``. Note that it " "contains a closing brace; it must be matched with an earlier :c:macro:" @@ -1379,40 +1565,40 @@ msgid "" "macro." msgstr "" -#: ../../c-api/init.rst:1150 +#: ../../c-api/init.rst:1272 msgid "" "This macro expands to ``PyEval_RestoreThread(_save);``: it is equivalent to :" "c:macro:`Py_END_ALLOW_THREADS` without the closing brace." msgstr "" -#: ../../c-api/init.rst:1156 +#: ../../c-api/init.rst:1278 msgid "" "This macro expands to ``_save = PyEval_SaveThread();``: it is equivalent to :" "c:macro:`Py_BEGIN_ALLOW_THREADS` without the opening brace and variable " "declaration." msgstr "" -#: ../../c-api/init.rst:1162 +#: ../../c-api/init.rst:1284 msgid "Low-level API" msgstr "低階 API" -#: ../../c-api/init.rst:1164 +#: ../../c-api/init.rst:1286 msgid "" "All of the following functions must be called after :c:func:`Py_Initialize`." msgstr "" -#: ../../c-api/init.rst:1166 +#: ../../c-api/init.rst:1288 msgid ":c:func:`Py_Initialize()` now initializes the :term:`GIL`." msgstr "" -#: ../../c-api/init.rst:1172 +#: ../../c-api/init.rst:1294 msgid "" "Create a new interpreter state object. The global interpreter lock need not " "be held, but may be held if it is necessary to serialize calls to this " "function." msgstr "" -#: ../../c-api/init.rst:1176 +#: ../../c-api/init.rst:1298 msgid "" "Raises an :ref:`auditing event ` ``cpython." "PyInterpreterState_New`` with no arguments." @@ -1420,13 +1606,13 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``cpython." "PyInterpreterState_New``。" -#: ../../c-api/init.rst:1181 +#: ../../c-api/init.rst:1303 msgid "" "Reset all information in an interpreter state object. The global " "interpreter lock must be held." msgstr "" -#: ../../c-api/init.rst:1184 +#: ../../c-api/init.rst:1306 msgid "" "Raises an :ref:`auditing event ` ``cpython." "PyInterpreterState_Clear`` with no arguments." @@ -1434,40 +1620,40 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``cpython." "PyInterpreterState_Clear``。" -#: ../../c-api/init.rst:1189 +#: ../../c-api/init.rst:1311 msgid "" "Destroy an interpreter state object. The global interpreter lock need not " "be held. The interpreter state must have been reset with a previous call " "to :c:func:`PyInterpreterState_Clear`." msgstr "" -#: ../../c-api/init.rst:1196 +#: ../../c-api/init.rst:1318 msgid "" "Create a new thread state object belonging to the given interpreter object. " "The global interpreter lock need not be held, but may be held if it is " "necessary to serialize calls to this function." msgstr "" -#: ../../c-api/init.rst:1203 +#: ../../c-api/init.rst:1325 msgid "" "Reset all information in a thread state object. The global interpreter lock " "must be held." msgstr "" -#: ../../c-api/init.rst:1206 +#: ../../c-api/init.rst:1328 msgid "" "This function now calls the :c:member:`PyThreadState.on_delete` callback. " "Previously, that happened in :c:func:`PyThreadState_Delete`." msgstr "" -#: ../../c-api/init.rst:1213 +#: ../../c-api/init.rst:1335 msgid "" "Destroy a thread state object. The global interpreter lock need not be " "held. The thread state must have been reset with a previous call to :c:func:" "`PyThreadState_Clear`." msgstr "" -#: ../../c-api/init.rst:1220 +#: ../../c-api/init.rst:1342 msgid "" "Destroy the current thread state and release the global interpreter lock. " "Like :c:func:`PyThreadState_Delete`, the global interpreter lock must be " @@ -1475,119 +1661,119 @@ msgid "" "`PyThreadState_Clear`." msgstr "" -#: ../../c-api/init.rst:1228 +#: ../../c-api/init.rst:1350 msgid "Get the current frame of the Python thread state *tstate*." msgstr "" -#: ../../c-api/init.rst:1230 +#: ../../c-api/init.rst:1352 msgid "" "Return a :term:`strong reference`. Return ``NULL`` if no frame is currently " "executing." msgstr "" -#: ../../c-api/init.rst:1233 +#: ../../c-api/init.rst:1355 msgid "See also :c:func:`PyEval_GetFrame`." msgstr "也請見 :c:func:`PyEval_GetFrame`。" -#: ../../c-api/init.rst:1235 ../../c-api/init.rst:1244 -#: ../../c-api/init.rst:1253 +#: ../../c-api/init.rst:1357 ../../c-api/init.rst:1366 +#: ../../c-api/init.rst:1375 msgid "*tstate* must not be ``NULL``." msgstr "*tstate* 不可為 ``NULL``。" -#: ../../c-api/init.rst:1242 +#: ../../c-api/init.rst:1364 msgid "" "Get the unique thread state identifier of the Python thread state *tstate*." msgstr "" -#: ../../c-api/init.rst:1251 +#: ../../c-api/init.rst:1373 msgid "Get the interpreter of the Python thread state *tstate*." msgstr "" -#: ../../c-api/init.rst:1260 +#: ../../c-api/init.rst:1382 msgid "Suspend tracing and profiling in the Python thread state *tstate*." msgstr "" -#: ../../c-api/init.rst:1262 +#: ../../c-api/init.rst:1384 msgid "Resume them using the :c:func:`PyThreadState_LeaveTracing` function." msgstr "" -#: ../../c-api/init.rst:1269 +#: ../../c-api/init.rst:1391 msgid "" "Resume tracing and profiling in the Python thread state *tstate* suspended " "by the :c:func:`PyThreadState_EnterTracing` function." msgstr "" -#: ../../c-api/init.rst:1272 +#: ../../c-api/init.rst:1394 msgid "" "See also :c:func:`PyEval_SetTrace` and :c:func:`PyEval_SetProfile` functions." msgstr "" -#: ../../c-api/init.rst:1280 +#: ../../c-api/init.rst:1402 msgid "Get the current interpreter." msgstr "" -#: ../../c-api/init.rst:1282 +#: ../../c-api/init.rst:1404 msgid "" "Issue a fatal error if there no current Python thread state or no current " "interpreter. It cannot return NULL." msgstr "" -#: ../../c-api/init.rst:1285 ../../c-api/init.rst:1295 +#: ../../c-api/init.rst:1407 ../../c-api/init.rst:1417 msgid "The caller must hold the GIL." msgstr "" -#: ../../c-api/init.rst:1292 +#: ../../c-api/init.rst:1414 msgid "" "Return the interpreter's unique ID. If there was any error in doing so then " "``-1`` is returned and an error is set." msgstr "" -#: ../../c-api/init.rst:1302 +#: ../../c-api/init.rst:1424 msgid "" "Return a dictionary in which interpreter-specific data may be stored. If " "this function returns ``NULL`` then no exception has been raised and the " "caller should assume no interpreter-specific dict is available." msgstr "" -#: ../../c-api/init.rst:1306 +#: ../../c-api/init.rst:1428 msgid "" "This is not a replacement for :c:func:`PyModule_GetState()`, which " "extensions should use to store interpreter-specific state information." msgstr "" -#: ../../c-api/init.rst:1313 +#: ../../c-api/init.rst:1435 msgid "Type of a frame evaluation function." msgstr "" -#: ../../c-api/init.rst:1315 +#: ../../c-api/init.rst:1437 msgid "" "The *throwflag* parameter is used by the ``throw()`` method of generators: " "if non-zero, handle the current exception." msgstr "" -#: ../../c-api/init.rst:1318 +#: ../../c-api/init.rst:1440 msgid "The function now takes a *tstate* parameter." msgstr "" -#: ../../c-api/init.rst:1321 +#: ../../c-api/init.rst:1443 msgid "" "The *frame* parameter changed from ``PyFrameObject*`` to " "``_PyInterpreterFrame*``." msgstr "" -#: ../../c-api/init.rst:1326 +#: ../../c-api/init.rst:1448 msgid "Get the frame evaluation function." msgstr "" -#: ../../c-api/init.rst:1328 ../../c-api/init.rst:1336 +#: ../../c-api/init.rst:1450 ../../c-api/init.rst:1458 msgid "See the :pep:`523` \"Adding a frame evaluation API to CPython\"." msgstr "" -#: ../../c-api/init.rst:1334 +#: ../../c-api/init.rst:1456 msgid "Set the frame evaluation function." msgstr "" -#: ../../c-api/init.rst:1343 +#: ../../c-api/init.rst:1465 msgid "" "Return a dictionary in which extensions can store thread-specific state " "information. Each extension should use a unique key to use to store state " @@ -1596,7 +1782,7 @@ msgid "" "raised and the caller should assume no current thread state is available." msgstr "" -#: ../../c-api/init.rst:1352 +#: ../../c-api/init.rst:1474 msgid "" "Asynchronously raise an exception in a thread. The *id* argument is the " "thread id of the target thread; *exc* is the exception object to be raised. " @@ -1608,33 +1794,33 @@ msgid "" "raises no exceptions." msgstr "" -#: ../../c-api/init.rst:1360 +#: ../../c-api/init.rst:1482 msgid "" "The type of the *id* parameter changed from :c:expr:`long` to :c:expr:" "`unsigned long`." msgstr "" -#: ../../c-api/init.rst:1366 +#: ../../c-api/init.rst:1488 msgid "" "Acquire the global interpreter lock and set the current thread state to " "*tstate*, which must not be ``NULL``. The lock must have been created " "earlier. If this thread already has the lock, deadlock ensues." msgstr "" -#: ../../c-api/init.rst:1377 +#: ../../c-api/init.rst:1499 msgid "" "Updated to be consistent with :c:func:`PyEval_RestoreThread`, :c:func:" "`Py_END_ALLOW_THREADS`, and :c:func:`PyGILState_Ensure`, and terminate the " "current thread if called while the interpreter is finalizing." msgstr "" -#: ../../c-api/init.rst:1382 +#: ../../c-api/init.rst:1504 msgid "" ":c:func:`PyEval_RestoreThread` is a higher-level function which is always " "available (even when threads have not been initialized)." msgstr "" -#: ../../c-api/init.rst:1388 +#: ../../c-api/init.rst:1510 msgid "" "Reset the current thread state to ``NULL`` and release the global " "interpreter lock. The lock must have been created earlier and must be held " @@ -1643,17 +1829,17 @@ msgid "" "isn't, a fatal error is reported." msgstr "" -#: ../../c-api/init.rst:1394 +#: ../../c-api/init.rst:1516 msgid "" ":c:func:`PyEval_SaveThread` is a higher-level function which is always " "available (even when threads have not been initialized)." msgstr "" -#: ../../c-api/init.rst:1401 +#: ../../c-api/init.rst:1523 msgid "Sub-interpreter support" msgstr "" -#: ../../c-api/init.rst:1403 +#: ../../c-api/init.rst:1525 msgid "" "While in most uses, you will only embed a single Python interpreter, there " "are cases where you need to create several independent interpreters in the " @@ -1661,7 +1847,7 @@ msgid "" "to do that." msgstr "" -#: ../../c-api/init.rst:1408 +#: ../../c-api/init.rst:1530 msgid "" "The \"main\" interpreter is the first one created when the runtime " "initializes. It is usually the only Python interpreter in a process. Unlike " @@ -1672,31 +1858,31 @@ msgid "" "returns a pointer to its state." msgstr "" -#: ../../c-api/init.rst:1415 +#: ../../c-api/init.rst:1537 msgid "" "You can switch between sub-interpreters using the :c:func:" "`PyThreadState_Swap` function. You can create and destroy them using the " "following functions:" msgstr "" -#: ../../c-api/init.rst:1421 +#: ../../c-api/init.rst:1543 msgid "" "Structure containing most parameters to configure a sub-interpreter. Its " "values are used only in :c:func:`Py_NewInterpreterFromConfig` and never " "modified by the runtime." msgstr "" -#: ../../c-api/init.rst:1427 +#: ../../c-api/init.rst:1549 msgid "Structure fields:" msgstr "" -#: ../../c-api/init.rst:1431 +#: ../../c-api/init.rst:1553 msgid "" "If this is ``0`` then the sub-interpreter will use its own \"object\" " "allocator state. Otherwise it will use (share) the main interpreter's." msgstr "" -#: ../../c-api/init.rst:1435 +#: ../../c-api/init.rst:1557 msgid "" "If this is ``0`` then :c:member:`~PyInterpreterConfig." "check_multi_interp_extensions` must be ``1`` (non-zero). If this is ``1`` " @@ -1704,44 +1890,44 @@ msgid "" "`PyInterpreterConfig_OWN_GIL`." msgstr "" -#: ../../c-api/init.rst:1443 +#: ../../c-api/init.rst:1565 msgid "" "If this is ``0`` then the runtime will not support forking the process in " "any thread where the sub-interpreter is currently active. Otherwise fork is " "unrestricted." msgstr "" -#: ../../c-api/init.rst:1447 +#: ../../c-api/init.rst:1569 msgid "" "Note that the :mod:`subprocess` module still works when fork is disallowed." msgstr "" -#: ../../c-api/init.rst:1452 +#: ../../c-api/init.rst:1574 msgid "" "If this is ``0`` then the runtime will not support replacing the current " "process via exec (e.g. :func:`os.execv`) in any thread where the sub-" "interpreter is currently active. Otherwise exec is unrestricted." msgstr "" -#: ../../c-api/init.rst:1457 +#: ../../c-api/init.rst:1579 msgid "" "Note that the :mod:`subprocess` module still works when exec is disallowed." msgstr "" -#: ../../c-api/init.rst:1462 +#: ../../c-api/init.rst:1584 msgid "" "If this is ``0`` then the sub-interpreter's :mod:`threading` module won't " "create threads. Otherwise threads are allowed." msgstr "" -#: ../../c-api/init.rst:1468 +#: ../../c-api/init.rst:1590 msgid "" "If this is ``0`` then the sub-interpreter's :mod:`threading` module won't " "create daemon threads. Otherwise daemon threads are allowed (as long as :c:" "member:`~PyInterpreterConfig.allow_threads` is non-zero)." msgstr "" -#: ../../c-api/init.rst:1475 +#: ../../c-api/init.rst:1597 msgid "" "If this is ``0`` then all extension modules may be imported, including " "legacy (single-phase init) modules, in any thread where the sub-interpreter " @@ -1750,37 +1936,37 @@ msgid "" "`Py_mod_multiple_interpreters`.)" msgstr "" -#: ../../c-api/init.rst:1482 +#: ../../c-api/init.rst:1604 msgid "" "This must be ``1`` (non-zero) if :c:member:`~PyInterpreterConfig." "use_main_obmalloc` is ``0``." msgstr "" -#: ../../c-api/init.rst:1487 +#: ../../c-api/init.rst:1609 msgid "" "This determines the operation of the GIL for the sub-interpreter. It may be " "one of the following:" msgstr "" -#: ../../c-api/init.rst:1494 +#: ../../c-api/init.rst:1616 msgid "Use the default selection (:c:macro:`PyInterpreterConfig_SHARED_GIL`)." msgstr "" -#: ../../c-api/init.rst:1498 +#: ../../c-api/init.rst:1620 msgid "Use (share) the main interpreter's GIL." msgstr "" -#: ../../c-api/init.rst:1502 +#: ../../c-api/init.rst:1624 msgid "Use the sub-interpreter's own GIL." msgstr "" -#: ../../c-api/init.rst:1504 +#: ../../c-api/init.rst:1626 msgid "" "If this is :c:macro:`PyInterpreterConfig_OWN_GIL` then :c:member:" "`PyInterpreterConfig.use_main_obmalloc` must be ``0``." msgstr "" -#: ../../c-api/init.rst:1518 +#: ../../c-api/init.rst:1640 msgid "" "Create a new sub-interpreter. This is an (almost) totally separate " "environment for the execution of Python code. In particular, the new " @@ -1793,13 +1979,13 @@ msgid "" "underlying file descriptors)." msgstr "" -#: ../../c-api/init.rst:1528 +#: ../../c-api/init.rst:1650 msgid "" "The given *config* controls the options with which the interpreter is " "initialized." msgstr "" -#: ../../c-api/init.rst:1531 +#: ../../c-api/init.rst:1653 msgid "" "Upon success, *tstate_p* will be set to the first thread state created in " "the new sub-interpreter. This thread state is made in the current thread " @@ -1810,7 +1996,7 @@ msgid "" "state." msgstr "" -#: ../../c-api/init.rst:1540 +#: ../../c-api/init.rst:1662 msgid "" "Like all other Python/C API functions, the global interpreter lock must be " "held before calling this function and is still held when it returns. " @@ -1822,13 +2008,13 @@ msgid "" "released here." msgstr "" -#: ../../c-api/init.rst:1551 +#: ../../c-api/init.rst:1673 msgid "" "Sub-interpreters are most effective when isolated from each other, with " "certain functionality restricted::" msgstr "" -#: ../../c-api/init.rst:1554 +#: ../../c-api/init.rst:1676 msgid "" "PyInterpreterConfig config = {\n" " .use_main_obmalloc = 0,\n" @@ -1852,7 +2038,7 @@ msgstr "" "};\n" "PyThreadState *tstate = Py_NewInterpreterFromConfig(&config);" -#: ../../c-api/init.rst:1565 +#: ../../c-api/init.rst:1687 msgid "" "Note that the config is used only briefly and does not get modified. During " "initialization the config's values are converted into various :c:type:" @@ -1860,11 +2046,11 @@ msgid "" "internally on the :c:type:`PyInterpreterState`." msgstr "" -#: ../../c-api/init.rst:1574 +#: ../../c-api/init.rst:1696 msgid "Extension modules are shared between (sub-)interpreters as follows:" msgstr "" -#: ../../c-api/init.rst:1576 +#: ../../c-api/init.rst:1698 msgid "" "For modules using multi-phase initialization, e.g. :c:func:" "`PyModule_FromDefAndSpec`, a separate module object is created and " @@ -1872,7 +2058,7 @@ msgid "" "are shared between these module objects." msgstr "" -#: ../../c-api/init.rst:1582 +#: ../../c-api/init.rst:1704 msgid "" "For modules using single-phase initialization, e.g. :c:func:" "`PyModule_Create`, the first time a particular extension is imported, it is " @@ -1884,7 +2070,7 @@ msgid "" "might cause unwanted behavior (see `Bugs and caveats`_ below)." msgstr "" -#: ../../c-api/init.rst:1593 +#: ../../c-api/init.rst:1715 msgid "" "Note that this is different from what happens when an extension is imported " "after the interpreter has been completely re-initialized by calling :c:func:" @@ -1894,7 +2080,7 @@ msgid "" "shared between these modules." msgstr "" -#: ../../c-api/init.rst:1613 +#: ../../c-api/init.rst:1735 msgid "" "Create a new sub-interpreter. This is essentially just a wrapper around :c:" "func:`Py_NewInterpreterFromConfig` with a config that preserves the existing " @@ -1903,7 +2089,7 @@ msgid "" "single-phase init modules." msgstr "" -#: ../../c-api/init.rst:1625 +#: ../../c-api/init.rst:1747 msgid "" "Destroy the (sub-)interpreter represented by the given thread state. The " "given thread state must be the current thread state. See the discussion of " @@ -1913,17 +2099,17 @@ msgid "" "be held before calling this function. No GIL is held when it returns." msgstr "" -#: ../../c-api/init.rst:1633 +#: ../../c-api/init.rst:1755 msgid "" ":c:func:`Py_FinalizeEx` will destroy all sub-interpreters that haven't been " "explicitly destroyed at that point." msgstr "" -#: ../../c-api/init.rst:1638 +#: ../../c-api/init.rst:1760 msgid "A Per-Interpreter GIL" msgstr "" -#: ../../c-api/init.rst:1640 +#: ../../c-api/init.rst:1762 msgid "" "Using :c:func:`Py_NewInterpreterFromConfig` you can create a sub-interpreter " "that is completely isolated from other interpreters, including having its " @@ -1935,7 +2121,7 @@ msgid "" "just using threads. (See :pep:`554`.)" msgstr "" -#: ../../c-api/init.rst:1650 +#: ../../c-api/init.rst:1772 msgid "" "Using an isolated interpreter requires vigilance in preserving that " "isolation. That especially means not sharing any objects or mutable state " @@ -1949,7 +2135,7 @@ msgid "" "builtin objects." msgstr "" -#: ../../c-api/init.rst:1661 +#: ../../c-api/init.rst:1783 msgid "" "If you preserve isolation then you will have access to proper multi-core " "computing without the complications that come with free-threading. Failure " @@ -1957,7 +2143,7 @@ msgid "" "threading, including races and hard-to-debug crashes." msgstr "" -#: ../../c-api/init.rst:1666 +#: ../../c-api/init.rst:1788 msgid "" "Aside from that, one of the main challenges of using multiple isolated " "interpreters is how to communicate between them safely (not break isolation) " @@ -1967,11 +2153,11 @@ msgid "" "sharing) data between interpreters." msgstr "" -#: ../../c-api/init.rst:1677 +#: ../../c-api/init.rst:1799 msgid "Bugs and caveats" msgstr "" -#: ../../c-api/init.rst:1679 +#: ../../c-api/init.rst:1801 msgid "" "Because sub-interpreters (and the main interpreter) are part of the same " "process, the insulation between them isn't perfect --- for example, using " @@ -1984,7 +2170,7 @@ msgid "" "should be avoided if possible." msgstr "" -#: ../../c-api/init.rst:1689 +#: ../../c-api/init.rst:1811 msgid "" "Special care should be taken to avoid sharing user-defined functions, " "methods, instances or classes between sub-interpreters, since import " @@ -1993,7 +2179,7 @@ msgid "" "objects from which the above are reachable." msgstr "" -#: ../../c-api/init.rst:1695 +#: ../../c-api/init.rst:1817 msgid "" "Also note that combining this functionality with ``PyGILState_*`` APIs is " "delicate, because these APIs assume a bijection between Python thread states " @@ -2005,25 +2191,25 @@ msgid "" "created threads will probably be broken when using sub-interpreters." msgstr "" -#: ../../c-api/init.rst:1706 +#: ../../c-api/init.rst:1828 msgid "Asynchronous Notifications" msgstr "" -#: ../../c-api/init.rst:1708 +#: ../../c-api/init.rst:1830 msgid "" "A mechanism is provided to make asynchronous notifications to the main " "interpreter thread. These notifications take the form of a function pointer " "and a void pointer argument." msgstr "" -#: ../../c-api/init.rst:1715 +#: ../../c-api/init.rst:1837 msgid "" "Schedule a function to be called from the main interpreter thread. On " "success, ``0`` is returned and *func* is queued for being called in the main " "thread. On failure, ``-1`` is returned without setting any exception." msgstr "" -#: ../../c-api/init.rst:1719 +#: ../../c-api/init.rst:1841 msgid "" "When successfully queued, *func* will be *eventually* called from the main " "interpreter thread with the argument *arg*. It will be called " @@ -2031,17 +2217,17 @@ msgid "" "these conditions met:" msgstr "" -#: ../../c-api/init.rst:1724 +#: ../../c-api/init.rst:1846 msgid "on a :term:`bytecode` boundary;" msgstr "" -#: ../../c-api/init.rst:1725 +#: ../../c-api/init.rst:1847 msgid "" "with the main thread holding the :term:`global interpreter lock` (*func* can " "therefore use the full C API)." msgstr "" -#: ../../c-api/init.rst:1728 +#: ../../c-api/init.rst:1850 msgid "" "*func* must return ``0`` on success, or ``-1`` on failure with an exception " "set. *func* won't be interrupted to perform another asynchronous " @@ -2049,20 +2235,20 @@ msgid "" "if the global interpreter lock is released." msgstr "" -#: ../../c-api/init.rst:1733 +#: ../../c-api/init.rst:1855 msgid "" "This function doesn't need a current thread state to run, and it doesn't " "need the global interpreter lock." msgstr "" -#: ../../c-api/init.rst:1736 +#: ../../c-api/init.rst:1858 msgid "" "To call this function in a subinterpreter, the caller must hold the GIL. " "Otherwise, the function *func* can be scheduled to be called from the wrong " "interpreter." msgstr "" -#: ../../c-api/init.rst:1741 +#: ../../c-api/init.rst:1863 msgid "" "This is a low-level function, only useful for very special cases. There is " "no guarantee that *func* will be called as quick as possible. If the main " @@ -2072,7 +2258,7 @@ msgid "" "`PyGILState API`." msgstr "" -#: ../../c-api/init.rst:1750 +#: ../../c-api/init.rst:1872 msgid "" "If this function is called in a subinterpreter, the function *func* is now " "scheduled to be called from the subinterpreter, rather than being called " @@ -2080,18 +2266,18 @@ msgid "" "scheduled calls." msgstr "" -#: ../../c-api/init.rst:1759 +#: ../../c-api/init.rst:1881 msgid "Profiling and Tracing" msgstr "" -#: ../../c-api/init.rst:1764 +#: ../../c-api/init.rst:1886 msgid "" "The Python interpreter provides some low-level support for attaching " "profiling and execution tracing facilities. These are used for profiling, " "debugging, and coverage analysis tools." msgstr "" -#: ../../c-api/init.rst:1768 +#: ../../c-api/init.rst:1890 msgid "" "This C interface allows the profiling or tracing code to avoid the overhead " "of calling through Python-level callable objects, making a direct C function " @@ -2101,7 +2287,7 @@ msgid "" "reported to the Python-level trace functions in previous versions." msgstr "" -#: ../../c-api/init.rst:1778 +#: ../../c-api/init.rst:1900 msgid "" "The type of the trace function registered using :c:func:`PyEval_SetProfile` " "and :c:func:`PyEval_SetTrace`. The first parameter is the object passed to " @@ -2113,66 +2299,66 @@ msgid "" "value of *what*:" msgstr "" -#: ../../c-api/init.rst:1787 +#: ../../c-api/init.rst:1909 msgid "Value of *what*" msgstr "" -#: ../../c-api/init.rst:1787 +#: ../../c-api/init.rst:1909 msgid "Meaning of *arg*" msgstr "*arg* 的含義" -#: ../../c-api/init.rst:1789 +#: ../../c-api/init.rst:1911 msgid ":c:data:`PyTrace_CALL`" msgstr ":c:data:`PyTrace_CALL`" -#: ../../c-api/init.rst:1789 ../../c-api/init.rst:1794 -#: ../../c-api/init.rst:1805 +#: ../../c-api/init.rst:1911 ../../c-api/init.rst:1916 +#: ../../c-api/init.rst:1927 msgid "Always :c:data:`Py_None`." msgstr "" -#: ../../c-api/init.rst:1791 +#: ../../c-api/init.rst:1913 msgid ":c:data:`PyTrace_EXCEPTION`" msgstr ":c:data:`PyTrace_EXCEPTION`" -#: ../../c-api/init.rst:1791 +#: ../../c-api/init.rst:1913 msgid "Exception information as returned by :func:`sys.exc_info`." msgstr "" -#: ../../c-api/init.rst:1794 +#: ../../c-api/init.rst:1916 msgid ":c:data:`PyTrace_LINE`" msgstr ":c:data:`PyTrace_LINE`" -#: ../../c-api/init.rst:1796 +#: ../../c-api/init.rst:1918 msgid ":c:data:`PyTrace_RETURN`" msgstr ":c:data:`PyTrace_RETURN`" -#: ../../c-api/init.rst:1796 +#: ../../c-api/init.rst:1918 msgid "" "Value being returned to the caller, or ``NULL`` if caused by an exception." msgstr "" -#: ../../c-api/init.rst:1799 +#: ../../c-api/init.rst:1921 msgid ":c:data:`PyTrace_C_CALL`" msgstr ":c:data:`PyTrace_C_CALL`" -#: ../../c-api/init.rst:1799 ../../c-api/init.rst:1801 -#: ../../c-api/init.rst:1803 +#: ../../c-api/init.rst:1921 ../../c-api/init.rst:1923 +#: ../../c-api/init.rst:1925 msgid "Function object being called." msgstr "被呼叫的函式物件。" -#: ../../c-api/init.rst:1801 +#: ../../c-api/init.rst:1923 msgid ":c:data:`PyTrace_C_EXCEPTION`" msgstr ":c:data:`PyTrace_C_EXCEPTION`" -#: ../../c-api/init.rst:1803 +#: ../../c-api/init.rst:1925 msgid ":c:data:`PyTrace_C_RETURN`" msgstr ":c:data:`PyTrace_C_RETURN`" -#: ../../c-api/init.rst:1805 +#: ../../c-api/init.rst:1927 msgid ":c:data:`PyTrace_OPCODE`" msgstr ":c:data:`PyTrace_OPCODE`" -#: ../../c-api/init.rst:1810 +#: ../../c-api/init.rst:1932 msgid "" "The value of the *what* parameter to a :c:type:`Py_tracefunc` function when " "a new call to a function or method is being reported, or a new entry into a " @@ -2181,7 +2367,7 @@ msgid "" "the corresponding frame." msgstr "" -#: ../../c-api/init.rst:1819 +#: ../../c-api/init.rst:1941 msgid "" "The value of the *what* parameter to a :c:type:`Py_tracefunc` function when " "an exception has been raised. The callback function is called with this " @@ -2193,7 +2379,7 @@ msgid "" "profiler." msgstr "" -#: ../../c-api/init.rst:1830 +#: ../../c-api/init.rst:1952 msgid "" "The value passed as the *what* parameter to a :c:type:`Py_tracefunc` " "function (but not a profiling function) when a line-number event is being " @@ -2201,31 +2387,31 @@ msgid "" "f_trace_lines` to *0* on that frame." msgstr "" -#: ../../c-api/init.rst:1838 +#: ../../c-api/init.rst:1960 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a call is about to return." msgstr "" -#: ../../c-api/init.rst:1844 +#: ../../c-api/init.rst:1966 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function is about to be called." msgstr "" -#: ../../c-api/init.rst:1850 +#: ../../c-api/init.rst:1972 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function has raised an exception." msgstr "" -#: ../../c-api/init.rst:1856 +#: ../../c-api/init.rst:1978 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function has returned." msgstr "" -#: ../../c-api/init.rst:1862 +#: ../../c-api/init.rst:1984 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions (but " "not profiling functions) when a new opcode is about to be executed. This " @@ -2233,7 +2419,7 @@ msgid "" "attr:`~frame.f_trace_opcodes` to *1* on the frame." msgstr "" -#: ../../c-api/init.rst:1870 +#: ../../c-api/init.rst:1992 msgid "" "Set the profiler function to *func*. The *obj* parameter is passed to the " "function as its first parameter, and may be any Python object, or ``NULL``. " @@ -2243,29 +2429,29 @@ msgid "" "`PyTrace_LINE` :c:data:`PyTrace_OPCODE` and :c:data:`PyTrace_EXCEPTION`." msgstr "" -#: ../../c-api/init.rst:1877 +#: ../../c-api/init.rst:1999 msgid "See also the :func:`sys.setprofile` function." msgstr "" -#: ../../c-api/init.rst:1879 ../../c-api/init.rst:1886 -#: ../../c-api/init.rst:1905 ../../c-api/init.rst:1912 +#: ../../c-api/init.rst:2001 ../../c-api/init.rst:2008 +#: ../../c-api/init.rst:2027 ../../c-api/init.rst:2034 msgid "The caller must hold the :term:`GIL`." msgstr "呼叫者必須持有 :term:`GIL`。" -#: ../../c-api/init.rst:1883 +#: ../../c-api/init.rst:2005 msgid "" "Like :c:func:`PyEval_SetProfile` but sets the profile function in all " "running threads belonging to the current interpreter instead of the setting " "it only on the current thread." msgstr "" -#: ../../c-api/init.rst:1888 +#: ../../c-api/init.rst:2010 msgid "" "As :c:func:`PyEval_SetProfile`, this function ignores any exceptions raised " "while setting the profile functions in all threads." msgstr "" -#: ../../c-api/init.rst:1896 +#: ../../c-api/init.rst:2018 msgid "" "Set the tracing function to *func*. This is similar to :c:func:" "`PyEval_SetProfile`, except the tracing function does receive line-number " @@ -2276,28 +2462,28 @@ msgid "" "*what* parameter." msgstr "" -#: ../../c-api/init.rst:1903 +#: ../../c-api/init.rst:2025 msgid "See also the :func:`sys.settrace` function." msgstr "也請見 :func:`sys.settrace` 函式。" -#: ../../c-api/init.rst:1909 +#: ../../c-api/init.rst:2031 msgid "" "Like :c:func:`PyEval_SetTrace` but sets the tracing function in all running " "threads belonging to the current interpreter instead of the setting it only " "on the current thread." msgstr "" -#: ../../c-api/init.rst:1914 +#: ../../c-api/init.rst:2036 msgid "" "As :c:func:`PyEval_SetTrace`, this function ignores any exceptions raised " "while setting the trace functions in all threads." msgstr "" -#: ../../c-api/init.rst:1920 +#: ../../c-api/init.rst:2042 msgid "Reference tracing" msgstr "" -#: ../../c-api/init.rst:1926 +#: ../../c-api/init.rst:2048 msgid "" "The type of the trace function registered using :c:func:" "`PyRefTracer_SetTracer`. The first parameter is a Python object that has " @@ -2307,19 +2493,19 @@ msgid "" "provided when :c:func:`PyRefTracer_SetTracer` was called." msgstr "" -#: ../../c-api/init.rst:1936 +#: ../../c-api/init.rst:2058 msgid "" "The value for the *event* parameter to :c:type:`PyRefTracer` functions when " "a Python object has been created." msgstr "" -#: ../../c-api/init.rst:1941 +#: ../../c-api/init.rst:2063 msgid "" "The value for the *event* parameter to :c:type:`PyRefTracer` functions when " "a Python object has been destroyed." msgstr "" -#: ../../c-api/init.rst:1946 +#: ../../c-api/init.rst:2068 msgid "" "Register a reference tracer function. The function will be called when a new " "Python has been created or when an object is going to be destroyed. If " @@ -2328,7 +2514,7 @@ msgid "" "return ``-1`` on error." msgstr "" -#: ../../c-api/init.rst:1952 +#: ../../c-api/init.rst:2074 msgid "" "Not that tracer functions **must not** create Python objects inside or " "otherwise the call will be re-entrant. The tracer also **must not** clear " @@ -2336,11 +2522,11 @@ msgid "" "the tracer function is called." msgstr "" -#: ../../c-api/init.rst:1957 ../../c-api/init.rst:1968 +#: ../../c-api/init.rst:2079 ../../c-api/init.rst:2090 msgid "The GIL must be held when calling this function." msgstr "" -#: ../../c-api/init.rst:1963 +#: ../../c-api/init.rst:2085 msgid "" "Get the registered reference tracer function and the value of the opaque " "data pointer that was registered when :c:func:`PyRefTracer_SetTracer` was " @@ -2348,48 +2534,48 @@ msgid "" "set the **data** pointer to NULL." msgstr "" -#: ../../c-api/init.rst:1975 +#: ../../c-api/init.rst:2097 msgid "Advanced Debugger Support" msgstr "" -#: ../../c-api/init.rst:1980 +#: ../../c-api/init.rst:2102 msgid "" "These functions are only intended to be used by advanced debugging tools." msgstr "" -#: ../../c-api/init.rst:1985 +#: ../../c-api/init.rst:2107 msgid "" "Return the interpreter state object at the head of the list of all such " "objects." msgstr "" -#: ../../c-api/init.rst:1990 +#: ../../c-api/init.rst:2112 msgid "Return the main interpreter state object." msgstr "" -#: ../../c-api/init.rst:1995 +#: ../../c-api/init.rst:2117 msgid "" "Return the next interpreter state object after *interp* from the list of all " "such objects." msgstr "" -#: ../../c-api/init.rst:2001 +#: ../../c-api/init.rst:2123 msgid "" "Return the pointer to the first :c:type:`PyThreadState` object in the list " "of threads associated with the interpreter *interp*." msgstr "" -#: ../../c-api/init.rst:2007 +#: ../../c-api/init.rst:2129 msgid "" "Return the next thread state object after *tstate* from the list of all such " "objects belonging to the same :c:type:`PyInterpreterState` object." msgstr "" -#: ../../c-api/init.rst:2014 +#: ../../c-api/init.rst:2136 msgid "Thread Local Storage Support" msgstr "" -#: ../../c-api/init.rst:2018 +#: ../../c-api/init.rst:2140 msgid "" "The Python interpreter provides low-level support for thread-local storage " "(TLS) which wraps the underlying native TLS implementation to support the " @@ -2399,19 +2585,19 @@ msgid "" "thread." msgstr "" -#: ../../c-api/init.rst:2025 +#: ../../c-api/init.rst:2147 msgid "" "The GIL does *not* need to be held when calling these functions; they supply " "their own locking." msgstr "" -#: ../../c-api/init.rst:2028 +#: ../../c-api/init.rst:2150 msgid "" "Note that :file:`Python.h` does not include the declaration of the TLS APIs, " "you need to include :file:`pythread.h` to use thread-local storage." msgstr "" -#: ../../c-api/init.rst:2032 +#: ../../c-api/init.rst:2154 msgid "" "None of these API functions handle memory management on behalf of the :c:" "expr:`void*` values. You need to allocate and deallocate them yourself. If " @@ -2419,22 +2605,22 @@ msgid "" "don't do refcount operations on them either." msgstr "" -#: ../../c-api/init.rst:2040 +#: ../../c-api/init.rst:2162 msgid "Thread Specific Storage (TSS) API" msgstr "" -#: ../../c-api/init.rst:2042 +#: ../../c-api/init.rst:2164 msgid "" "TSS API is introduced to supersede the use of the existing TLS API within " "the CPython interpreter. This API uses a new type :c:type:`Py_tss_t` " "instead of :c:expr:`int` to represent thread keys." msgstr "" -#: ../../c-api/init.rst:2048 +#: ../../c-api/init.rst:2170 msgid "\"A New C-API for Thread-Local Storage in CPython\" (:pep:`539`)" msgstr "" -#: ../../c-api/init.rst:2053 +#: ../../c-api/init.rst:2175 msgid "" "This data structure represents the state of a thread key, the definition of " "which may depend on the underlying TLS implementation, and it has an " @@ -2442,52 +2628,52 @@ msgid "" "public members in this structure." msgstr "" -#: ../../c-api/init.rst:2058 +#: ../../c-api/init.rst:2180 msgid "" "When :ref:`Py_LIMITED_API ` is not defined, static allocation of " "this type by :c:macro:`Py_tss_NEEDS_INIT` is allowed." msgstr "" -#: ../../c-api/init.rst:2064 +#: ../../c-api/init.rst:2186 msgid "" "This macro expands to the initializer for :c:type:`Py_tss_t` variables. Note " "that this macro won't be defined with :ref:`Py_LIMITED_API `." msgstr "" -#: ../../c-api/init.rst:2069 +#: ../../c-api/init.rst:2191 msgid "Dynamic Allocation" msgstr "" -#: ../../c-api/init.rst:2071 +#: ../../c-api/init.rst:2193 msgid "" "Dynamic allocation of the :c:type:`Py_tss_t`, required in extension modules " "built with :ref:`Py_LIMITED_API `, where static allocation of this " "type is not possible due to its implementation being opaque at build time." msgstr "" -#: ../../c-api/init.rst:2078 +#: ../../c-api/init.rst:2200 msgid "" "Return a value which is the same state as a value initialized with :c:macro:" "`Py_tss_NEEDS_INIT`, or ``NULL`` in the case of dynamic allocation failure." msgstr "" -#: ../../c-api/init.rst:2085 +#: ../../c-api/init.rst:2207 msgid "" "Free the given *key* allocated by :c:func:`PyThread_tss_alloc`, after first " "calling :c:func:`PyThread_tss_delete` to ensure any associated thread locals " "have been unassigned. This is a no-op if the *key* argument is ``NULL``." msgstr "" -#: ../../c-api/init.rst:2091 +#: ../../c-api/init.rst:2213 msgid "" "A freed key becomes a dangling pointer. You should reset the key to ``NULL``." msgstr "" -#: ../../c-api/init.rst:2096 +#: ../../c-api/init.rst:2218 msgid "Methods" msgstr "方法" -#: ../../c-api/init.rst:2098 +#: ../../c-api/init.rst:2220 msgid "" "The parameter *key* of these functions must not be ``NULL``. Moreover, the " "behaviors of :c:func:`PyThread_tss_set` and :c:func:`PyThread_tss_get` are " @@ -2495,13 +2681,13 @@ msgid "" "func:`PyThread_tss_create`." msgstr "" -#: ../../c-api/init.rst:2106 +#: ../../c-api/init.rst:2228 msgid "" "Return a non-zero value if the given :c:type:`Py_tss_t` has been initialized " "by :c:func:`PyThread_tss_create`." msgstr "" -#: ../../c-api/init.rst:2112 +#: ../../c-api/init.rst:2234 msgid "" "Return a zero value on successful initialization of a TSS key. The behavior " "is undefined if the value pointed to by the *key* argument is not " @@ -2510,7 +2696,7 @@ msgid "" "no-op and immediately returns success." msgstr "" -#: ../../c-api/init.rst:2121 +#: ../../c-api/init.rst:2243 msgid "" "Destroy a TSS key to forget the values associated with the key across all " "threads, and change the key's initialization state to uninitialized. A " @@ -2519,31 +2705,31 @@ msgid "" "key -- calling it on an already destroyed key is a no-op." msgstr "" -#: ../../c-api/init.rst:2130 +#: ../../c-api/init.rst:2252 msgid "" "Return a zero value to indicate successfully associating a :c:expr:`void*` " "value with a TSS key in the current thread. Each thread has a distinct " "mapping of the key to a :c:expr:`void*` value." msgstr "" -#: ../../c-api/init.rst:2137 +#: ../../c-api/init.rst:2259 msgid "" "Return the :c:expr:`void*` value associated with a TSS key in the current " "thread. This returns ``NULL`` if no value is associated with the key in the " "current thread." msgstr "" -#: ../../c-api/init.rst:2145 +#: ../../c-api/init.rst:2267 msgid "Thread Local Storage (TLS) API" msgstr "執行緒局部儲存 (Thread Local Storage, TLS) API:" -#: ../../c-api/init.rst:2147 +#: ../../c-api/init.rst:2269 msgid "" "This API is superseded by :ref:`Thread Specific Storage (TSS) API `." msgstr "" -#: ../../c-api/init.rst:2152 +#: ../../c-api/init.rst:2274 msgid "" "This version of the API does not support platforms where the native TLS key " "is defined in a way that cannot be safely cast to ``int``. On such " @@ -2552,62 +2738,62 @@ msgid "" "platforms." msgstr "" -#: ../../c-api/init.rst:2157 +#: ../../c-api/init.rst:2279 msgid "" "Due to the compatibility problem noted above, this version of the API should " "not be used in new code." msgstr "" -#: ../../c-api/init.rst:2168 +#: ../../c-api/init.rst:2290 msgid "Synchronization Primitives" msgstr "" -#: ../../c-api/init.rst:2170 +#: ../../c-api/init.rst:2292 msgid "The C-API provides a basic mutual exclusion lock." msgstr "" -#: ../../c-api/init.rst:2174 +#: ../../c-api/init.rst:2296 msgid "" "A mutual exclusion lock. The :c:type:`!PyMutex` should be initialized to " "zero to represent the unlocked state. For example::" msgstr "" -#: ../../c-api/init.rst:2177 +#: ../../c-api/init.rst:2299 msgid "PyMutex mutex = {0};" msgstr "" -#: ../../c-api/init.rst:2179 +#: ../../c-api/init.rst:2301 msgid "" "Instances of :c:type:`!PyMutex` should not be copied or moved. Both the " "contents and address of a :c:type:`!PyMutex` are meaningful, and it must " "remain at a fixed, writable location in memory." msgstr "" -#: ../../c-api/init.rst:2185 +#: ../../c-api/init.rst:2307 msgid "" "A :c:type:`!PyMutex` currently occupies one byte, but the size should be " "considered unstable. The size may change in future Python releases without " "a deprecation period." msgstr "" -#: ../../c-api/init.rst:2193 +#: ../../c-api/init.rst:2315 msgid "" "Lock mutex *m*. If another thread has already locked it, the calling thread " "will block until the mutex is unlocked. While blocked, the thread will " "temporarily release the :term:`GIL` if it is held." msgstr "" -#: ../../c-api/init.rst:2201 +#: ../../c-api/init.rst:2323 msgid "" "Unlock mutex *m*. The mutex must be locked --- otherwise, the function will " "issue a fatal error." msgstr "" -#: ../../c-api/init.rst:2209 +#: ../../c-api/init.rst:2331 msgid "Python Critical Section API" msgstr "" -#: ../../c-api/init.rst:2211 +#: ../../c-api/init.rst:2333 msgid "" "The critical section API provides a deadlock avoidance layer on top of per-" "object locks for :term:`free-threaded ` CPython. They are " @@ -2615,7 +2801,7 @@ msgid "" "no-ops in versions of Python with the global interpreter lock." msgstr "" -#: ../../c-api/init.rst:2216 +#: ../../c-api/init.rst:2338 msgid "" "Critical sections avoid deadlocks by implicitly suspending active critical " "sections and releasing the locks during calls to :c:func:" @@ -2625,7 +2811,7 @@ msgid "" "-- they are useful because their behavior is similar to the :term:`GIL`." msgstr "" -#: ../../c-api/init.rst:2223 +#: ../../c-api/init.rst:2345 msgid "" "The functions and structs used by the macros are exposed for cases where C " "macros are not available. They should only be used as in the given macro " @@ -2633,7 +2819,7 @@ msgid "" "future Python versions." msgstr "" -#: ../../c-api/init.rst:2230 +#: ../../c-api/init.rst:2352 msgid "" "Operations that need to lock two objects at once must use :c:macro:" "`Py_BEGIN_CRITICAL_SECTION2`. You *cannot* use nested critical sections to " @@ -2642,11 +2828,11 @@ msgid "" "lock more than two objects at once." msgstr "" -#: ../../c-api/init.rst:2236 +#: ../../c-api/init.rst:2358 msgid "Example usage::" msgstr "" -#: ../../c-api/init.rst:2238 +#: ../../c-api/init.rst:2360 msgid "" "static PyObject *\n" "set_field(MyObject *self, PyObject *value)\n" @@ -2658,7 +2844,7 @@ msgid "" "}" msgstr "" -#: ../../c-api/init.rst:2247 +#: ../../c-api/init.rst:2369 msgid "" "In the above example, :c:macro:`Py_SETREF` calls :c:macro:`Py_DECREF`, which " "can call arbitrary code through an object's deallocation function. The " @@ -2668,248 +2854,215 @@ msgid "" "`PyEval_SaveThread`." msgstr "" -#: ../../c-api/init.rst:2255 +#: ../../c-api/init.rst:2377 msgid "" "Acquires the per-object lock for the object *op* and begins a critical " "section." msgstr "" -#: ../../c-api/init.rst:2258 ../../c-api/init.rst:2272 -#: ../../c-api/init.rst:2287 ../../c-api/init.rst:2301 +#: ../../c-api/init.rst:2380 ../../c-api/init.rst:2394 +#: ../../c-api/init.rst:2409 ../../c-api/init.rst:2423 msgid "In the free-threaded build, this macro expands to::" msgstr "" -#: ../../c-api/init.rst:2260 +#: ../../c-api/init.rst:2382 msgid "" "{\n" " PyCriticalSection _py_cs;\n" " PyCriticalSection_Begin(&_py_cs, (PyObject*)(op))" msgstr "" -#: ../../c-api/init.rst:2264 ../../c-api/init.rst:2293 +#: ../../c-api/init.rst:2386 ../../c-api/init.rst:2415 msgid "In the default build, this macro expands to ``{``." msgstr "" -#: ../../c-api/init.rst:2270 +#: ../../c-api/init.rst:2392 msgid "Ends the critical section and releases the per-object lock." msgstr "" -#: ../../c-api/init.rst:2274 +#: ../../c-api/init.rst:2396 msgid "" " PyCriticalSection_End(&_py_cs);\n" "}" msgstr "" -#: ../../c-api/init.rst:2277 ../../c-api/init.rst:2306 +#: ../../c-api/init.rst:2399 ../../c-api/init.rst:2428 msgid "In the default build, this macro expands to ``}``." msgstr "" -#: ../../c-api/init.rst:2283 +#: ../../c-api/init.rst:2405 msgid "" "Acquires the per-objects locks for the objects *a* and *b* and begins a " "critical section. The locks are acquired in a consistent order (lowest " "address first) to avoid lock ordering deadlocks." msgstr "" -#: ../../c-api/init.rst:2289 +#: ../../c-api/init.rst:2411 msgid "" "{\n" " PyCriticalSection2 _py_cs2;\n" " PyCriticalSection_Begin2(&_py_cs2, (PyObject*)(a), (PyObject*)(b))" msgstr "" -#: ../../c-api/init.rst:2299 +#: ../../c-api/init.rst:2421 msgid "Ends the critical section and releases the per-object locks." msgstr "" -#: ../../c-api/init.rst:2303 +#: ../../c-api/init.rst:2425 msgid "" " PyCriticalSection_End2(&_py_cs2);\n" "}" msgstr "" -#: ../../c-api/init.rst:335 +#: ../../c-api/init.rst:350 msgid "PyEval_InitThreads()" msgstr "PyEval_InitThreads()" -#: ../../c-api/init.rst:335 +#: ../../c-api/init.rst:350 msgid "modules (in module sys)" msgstr "modules(sys 模組中)" -#: ../../c-api/init.rst:335 ../../c-api/init.rst:576 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:698 msgid "path (in module sys)" msgstr "path(sys 模組中)" -#: ../../c-api/init.rst:335 ../../c-api/init.rst:576 ../../c-api/init.rst:1011 -#: ../../c-api/init.rst:1510 ../../c-api/init.rst:1605 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:698 ../../c-api/init.rst:1133 +#: ../../c-api/init.rst:1632 ../../c-api/init.rst:1727 msgid "module" msgstr "模組" -#: ../../c-api/init.rst:335 ../../c-api/init.rst:1510 ../../c-api/init.rst:1605 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:1632 ../../c-api/init.rst:1727 msgid "builtins" msgstr "builtins(內建)" -#: ../../c-api/init.rst:335 ../../c-api/init.rst:1510 ../../c-api/init.rst:1605 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:1632 ../../c-api/init.rst:1727 msgid "__main__" msgstr "__main__" -#: ../../c-api/init.rst:335 ../../c-api/init.rst:1510 ../../c-api/init.rst:1605 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:1632 ../../c-api/init.rst:1727 msgid "sys" msgstr "sys" -#: ../../c-api/init.rst:335 ../../c-api/init.rst:576 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:698 msgid "search" msgstr "search(搜尋)" -#: ../../c-api/init.rst:335 ../../c-api/init.rst:576 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:698 msgid "path" msgstr "path(路徑)" -#: ../../c-api/init.rst:335 ../../c-api/init.rst:1570 ../../c-api/init.rst:1623 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:1692 ../../c-api/init.rst:1745 msgid "Py_FinalizeEx (C function)" msgstr "Py_FinalizeEx(C 函式)" -#: ../../c-api/init.rst:445 +#: ../../c-api/init.rst:567 msgid "Py_Initialize()" msgstr "Py_Initialize()" -#: ../../c-api/init.rst:445 ../../c-api/init.rst:674 +#: ../../c-api/init.rst:567 ../../c-api/init.rst:796 msgid "main()" msgstr "main()" -#: ../../c-api/init.rst:445 +#: ../../c-api/init.rst:567 msgid "Py_GetPath()" msgstr "Py_GetPath()" -#: ../../c-api/init.rst:555 +#: ../../c-api/init.rst:677 msgid "executable (in module sys)" msgstr "executable(sys 模組中)" -#: ../../c-api/init.rst:609 ../../c-api/init.rst:651 ../../c-api/init.rst:665 +#: ../../c-api/init.rst:731 ../../c-api/init.rst:773 ../../c-api/init.rst:787 msgid "version (in module sys)" msgstr "version(sys 模組中)" -#: ../../c-api/init.rst:621 +#: ../../c-api/init.rst:743 msgid "platform (in module sys)" msgstr "platform(sys 模組中)" -#: ../../c-api/init.rst:638 +#: ../../c-api/init.rst:760 msgid "copyright (in module sys)" msgstr "copyright(sys 模組中)" -#: ../../c-api/init.rst:674 +#: ../../c-api/init.rst:796 msgid "Py_FatalError()" msgstr "Py_FatalError()" -#: ../../c-api/init.rst:674 +#: ../../c-api/init.rst:796 msgid "argv (in module sys)" msgstr "argv(sys 模組中)" -#: ../../c-api/init.rst:794 +#: ../../c-api/init.rst:916 msgid "global interpreter lock" msgstr "global interpreter lock(全域直譯器鎖)" -#: ../../c-api/init.rst:794 +#: ../../c-api/init.rst:916 msgid "interpreter lock" msgstr "interpreter lock(直譯器鎖)" -#: ../../c-api/init.rst:794 +#: ../../c-api/init.rst:916 msgid "lock, interpreter" msgstr "lock, interpreter(鎖、直譯器)" -#: ../../c-api/init.rst:807 +#: ../../c-api/init.rst:929 msgid "setswitchinterval (in module sys)" msgstr "setswitchinterval (sys 模組中)" -#: ../../c-api/init.rst:816 +#: ../../c-api/init.rst:938 msgid "PyThreadState (C type)" msgstr "PyThreadState(C 型別)" -#: ../../c-api/init.rst:842 +#: ../../c-api/init.rst:964 msgid "Py_BEGIN_ALLOW_THREADS (C macro)" msgstr "Py_BEGIN_ALLOW_THREADS(C 巨集)" -#: ../../c-api/init.rst:842 +#: ../../c-api/init.rst:964 msgid "Py_END_ALLOW_THREADS (C macro)" msgstr "Py_END_ALLOW_THREADS(C 巨集)" -#: ../../c-api/init.rst:858 +#: ../../c-api/init.rst:980 msgid "PyEval_RestoreThread (C function)" msgstr "PyEval_RestoreThread(C 函式)" -#: ../../c-api/init.rst:858 +#: ../../c-api/init.rst:980 msgid "PyEval_SaveThread (C function)" msgstr "PyEval_SaveThread(C 函式)" -#: ../../c-api/init.rst:989 +#: ../../c-api/init.rst:1111 msgid "PyEval_AcquireThread()" msgstr "PyEval_AcquireThread()" -#: ../../c-api/init.rst:989 +#: ../../c-api/init.rst:1111 msgid "PyEval_ReleaseThread()" msgstr "PyEval_ReleaseThread()" -#: ../../c-api/init.rst:989 +#: ../../c-api/init.rst:1111 msgid "PyEval_SaveThread()" msgstr "PyEval_SaveThread()" -#: ../../c-api/init.rst:989 +#: ../../c-api/init.rst:1111 msgid "PyEval_RestoreThread()" msgstr "PyEval_RestoreThread()" -#: ../../c-api/init.rst:1011 +#: ../../c-api/init.rst:1133 msgid "_thread" msgstr "_thread" -#: ../../c-api/init.rst:1510 ../../c-api/init.rst:1605 +#: ../../c-api/init.rst:1632 ../../c-api/init.rst:1727 msgid "stdout (in module sys)" msgstr "stdout(sys 模組中)" -#: ../../c-api/init.rst:1510 ../../c-api/init.rst:1605 +#: ../../c-api/init.rst:1632 ../../c-api/init.rst:1727 msgid "stderr (in module sys)" msgstr "stderr(sys 模組中)" -#: ../../c-api/init.rst:1510 ../../c-api/init.rst:1605 +#: ../../c-api/init.rst:1632 ../../c-api/init.rst:1727 msgid "stdin (in module sys)" msgstr "stdin(sys 模組中)" -#: ../../c-api/init.rst:1570 +#: ../../c-api/init.rst:1692 msgid "Py_Initialize (C function)" msgstr "Py_Initialize(C 函式)" -#: ../../c-api/init.rst:1600 +#: ../../c-api/init.rst:1722 msgid "close (in module os)" msgstr "close(os 模組中)" - -#~ msgid ":c:func:`Py_SetPath`" -#~ msgstr ":c:func:`Py_SetPath`" - -#~ msgid ":c:func:`Py_SetStandardStreamEncoding`" -#~ msgstr ":c:func:`Py_SetStandardStreamEncoding`" - -#~ msgid ":c:func:`PySys_AddWarnOption`" -#~ msgstr ":c:func:`PySys_AddWarnOption`" - -#~ msgid ":c:func:`PySys_AddXOption`" -#~ msgstr ":c:func:`PySys_AddXOption`" - -#~ msgid "Py_SetProgramName()" -#~ msgstr "Py_SetProgramName()" - -#~ msgid "PySys_SetArgv (C function)" -#~ msgstr "PySys_SetArgv(C 函式)" - -#~ msgid "PySys_SetArgvEx (C function)" -#~ msgstr "PySys_SetArgvEx(C 函式)" - -#~ msgid "stdin" -#~ msgstr "stdin" - -#~ msgid "stdout" -#~ msgstr "stdout" - -#~ msgid "sdterr" -#~ msgstr "sdterr" - -#~ msgid "Py_SetPath()" -#~ msgstr "Py_SetPath()" diff --git a/c-api/init_config.po b/c-api/init_config.po index a51f220060..92b1a1a024 100644 --- a/c-api/init_config.po +++ b/c-api/init_config.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-09 00:13+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-" @@ -573,7 +573,7 @@ msgid "" "`~PyPreConfig.parse_argv` of *preconfig* is non-zero." msgstr "" -#: ../../c-api/init_config.rst:401 ../../c-api/init_config.rst:1360 +#: ../../c-api/init_config.rst:401 ../../c-api/init_config.rst:1359 msgid "" "The caller is responsible to handle exceptions (error or exit) using :c:func:" "`PyStatus_Exception` and :c:func:`Py_ExitStatusException`." @@ -1839,19 +1839,17 @@ msgstr "" msgid "The ``show_alloc_count`` field has been removed." msgstr "" -#: ../../c-api/init_config.rst:1352 -msgid "Initialization with PyConfig" -msgstr "" - #: ../../c-api/init_config.rst:1354 -msgid "Function to initialize Python:" +msgid "Initialization with PyConfig" msgstr "" -#: ../../c-api/init_config.rst:1358 -msgid "Initialize Python from *config* configuration." +#: ../../c-api/init_config.rst:1356 +msgid "" +"Initializing the interpreter from a populated configuration struct is " +"handled by calling :c:func:`Py_InitializeFromConfig`." msgstr "" -#: ../../c-api/init_config.rst:1363 +#: ../../c-api/init_config.rst:1362 msgid "" "If :c:func:`PyImport_FrozenModules`, :c:func:`PyImport_AppendInittab` or :c:" "func:`PyImport_ExtendInittab` are used, they must be set or called after " @@ -1860,17 +1858,17 @@ msgid "" "`PyImport_ExtendInittab` must be called before each Python initialization." msgstr "" -#: ../../c-api/init_config.rst:1370 +#: ../../c-api/init_config.rst:1369 msgid "" "The current configuration (``PyConfig`` type) is stored in " "``PyInterpreterState.config``." msgstr "" -#: ../../c-api/init_config.rst:1373 +#: ../../c-api/init_config.rst:1372 msgid "Example setting the program name::" msgstr "" -#: ../../c-api/init_config.rst:1375 +#: ../../c-api/init_config.rst:1374 msgid "" "void init_python(void)\n" "{\n" @@ -1924,7 +1922,7 @@ msgstr "" " Py_ExitStatusException(status);\n" "}" -#: ../../c-api/init_config.rst:1401 +#: ../../c-api/init_config.rst:1400 msgid "" "More complete example modifying the default configuration, read the " "configuration, and then override some parameters. Note that since 3.11, many " @@ -1933,7 +1931,7 @@ msgid "" "called will be left unchanged by initialization::" msgstr "" -#: ../../c-api/init_config.rst:1408 +#: ../../c-api/init_config.rst:1407 msgid "" "PyStatus init_python(const char *program_name)\n" "{\n" @@ -1988,18 +1986,18 @@ msgid "" "}" msgstr "" -#: ../../c-api/init_config.rst:1464 +#: ../../c-api/init_config.rst:1463 msgid "Isolated Configuration" msgstr "" -#: ../../c-api/init_config.rst:1466 +#: ../../c-api/init_config.rst:1465 msgid "" ":c:func:`PyPreConfig_InitIsolatedConfig` and :c:func:" "`PyConfig_InitIsolatedConfig` functions create a configuration to isolate " "Python from the system. For example, to embed Python into an application." msgstr "" -#: ../../c-api/init_config.rst:1471 +#: ../../c-api/init_config.rst:1470 msgid "" "This configuration ignores global configuration variables, environment " "variables, command line arguments (:c:member:`PyConfig.argv` is not parsed) " @@ -2007,115 +2005,115 @@ msgid "" "LC_CTYPE locale are left unchanged. Signal handlers are not installed." msgstr "" -#: ../../c-api/init_config.rst:1476 +#: ../../c-api/init_config.rst:1475 msgid "" "Configuration files are still used with this configuration to determine " "paths that are unspecified. Ensure :c:member:`PyConfig.home` is specified to " "avoid computing the default path configuration." msgstr "" -#: ../../c-api/init_config.rst:1484 +#: ../../c-api/init_config.rst:1483 msgid "Python Configuration" msgstr "" -#: ../../c-api/init_config.rst:1486 +#: ../../c-api/init_config.rst:1485 msgid "" ":c:func:`PyPreConfig_InitPythonConfig` and :c:func:" "`PyConfig_InitPythonConfig` functions create a configuration to build a " "customized Python which behaves as the regular Python." msgstr "" -#: ../../c-api/init_config.rst:1490 +#: ../../c-api/init_config.rst:1489 msgid "" "Environments variables and command line arguments are used to configure " "Python, whereas global configuration variables are ignored." msgstr "" -#: ../../c-api/init_config.rst:1493 +#: ../../c-api/init_config.rst:1492 msgid "" "This function enables C locale coercion (:pep:`538`) and :ref:`Python UTF-8 " "Mode ` (:pep:`540`) depending on the LC_CTYPE locale, :envvar:" "`PYTHONUTF8` and :envvar:`PYTHONCOERCECLOCALE` environment variables." msgstr "" -#: ../../c-api/init_config.rst:1502 +#: ../../c-api/init_config.rst:1501 msgid "Python Path Configuration" msgstr "" -#: ../../c-api/init_config.rst:1504 +#: ../../c-api/init_config.rst:1503 msgid ":c:type:`PyConfig` contains multiple fields for the path configuration:" msgstr "" -#: ../../c-api/init_config.rst:1506 +#: ../../c-api/init_config.rst:1505 msgid "Path configuration inputs:" msgstr "" -#: ../../c-api/init_config.rst:1508 +#: ../../c-api/init_config.rst:1507 msgid ":c:member:`PyConfig.home`" msgstr ":c:member:`PyConfig.home`" -#: ../../c-api/init_config.rst:1509 +#: ../../c-api/init_config.rst:1508 msgid ":c:member:`PyConfig.platlibdir`" msgstr ":c:member:`PyConfig.platlibdir`" -#: ../../c-api/init_config.rst:1510 +#: ../../c-api/init_config.rst:1509 msgid ":c:member:`PyConfig.pathconfig_warnings`" msgstr ":c:member:`PyConfig.pathconfig_warnings`" -#: ../../c-api/init_config.rst:1511 +#: ../../c-api/init_config.rst:1510 msgid ":c:member:`PyConfig.program_name`" msgstr ":c:member:`PyConfig.program_name`" -#: ../../c-api/init_config.rst:1512 +#: ../../c-api/init_config.rst:1511 msgid ":c:member:`PyConfig.pythonpath_env`" msgstr ":c:member:`PyConfig.pythonpath_env`" -#: ../../c-api/init_config.rst:1513 +#: ../../c-api/init_config.rst:1512 msgid "current working directory: to get absolute paths" msgstr "" -#: ../../c-api/init_config.rst:1514 +#: ../../c-api/init_config.rst:1513 msgid "" "``PATH`` environment variable to get the program full path (from :c:member:" "`PyConfig.program_name`)" msgstr "" -#: ../../c-api/init_config.rst:1516 +#: ../../c-api/init_config.rst:1515 msgid "``__PYVENV_LAUNCHER__`` environment variable" msgstr "``__PYVENV_LAUNCHER__`` 環境變數" -#: ../../c-api/init_config.rst:1517 +#: ../../c-api/init_config.rst:1516 msgid "" "(Windows only) Application paths in the registry under " "\"Software\\Python\\PythonCore\\X.Y\\PythonPath\" of HKEY_CURRENT_USER and " "HKEY_LOCAL_MACHINE (where X.Y is the Python version)." msgstr "" -#: ../../c-api/init_config.rst:1521 +#: ../../c-api/init_config.rst:1520 msgid "Path configuration output fields:" msgstr "" -#: ../../c-api/init_config.rst:1523 +#: ../../c-api/init_config.rst:1522 msgid ":c:member:`PyConfig.base_exec_prefix`" msgstr ":c:member:`PyConfig.base_exec_prefix`" -#: ../../c-api/init_config.rst:1524 +#: ../../c-api/init_config.rst:1523 msgid ":c:member:`PyConfig.base_executable`" msgstr ":c:member:`PyConfig.base_executable`" -#: ../../c-api/init_config.rst:1525 +#: ../../c-api/init_config.rst:1524 msgid ":c:member:`PyConfig.base_prefix`" msgstr ":c:member:`PyConfig.base_prefix`" -#: ../../c-api/init_config.rst:1526 +#: ../../c-api/init_config.rst:1525 msgid ":c:member:`PyConfig.exec_prefix`" msgstr ":c:member:`PyConfig.exec_prefix`" -#: ../../c-api/init_config.rst:1527 +#: ../../c-api/init_config.rst:1526 msgid ":c:member:`PyConfig.executable`" msgstr ":c:member:`PyConfig.executable`" -#: ../../c-api/init_config.rst:1528 +#: ../../c-api/init_config.rst:1527 msgid "" ":c:member:`PyConfig.module_search_paths_set`, :c:member:`PyConfig." "module_search_paths`" @@ -2123,11 +2121,11 @@ msgstr "" ":c:member:`PyConfig.module_search_paths_set`, :c:member:`PyConfig." "module_search_paths`" -#: ../../c-api/init_config.rst:1530 +#: ../../c-api/init_config.rst:1529 msgid ":c:member:`PyConfig.prefix`" msgstr ":c:member:`PyConfig.prefix`" -#: ../../c-api/init_config.rst:1532 +#: ../../c-api/init_config.rst:1531 msgid "" "If at least one \"output field\" is not set, Python calculates the path " "configuration to fill unset fields. If :c:member:`~PyConfig." @@ -2136,7 +2134,7 @@ msgid "" "module_search_paths_set` is set to ``1``." msgstr "" -#: ../../c-api/init_config.rst:1538 +#: ../../c-api/init_config.rst:1537 msgid "" "It is possible to completely ignore the function calculating the default " "path configuration by setting explicitly all path configuration output " @@ -2146,52 +2144,52 @@ msgid "" "modification." msgstr "" -#: ../../c-api/init_config.rst:1545 +#: ../../c-api/init_config.rst:1544 msgid "" "Set :c:member:`~PyConfig.pathconfig_warnings` to ``0`` to suppress warnings " "when calculating the path configuration (Unix only, Windows does not log any " "warning)." msgstr "" -#: ../../c-api/init_config.rst:1548 +#: ../../c-api/init_config.rst:1547 msgid "" "If :c:member:`~PyConfig.base_prefix` or :c:member:`~PyConfig." "base_exec_prefix` fields are not set, they inherit their value from :c:" "member:`~PyConfig.prefix` and :c:member:`~PyConfig.exec_prefix` respectively." msgstr "" -#: ../../c-api/init_config.rst:1552 +#: ../../c-api/init_config.rst:1551 msgid ":c:func:`Py_RunMain` and :c:func:`Py_Main` modify :data:`sys.path`:" msgstr "" -#: ../../c-api/init_config.rst:1554 +#: ../../c-api/init_config.rst:1553 msgid "" "If :c:member:`~PyConfig.run_filename` is set and is a directory which " "contains a ``__main__.py`` script, prepend :c:member:`~PyConfig." "run_filename` to :data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:1557 +#: ../../c-api/init_config.rst:1556 msgid "If :c:member:`~PyConfig.isolated` is zero:" msgstr "" -#: ../../c-api/init_config.rst:1559 +#: ../../c-api/init_config.rst:1558 msgid "" "If :c:member:`~PyConfig.run_module` is set, prepend the current directory " "to :data:`sys.path`. Do nothing if the current directory cannot be read." msgstr "" -#: ../../c-api/init_config.rst:1561 +#: ../../c-api/init_config.rst:1560 msgid "" "If :c:member:`~PyConfig.run_filename` is set, prepend the directory of the " "filename to :data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:1563 +#: ../../c-api/init_config.rst:1562 msgid "Otherwise, prepend an empty string to :data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:1565 +#: ../../c-api/init_config.rst:1564 msgid "" "If :c:member:`~PyConfig.site_import` is non-zero, :data:`sys.path` can be " "modified by the :mod:`site` module. If :c:member:`~PyConfig." @@ -2200,170 +2198,143 @@ msgid "" "data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:1571 +#: ../../c-api/init_config.rst:1570 msgid "The following configuration files are used by the path configuration:" msgstr "" -#: ../../c-api/init_config.rst:1573 +#: ../../c-api/init_config.rst:1572 msgid "``pyvenv.cfg``" msgstr "``pyvenv.cfg``" -#: ../../c-api/init_config.rst:1574 +#: ../../c-api/init_config.rst:1573 msgid "``._pth`` file (ex: ``python._pth``)" msgstr "" -#: ../../c-api/init_config.rst:1575 +#: ../../c-api/init_config.rst:1574 msgid "``pybuilddir.txt`` (Unix only)" msgstr "" -#: ../../c-api/init_config.rst:1577 +#: ../../c-api/init_config.rst:1576 msgid "If a ``._pth`` file is present:" msgstr "" -#: ../../c-api/init_config.rst:1579 +#: ../../c-api/init_config.rst:1578 msgid "Set :c:member:`~PyConfig.isolated` to ``1``." msgstr "將 :c:member:`~PyConfig.isolated` 設定為 ``1``。" -#: ../../c-api/init_config.rst:1580 +#: ../../c-api/init_config.rst:1579 msgid "Set :c:member:`~PyConfig.use_environment` to ``0``." msgstr "將 :c:member:`~PyConfig.use_environment` 設定為 ``0``。" -#: ../../c-api/init_config.rst:1581 +#: ../../c-api/init_config.rst:1580 msgid "Set :c:member:`~PyConfig.site_import` to ``0``." msgstr "將 :c:member:`~PyConfig.site_import` 設定為 ``0``。" -#: ../../c-api/init_config.rst:1582 +#: ../../c-api/init_config.rst:1581 msgid "Set :c:member:`~PyConfig.safe_path` to ``1``." msgstr "將 :c:member:`~PyConfig.safe_path` 設定為 ``1``。" -#: ../../c-api/init_config.rst:1584 +#: ../../c-api/init_config.rst:1583 msgid "" "The ``__PYVENV_LAUNCHER__`` environment variable is used to set :c:member:" "`PyConfig.base_executable`." msgstr "" -#: ../../c-api/init_config.rst:1589 -msgid "Py_RunMain()" -msgstr "Py_RunMain()" - -#: ../../c-api/init_config.rst:1593 -msgid "" -"Execute the command (:c:member:`PyConfig.run_command`), the script (:c:" -"member:`PyConfig.run_filename`) or the module (:c:member:`PyConfig." -"run_module`) specified on the command line or in the configuration." -msgstr "" - -#: ../../c-api/init_config.rst:1598 -msgid "By default and when if :option:`-i` option is used, run the REPL." -msgstr "" - -#: ../../c-api/init_config.rst:1600 -msgid "" -"Finally, finalizes Python and returns an exit status that can be passed to " -"the ``exit()`` function." -msgstr "" - -#: ../../c-api/init_config.rst:1603 -msgid "" -"See :ref:`Python Configuration ` for an example of " -"customized Python always running in isolated mode using :c:func:`Py_RunMain`." -msgstr "" - -#: ../../c-api/init_config.rst:1609 +#: ../../c-api/init_config.rst:1588 msgid "Py_GetArgcArgv()" msgstr "Py_GetArgcArgv()" -#: ../../c-api/init_config.rst:1613 +#: ../../c-api/init_config.rst:1592 msgid "Get the original command line arguments, before Python modified them." msgstr "" -#: ../../c-api/init_config.rst:1615 +#: ../../c-api/init_config.rst:1594 msgid "See also :c:member:`PyConfig.orig_argv` member." msgstr "" -#: ../../c-api/init_config.rst:1619 +#: ../../c-api/init_config.rst:1598 msgid "Multi-Phase Initialization Private Provisional API" msgstr "" -#: ../../c-api/init_config.rst:1621 +#: ../../c-api/init_config.rst:1600 msgid "" "This section is a private provisional API introducing multi-phase " "initialization, the core feature of :pep:`432`:" msgstr "" -#: ../../c-api/init_config.rst:1624 +#: ../../c-api/init_config.rst:1603 msgid "\"Core\" initialization phase, \"bare minimum Python\":" msgstr "" -#: ../../c-api/init_config.rst:1626 +#: ../../c-api/init_config.rst:1605 msgid "Builtin types;" msgstr "內建型別;" -#: ../../c-api/init_config.rst:1627 +#: ../../c-api/init_config.rst:1606 msgid "Builtin exceptions;" msgstr "內建例外;" -#: ../../c-api/init_config.rst:1628 +#: ../../c-api/init_config.rst:1607 msgid "Builtin and frozen modules;" msgstr "" -#: ../../c-api/init_config.rst:1629 +#: ../../c-api/init_config.rst:1608 msgid "" "The :mod:`sys` module is only partially initialized (ex: :data:`sys.path` " "doesn't exist yet)." msgstr "" -#: ../../c-api/init_config.rst:1632 +#: ../../c-api/init_config.rst:1611 msgid "\"Main\" initialization phase, Python is fully initialized:" msgstr "" -#: ../../c-api/init_config.rst:1634 +#: ../../c-api/init_config.rst:1613 msgid "Install and configure :mod:`importlib`;" msgstr "" -#: ../../c-api/init_config.rst:1635 +#: ../../c-api/init_config.rst:1614 msgid "Apply the :ref:`Path Configuration `;" msgstr "" -#: ../../c-api/init_config.rst:1636 +#: ../../c-api/init_config.rst:1615 msgid "Install signal handlers;" msgstr "" -#: ../../c-api/init_config.rst:1637 +#: ../../c-api/init_config.rst:1616 msgid "" "Finish :mod:`sys` module initialization (ex: create :data:`sys.stdout` and :" "data:`sys.path`);" msgstr "" -#: ../../c-api/init_config.rst:1639 +#: ../../c-api/init_config.rst:1618 msgid "" "Enable optional features like :mod:`faulthandler` and :mod:`tracemalloc`;" msgstr "" -#: ../../c-api/init_config.rst:1640 +#: ../../c-api/init_config.rst:1619 msgid "Import the :mod:`site` module;" msgstr "引入 :mod:`site` 模組;" -#: ../../c-api/init_config.rst:1641 +#: ../../c-api/init_config.rst:1620 msgid "etc." msgstr "" -#: ../../c-api/init_config.rst:1643 +#: ../../c-api/init_config.rst:1622 msgid "Private provisional API:" msgstr "" -#: ../../c-api/init_config.rst:1645 +#: ../../c-api/init_config.rst:1624 msgid "" ":c:member:`PyConfig._init_main`: if set to ``0``, :c:func:" "`Py_InitializeFromConfig` stops at the \"Core\" initialization phase." msgstr "" -#: ../../c-api/init_config.rst:1650 +#: ../../c-api/init_config.rst:1629 msgid "" "Move to the \"Main\" initialization phase, finish the Python initialization." msgstr "" -#: ../../c-api/init_config.rst:1652 +#: ../../c-api/init_config.rst:1631 msgid "" "No module is imported during the \"Core\" phase and the ``importlib`` module " "is not configured: the :ref:`Path Configuration ` is only " @@ -2372,14 +2343,14 @@ msgid "" "maybe install a custom :data:`sys.meta_path` importer or an import hook, etc." msgstr "" -#: ../../c-api/init_config.rst:1658 +#: ../../c-api/init_config.rst:1637 msgid "" "It may become possible to calculate the :ref:`Path Configuration ` in Python, after the Core phase and before the Main phase, which is " "one of the :pep:`432` motivation." msgstr "" -#: ../../c-api/init_config.rst:1662 +#: ../../c-api/init_config.rst:1641 msgid "" "The \"Core\" phase is not properly defined: what should be and what should " "not be available at this phase is not specified yet. The API is marked as " @@ -2387,13 +2358,13 @@ msgid "" "until a proper public API is designed." msgstr "" -#: ../../c-api/init_config.rst:1667 +#: ../../c-api/init_config.rst:1646 msgid "" "Example running Python code between \"Core\" and \"Main\" initialization " "phases::" msgstr "" -#: ../../c-api/init_config.rst:1670 +#: ../../c-api/init_config.rst:1649 msgid "" "void init_python(void)\n" "{\n" @@ -2438,5 +2409,8 @@ msgstr "" msgid "argv (in module sys)" msgstr "" +#~ msgid "Py_RunMain()" +#~ msgstr "Py_RunMain()" + #~ msgid "Command line arguments: :data:`sys.argv`." #~ msgstr "命令列引數::data:`sys.argv`。" diff --git a/c-api/long.po b/c-api/long.po index 8416a8fa8a..281c5ae8a4 100644 --- a/c-api/long.po +++ b/c-api/long.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-30 09:19+0000\n" +"POT-Creation-Date: 2024-10-14 00:14+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-" @@ -624,13 +624,13 @@ msgid "" "is subject to change." msgstr "" -#: ../../c-api/long.rst:543 +#: ../../c-api/long.rst:546 msgid "" "If *op* is compact, as determined by :c:func:`PyUnstable_Long_IsCompact`, " "return its value." msgstr "" -#: ../../c-api/long.rst:546 +#: ../../c-api/long.rst:549 msgid "Otherwise, the return value is undefined." msgstr "" diff --git a/c-api/module.po b/c-api/module.po index 13cc3dc95a..bfd8be22ed 100644 --- a/c-api/module.po +++ b/c-api/module.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-10 00:13+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-" @@ -42,29 +42,33 @@ msgstr "" #: ../../c-api/module.rst:40 msgid "" -"Return a new module object with the :attr:`__name__` attribute set to " -"*name*. The module's :attr:`__name__`, :attr:`__doc__`, :attr:`__package__`, " -"and :attr:`__loader__` attributes are filled in (all but :attr:`__name__` " -"are set to ``None``); the caller is responsible for providing a :attr:" -"`__file__` attribute." +"Return a new module object with :attr:`module.__name__` set to *name*. The " +"module's :attr:`!__name__`, :attr:`~module.__doc__`, :attr:`~module." +"__package__` and :attr:`~module.__loader__` attributes are filled in (all " +"but :attr:`!__name__` are set to ``None``). The caller is responsible for " +"setting a :attr:`~module.__file__` attribute." msgstr "" -#: ../../c-api/module.rst:46 ../../c-api/module.rst:270 -#: ../../c-api/module.rst:472 +#: ../../c-api/module.rst:46 ../../c-api/module.rst:272 +#: ../../c-api/module.rst:474 msgid "Return ``NULL`` with an exception set on error." msgstr "在失敗時回傳 ``NULL`` 並設定例外。" #: ../../c-api/module.rst:50 -msgid ":attr:`__package__` and :attr:`__loader__` are set to ``None``." -msgstr ":attr:`__package__` 和 :attr:`__loader__` 被設為 ``None``。" +msgid "" +":attr:`~module.__package__` and :attr:`~module.__loader__` are now set to " +"``None``." +msgstr "" +":attr:`~module.__package__` 和 :attr:`~module.__loader__` 現在被設為 " +"``None``。" -#: ../../c-api/module.rst:56 +#: ../../c-api/module.rst:57 msgid "" "Similar to :c:func:`PyModule_NewObject`, but the name is a UTF-8 encoded " "string instead of a Unicode object." msgstr "" -#: ../../c-api/module.rst:64 +#: ../../c-api/module.rst:65 msgid "" "Return the dictionary object that implements *module*'s namespace; this " "object is the same as the :attr:`~object.__dict__` attribute of the module " @@ -72,64 +76,64 @@ msgid "" "object), :exc:`SystemError` is raised and ``NULL`` is returned." msgstr "" -#: ../../c-api/module.rst:69 +#: ../../c-api/module.rst:70 msgid "" "It is recommended extensions use other ``PyModule_*`` and ``PyObject_*`` " "functions rather than directly manipulate a module's :attr:`~object." "__dict__`." msgstr "" -#: ../../c-api/module.rst:80 +#: ../../c-api/module.rst:81 msgid "" -"Return *module*'s :attr:`__name__` value. If the module does not provide " -"one, or if it is not a string, :exc:`SystemError` is raised and ``NULL`` is " -"returned." +"Return *module*'s :attr:`~module.__name__` value. If the module does not " +"provide one, or if it is not a string, :exc:`SystemError` is raised and " +"``NULL`` is returned." msgstr "" -#: ../../c-api/module.rst:88 +#: ../../c-api/module.rst:90 msgid "" "Similar to :c:func:`PyModule_GetNameObject` but return the name encoded to " "``'utf-8'``." msgstr "" -#: ../../c-api/module.rst:93 +#: ../../c-api/module.rst:95 msgid "" "Return the \"state\" of the module, that is, a pointer to the block of " "memory allocated at module creation time, or ``NULL``. See :c:member:" "`PyModuleDef.m_size`." msgstr "" -#: ../../c-api/module.rst:100 +#: ../../c-api/module.rst:102 msgid "" "Return a pointer to the :c:type:`PyModuleDef` struct from which the module " "was created, or ``NULL`` if the module wasn't created from a definition." msgstr "" -#: ../../c-api/module.rst:110 +#: ../../c-api/module.rst:112 msgid "" "Return the name of the file from which *module* was loaded using *module*'s :" -"attr:`__file__` attribute. If this is not defined, or if it is not a " -"unicode string, raise :exc:`SystemError` and return ``NULL``; otherwise " -"return a reference to a Unicode object." +"attr:`~module.__file__` attribute. If this is not defined, or if it is not " +"a string, raise :exc:`SystemError` and return ``NULL``; otherwise return a " +"reference to a Unicode object." msgstr "" -#: ../../c-api/module.rst:120 +#: ../../c-api/module.rst:122 msgid "" "Similar to :c:func:`PyModule_GetFilenameObject` but return the filename " "encoded to 'utf-8'." msgstr "" -#: ../../c-api/module.rst:123 +#: ../../c-api/module.rst:125 msgid "" ":c:func:`PyModule_GetFilename` raises :exc:`UnicodeEncodeError` on " "unencodable filenames, use :c:func:`PyModule_GetFilenameObject` instead." msgstr "" -#: ../../c-api/module.rst:131 +#: ../../c-api/module.rst:133 msgid "Initializing C modules" msgstr "初始化 C 模組" -#: ../../c-api/module.rst:133 +#: ../../c-api/module.rst:135 msgid "" "Modules objects are usually created from extension modules (shared libraries " "which export an initialization function), or compiled-in modules (where the " @@ -137,55 +141,55 @@ msgid "" "See :ref:`building` or :ref:`extending-with-embedding` for details." msgstr "" -#: ../../c-api/module.rst:138 +#: ../../c-api/module.rst:140 msgid "" "The initialization function can either pass a module definition instance to :" "c:func:`PyModule_Create`, and return the resulting module object, or request " "\"multi-phase initialization\" by returning the definition struct itself." msgstr "" -#: ../../c-api/module.rst:144 +#: ../../c-api/module.rst:146 msgid "" "The module definition struct, which holds all information needed to create a " "module object. There is usually only one statically initialized variable of " "this type for each module." msgstr "" -#: ../../c-api/module.rst:150 +#: ../../c-api/module.rst:152 msgid "Always initialize this member to :c:macro:`PyModuleDef_HEAD_INIT`." msgstr "" -#: ../../c-api/module.rst:154 +#: ../../c-api/module.rst:156 msgid "Name for the new module." msgstr "" -#: ../../c-api/module.rst:158 +#: ../../c-api/module.rst:160 msgid "" "Docstring for the module; usually a docstring variable created with :c:macro:" "`PyDoc_STRVAR` is used." msgstr "" -#: ../../c-api/module.rst:163 +#: ../../c-api/module.rst:165 msgid "" "Module state may be kept in a per-module memory area that can be retrieved " "with :c:func:`PyModule_GetState`, rather than in static globals. This makes " "modules safe for use in multiple sub-interpreters." msgstr "" -#: ../../c-api/module.rst:167 +#: ../../c-api/module.rst:169 msgid "" "This memory area is allocated based on *m_size* on module creation, and " "freed when the module object is deallocated, after the :c:member:" "`~PyModuleDef.m_free` function has been called, if present." msgstr "" -#: ../../c-api/module.rst:171 +#: ../../c-api/module.rst:173 msgid "" "Setting ``m_size`` to ``-1`` means that the module does not support sub-" "interpreters, because it has global state." msgstr "" -#: ../../c-api/module.rst:174 +#: ../../c-api/module.rst:176 msgid "" "Setting it to a non-negative value means that the module can be re-" "initialized and specifies the additional amount of memory it requires for " @@ -193,37 +197,37 @@ msgid "" "initialization." msgstr "" -#: ../../c-api/module.rst:179 +#: ../../c-api/module.rst:181 msgid "See :PEP:`3121` for more details." msgstr "更多詳情請見 :pep:`3121`。" -#: ../../c-api/module.rst:183 +#: ../../c-api/module.rst:185 msgid "" "A pointer to a table of module-level functions, described by :c:type:" "`PyMethodDef` values. Can be ``NULL`` if no functions are present." msgstr "" -#: ../../c-api/module.rst:188 +#: ../../c-api/module.rst:190 msgid "" "An array of slot definitions for multi-phase initialization, terminated by a " "``{0, NULL}`` entry. When using single-phase initialization, *m_slots* must " "be ``NULL``." msgstr "" -#: ../../c-api/module.rst:194 +#: ../../c-api/module.rst:196 msgid "" "Prior to version 3.5, this member was always set to ``NULL``, and was " "defined as:" msgstr "" -#: ../../c-api/module.rst:201 +#: ../../c-api/module.rst:203 msgid "" "A traversal function to call during GC traversal of the module object, or " "``NULL`` if not needed." msgstr "" -#: ../../c-api/module.rst:204 ../../c-api/module.rst:219 -#: ../../c-api/module.rst:240 +#: ../../c-api/module.rst:206 ../../c-api/module.rst:221 +#: ../../c-api/module.rst:242 msgid "" "This function is not called if the module state was requested but is not " "allocated yet. This is the case immediately after the module is created and " @@ -233,18 +237,18 @@ msgid "" "`PyModule_GetState`) is ``NULL``." msgstr "" -#: ../../c-api/module.rst:211 ../../c-api/module.rst:232 -#: ../../c-api/module.rst:247 +#: ../../c-api/module.rst:213 ../../c-api/module.rst:234 +#: ../../c-api/module.rst:249 msgid "No longer called before the module state is allocated." msgstr "" -#: ../../c-api/module.rst:216 +#: ../../c-api/module.rst:218 msgid "" "A clear function to call during GC clearing of the module object, or " "``NULL`` if not needed." msgstr "" -#: ../../c-api/module.rst:226 +#: ../../c-api/module.rst:228 msgid "" "Like :c:member:`PyTypeObject.tp_clear`, this function is not *always* called " "before a module is deallocated. For example, when reference counting is " @@ -253,55 +257,55 @@ msgid "" "directly." msgstr "" -#: ../../c-api/module.rst:237 +#: ../../c-api/module.rst:239 msgid "" "A function to call during deallocation of the module object, or ``NULL`` if " "not needed." msgstr "" -#: ../../c-api/module.rst:251 +#: ../../c-api/module.rst:253 msgid "Single-phase initialization" msgstr "" -#: ../../c-api/module.rst:253 +#: ../../c-api/module.rst:255 msgid "" "The module initialization function may create and return the module object " "directly. This is referred to as \"single-phase initialization\", and uses " "one of the following two module creation functions:" msgstr "" -#: ../../c-api/module.rst:259 +#: ../../c-api/module.rst:261 msgid "" "Create a new module object, given the definition in *def*. This behaves " "like :c:func:`PyModule_Create2` with *module_api_version* set to :c:macro:" "`PYTHON_API_VERSION`." msgstr "" -#: ../../c-api/module.rst:266 +#: ../../c-api/module.rst:268 msgid "" "Create a new module object, given the definition in *def*, assuming the API " "version *module_api_version*. If that version does not match the version of " "the running interpreter, a :exc:`RuntimeWarning` is emitted." msgstr "" -#: ../../c-api/module.rst:274 +#: ../../c-api/module.rst:276 msgid "" "Most uses of this function should be using :c:func:`PyModule_Create` " "instead; only use this if you are sure you need it." msgstr "" -#: ../../c-api/module.rst:277 +#: ../../c-api/module.rst:279 msgid "" "Before it is returned from in the initialization function, the resulting " "module object is typically populated using functions like :c:func:" "`PyModule_AddObjectRef`." msgstr "" -#: ../../c-api/module.rst:283 +#: ../../c-api/module.rst:285 msgid "Multi-phase initialization" msgstr "" -#: ../../c-api/module.rst:285 +#: ../../c-api/module.rst:287 msgid "" "An alternate way to specify extensions is to request \"multi-phase " "initialization\". Extension modules created this way behave more like Python " @@ -311,7 +315,7 @@ msgid "" "__init__` methods of classes." msgstr "" -#: ../../c-api/module.rst:292 +#: ../../c-api/module.rst:294 msgid "" "Unlike modules created using single-phase initialization, these modules are " "not singletons: if the *sys.modules* entry is removed and the module is re-" @@ -324,14 +328,14 @@ msgid "" "__dict__` or individual classes created with :c:func:`PyType_FromSpec`)." msgstr "" -#: ../../c-api/module.rst:302 +#: ../../c-api/module.rst:304 msgid "" "All modules created using multi-phase initialization are expected to " "support :ref:`sub-interpreters `. Making sure " "multiple modules are independent is typically enough to achieve this." msgstr "" -#: ../../c-api/module.rst:306 +#: ../../c-api/module.rst:308 msgid "" "To request multi-phase initialization, the initialization function " "(PyInit_modulename) returns a :c:type:`PyModuleDef` instance with non-empty :" @@ -339,65 +343,65 @@ msgid "" "instance must be initialized with the following function:" msgstr "" -#: ../../c-api/module.rst:313 +#: ../../c-api/module.rst:315 msgid "" "Ensures a module definition is a properly initialized Python object that " "correctly reports its type and reference count." msgstr "" -#: ../../c-api/module.rst:316 +#: ../../c-api/module.rst:318 msgid "Returns *def* cast to ``PyObject*``, or ``NULL`` if an error occurred." msgstr "" -#: ../../c-api/module.rst:320 +#: ../../c-api/module.rst:322 msgid "" "The *m_slots* member of the module definition must point to an array of " "``PyModuleDef_Slot`` structures:" msgstr "" -#: ../../c-api/module.rst:327 +#: ../../c-api/module.rst:329 msgid "A slot ID, chosen from the available values explained below." msgstr "" -#: ../../c-api/module.rst:331 +#: ../../c-api/module.rst:333 msgid "Value of the slot, whose meaning depends on the slot ID." msgstr "" -#: ../../c-api/module.rst:335 +#: ../../c-api/module.rst:337 msgid "The *m_slots* array must be terminated by a slot with id 0." msgstr "" -#: ../../c-api/module.rst:337 +#: ../../c-api/module.rst:339 msgid "The available slot types are:" msgstr "" -#: ../../c-api/module.rst:341 +#: ../../c-api/module.rst:343 msgid "" "Specifies a function that is called to create the module object itself. The " "*value* pointer of this slot must point to a function of the signature:" msgstr "" -#: ../../c-api/module.rst:348 +#: ../../c-api/module.rst:350 msgid "" "The function receives a :py:class:`~importlib.machinery.ModuleSpec` " "instance, as defined in :PEP:`451`, and the module definition. It should " "return a new module object, or set an error and return ``NULL``." msgstr "" -#: ../../c-api/module.rst:353 +#: ../../c-api/module.rst:355 msgid "" "This function should be kept minimal. In particular, it should not call " "arbitrary Python code, as trying to import the same module again may result " "in an infinite loop." msgstr "" -#: ../../c-api/module.rst:357 +#: ../../c-api/module.rst:359 msgid "" "Multiple ``Py_mod_create`` slots may not be specified in one module " "definition." msgstr "" -#: ../../c-api/module.rst:360 +#: ../../c-api/module.rst:362 msgid "" "If ``Py_mod_create`` is not specified, the import machinery will create a " "normal module object using :c:func:`PyModule_New`. The name is taken from " @@ -406,7 +410,7 @@ msgid "" "through symlinks, all while sharing a single module definition." msgstr "" -#: ../../c-api/module.rst:366 +#: ../../c-api/module.rst:368 msgid "" "There is no requirement for the returned object to be an instance of :c:type:" "`PyModule_Type`. Any type can be used, as long as it supports setting and " @@ -416,7 +420,7 @@ msgid "" "``Py_mod_create``." msgstr "" -#: ../../c-api/module.rst:375 +#: ../../c-api/module.rst:377 msgid "" "Specifies a function that is called to *execute* the module. This is " "equivalent to executing the code of a Python module: typically, this " @@ -424,61 +428,61 @@ msgid "" "function is:" msgstr "" -#: ../../c-api/module.rst:384 +#: ../../c-api/module.rst:386 msgid "" "If multiple ``Py_mod_exec`` slots are specified, they are processed in the " "order they appear in the *m_slots* array." msgstr "" -#: ../../c-api/module.rst:389 ../../c-api/module.rst:422 +#: ../../c-api/module.rst:391 ../../c-api/module.rst:424 msgid "Specifies one of the following values:" msgstr "" -#: ../../c-api/module.rst:395 +#: ../../c-api/module.rst:397 msgid "The module does not support being imported in subinterpreters." msgstr "" -#: ../../c-api/module.rst:399 +#: ../../c-api/module.rst:401 msgid "" "The module supports being imported in subinterpreters, but only when they " "share the main interpreter's GIL. (See :ref:`isolating-extensions-howto`.)" msgstr "" -#: ../../c-api/module.rst:405 +#: ../../c-api/module.rst:407 msgid "" "The module supports being imported in subinterpreters, even when they have " "their own GIL. (See :ref:`isolating-extensions-howto`.)" msgstr "" -#: ../../c-api/module.rst:409 +#: ../../c-api/module.rst:411 msgid "" "This slot determines whether or not importing this module in a " "subinterpreter will fail." msgstr "" -#: ../../c-api/module.rst:412 +#: ../../c-api/module.rst:414 msgid "" "Multiple ``Py_mod_multiple_interpreters`` slots may not be specified in one " "module definition." msgstr "" -#: ../../c-api/module.rst:415 +#: ../../c-api/module.rst:417 msgid "" "If ``Py_mod_multiple_interpreters`` is not specified, the import machinery " "defaults to ``Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED``." msgstr "" -#: ../../c-api/module.rst:428 +#: ../../c-api/module.rst:430 msgid "" "The module depends on the presence of the global interpreter lock (GIL), and " "may access global state without synchronization." msgstr "" -#: ../../c-api/module.rst:433 +#: ../../c-api/module.rst:435 msgid "The module is safe to run without an active GIL." msgstr "" -#: ../../c-api/module.rst:435 +#: ../../c-api/module.rst:437 msgid "" "This slot is ignored by Python builds not configured with :option:`--disable-" "gil`. Otherwise, it determines whether or not importing this module will " @@ -486,26 +490,26 @@ msgid "" "threaded-cpython` for more detail." msgstr "" -#: ../../c-api/module.rst:440 +#: ../../c-api/module.rst:442 msgid "" "Multiple ``Py_mod_gil`` slots may not be specified in one module definition." msgstr "" -#: ../../c-api/module.rst:442 +#: ../../c-api/module.rst:444 msgid "" "If ``Py_mod_gil`` is not specified, the import machinery defaults to " "``Py_MOD_GIL_USED``." msgstr "" -#: ../../c-api/module.rst:447 +#: ../../c-api/module.rst:449 msgid "See :PEP:`489` for more details on multi-phase initialization." msgstr "" -#: ../../c-api/module.rst:450 +#: ../../c-api/module.rst:452 msgid "Low-level module creation functions" msgstr "" -#: ../../c-api/module.rst:452 +#: ../../c-api/module.rst:454 msgid "" "The following functions are called under the hood when using multi-phase " "initialization. They can be used directly, for example when creating module " @@ -513,14 +517,14 @@ msgid "" "``PyModule_ExecDef`` must be called to fully initialize a module." msgstr "" -#: ../../c-api/module.rst:459 +#: ../../c-api/module.rst:461 msgid "" "Create a new module object, given the definition in *def* and the ModuleSpec " "*spec*. This behaves like :c:func:`PyModule_FromDefAndSpec2` with " "*module_api_version* set to :c:macro:`PYTHON_API_VERSION`." msgstr "" -#: ../../c-api/module.rst:467 +#: ../../c-api/module.rst:469 msgid "" "Create a new module object, given the definition in *def* and the ModuleSpec " "*spec*, assuming the API version *module_api_version*. If that version does " @@ -528,24 +532,24 @@ msgid "" "emitted." msgstr "" -#: ../../c-api/module.rst:476 +#: ../../c-api/module.rst:478 msgid "" "Most uses of this function should be using :c:func:`PyModule_FromDefAndSpec` " "instead; only use this if you are sure you need it." msgstr "" -#: ../../c-api/module.rst:483 +#: ../../c-api/module.rst:485 msgid "Process any execution slots (:c:data:`Py_mod_exec`) given in *def*." msgstr "" -#: ../../c-api/module.rst:489 +#: ../../c-api/module.rst:491 msgid "" "Set the docstring for *module* to *docstring*. This function is called " "automatically when creating a module from ``PyModuleDef``, using either " "``PyModule_Create`` or ``PyModule_FromDefAndSpec``." msgstr "" -#: ../../c-api/module.rst:498 +#: ../../c-api/module.rst:500 msgid "" "Add the functions from the ``NULL`` terminated *functions* array to " "*module*. Refer to the :c:type:`PyMethodDef` documentation for details on " @@ -557,11 +561,11 @@ msgid "" "``PyModule_FromDefAndSpec``." msgstr "" -#: ../../c-api/module.rst:510 +#: ../../c-api/module.rst:512 msgid "Support functions" msgstr "支援的函式" -#: ../../c-api/module.rst:512 +#: ../../c-api/module.rst:514 msgid "" "The module initialization function (if using single phase initialization) or " "a function called from a module execution slot (if using multi-phase " @@ -569,29 +573,29 @@ msgid "" "module state:" msgstr "" -#: ../../c-api/module.rst:519 +#: ../../c-api/module.rst:521 msgid "" "Add an object to *module* as *name*. This is a convenience function which " "can be used from the module's initialization function." msgstr "" -#: ../../c-api/module.rst:522 +#: ../../c-api/module.rst:524 msgid "" "On success, return ``0``. On error, raise an exception and return ``-1``." msgstr "" -#: ../../c-api/module.rst:524 +#: ../../c-api/module.rst:526 msgid "" "Return ``-1`` if *value* is ``NULL``. It must be called with an exception " "raised in this case." msgstr "" -#: ../../c-api/module.rst:527 ../../c-api/module.rst:574 -#: ../../c-api/module.rst:601 +#: ../../c-api/module.rst:529 ../../c-api/module.rst:576 +#: ../../c-api/module.rst:603 msgid "Example usage::" msgstr "用法範例: ::" -#: ../../c-api/module.rst:529 +#: ../../c-api/module.rst:531 msgid "" "static int\n" "add_spam(PyObject *module, int value)\n" @@ -617,13 +621,13 @@ msgstr "" " return res;\n" " }" -#: ../../c-api/module.rst:541 +#: ../../c-api/module.rst:543 msgid "" "The example can also be written without checking explicitly if *obj* is " "``NULL``::" msgstr "" -#: ../../c-api/module.rst:544 +#: ../../c-api/module.rst:546 msgid "" "static int\n" "add_spam(PyObject *module, int value)\n" @@ -643,13 +647,13 @@ msgstr "" " return res;\n" " }" -#: ../../c-api/module.rst:553 +#: ../../c-api/module.rst:555 msgid "" "Note that ``Py_XDECREF()`` should be used instead of ``Py_DECREF()`` in this " "case, since *obj* can be ``NULL``." msgstr "" -#: ../../c-api/module.rst:556 +#: ../../c-api/module.rst:558 msgid "" "The number of different *name* strings passed to this function should be " "kept small, usually by only using statically allocated strings as *name*. " @@ -659,7 +663,7 @@ msgid "" "internally to create a key object." msgstr "" -#: ../../c-api/module.rst:569 +#: ../../c-api/module.rst:571 msgid "" "Similar to :c:func:`PyModule_AddObjectRef`, but \"steals\" a reference to " "*value*. It can be called with a result of function that returns a new " @@ -667,39 +671,39 @@ msgid "" "variable." msgstr "" -#: ../../c-api/module.rst:576 +#: ../../c-api/module.rst:578 msgid "" "if (PyModule_Add(module, \"spam\", PyBytes_FromString(value)) < 0) {\n" " goto error;\n" "}" msgstr "" -#: ../../c-api/module.rst:585 +#: ../../c-api/module.rst:587 msgid "" "Similar to :c:func:`PyModule_AddObjectRef`, but steals a reference to " "*value* on success (if it returns ``0``)." msgstr "" -#: ../../c-api/module.rst:588 +#: ../../c-api/module.rst:590 msgid "" "The new :c:func:`PyModule_Add` or :c:func:`PyModule_AddObjectRef` functions " "are recommended, since it is easy to introduce reference leaks by misusing " "the :c:func:`PyModule_AddObject` function." msgstr "" -#: ../../c-api/module.rst:595 +#: ../../c-api/module.rst:597 msgid "" "Unlike other functions that steal references, ``PyModule_AddObject()`` only " "releases the reference to *value* **on success**." msgstr "" -#: ../../c-api/module.rst:598 +#: ../../c-api/module.rst:600 msgid "" "This means that its return value must be checked, and calling code must :c:" "func:`Py_XDECREF` *value* manually on error." msgstr "" -#: ../../c-api/module.rst:603 +#: ../../c-api/module.rst:605 msgid "" "PyObject *obj = PyBytes_FromString(value);\n" "if (PyModule_AddObject(module, \"spam\", obj) < 0) {\n" @@ -713,24 +717,24 @@ msgid "" "// Py_XDECREF(obj) is not needed here." msgstr "" -#: ../../c-api/module.rst:616 +#: ../../c-api/module.rst:618 msgid ":c:func:`PyModule_AddObject` is :term:`soft deprecated`." msgstr "" -#: ../../c-api/module.rst:621 +#: ../../c-api/module.rst:623 msgid "" "Add an integer constant to *module* as *name*. This convenience function " "can be used from the module's initialization function. Return ``-1`` with an " "exception set on error, ``0`` on success." msgstr "" -#: ../../c-api/module.rst:625 +#: ../../c-api/module.rst:627 msgid "" "This is a convenience function that calls :c:func:`PyLong_FromLong` and :c:" "func:`PyModule_AddObjectRef`; see their documentation for details." msgstr "" -#: ../../c-api/module.rst:631 +#: ../../c-api/module.rst:633 msgid "" "Add a string constant to *module* as *name*. This convenience function can " "be used from the module's initialization function. The string *value* must " @@ -738,14 +742,14 @@ msgid "" "on success." msgstr "" -#: ../../c-api/module.rst:636 +#: ../../c-api/module.rst:638 msgid "" "This is a convenience function that calls :c:func:" "`PyUnicode_InternFromString` and :c:func:`PyModule_AddObjectRef`; see their " "documentation for details." msgstr "" -#: ../../c-api/module.rst:643 +#: ../../c-api/module.rst:645 msgid "" "Add an int constant to *module*. The name and the value are taken from " "*macro*. For example ``PyModule_AddIntMacro(module, AF_INET)`` adds the int " @@ -753,11 +757,11 @@ msgid "" "with an exception set on error, ``0`` on success." msgstr "" -#: ../../c-api/module.rst:651 +#: ../../c-api/module.rst:653 msgid "Add a string constant to *module*." msgstr "" -#: ../../c-api/module.rst:655 +#: ../../c-api/module.rst:657 msgid "" "Add a type object to *module*. The type object is finalized by calling " "internally :c:func:`PyType_Ready`. The name of the type object is taken from " @@ -765,7 +769,7 @@ msgid "" "``-1`` with an exception set on error, ``0`` on success." msgstr "" -#: ../../c-api/module.rst:665 +#: ../../c-api/module.rst:667 msgid "" "Indicate that *module* does or does not support running without the global " "interpreter lock (GIL), using one of the values from :c:macro:`Py_mod_gil`. " @@ -776,25 +780,25 @@ msgid "" "Return ``-1`` with an exception set on error, ``0`` on success." msgstr "" -#: ../../c-api/module.rst:678 +#: ../../c-api/module.rst:680 msgid "Module lookup" msgstr "模組查找" -#: ../../c-api/module.rst:680 +#: ../../c-api/module.rst:682 msgid "" "Single-phase initialization creates singleton modules that can be looked up " "in the context of the current interpreter. This allows the module object to " "be retrieved later with only a reference to the module definition." msgstr "" -#: ../../c-api/module.rst:684 +#: ../../c-api/module.rst:686 msgid "" "These functions will not work on modules created using multi-phase " "initialization, since multiple such modules can be created from a single " "definition." msgstr "" -#: ../../c-api/module.rst:689 +#: ../../c-api/module.rst:691 msgid "" "Returns the module object that was created from *def* for the current " "interpreter. This method requires that the module object has been attached " @@ -803,18 +807,18 @@ msgid "" "to the interpreter state yet, it returns ``NULL``." msgstr "" -#: ../../c-api/module.rst:696 +#: ../../c-api/module.rst:698 msgid "" "Attaches the module object passed to the function to the interpreter state. " "This allows the module object to be accessible via :c:func:" "`PyState_FindModule`." msgstr "" -#: ../../c-api/module.rst:699 +#: ../../c-api/module.rst:701 msgid "Only effective on modules created using single-phase initialization." msgstr "" -#: ../../c-api/module.rst:701 +#: ../../c-api/module.rst:703 msgid "" "Python calls ``PyState_AddModule`` automatically after importing a module, " "so it is unnecessary (but harmless) to call it from module initialization " @@ -825,15 +829,15 @@ msgid "" "state updates)." msgstr "" -#: ../../c-api/module.rst:709 ../../c-api/module.rst:720 +#: ../../c-api/module.rst:711 ../../c-api/module.rst:722 msgid "The caller must hold the GIL." msgstr "" -#: ../../c-api/module.rst:711 +#: ../../c-api/module.rst:713 msgid "Return ``-1`` with an exception set on error, ``0`` on success." msgstr "成功時回傳 ``0``,在失敗時回傳 ``-1`` 並設定例外。" -#: ../../c-api/module.rst:717 +#: ../../c-api/module.rst:719 msgid "" "Removes the module object created from *def* from the interpreter state. " "Return ``-1`` with an exception set on error, ``0`` on success." @@ -851,7 +855,7 @@ msgstr "module(模組)" msgid "ModuleType (in module types)" msgstr "MethodType(types 模組中)" -#: ../../c-api/module.rst:33 ../../c-api/module.rst:76 +#: ../../c-api/module.rst:33 ../../c-api/module.rst:77 msgid "__name__ (module attribute)" msgstr "__name__(模組屬性)" @@ -859,7 +863,7 @@ msgstr "__name__(模組屬性)" msgid "__doc__ (module attribute)" msgstr "__doc__(模組屬性)" -#: ../../c-api/module.rst:33 ../../c-api/module.rst:106 +#: ../../c-api/module.rst:33 ../../c-api/module.rst:108 msgid "__file__ (module attribute)" msgstr "__file__(模組屬性)" @@ -871,10 +875,10 @@ msgstr "__package__(模組屬性)" msgid "__loader__ (module attribute)" msgstr "__loader__(模組屬性)" -#: ../../c-api/module.rst:62 +#: ../../c-api/module.rst:63 msgid "__dict__ (module attribute)" msgstr "__dict__(模組屬性)" -#: ../../c-api/module.rst:76 ../../c-api/module.rst:106 +#: ../../c-api/module.rst:77 ../../c-api/module.rst:108 msgid "SystemError (built-in exception)" msgstr "SystemError(內建例外)" diff --git a/c-api/tuple.po b/c-api/tuple.po index 3e5dbda024..0392e13819 100644 --- a/c-api/tuple.po +++ b/c-api/tuple.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-08 00:13+0000\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Leon H.\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -119,8 +119,8 @@ msgid "" "*only* be used to fill in brand new tuples." msgstr "" -#: ../../c-api/tuple.rst:102 ../../c-api/tuple.rst:217 -#: ../../c-api/tuple.rst:235 +#: ../../c-api/tuple.rst:102 ../../c-api/tuple.rst:218 +#: ../../c-api/tuple.rst:236 msgid "" "Bounds checking is performed as an assertion if Python is built in :ref:" "`debug mode ` or :option:`with assertions <--with-assertions>`." @@ -167,7 +167,7 @@ msgid "" "`PyStructSequence_New`." msgstr "" -#: ../../c-api/tuple.rst:142 ../../c-api/tuple.rst:210 +#: ../../c-api/tuple.rst:142 ../../c-api/tuple.rst:211 msgid "Return ``NULL`` with an exception set on failure." msgstr "" @@ -186,22 +186,24 @@ msgid "Contains the meta information of a struct sequence type to create." msgstr "" #: ../../c-api/tuple.rst:164 -msgid "Name of the struct sequence type." +msgid "" +"Fully qualified name of the type; null-terminated UTF-8 encoded. The name " +"must contain the module name." msgstr "" -#: ../../c-api/tuple.rst:168 +#: ../../c-api/tuple.rst:169 msgid "Pointer to docstring for the type or ``NULL`` to omit." msgstr "" -#: ../../c-api/tuple.rst:172 +#: ../../c-api/tuple.rst:173 msgid "Pointer to ``NULL``-terminated array with field names of the new type." msgstr "" -#: ../../c-api/tuple.rst:176 +#: ../../c-api/tuple.rst:177 msgid "Number of fields visible to the Python side (if used as tuple)." msgstr "" -#: ../../c-api/tuple.rst:181 +#: ../../c-api/tuple.rst:182 msgid "" "Describes a field of a struct sequence. As a struct sequence is modeled as a " "tuple, all fields are typed as :c:expr:`PyObject*`. The index in the :c:" @@ -210,59 +212,59 @@ msgid "" "described." msgstr "" -#: ../../c-api/tuple.rst:189 +#: ../../c-api/tuple.rst:190 msgid "" "Name for the field or ``NULL`` to end the list of named fields, set to :c:" "data:`PyStructSequence_UnnamedField` to leave unnamed." msgstr "" -#: ../../c-api/tuple.rst:194 +#: ../../c-api/tuple.rst:195 msgid "Field docstring or ``NULL`` to omit." msgstr "" -#: ../../c-api/tuple.rst:199 +#: ../../c-api/tuple.rst:200 msgid "Special value for a field name to leave it unnamed." msgstr "" -#: ../../c-api/tuple.rst:201 +#: ../../c-api/tuple.rst:202 msgid "The type was changed from ``char *``." msgstr "" -#: ../../c-api/tuple.rst:207 +#: ../../c-api/tuple.rst:208 msgid "" "Creates an instance of *type*, which must have been created with :c:func:" "`PyStructSequence_NewType`." msgstr "" -#: ../../c-api/tuple.rst:215 +#: ../../c-api/tuple.rst:216 msgid "" "Return the object at position *pos* in the struct sequence pointed to by *p*." msgstr "" -#: ../../c-api/tuple.rst:223 +#: ../../c-api/tuple.rst:224 msgid "Alias to :c:func:`PyStructSequence_GetItem`." msgstr "" -#: ../../c-api/tuple.rst:225 +#: ../../c-api/tuple.rst:226 msgid "Now implemented as an alias to :c:func:`PyStructSequence_GetItem`." msgstr "" -#: ../../c-api/tuple.rst:231 +#: ../../c-api/tuple.rst:232 msgid "" "Sets the field at index *pos* of the struct sequence *p* to value *o*. " "Like :c:func:`PyTuple_SET_ITEM`, this should only be used to fill in brand " "new instances." msgstr "" -#: ../../c-api/tuple.rst:240 +#: ../../c-api/tuple.rst:241 msgid "This function \"steals\" a reference to *o*." msgstr "" -#: ../../c-api/tuple.rst:245 +#: ../../c-api/tuple.rst:246 msgid "Alias to :c:func:`PyStructSequence_SetItem`." msgstr "" -#: ../../c-api/tuple.rst:247 +#: ../../c-api/tuple.rst:248 msgid "Now implemented as an alias to :c:func:`PyStructSequence_SetItem`." msgstr "" diff --git a/c-api/veryhigh.po b/c-api/veryhigh.po index 7f42392eaf..468bb4f7bf 100644 --- a/c-api/veryhigh.po +++ b/c-api/veryhigh.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-02-12 00:03+0000\n" +"POT-Creation-Date: 2024-10-09 00:13+0000\n" "PO-Revision-Date: 2018-05-23 14:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -51,47 +51,23 @@ msgstr "" #: ../../c-api/veryhigh.rst:30 msgid "" -"The main program for the standard interpreter. This is made available for " -"programs which embed Python. The *argc* and *argv* parameters should be " -"prepared exactly as those which are passed to a C program's :c:func:`main` " -"function (converted to wchar_t according to the user's locale). It is " -"important to note that the argument list may be modified (but the contents " -"of the strings pointed to by the argument list are not). The return value " -"will be ``0`` if the interpreter exits normally (i.e., without an " -"exception), ``1`` if the interpreter exits due to an exception, or ``2`` if " -"the parameter list does not represent a valid Python command line." -msgstr "" - -#: ../../c-api/veryhigh.rst:40 -msgid "" -"Note that if an otherwise unhandled :exc:`SystemExit` is raised, this " -"function will not return ``1``, but exit the process, as long as :c:member:" -"`PyConfig.inspect` is zero." -msgstr "" - -#: ../../c-api/veryhigh.rst:47 -msgid "Similar to :c:func:`Py_Main` but *argv* is an array of bytes strings." -msgstr "" - -#: ../../c-api/veryhigh.rst:54 -msgid "" "This is a simplified interface to :c:func:`PyRun_AnyFileExFlags` below, " "leaving *closeit* set to ``0`` and *flags* set to ``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:60 +#: ../../c-api/veryhigh.rst:36 msgid "" "This is a simplified interface to :c:func:`PyRun_AnyFileExFlags` below, " "leaving the *closeit* argument set to ``0``." msgstr "" -#: ../../c-api/veryhigh.rst:66 +#: ../../c-api/veryhigh.rst:42 msgid "" "This is a simplified interface to :c:func:`PyRun_AnyFileExFlags` below, " "leaving the *flags* argument set to ``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:72 +#: ../../c-api/veryhigh.rst:48 msgid "" "If *fp* refers to a file associated with an interactive device (console or " "terminal input or Unix pseudo-terminal), return the value of :c:func:" @@ -102,13 +78,13 @@ msgid "" "before ``PyRun_SimpleFileExFlags()`` returns." msgstr "" -#: ../../c-api/veryhigh.rst:84 +#: ../../c-api/veryhigh.rst:60 msgid "" "This is a simplified interface to :c:func:`PyRun_SimpleStringFlags` below, " "leaving the :c:struct:`PyCompilerFlags`\\* argument set to ``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:90 +#: ../../c-api/veryhigh.rst:66 msgid "" "Executes the Python source code from *command* in the :mod:`__main__` module " "according to the *flags* argument. If :mod:`__main__` does not already " @@ -117,26 +93,26 @@ msgid "" "information. For the meaning of *flags*, see below." msgstr "" -#: ../../c-api/veryhigh.rst:96 +#: ../../c-api/veryhigh.rst:72 msgid "" "Note that if an otherwise unhandled :exc:`SystemExit` is raised, this " "function will not return ``-1``, but exit the process, as long as :c:member:" "`PyConfig.inspect` is zero." msgstr "" -#: ../../c-api/veryhigh.rst:103 +#: ../../c-api/veryhigh.rst:79 msgid "" "This is a simplified interface to :c:func:`PyRun_SimpleFileExFlags` below, " "leaving *closeit* set to ``0`` and *flags* set to ``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:109 +#: ../../c-api/veryhigh.rst:85 msgid "" "This is a simplified interface to :c:func:`PyRun_SimpleFileExFlags` below, " "leaving *flags* set to ``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:115 +#: ../../c-api/veryhigh.rst:91 msgid "" "Similar to :c:func:`PyRun_SimpleStringFlags`, but the Python source code is " "read from *fp* instead of an in-memory string. *filename* should be the name " @@ -145,20 +121,20 @@ msgid "" "``PyRun_SimpleFileExFlags()`` returns." msgstr "" -#: ../../c-api/veryhigh.rst:122 +#: ../../c-api/veryhigh.rst:98 msgid "" "On Windows, *fp* should be opened as binary mode (e.g. ``fopen(filename, " "\"rb\")``). Otherwise, Python may not handle script file with LF line ending " "correctly." msgstr "" -#: ../../c-api/veryhigh.rst:128 +#: ../../c-api/veryhigh.rst:104 msgid "" "This is a simplified interface to :c:func:`PyRun_InteractiveOneFlags` below, " "leaving *flags* set to ``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:134 +#: ../../c-api/veryhigh.rst:110 msgid "" "Read and execute a single statement from a file associated with an " "interactive device according to the *flags* argument. The user will be " @@ -166,7 +142,7 @@ msgid "" "term:`filesystem encoding and error handler`." msgstr "" -#: ../../c-api/veryhigh.rst:139 +#: ../../c-api/veryhigh.rst:115 msgid "" "Returns ``0`` when the input was executed successfully, ``-1`` if there was " "an exception, or an error code from the :file:`errcode.h` include file " @@ -175,13 +151,13 @@ msgid "" "specifically if needed.)" msgstr "" -#: ../../c-api/veryhigh.rst:148 +#: ../../c-api/veryhigh.rst:124 msgid "" "This is a simplified interface to :c:func:`PyRun_InteractiveLoopFlags` " "below, leaving *flags* set to ``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:154 +#: ../../c-api/veryhigh.rst:130 msgid "" "Read and execute statements from a file associated with an interactive " "device until EOF is reached. The user will be prompted using ``sys.ps1`` " @@ -189,7 +165,7 @@ msgid "" "and error handler`. Returns ``0`` at EOF or a negative number upon failure." msgstr "" -#: ../../c-api/veryhigh.rst:162 +#: ../../c-api/veryhigh.rst:138 msgid "" "Can be set to point to a function with the prototype ``int func(void)``. " "The function will be called when Python's interpreter prompt is about to " @@ -199,13 +175,13 @@ msgid "" "the Python source code." msgstr "" -#: ../../c-api/veryhigh.rst:170 ../../c-api/veryhigh.rst:194 +#: ../../c-api/veryhigh.rst:146 ../../c-api/veryhigh.rst:170 msgid "" "This function is only called from the :ref:`main interpreter `." msgstr "" -#: ../../c-api/veryhigh.rst:177 +#: ../../c-api/veryhigh.rst:153 msgid "" "Can be set to point to a function with the prototype ``char *func(FILE " "*stdin, FILE *stdout, char *prompt)``, overriding the default function used " @@ -216,26 +192,26 @@ msgid "" "line-editing and tab-completion features." msgstr "" -#: ../../c-api/veryhigh.rst:186 +#: ../../c-api/veryhigh.rst:162 msgid "" "The result must be a string allocated by :c:func:`PyMem_RawMalloc` or :c:" "func:`PyMem_RawRealloc`, or ``NULL`` if an error occurred." msgstr "" -#: ../../c-api/veryhigh.rst:189 +#: ../../c-api/veryhigh.rst:165 msgid "" "The result must be allocated by :c:func:`PyMem_RawMalloc` or :c:func:" "`PyMem_RawRealloc`, instead of being allocated by :c:func:`PyMem_Malloc` or :" "c:func:`PyMem_Realloc`." msgstr "" -#: ../../c-api/veryhigh.rst:200 +#: ../../c-api/veryhigh.rst:176 msgid "" "This is a simplified interface to :c:func:`PyRun_StringFlags` below, leaving " "*flags* set to ``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:206 +#: ../../c-api/veryhigh.rst:182 msgid "" "Execute Python source code from *str* in the context specified by the " "objects *globals* and *locals* with the compiler flags specified by " @@ -244,31 +220,31 @@ msgid "" "token that should be used to parse the source code." msgstr "" -#: ../../c-api/veryhigh.rst:212 +#: ../../c-api/veryhigh.rst:188 msgid "" "Returns the result of executing the code as a Python object, or ``NULL`` if " "an exception was raised." msgstr "" -#: ../../c-api/veryhigh.rst:218 +#: ../../c-api/veryhigh.rst:194 msgid "" "This is a simplified interface to :c:func:`PyRun_FileExFlags` below, leaving " "*closeit* set to ``0`` and *flags* set to ``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:224 +#: ../../c-api/veryhigh.rst:200 msgid "" "This is a simplified interface to :c:func:`PyRun_FileExFlags` below, leaving " "*flags* set to ``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:230 +#: ../../c-api/veryhigh.rst:206 msgid "" "This is a simplified interface to :c:func:`PyRun_FileExFlags` below, leaving " "*closeit* set to ``0``." msgstr "" -#: ../../c-api/veryhigh.rst:236 +#: ../../c-api/veryhigh.rst:212 msgid "" "Similar to :c:func:`PyRun_StringFlags`, but the Python source code is read " "from *fp* instead of an in-memory string. *filename* should be the name of " @@ -277,19 +253,19 @@ msgid "" "`PyRun_FileExFlags` returns." msgstr "" -#: ../../c-api/veryhigh.rst:245 +#: ../../c-api/veryhigh.rst:221 msgid "" "This is a simplified interface to :c:func:`Py_CompileStringFlags` below, " "leaving *flags* set to ``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:251 +#: ../../c-api/veryhigh.rst:227 msgid "" "This is a simplified interface to :c:func:`Py_CompileStringExFlags` below, " "with *optimize* set to ``-1``." msgstr "" -#: ../../c-api/veryhigh.rst:257 +#: ../../c-api/veryhigh.rst:233 msgid "" "Parse and compile the Python source code in *str*, returning the resulting " "code object. The start token is given by *start*; this can be used to " @@ -300,7 +276,7 @@ msgid "" "returns ``NULL`` if the code cannot be parsed or compiled." msgstr "" -#: ../../c-api/veryhigh.rst:265 +#: ../../c-api/veryhigh.rst:241 msgid "" "The integer *optimize* specifies the optimization level of the compiler; a " "value of ``-1`` selects the optimization level of the interpreter as given " @@ -309,20 +285,20 @@ msgid "" "or ``2`` (docstrings are removed too)." msgstr "" -#: ../../c-api/veryhigh.rst:276 +#: ../../c-api/veryhigh.rst:252 msgid "" "Like :c:func:`Py_CompileStringObject`, but *filename* is a byte string " "decoded from the :term:`filesystem encoding and error handler`." msgstr "" -#: ../../c-api/veryhigh.rst:283 +#: ../../c-api/veryhigh.rst:259 msgid "" "This is a simplified interface to :c:func:`PyEval_EvalCodeEx`, with just the " "code object, and global and local variables. The other arguments are set to " "``NULL``." msgstr "" -#: ../../c-api/veryhigh.rst:290 +#: ../../c-api/veryhigh.rst:266 msgid "" "Evaluate a precompiled code object, given a particular environment for its " "evaluation. This environment consists of a dictionary of global variables, " @@ -331,13 +307,13 @@ msgid "" "only_parameter>` arguments and a closure tuple of cells." msgstr "" -#: ../../c-api/veryhigh.rst:299 +#: ../../c-api/veryhigh.rst:275 msgid "" "Evaluate an execution frame. This is a simplified interface to :c:func:" "`PyEval_EvalFrameEx`, for backward compatibility." msgstr "" -#: ../../c-api/veryhigh.rst:305 +#: ../../c-api/veryhigh.rst:281 msgid "" "This is the main, unvarnished function of Python interpretation. The code " "object associated with the execution frame *f* is executed, interpreting " @@ -347,39 +323,39 @@ msgid "" "of generator objects." msgstr "" -#: ../../c-api/veryhigh.rst:312 +#: ../../c-api/veryhigh.rst:288 msgid "" "This function now includes a debug assertion to help ensure that it does not " "silently discard an active exception." msgstr "" -#: ../../c-api/veryhigh.rst:319 +#: ../../c-api/veryhigh.rst:295 msgid "" "This function changes the flags of the current evaluation frame, and returns " "true on success, false on failure." msgstr "" -#: ../../c-api/veryhigh.rst:327 +#: ../../c-api/veryhigh.rst:303 msgid "" "The start symbol from the Python grammar for isolated expressions; for use " "with :c:func:`Py_CompileString`." msgstr "" -#: ../../c-api/veryhigh.rst:335 +#: ../../c-api/veryhigh.rst:311 msgid "" "The start symbol from the Python grammar for sequences of statements as read " "from a file or other source; for use with :c:func:`Py_CompileString`. This " "is the symbol to use when compiling arbitrarily long Python source code." msgstr "" -#: ../../c-api/veryhigh.rst:344 +#: ../../c-api/veryhigh.rst:320 msgid "" "The start symbol from the Python grammar for a single statement; for use " "with :c:func:`Py_CompileString`. This is the symbol used for the interactive " "interpreter loop." msgstr "" -#: ../../c-api/veryhigh.rst:351 +#: ../../c-api/veryhigh.rst:327 msgid "" "This is the structure used to hold compiler flags. In cases where code is " "only being compiled, it is passed as ``int flags``, and in cases where code " @@ -387,40 +363,40 @@ msgid "" "case, ``from __future__ import`` can modify *flags*." msgstr "" -#: ../../c-api/veryhigh.rst:356 +#: ../../c-api/veryhigh.rst:332 msgid "" "Whenever ``PyCompilerFlags *flags`` is ``NULL``, :c:member:`~PyCompilerFlags." "cf_flags` is treated as equal to ``0``, and any modification due to ``from " "__future__ import`` is discarded." msgstr "" -#: ../../c-api/veryhigh.rst:362 +#: ../../c-api/veryhigh.rst:338 msgid "Compiler flags." msgstr "" -#: ../../c-api/veryhigh.rst:366 +#: ../../c-api/veryhigh.rst:342 msgid "" "*cf_feature_version* is the minor Python version. It should be initialized " "to ``PY_MINOR_VERSION``." msgstr "" -#: ../../c-api/veryhigh.rst:369 +#: ../../c-api/veryhigh.rst:345 msgid "" "The field is ignored by default, it is used if and only if ``PyCF_ONLY_AST`` " "flag is set in :c:member:`~PyCompilerFlags.cf_flags`." msgstr "" -#: ../../c-api/veryhigh.rst:372 +#: ../../c-api/veryhigh.rst:348 msgid "Added *cf_feature_version* field." msgstr "新增 *cf_feature_version* 欄位。" -#: ../../c-api/veryhigh.rst:378 +#: ../../c-api/veryhigh.rst:354 msgid "" "This bit can be set in *flags* to cause division operator ``/`` to be " "interpreted as \"true division\" according to :pep:`238`." msgstr "" -#: ../../c-api/veryhigh.rst:325 ../../c-api/veryhigh.rst:333 -#: ../../c-api/veryhigh.rst:342 +#: ../../c-api/veryhigh.rst:301 ../../c-api/veryhigh.rst:309 +#: ../../c-api/veryhigh.rst:318 msgid "Py_CompileString (C function)" msgstr "Py_CompileString(C 函式)" diff --git a/deprecations/index.po b/deprecations/index.po index 7634be6157..24c3129544 100644 --- a/deprecations/index.po +++ b/deprecations/index.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-28 00:13+0000\n" +"POT-Creation-Date: 2024-10-10 00:13+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -25,6 +25,22 @@ msgid "Pending Removal in Python 3.14" msgstr "Python 3.14 中待移除的項目" #: ../../deprecations/pending-removal-in-3.14.rst:4 +#: ../../deprecations/pending-removal-in-3.15.rst:4 +msgid "The import system:" +msgstr "引入系統 (import system):" + +#: ../../deprecations/pending-removal-in-3.14.rst:6 +msgid "" +"Setting :attr:`~module.__loader__` on a module while failing to set :attr:" +"`__spec__.loader ` is deprecated. In " +"Python 3.14, :attr:`!__loader__` will cease to be set or taken into " +"consideration by the import system or the standard library." +msgstr "" +"在模組上設定 :attr:`~module.__loader__` 而沒有設定 :attr:`__spec__.loader " +"` 的做法已被棄用。在 Python 3.14 中," +"引入系統或標準函式庫將不再設定或考慮 :attr:`!__loader__` 。" + +#: ../../deprecations/pending-removal-in-3.14.rst:11 msgid "" ":mod:`argparse`: The *type*, *choices*, and *metavar* parameters of :class:`!" "argparse.BooleanOptionalAction` are deprecated and will be removed in 3.14. " @@ -34,7 +50,7 @@ msgstr "" "*choices* 和 *metavar* 參數已被棄用,將在 3.14 中移除。 (由 Nikita Sobolev " "於 :gh:`92248` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:9 +#: ../../deprecations/pending-removal-in-3.14.rst:16 msgid "" ":mod:`ast`: The following features have been deprecated in documentation " "since Python 3.8, now cause a :exc:`DeprecationWarning` to be emitted at " @@ -43,38 +59,38 @@ msgstr "" ":mod:`ast`:自 Python 3.8 起,下列功能已在文件中被棄用,現在在存取或使用時會" "於 runtime 發出 :exc:`DeprecationWarning`,並將在 Python 3.14 中移除:" -#: ../../deprecations/pending-removal-in-3.14.rst:13 +#: ../../deprecations/pending-removal-in-3.14.rst:20 msgid ":class:`!ast.Num`" msgstr ":class:`!ast.Num`" -#: ../../deprecations/pending-removal-in-3.14.rst:14 +#: ../../deprecations/pending-removal-in-3.14.rst:21 msgid ":class:`!ast.Str`" msgstr ":class:`!ast.Str`" -#: ../../deprecations/pending-removal-in-3.14.rst:15 +#: ../../deprecations/pending-removal-in-3.14.rst:22 msgid ":class:`!ast.Bytes`" msgstr ":class:`!ast.Bytes`" -#: ../../deprecations/pending-removal-in-3.14.rst:16 +#: ../../deprecations/pending-removal-in-3.14.rst:23 msgid ":class:`!ast.NameConstant`" msgstr ":class:`!ast.NameConstant`" -#: ../../deprecations/pending-removal-in-3.14.rst:17 +#: ../../deprecations/pending-removal-in-3.14.rst:24 msgid ":class:`!ast.Ellipsis`" msgstr ":class:`!ast.Ellipsis`" -#: ../../deprecations/pending-removal-in-3.14.rst:19 +#: ../../deprecations/pending-removal-in-3.14.rst:26 msgid "" "Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka in :gh:" "`90953`.)" msgstr "" "請改用 :class:`ast.Constant`。(由 Serhiy Storchaka 於 :gh:`90953` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:22 +#: ../../deprecations/pending-removal-in-3.14.rst:29 msgid ":mod:`asyncio`:" msgstr ":mod:`asyncio`:" -#: ../../deprecations/pending-removal-in-3.14.rst:24 +#: ../../deprecations/pending-removal-in-3.14.rst:31 msgid "" "The child watcher classes :class:`~asyncio.MultiLoopChildWatcher`, :class:" "`~asyncio.FastChildWatcher`, :class:`~asyncio.AbstractChildWatcher` and :" @@ -86,7 +102,7 @@ msgstr "" "AbstractChildWatcher` 和 :class:`~asyncio.SafeChildWatcher`。 (由 Kumar " "Aditya 於 :gh:`94597` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:30 +#: ../../deprecations/pending-removal-in-3.14.rst:37 msgid "" ":func:`asyncio.set_child_watcher`, :func:`asyncio.get_child_watcher`, :meth:" "`asyncio.AbstractEventLoopPolicy.set_child_watcher` and :meth:`asyncio." @@ -98,7 +114,7 @@ msgstr "" "AbstractEventLoopPolicy.get_child_watcher` 已被棄用並將在 Python 3.14 中移" "除。(由 Kumar Aditya 於 :gh:`94597` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:36 +#: ../../deprecations/pending-removal-in-3.14.rst:43 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 " @@ -109,7 +125,7 @@ msgstr "" "件迴圈且決定建立一個時發出 :exc:`DeprecationWarning`。 (由 Serhiy Storchaka " "和 Guido van Rossum 於 :gh:`100160` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:41 +#: ../../deprecations/pending-removal-in-3.14.rst:48 msgid "" ":mod:`collections.abc`: Deprecated :class:`~collections.abc.ByteString`. " "Prefer :class:`!Sequence` or :class:`~collections.abc.Buffer`. For use in " @@ -121,7 +137,7 @@ msgstr "" "改用聯集,如 ``bytes | bytearray``,或 :class:`collections.abc.Buffer`。(由 " "Shantanu Jain 於 :gh:`91896` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:47 +#: ../../deprecations/pending-removal-in-3.14.rst:54 msgid "" ":mod:`email`: Deprecated the *isdst* parameter in :func:`email.utils." "localtime`. (Contributed by Alan Williams in :gh:`72346`.)" @@ -129,39 +145,39 @@ msgstr "" ":mod:`email`:已棄用 :func:`email.utils.localtime` 中的 *isdst* 參數。(由 " "Alan Williams 於 :gh:`72346` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:50 +#: ../../deprecations/pending-removal-in-3.14.rst:57 msgid ":mod:`importlib.abc` deprecated classes:" msgstr ":mod:`importlib.abc` 的已棄用類別:" -#: ../../deprecations/pending-removal-in-3.14.rst:52 +#: ../../deprecations/pending-removal-in-3.14.rst:59 msgid ":class:`!importlib.abc.ResourceReader`" msgstr ":class:`!importlib.abc.ResourceReader`" -#: ../../deprecations/pending-removal-in-3.14.rst:53 +#: ../../deprecations/pending-removal-in-3.14.rst:60 msgid ":class:`!importlib.abc.Traversable`" msgstr ":class:`!importlib.abc.Traversable`" -#: ../../deprecations/pending-removal-in-3.14.rst:54 +#: ../../deprecations/pending-removal-in-3.14.rst:61 msgid ":class:`!importlib.abc.TraversableResources`" msgstr ":class:`!importlib.abc.TraversableResources`" -#: ../../deprecations/pending-removal-in-3.14.rst:56 +#: ../../deprecations/pending-removal-in-3.14.rst:63 msgid "Use :mod:`importlib.resources.abc` classes instead:" msgstr "請改用 :mod:`importlib.resources.abc` 類別:" -#: ../../deprecations/pending-removal-in-3.14.rst:58 +#: ../../deprecations/pending-removal-in-3.14.rst:65 msgid ":class:`importlib.resources.abc.Traversable`" msgstr ":class:`importlib.resources.abc.Traversable`" -#: ../../deprecations/pending-removal-in-3.14.rst:59 +#: ../../deprecations/pending-removal-in-3.14.rst:66 msgid ":class:`importlib.resources.abc.TraversableResources`" msgstr ":class:`importlib.resources.abc.TraversableResources`" -#: ../../deprecations/pending-removal-in-3.14.rst:61 +#: ../../deprecations/pending-removal-in-3.14.rst:68 msgid "(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)" msgstr "(由 Jason R. Coombs 和 Hugo van Kemenade 貢獻於 :gh:`93963`。)" -#: ../../deprecations/pending-removal-in-3.14.rst:63 +#: ../../deprecations/pending-removal-in-3.14.rst:70 msgid "" ":mod:`itertools` had undocumented, inefficient, historically buggy, and " "inconsistent support for copy, deepcopy, and pickle operations. This will be " @@ -172,7 +188,7 @@ msgstr "" "deepcopy 和 pickle 操作支援。將在 3.14 中移除以大幅減少程式碼量和維護負擔。 " "(由 Raymond Hettinger 於 :gh:`101588` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:69 +#: ../../deprecations/pending-removal-in-3.14.rst:76 msgid "" ":mod:`multiprocessing`: The default start method will change to a safer one " "on Linux, BSDs, and other non-macOS POSIX platforms where ``'fork'`` is " @@ -189,7 +205,7 @@ msgstr "" "API 來明確指定你的程式碼何時\\ *需要* ``'fork'``。請參閱 :ref:" "`multiprocessing-start-methods`。" -#: ../../deprecations/pending-removal-in-3.14.rst:77 +#: ../../deprecations/pending-removal-in-3.14.rst:84 msgid "" ":mod:`pathlib`: :meth:`~pathlib.PurePath.is_relative_to` and :meth:`~pathlib." "PurePath.relative_to`: passing additional arguments is deprecated." @@ -197,7 +213,7 @@ msgstr "" ":mod:`pathlib`:已棄用 :meth:`~pathlib.PurePath.is_relative_to` 和 :meth:" "`~pathlib.PurePath.relative_to`:額外引數的傳遞已被棄用。" -#: ../../deprecations/pending-removal-in-3.14.rst:81 +#: ../../deprecations/pending-removal-in-3.14.rst:88 msgid "" ":mod:`pkgutil`: :func:`~pkgutil.find_loader` and :func:`~pkgutil.get_loader` " "now raise :exc:`DeprecationWarning`; use :func:`importlib.util.find_spec` " @@ -207,27 +223,27 @@ msgstr "" "現在會引發 :exc:`DeprecationWarning`;請改用 :func:`importlib.util." "find_spec`。 (由 Nikita Sobolev 於 :gh:`97850` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:86 +#: ../../deprecations/pending-removal-in-3.14.rst:93 msgid ":mod:`pty`:" msgstr ":mod:`pty`:" -#: ../../deprecations/pending-removal-in-3.14.rst:88 +#: ../../deprecations/pending-removal-in-3.14.rst:95 msgid "``master_open()``: use :func:`pty.openpty`." msgstr "``master_open()``:請用 :func:`pty.openpty`。" -#: ../../deprecations/pending-removal-in-3.14.rst:89 +#: ../../deprecations/pending-removal-in-3.14.rst:96 msgid "``slave_open()``: use :func:`pty.openpty`." msgstr "``slave_open()``:請用 :func:`pty.openpty`。" -#: ../../deprecations/pending-removal-in-3.14.rst:91 +#: ../../deprecations/pending-removal-in-3.14.rst:98 msgid ":mod:`sqlite3`:" msgstr ":mod:`sqlite3`:" -#: ../../deprecations/pending-removal-in-3.14.rst:93 +#: ../../deprecations/pending-removal-in-3.14.rst:100 msgid ":data:`~sqlite3.version` and :data:`~sqlite3.version_info`." msgstr ":data:`~sqlite3.version` 和 :data:`~sqlite3.version_info`。" -#: ../../deprecations/pending-removal-in-3.14.rst:95 +#: ../../deprecations/pending-removal-in-3.14.rst:102 msgid "" ":meth:`~sqlite3.Cursor.execute` and :meth:`~sqlite3.Cursor.executemany` if :" "ref:`named placeholders ` are used and *parameters* is " @@ -237,7 +253,7 @@ msgstr "" "使用 :ref:`named placeholders ` 且 *parameters* 是序列" "而不是 :class:`dict`。" -#: ../../deprecations/pending-removal-in-3.14.rst:99 +#: ../../deprecations/pending-removal-in-3.14.rst:106 msgid "" "date and datetime adapter, date and timestamp converter: see the :mod:" "`sqlite3` documentation for suggested replacement recipes." @@ -245,7 +261,7 @@ msgstr "" "date 和 datetime 的適配器 (adapter)、date 和 timestamp 轉換器 (converter):請" "參閱 :mod:`sqlite3` 文件以獲得建議的替代方案。" -#: ../../deprecations/pending-removal-in-3.14.rst:102 +#: ../../deprecations/pending-removal-in-3.14.rst:109 msgid "" ":class:`types.CodeType`: Accessing :attr:`~codeobject.co_lnotab` was " "deprecated in :pep:`626` since 3.10 and was planned to be removed in 3.12, " @@ -257,7 +273,7 @@ msgstr "" "exc:`DeprecationWarning`。可能在 3.14 中移除。(由 Nikita Sobolev 於 :gh:" "`101866` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:109 +#: ../../deprecations/pending-removal-in-3.14.rst:116 msgid "" ":mod:`typing`: :class:`~typing.ByteString`, deprecated since Python 3.9, now " "causes a :exc:`DeprecationWarning` to be emitted when it is used." @@ -265,7 +281,7 @@ msgstr "" ":mod:`typing`:自 Python 3.9 起已被棄用的 :class:`~typing.ByteString` 現在在" "使用時會發出 :exc:`DeprecationWarning`。" -#: ../../deprecations/pending-removal-in-3.14.rst:112 +#: ../../deprecations/pending-removal-in-3.14.rst:119 msgid "" ":mod:`urllib`: :class:`!urllib.parse.Quoter` is deprecated: it was not " "intended to be a public API. (Contributed by Gregory P. Smith in :gh:" @@ -279,22 +295,44 @@ msgstr "" msgid "Pending Removal in Python 3.15" msgstr "Python 3.15 中待移除的項目" -#: ../../deprecations/pending-removal-in-3.15.rst:4 +#: ../../deprecations/pending-removal-in-3.15.rst:6 +msgid "" +"Setting :attr:`~module.__cached__` on a module while failing to set :attr:" +"`__spec__.cached ` is deprecated. In " +"Python 3.15, :attr:`!__cached__` will cease to be set or take into " +"consideration by the import system or standard library. (:gh:`97879`)" +msgstr "" +"在模組上設定 :attr:`~module.__cached__` 而沒有設定 :attr:`__spec__.cached " +"` 的做法已被棄用。在 Python 3.15 中," +"引入系統或標準函式庫將不再設定或考慮 :attr:`!__cached__`。(:gh:`97879`)" + +#: ../../deprecations/pending-removal-in-3.15.rst:11 +msgid "" +"Setting :attr:`~module.__package__` on a module while failing to set :attr:" +"`__spec__.parent ` is deprecated. In " +"Python 3.15, :attr:`!__package__` will cease to be set or take into " +"consideration by the import system or standard library. (:gh:`97879`)" +msgstr "" +"在模組上設定 :attr:`~module.__package__` 而沒有設定 :attr:`__spec__.parent " +"` 的做法已被棄用。在 Python 3.15 中," +"引入系統或標準函式庫將不再設定或考慮 :attr:`!__package__`。(:gh:`97879`)" + +#: ../../deprecations/pending-removal-in-3.15.rst:16 msgid ":mod:`ctypes`:" msgstr ":mod:`ctypes`:" -#: ../../deprecations/pending-removal-in-3.15.rst:6 +#: ../../deprecations/pending-removal-in-3.15.rst:18 msgid "" "The undocumented :func:`!ctypes.SetPointerType` function has been deprecated " "since Python 3.13." msgstr "" "自 Python 3.13 起,未記錄的 :func:`!ctypes.SetPointerType` 函式已被棄用。" -#: ../../deprecations/pending-removal-in-3.15.rst:9 +#: ../../deprecations/pending-removal-in-3.15.rst:21 msgid ":mod:`http.server`:" msgstr ":mod:`http.server`:" -#: ../../deprecations/pending-removal-in-3.15.rst:11 +#: ../../deprecations/pending-removal-in-3.15.rst:23 msgid "" "The obsolete and rarely used :class:`~http.server.CGIHTTPRequestHandler` has " "been deprecated since Python 3.13. No direct replacement exists. *Anything* " @@ -304,7 +342,7 @@ msgstr "" "起已被棄用。不存在直接的替代。*任何東西*\\ 都比 CGI 更好地將 Web 伺服器與請求" "處理程序介接起來。" -#: ../../deprecations/pending-removal-in-3.15.rst:17 +#: ../../deprecations/pending-removal-in-3.15.rst:29 msgid "" "The :option:`!--cgi` flag to the :program:`python -m http.server` command-" "line interface has been deprecated since Python 3.13." @@ -312,19 +350,11 @@ msgstr "" "自 Python 3.13 起,:program:`python -m http.server` 命令列介面的 :option:`!--" "cgi` 旗標已被棄用。" -#: ../../deprecations/pending-removal-in-3.15.rst:20 -msgid "" -":mod:`importlib`: ``__package__`` and ``__cached__`` will cease to be set or " -"taken into consideration by the import system (:gh:`97879`)." -msgstr "" -":mod:`importlib`:``__package__`` 和 ``__cached__`` 將不再被設定或被 import " -"系統考慮。 (:gh:`97879`)" - -#: ../../deprecations/pending-removal-in-3.15.rst:23 +#: ../../deprecations/pending-removal-in-3.15.rst:32 msgid ":class:`locale`:" msgstr ":class:`locale`:" -#: ../../deprecations/pending-removal-in-3.15.rst:25 +#: ../../deprecations/pending-removal-in-3.15.rst:34 msgid "" "The :func:`~locale.getdefaultlocale` function has been deprecated since " "Python 3.11. Its removal was originally planned for Python 3.13 (:gh:" @@ -337,11 +367,11 @@ msgstr "" "`~locale.getlocale`、:func:`~locale.setlocale` 和 :func:`~locale." "getencoding`。 (由 Hugo van Kemenade 於 :gh:`111187` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.15.rst:33 +#: ../../deprecations/pending-removal-in-3.15.rst:42 msgid ":mod:`pathlib`:" msgstr ":mod:`pathlib`:" -#: ../../deprecations/pending-removal-in-3.15.rst:35 +#: ../../deprecations/pending-removal-in-3.15.rst:44 msgid "" ":meth:`.PurePath.is_reserved` has been deprecated since Python 3.13. Use :" "func:`os.path.isreserved` to detect reserved paths on Windows." @@ -349,11 +379,11 @@ msgstr "" ":meth:`.PurePath.is_reserved` 已自 Python 3.13 被棄用。請用 :func:`os.path." "isreserved` 來偵測 Windows 上的保留路徑。" -#: ../../deprecations/pending-removal-in-3.15.rst:39 +#: ../../deprecations/pending-removal-in-3.15.rst:48 msgid ":mod:`platform`:" msgstr ":mod:`platform`:" -#: ../../deprecations/pending-removal-in-3.15.rst:41 +#: ../../deprecations/pending-removal-in-3.15.rst:50 msgid "" ":func:`~platform.java_ver` has been deprecated since Python 3.13. This " "function is only useful for Jython support, has a confusing API, and is " @@ -362,11 +392,11 @@ msgstr "" "自 Python 3.13 起,:func:`~platform.java_ver` 已被棄用。此函式僅對 Jython 支" "援有用,具有令人困惑的 API,基本上未經測試。" -#: ../../deprecations/pending-removal-in-3.15.rst:45 +#: ../../deprecations/pending-removal-in-3.15.rst:54 msgid ":mod:`threading`:" msgstr ":mod:`threading`:" -#: ../../deprecations/pending-removal-in-3.15.rst:47 +#: ../../deprecations/pending-removal-in-3.15.rst:56 msgid "" ":func:`~threading.RLock` will take no arguments in Python 3.15. Passing any " "arguments has been deprecated since Python 3.14, as the Python version does " @@ -377,11 +407,11 @@ msgstr "" "起,傳遞任何引數的用法已被棄用,因為 Python 版本不允許任何引數,但 C 版本允許" "任意數量的位置或關鍵字引數,並忽略每個引數。" -#: ../../deprecations/pending-removal-in-3.15.rst:53 +#: ../../deprecations/pending-removal-in-3.15.rst:62 msgid ":mod:`typing`:" msgstr ":mod:`typing`:" -#: ../../deprecations/pending-removal-in-3.15.rst:55 +#: ../../deprecations/pending-removal-in-3.15.rst:64 msgid "" "The undocumented keyword argument syntax for creating :class:`~typing." "NamedTuple` classes (e.g. ``Point = NamedTuple(\"Point\", x=int, y=int)``) " @@ -392,7 +422,7 @@ msgstr "" "(``Point = NamedTuple(\"Point\", x=int, y=int)``) 已自 Python 3.13 棄用。請改" "用基於類別的語法或函式語法 (functional syntax)。" -#: ../../deprecations/pending-removal-in-3.15.rst:61 +#: ../../deprecations/pending-removal-in-3.15.rst:70 msgid "" "The :func:`typing.no_type_check_decorator` decorator function has been " "deprecated since Python 3.13. After eight years in the :mod:`typing` module, " @@ -402,11 +432,11 @@ msgstr "" "用。在 :mod:`typing` 模組中使用了八年之後,它尚未得到任何主要型別檢查器的支" "援。" -#: ../../deprecations/pending-removal-in-3.15.rst:66 +#: ../../deprecations/pending-removal-in-3.15.rst:75 msgid ":mod:`wave`:" msgstr ":mod:`wave`:" -#: ../../deprecations/pending-removal-in-3.15.rst:68 +#: ../../deprecations/pending-removal-in-3.15.rst:77 msgid "" "The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:`~wave." "Wave_read.getmarkers` methods of the :class:`~wave.Wave_read` and :class:" @@ -669,6 +699,8 @@ msgid "" ":mod:`logging`: the ``warn()`` method has been deprecated since Python 3.3, " "use :meth:`~logging.warning` instead." msgstr "" +":mod:`logging`:自 Python 3.3 起,``warn()`` 方法已被棄用,請改用 :meth:" +"`~logging.warning`。" #: ../../deprecations/pending-removal-in-future.rst:72 msgid "" diff --git a/deprecations/pending-removal-in-3.14.po b/deprecations/pending-removal-in-3.14.po index 615e97ede1..a552eb8e16 100644 --- a/deprecations/pending-removal-in-3.14.po +++ b/deprecations/pending-removal-in-3.14.po @@ -1,4 +1,3 @@ -# SOME DESCRIPTIVE TITLE. # Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. @@ -7,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-28 00:13+0000\n" +"POT-Creation-Date: 2024-10-15 00:14+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -21,6 +20,21 @@ msgid "Pending Removal in Python 3.14" msgstr "Python 3.14 中待移除的項目" #: ../../deprecations/pending-removal-in-3.14.rst:4 +msgid "The import system:" +msgstr "引入系統 (import system):" + +#: ../../deprecations/pending-removal-in-3.14.rst:6 +msgid "" +"Setting :attr:`~module.__loader__` on a module while failing to set :attr:" +"`__spec__.loader ` is deprecated. In " +"Python 3.14, :attr:`!__loader__` will cease to be set or taken into " +"consideration by the import system or the standard library." +msgstr "" +"在模組上設定 :attr:`~module.__loader__` 而沒有設定 :attr:`__spec__.loader " +"` 的做法已被棄用。在 Python 3.14 中," +"引入系統或標準函式庫將不再設定或考慮 :attr:`!__loader__` 。" + +#: ../../deprecations/pending-removal-in-3.14.rst:11 msgid "" ":mod:`argparse`: The *type*, *choices*, and *metavar* parameters of :class:`!" "argparse.BooleanOptionalAction` are deprecated and will be removed in 3.14. " @@ -30,7 +44,7 @@ msgstr "" "*choices* 和 *metavar* 參數已被棄用,將在 3.14 中移除。 (由 Nikita Sobolev " "於 :gh:`92248` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:9 +#: ../../deprecations/pending-removal-in-3.14.rst:16 msgid "" ":mod:`ast`: The following features have been deprecated in documentation " "since Python 3.8, now cause a :exc:`DeprecationWarning` to be emitted at " @@ -39,38 +53,38 @@ msgstr "" ":mod:`ast`:自 Python 3.8 起,下列功能已在文件中被棄用,現在在存取或使用時會" "於 runtime 發出 :exc:`DeprecationWarning`,並將在 Python 3.14 中移除:" -#: ../../deprecations/pending-removal-in-3.14.rst:13 +#: ../../deprecations/pending-removal-in-3.14.rst:20 msgid ":class:`!ast.Num`" msgstr ":class:`!ast.Num`" -#: ../../deprecations/pending-removal-in-3.14.rst:14 +#: ../../deprecations/pending-removal-in-3.14.rst:21 msgid ":class:`!ast.Str`" msgstr ":class:`!ast.Str`" -#: ../../deprecations/pending-removal-in-3.14.rst:15 +#: ../../deprecations/pending-removal-in-3.14.rst:22 msgid ":class:`!ast.Bytes`" msgstr ":class:`!ast.Bytes`" -#: ../../deprecations/pending-removal-in-3.14.rst:16 +#: ../../deprecations/pending-removal-in-3.14.rst:23 msgid ":class:`!ast.NameConstant`" msgstr ":class:`!ast.NameConstant`" -#: ../../deprecations/pending-removal-in-3.14.rst:17 +#: ../../deprecations/pending-removal-in-3.14.rst:24 msgid ":class:`!ast.Ellipsis`" msgstr ":class:`!ast.Ellipsis`" -#: ../../deprecations/pending-removal-in-3.14.rst:19 +#: ../../deprecations/pending-removal-in-3.14.rst:26 msgid "" "Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka in :gh:" "`90953`.)" msgstr "" "請改用 :class:`ast.Constant`。(由 Serhiy Storchaka 於 :gh:`90953` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:22 +#: ../../deprecations/pending-removal-in-3.14.rst:29 msgid ":mod:`asyncio`:" msgstr ":mod:`asyncio`:" -#: ../../deprecations/pending-removal-in-3.14.rst:24 +#: ../../deprecations/pending-removal-in-3.14.rst:31 msgid "" "The child watcher classes :class:`~asyncio.MultiLoopChildWatcher`, :class:" "`~asyncio.FastChildWatcher`, :class:`~asyncio.AbstractChildWatcher` and :" @@ -82,7 +96,7 @@ msgstr "" "AbstractChildWatcher` 和 :class:`~asyncio.SafeChildWatcher`。 (由 Kumar " "Aditya 於 :gh:`94597` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:30 +#: ../../deprecations/pending-removal-in-3.14.rst:37 msgid "" ":func:`asyncio.set_child_watcher`, :func:`asyncio.get_child_watcher`, :meth:" "`asyncio.AbstractEventLoopPolicy.set_child_watcher` and :meth:`asyncio." @@ -94,7 +108,7 @@ msgstr "" "AbstractEventLoopPolicy.get_child_watcher` 已被棄用並將在 Python 3.14 中移" "除。(由 Kumar Aditya 於 :gh:`94597` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:36 +#: ../../deprecations/pending-removal-in-3.14.rst:43 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 " @@ -105,7 +119,7 @@ msgstr "" "件迴圈且決定建立一個時發出 :exc:`DeprecationWarning`。 (由 Serhiy Storchaka " "和 Guido van Rossum 於 :gh:`100160` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:41 +#: ../../deprecations/pending-removal-in-3.14.rst:48 msgid "" ":mod:`collections.abc`: Deprecated :class:`~collections.abc.ByteString`. " "Prefer :class:`!Sequence` or :class:`~collections.abc.Buffer`. For use in " @@ -117,7 +131,7 @@ msgstr "" "改用聯集,如 ``bytes | bytearray``,或 :class:`collections.abc.Buffer`。(由 " "Shantanu Jain 於 :gh:`91896` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:47 +#: ../../deprecations/pending-removal-in-3.14.rst:54 msgid "" ":mod:`email`: Deprecated the *isdst* parameter in :func:`email.utils." "localtime`. (Contributed by Alan Williams in :gh:`72346`.)" @@ -125,39 +139,39 @@ msgstr "" ":mod:`email`:已棄用 :func:`email.utils.localtime` 中的 *isdst* 參數。(由 " "Alan Williams 於 :gh:`72346` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:50 +#: ../../deprecations/pending-removal-in-3.14.rst:57 msgid ":mod:`importlib.abc` deprecated classes:" msgstr ":mod:`importlib.abc` 的已棄用類別:" -#: ../../deprecations/pending-removal-in-3.14.rst:52 +#: ../../deprecations/pending-removal-in-3.14.rst:59 msgid ":class:`!importlib.abc.ResourceReader`" msgstr ":class:`!importlib.abc.ResourceReader`" -#: ../../deprecations/pending-removal-in-3.14.rst:53 +#: ../../deprecations/pending-removal-in-3.14.rst:60 msgid ":class:`!importlib.abc.Traversable`" msgstr ":class:`!importlib.abc.Traversable`" -#: ../../deprecations/pending-removal-in-3.14.rst:54 +#: ../../deprecations/pending-removal-in-3.14.rst:61 msgid ":class:`!importlib.abc.TraversableResources`" msgstr ":class:`!importlib.abc.TraversableResources`" -#: ../../deprecations/pending-removal-in-3.14.rst:56 +#: ../../deprecations/pending-removal-in-3.14.rst:63 msgid "Use :mod:`importlib.resources.abc` classes instead:" msgstr "請改用 :mod:`importlib.resources.abc` 類別:" -#: ../../deprecations/pending-removal-in-3.14.rst:58 +#: ../../deprecations/pending-removal-in-3.14.rst:65 msgid ":class:`importlib.resources.abc.Traversable`" msgstr ":class:`importlib.resources.abc.Traversable`" -#: ../../deprecations/pending-removal-in-3.14.rst:59 +#: ../../deprecations/pending-removal-in-3.14.rst:66 msgid ":class:`importlib.resources.abc.TraversableResources`" msgstr ":class:`importlib.resources.abc.TraversableResources`" -#: ../../deprecations/pending-removal-in-3.14.rst:61 +#: ../../deprecations/pending-removal-in-3.14.rst:68 msgid "(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)" msgstr "(由 Jason R. Coombs 和 Hugo van Kemenade 貢獻於 :gh:`93963`。)" -#: ../../deprecations/pending-removal-in-3.14.rst:63 +#: ../../deprecations/pending-removal-in-3.14.rst:70 msgid "" ":mod:`itertools` had undocumented, inefficient, historically buggy, and " "inconsistent support for copy, deepcopy, and pickle operations. This will be " @@ -168,7 +182,7 @@ msgstr "" "deepcopy 和 pickle 操作支援。將在 3.14 中移除以大幅減少程式碼量和維護負擔。 " "(由 Raymond Hettinger 於 :gh:`101588` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:69 +#: ../../deprecations/pending-removal-in-3.14.rst:76 msgid "" ":mod:`multiprocessing`: The default start method will change to a safer one " "on Linux, BSDs, and other non-macOS POSIX platforms where ``'fork'`` is " @@ -185,7 +199,7 @@ msgstr "" "API 來明確指定你的程式碼何時\\ *需要* ``'fork'``。請參閱 :ref:" "`multiprocessing-start-methods`。" -#: ../../deprecations/pending-removal-in-3.14.rst:77 +#: ../../deprecations/pending-removal-in-3.14.rst:84 msgid "" ":mod:`pathlib`: :meth:`~pathlib.PurePath.is_relative_to` and :meth:`~pathlib." "PurePath.relative_to`: passing additional arguments is deprecated." @@ -193,7 +207,7 @@ msgstr "" ":mod:`pathlib`:已棄用 :meth:`~pathlib.PurePath.is_relative_to` 和 :meth:" "`~pathlib.PurePath.relative_to`:額外引數的傳遞已被棄用。" -#: ../../deprecations/pending-removal-in-3.14.rst:81 +#: ../../deprecations/pending-removal-in-3.14.rst:88 msgid "" ":mod:`pkgutil`: :func:`~pkgutil.find_loader` and :func:`~pkgutil.get_loader` " "now raise :exc:`DeprecationWarning`; use :func:`importlib.util.find_spec` " @@ -203,27 +217,27 @@ msgstr "" "現在會引發 :exc:`DeprecationWarning`;請改用 :func:`importlib.util." "find_spec`。 (由 Nikita Sobolev 於 :gh:`97850` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:86 +#: ../../deprecations/pending-removal-in-3.14.rst:93 msgid ":mod:`pty`:" msgstr ":mod:`pty`:" -#: ../../deprecations/pending-removal-in-3.14.rst:88 +#: ../../deprecations/pending-removal-in-3.14.rst:95 msgid "``master_open()``: use :func:`pty.openpty`." msgstr "``master_open()``:請用 :func:`pty.openpty`。" -#: ../../deprecations/pending-removal-in-3.14.rst:89 +#: ../../deprecations/pending-removal-in-3.14.rst:96 msgid "``slave_open()``: use :func:`pty.openpty`." msgstr "``slave_open()``:請用 :func:`pty.openpty`。" -#: ../../deprecations/pending-removal-in-3.14.rst:91 +#: ../../deprecations/pending-removal-in-3.14.rst:98 msgid ":mod:`sqlite3`:" msgstr ":mod:`sqlite3`:" -#: ../../deprecations/pending-removal-in-3.14.rst:93 +#: ../../deprecations/pending-removal-in-3.14.rst:100 msgid ":data:`~sqlite3.version` and :data:`~sqlite3.version_info`." msgstr ":data:`~sqlite3.version` 和 :data:`~sqlite3.version_info`。" -#: ../../deprecations/pending-removal-in-3.14.rst:95 +#: ../../deprecations/pending-removal-in-3.14.rst:102 msgid "" ":meth:`~sqlite3.Cursor.execute` and :meth:`~sqlite3.Cursor.executemany` if :" "ref:`named placeholders ` are used and *parameters* is " @@ -233,7 +247,7 @@ msgstr "" "使用 :ref:`named placeholders ` 且 *parameters* 是序列" "而不是 :class:`dict`。" -#: ../../deprecations/pending-removal-in-3.14.rst:99 +#: ../../deprecations/pending-removal-in-3.14.rst:106 msgid "" "date and datetime adapter, date and timestamp converter: see the :mod:" "`sqlite3` documentation for suggested replacement recipes." @@ -241,7 +255,7 @@ msgstr "" "date 和 datetime 的適配器 (adapter)、date 和 timestamp 轉換器 (converter):請" "參閱 :mod:`sqlite3` 文件以獲得建議的替代方案。" -#: ../../deprecations/pending-removal-in-3.14.rst:102 +#: ../../deprecations/pending-removal-in-3.14.rst:109 msgid "" ":class:`types.CodeType`: Accessing :attr:`~codeobject.co_lnotab` was " "deprecated in :pep:`626` since 3.10 and was planned to be removed in 3.12, " @@ -253,7 +267,7 @@ msgstr "" "exc:`DeprecationWarning`。可能在 3.14 中移除。(由 Nikita Sobolev 於 :gh:" "`101866` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:109 +#: ../../deprecations/pending-removal-in-3.14.rst:116 msgid "" ":mod:`typing`: :class:`~typing.ByteString`, deprecated since Python 3.9, now " "causes a :exc:`DeprecationWarning` to be emitted when it is used." @@ -261,7 +275,7 @@ msgstr "" ":mod:`typing`:自 Python 3.9 起已被棄用的 :class:`~typing.ByteString` 現在在" "使用時會發出 :exc:`DeprecationWarning`。" -#: ../../deprecations/pending-removal-in-3.14.rst:112 +#: ../../deprecations/pending-removal-in-3.14.rst:119 msgid "" ":mod:`urllib`: :class:`!urllib.parse.Quoter` is deprecated: it was not " "intended to be a public API. (Contributed by Gregory P. Smith in :gh:" diff --git a/deprecations/pending-removal-in-3.15.po b/deprecations/pending-removal-in-3.15.po index d160dbfc7a..1fc15168f5 100644 --- a/deprecations/pending-removal-in-3.15.po +++ b/deprecations/pending-removal-in-3.15.po @@ -1,4 +1,3 @@ -# SOME DESCRIPTIVE TITLE. # Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. @@ -7,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-28 00:13+0000\n" +"POT-Creation-Date: 2024-10-15 00:14+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -21,21 +20,47 @@ msgid "Pending Removal in Python 3.15" msgstr "Python 3.15 中待移除的項目" #: ../../deprecations/pending-removal-in-3.15.rst:4 +msgid "The import system:" +msgstr "引入系統 (import system):" + +#: ../../deprecations/pending-removal-in-3.15.rst:6 +msgid "" +"Setting :attr:`~module.__cached__` on a module while failing to set :attr:" +"`__spec__.cached ` is deprecated. In " +"Python 3.15, :attr:`!__cached__` will cease to be set or take into " +"consideration by the import system or standard library. (:gh:`97879`)" +msgstr "" +"在模組上設定 :attr:`~module.__cached__` 而沒有設定 :attr:`__spec__.cached " +"` 的做法已被棄用。在 Python 3.15 中," +"引入系統或標準函式庫將不再設定或考慮 :attr:`!__cached__`。(:gh:`97879`)" + +#: ../../deprecations/pending-removal-in-3.15.rst:11 +msgid "" +"Setting :attr:`~module.__package__` on a module while failing to set :attr:" +"`__spec__.parent ` is deprecated. In " +"Python 3.15, :attr:`!__package__` will cease to be set or take into " +"consideration by the import system or standard library. (:gh:`97879`)" +msgstr "" +"在模組上設定 :attr:`~module.__package__` 而沒有設定 :attr:`__spec__.parent " +"` 的做法已被棄用。在 Python 3.15 中," +"引入系統或標準函式庫將不再設定或考慮 :attr:`!__package__`。(:gh:`97879`)" + +#: ../../deprecations/pending-removal-in-3.15.rst:16 msgid ":mod:`ctypes`:" msgstr ":mod:`ctypes`:" -#: ../../deprecations/pending-removal-in-3.15.rst:6 +#: ../../deprecations/pending-removal-in-3.15.rst:18 msgid "" "The undocumented :func:`!ctypes.SetPointerType` function has been deprecated " "since Python 3.13." msgstr "" "自 Python 3.13 起,未記錄的 :func:`!ctypes.SetPointerType` 函式已被棄用。" -#: ../../deprecations/pending-removal-in-3.15.rst:9 +#: ../../deprecations/pending-removal-in-3.15.rst:21 msgid ":mod:`http.server`:" msgstr ":mod:`http.server`:" -#: ../../deprecations/pending-removal-in-3.15.rst:11 +#: ../../deprecations/pending-removal-in-3.15.rst:23 msgid "" "The obsolete and rarely used :class:`~http.server.CGIHTTPRequestHandler` has " "been deprecated since Python 3.13. No direct replacement exists. *Anything* " @@ -45,7 +70,7 @@ msgstr "" "起已被棄用。不存在直接的替代。*任何東西*\\ 都比 CGI 更好地將 Web 伺服器與請求" "處理程序介接起來。" -#: ../../deprecations/pending-removal-in-3.15.rst:17 +#: ../../deprecations/pending-removal-in-3.15.rst:29 msgid "" "The :option:`!--cgi` flag to the :program:`python -m http.server` command-" "line interface has been deprecated since Python 3.13." @@ -53,19 +78,11 @@ msgstr "" "自 Python 3.13 起,:program:`python -m http.server` 命令列介面的 :option:`!--" "cgi` 旗標已被棄用。" -#: ../../deprecations/pending-removal-in-3.15.rst:20 -msgid "" -":mod:`importlib`: ``__package__`` and ``__cached__`` will cease to be set or " -"taken into consideration by the import system (:gh:`97879`)." -msgstr "" -":mod:`importlib`:引入系統將不再設定或考慮 ``__package__`` 和 ``__cached__`` " -"(:gh:`97879`)。" - -#: ../../deprecations/pending-removal-in-3.15.rst:23 +#: ../../deprecations/pending-removal-in-3.15.rst:32 msgid ":class:`locale`:" msgstr ":class:`locale`:" -#: ../../deprecations/pending-removal-in-3.15.rst:25 +#: ../../deprecations/pending-removal-in-3.15.rst:34 msgid "" "The :func:`~locale.getdefaultlocale` function has been deprecated since " "Python 3.11. Its removal was originally planned for Python 3.13 (:gh:" @@ -78,11 +95,11 @@ msgstr "" "`~locale.getlocale`、:func:`~locale.setlocale` 和 :func:`~locale." "getencoding`。 (由 Hugo van Kemenade 於 :gh:`111187` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.15.rst:33 +#: ../../deprecations/pending-removal-in-3.15.rst:42 msgid ":mod:`pathlib`:" msgstr ":mod:`pathlib`:" -#: ../../deprecations/pending-removal-in-3.15.rst:35 +#: ../../deprecations/pending-removal-in-3.15.rst:44 msgid "" ":meth:`.PurePath.is_reserved` has been deprecated since Python 3.13. Use :" "func:`os.path.isreserved` to detect reserved paths on Windows." @@ -90,11 +107,11 @@ msgstr "" ":meth:`.PurePath.is_reserved` 已自 Python 3.13 被棄用。請用 :func:`os.path." "isreserved` 來偵測 Windows 上的保留路徑。" -#: ../../deprecations/pending-removal-in-3.15.rst:39 +#: ../../deprecations/pending-removal-in-3.15.rst:48 msgid ":mod:`platform`:" msgstr ":mod:`platform`:" -#: ../../deprecations/pending-removal-in-3.15.rst:41 +#: ../../deprecations/pending-removal-in-3.15.rst:50 msgid "" ":func:`~platform.java_ver` has been deprecated since Python 3.13. This " "function is only useful for Jython support, has a confusing API, and is " @@ -103,11 +120,11 @@ msgstr "" "自 Python 3.13 起,:func:`~platform.java_ver` 已被棄用。此函式僅對 Jython 支" "援有用,具有令人困惑的 API,基本上未經測試。" -#: ../../deprecations/pending-removal-in-3.15.rst:45 +#: ../../deprecations/pending-removal-in-3.15.rst:54 msgid ":mod:`threading`:" msgstr ":mod:`threading`:" -#: ../../deprecations/pending-removal-in-3.15.rst:47 +#: ../../deprecations/pending-removal-in-3.15.rst:56 msgid "" ":func:`~threading.RLock` will take no arguments in Python 3.15. Passing any " "arguments has been deprecated since Python 3.14, as the Python version does " @@ -118,11 +135,11 @@ msgstr "" "起,傳遞任何引數的用法已被棄用,因為 Python 版本不允許任何引數,但 C 版本允許" "任意數量的位置或關鍵字引數,並忽略每個引數。" -#: ../../deprecations/pending-removal-in-3.15.rst:53 +#: ../../deprecations/pending-removal-in-3.15.rst:62 msgid ":mod:`typing`:" msgstr ":mod:`typing`:" -#: ../../deprecations/pending-removal-in-3.15.rst:55 +#: ../../deprecations/pending-removal-in-3.15.rst:64 msgid "" "The undocumented keyword argument syntax for creating :class:`~typing." "NamedTuple` classes (e.g. ``Point = NamedTuple(\"Point\", x=int, y=int)``) " @@ -133,7 +150,7 @@ msgstr "" "(``Point = NamedTuple(\"Point\", x=int, y=int)``) 已自 Python 3.13 棄用。請改" "用基於類別的語法或函式語法 (functional syntax)。" -#: ../../deprecations/pending-removal-in-3.15.rst:61 +#: ../../deprecations/pending-removal-in-3.15.rst:70 msgid "" "The :func:`typing.no_type_check_decorator` decorator function has been " "deprecated since Python 3.13. After eight years in the :mod:`typing` module, " @@ -143,11 +160,11 @@ msgstr "" "用。在 :mod:`typing` 模組中使用了八年之後,它尚未得到任何主要型別檢查器的支" "援。" -#: ../../deprecations/pending-removal-in-3.15.rst:66 +#: ../../deprecations/pending-removal-in-3.15.rst:75 msgid ":mod:`wave`:" msgstr ":mod:`wave`:" -#: ../../deprecations/pending-removal-in-3.15.rst:68 +#: ../../deprecations/pending-removal-in-3.15.rst:77 msgid "" "The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:`~wave." "Wave_read.getmarkers` methods of the :class:`~wave.Wave_read` and :class:" diff --git a/deprecations/pending-removal-in-future.po b/deprecations/pending-removal-in-future.po index c46ed6f7d3..80f5e1023a 100644 --- a/deprecations/pending-removal-in-future.po +++ b/deprecations/pending-removal-in-future.po @@ -185,6 +185,8 @@ msgid "" ":mod:`logging`: the ``warn()`` method has been deprecated since Python 3.3, " "use :meth:`~logging.warning` instead." msgstr "" +":mod:`logging`:自 Python 3.3 起,``warn()`` 方法已被棄用,請改用 :meth:" +"`~logging.warning`。" #: ../../deprecations/pending-removal-in-future.rst:72 msgid "" diff --git a/glossary.po b/glossary.po index a882706b5e..92507365c3 100644 --- a/glossary.po +++ b/glossary.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-27 00:14+0000\n" +"POT-Creation-Date: 2024-10-14 00:14+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-" @@ -534,10 +534,66 @@ msgstr "" "修改的變數。" #: ../../glossary.rst:228 +msgid "closure variable" +msgstr "closure variable(閉包變數)" + +#: ../../glossary.rst:230 +msgid "" +"A :term:`free variable` referenced from a :term:`nested scope` that is " +"defined in an outer scope rather than being resolved at runtime from the " +"globals or builtin namespaces. May be explicitly defined with the :keyword:" +"`nonlocal` keyword to allow write access, or implicitly defined if the " +"variable is only being read." +msgstr "" +"從外部作用域中定義且從\\ :term:`巢狀作用域 `\\ 參照的\\ :term:`" +"自由變數 `,不是於 runtime 從全域或內建命名空間解析。可以使" +"用 :keyword:`nonlocal` 關鍵字明確定義以允許寫入存取,或者如果僅需讀取變數則隱" +"式定義即可。" + +#: ../../glossary.rst:235 +msgid "" +"For example, in the ``inner`` function in the following code, both ``x`` and " +"``print`` are :term:`free variables `, but only ``x`` is a " +"*closure variable*::" +msgstr "" +"例如在下面程式碼中的 ``inner`` 函式中,``x`` 和 ``print`` 都是\\ :term:`自由" +"變數 `,但只有 ``x`` 是\\ *閉包變數*: ::" + +#: ../../glossary.rst:238 +msgid "" +"def outer():\n" +" x = 0\n" +" def inner():\n" +" nonlocal x\n" +" x += 1\n" +" print(x)\n" +" return inner" +msgstr "" +"def outer():\n" +" x = 0\n" +" def inner():\n" +" nonlocal x\n" +" x += 1\n" +" print(x)\n" +" return inner" + +#: ../../glossary.rst:246 +msgid "" +"Due to the :attr:`codeobject.co_freevars` attribute (which, despite its " +"name, only includes the names of closure variables rather than listing all " +"referenced free variables), the more general :term:`free variable` term is " +"sometimes used even when the intended meaning is to refer specifically to " +"closure variables." +msgstr "" +"由於 :attr:`codeobject.co_freevars` 屬性(儘管名稱如此,但它僅包含閉包變數的" +"名稱,而不是列出所有參照的自由變數),當預期含義是特指閉包變數時,有時候甚至" +"也會使用更通用的\\ :term:`自由變數 `\\ 一詞。" + +#: ../../glossary.rst:250 msgid "complex number" msgstr "complex number(複數)" -#: ../../glossary.rst:230 +#: ../../glossary.rst:252 msgid "" "An extension of the familiar real number system in which all numbers are " "expressed as a sum of a real part and an imaginary part. Imaginary numbers " @@ -557,11 +613,11 @@ msgstr "" "相當進階的數學功能。如果你沒有察覺到對它們的需求,那麼幾乎能確定你可以安全地" "忽略它們。" -#: ../../glossary.rst:240 +#: ../../glossary.rst:262 msgid "context manager" msgstr "context manager(情境管理器)" -#: ../../glossary.rst:242 +#: ../../glossary.rst:264 msgid "" "An object which controls the environment seen in a :keyword:`with` statement " "by defining :meth:`~object.__enter__` and :meth:`~object.__exit__` methods. " @@ -571,11 +627,11 @@ msgstr "" "`~object.__enter__` 和 :meth:`~object.__exit__` method 來控制的。請參閱 :pep:" "`343`。" -#: ../../glossary.rst:245 +#: ../../glossary.rst:267 msgid "context variable" msgstr "context variable(情境變數)" -#: ../../glossary.rst:247 +#: ../../glossary.rst:269 msgid "" "A variable which can have different values depending on its context. This is " "similar to Thread-Local Storage in which each execution thread may have a " @@ -590,11 +646,11 @@ msgstr "" "任務 (concurrent asynchronous task) 中,對於變數狀態的追蹤。請參閱 :mod:" "`contextvars`。" -#: ../../glossary.rst:254 +#: ../../glossary.rst:276 msgid "contiguous" msgstr "contiguous(連續的)" -#: ../../glossary.rst:258 +#: ../../glossary.rst:280 msgid "" "A buffer is considered contiguous exactly if it is either *C-contiguous* or " "*Fortran contiguous*. Zero-dimensional buffers are C and Fortran " @@ -611,11 +667,11 @@ msgstr "" "的順序訪問各個項目時,最後一個索引的變化最快。然而,在 Fortran contiguous 陣" "列中,第一個索引的變化最快。" -#: ../../glossary.rst:266 +#: ../../glossary.rst:288 msgid "coroutine" msgstr "coroutine(協程)" -#: ../../glossary.rst:268 +#: ../../glossary.rst:290 msgid "" "Coroutines are a more generalized form of subroutines. Subroutines are " "entered at one point and exited at another point. Coroutines can be " @@ -626,11 +682,11 @@ msgstr "" "在另一個時間點被退出。協程可以在許多不同的時間點被進入、退出和回復。它們能夠" "以 :keyword:`async def` 陳述式被實作。另請參閱 :pep:`492`。" -#: ../../glossary.rst:273 +#: ../../glossary.rst:295 msgid "coroutine function" msgstr "coroutine function(協程函式)" -#: ../../glossary.rst:275 +#: ../../glossary.rst:297 msgid "" "A function which returns a :term:`coroutine` object. A coroutine function " "may be defined with the :keyword:`async def` statement, and may contain :" @@ -641,11 +697,11 @@ msgstr "" "`async def` 陳述式被定義,並可能會包含 :keyword:`await`、:keyword:`async " "for` 和 :keyword:`async with` 關鍵字。這些關鍵字由 :pep:`492` 引入。" -#: ../../glossary.rst:280 +#: ../../glossary.rst:302 msgid "CPython" msgstr "CPython" -#: ../../glossary.rst:282 +#: ../../glossary.rst:304 msgid "" "The canonical implementation of the Python programming language, as " "distributed on `python.org `_. The term \"CPython\" " @@ -656,11 +712,11 @@ msgstr "" "`_ 上。「CPython」這個術語在必要時被使用,以區分此實" "作與其它語言的實作,例如 Jython 或 IronPython。" -#: ../../glossary.rst:286 +#: ../../glossary.rst:308 msgid "decorator" msgstr "decorator(裝飾器)" -#: ../../glossary.rst:288 +#: ../../glossary.rst:310 msgid "" "A function returning another function, usually applied as a function " "transformation using the ``@wrapper`` syntax. Common examples for " @@ -670,13 +726,13 @@ msgstr "" "式的變換 (function transformation)。裝飾器的常見範例是 :func:`classmethod` " "和 :func:`staticmethod`。" -#: ../../glossary.rst:292 +#: ../../glossary.rst:314 msgid "" "The decorator syntax is merely syntactic sugar, the following two function " "definitions are semantically equivalent::" msgstr "裝飾器語法只是語法糖。以下兩個函式定義在語義上是等效的: ::" -#: ../../glossary.rst:295 +#: ../../glossary.rst:317 msgid "" "def f(arg):\n" " ...\n" @@ -694,7 +750,7 @@ msgstr "" "def f(arg):\n" " ..." -#: ../../glossary.rst:303 +#: ../../glossary.rst:325 msgid "" "The same concept exists for classes, but is less commonly used there. See " "the documentation for :ref:`function definitions ` and :ref:`class " @@ -703,11 +759,11 @@ msgstr "" "Class 也存在相同的概念,但在那裡比較不常用。關於裝飾器的更多內容,請參閱\\ :" "ref:`函式定義 `\\ 和 :ref:`class 定義 `\\ 的說明文件。" -#: ../../glossary.rst:306 +#: ../../glossary.rst:328 msgid "descriptor" msgstr "descriptor(描述器)" -#: ../../glossary.rst:308 +#: ../../glossary.rst:330 msgid "" "Any object which defines the methods :meth:`~object.__get__`, :meth:`~object." "__set__`, or :meth:`~object.__delete__`. When a class attribute is a " @@ -727,7 +783,7 @@ msgstr "" "們是許多功能的基礎,這些功能包括函式、method、屬性 (property)、class method、" "靜態 method,以及對 super class(父類別)的參照。" -#: ../../glossary.rst:319 +#: ../../glossary.rst:341 msgid "" "For more information about descriptors' methods, see :ref:`descriptors` or " "the :ref:`Descriptor How To Guide `." @@ -735,11 +791,11 @@ msgstr "" "關於描述器 method 的更多資訊,請參閱\\ :ref:`descriptors`\\ 或\\ :ref:`描述器" "使用指南 `。" -#: ../../glossary.rst:321 +#: ../../glossary.rst:343 msgid "dictionary" msgstr "dictionary(字典)" -#: ../../glossary.rst:323 +#: ../../glossary.rst:345 msgid "" "An associative array, where arbitrary keys are mapped to values. The keys " "can be any object with :meth:`~object.__hash__` and :meth:`~object.__eq__` " @@ -749,11 +805,11 @@ msgstr "" "有 :meth:`~object.__hash__` 和 :meth:`~object.__eq__` method 的物件。在 Perl " "中被稱為雜湊 (hash)。" -#: ../../glossary.rst:327 +#: ../../glossary.rst:349 msgid "dictionary comprehension" msgstr "dictionary comprehension(字典綜合運算)" -#: ../../glossary.rst:329 +#: ../../glossary.rst:351 msgid "" "A compact way to process all or part of the elements in an iterable and " "return a dictionary with the results. ``results = {n: n ** 2 for n in " @@ -764,11 +820,11 @@ msgstr "" "字典回傳。``results = {n: n ** 2 for n in range(10)}`` 會產生一個字典,它包含" "了鍵 ``n`` 對映到值 ``n ** 2``。請參閱\\ :ref:`comprehensions`。" -#: ../../glossary.rst:333 +#: ../../glossary.rst:355 msgid "dictionary view" msgstr "dictionary view(字典檢視)" -#: ../../glossary.rst:335 +#: ../../glossary.rst:357 msgid "" "The objects returned from :meth:`dict.keys`, :meth:`dict.values`, and :meth:" "`dict.items` are called dictionary views. They provide a dynamic view on the " @@ -781,11 +837,11 @@ msgstr "" "反映這些變動。若要強制將字典檢視轉為完整的 list(串列),須使用 " "``list(dictview)``。請參閱\\ :ref:`dict-views`。" -#: ../../glossary.rst:341 +#: ../../glossary.rst:363 msgid "docstring" msgstr "docstring(說明字串)" -#: ../../glossary.rst:343 +#: ../../glossary.rst:365 msgid "" "A string literal which appears as the first expression in a class, function " "or module. While ignored when the suite is executed, it is recognized by " @@ -798,11 +854,11 @@ msgstr "" "`~definition.__doc__` 屬性中。由於說明字串可以透過內省 (introspection) 來瀏" "覽,因此它是物件的說明文件存放的標準位置。" -#: ../../glossary.rst:349 +#: ../../glossary.rst:371 msgid "duck-typing" msgstr "duck-typing(鴨子型別)" -#: ../../glossary.rst:351 +#: ../../glossary.rst:373 msgid "" "A programming style which does not look at an object's type to determine if " "it has the right interface; instead, the method or attribute is simply " @@ -823,11 +879,11 @@ msgstr "" "來補充。)然而,它通常會採用 :func:`hasattr` 測試,或是 :term:`EAFP` 程式設計" "風格。" -#: ../../glossary.rst:360 +#: ../../glossary.rst:382 msgid "EAFP" msgstr "EAFP" -#: ../../glossary.rst:362 +#: ../../glossary.rst:384 msgid "" "Easier to ask for forgiveness than permission. This common Python coding " "style assumes the existence of valid keys or attributes and catches " @@ -842,11 +898,11 @@ msgstr "" "keyword:`except` 陳述式。該技術與許多其他語言(例如 C)常見的 :term:`LBYL` 風" "格形成了對比。" -#: ../../glossary.rst:368 +#: ../../glossary.rst:390 msgid "expression" msgstr "expression(運算式)" -#: ../../glossary.rst:370 +#: ../../glossary.rst:392 msgid "" "A piece of syntax which can be evaluated to some value. In other words, an " "expression is an accumulation of expression elements like literals, names, " @@ -862,11 +918,11 @@ msgstr "" "(陳述式)不能被用作運算式,例如 :keyword:`while`。賦值 (assignment) 也是陳述" "式,而不是運算式。" -#: ../../glossary.rst:377 +#: ../../glossary.rst:399 msgid "extension module" msgstr "extension module(擴充模組)" -#: ../../glossary.rst:379 +#: ../../glossary.rst:401 msgid "" "A module written in C or C++, using Python's C API to interact with the core " "and with user code." @@ -874,11 +930,11 @@ msgstr "" "一個以 C 或 C++ 編寫的模組,它使用 Python 的 C API 來與核心及使用者程式碼進行" "互動。" -#: ../../glossary.rst:381 +#: ../../glossary.rst:403 msgid "f-string" msgstr "f-string(f 字串)" -#: ../../glossary.rst:383 +#: ../../glossary.rst:405 msgid "" "String literals prefixed with ``'f'`` or ``'F'`` are commonly called \"f-" "strings\" which is short for :ref:`formatted string literals `. " @@ -887,11 +943,11 @@ msgstr "" "以 ``'f'`` 或 ``'F'`` 為前綴的字串文本通常被稱為「f 字串」,它是\\ :ref:`格式" "化的字串文本 `\\ 的縮寫。另請參閱 :pep:`498`。" -#: ../../glossary.rst:386 +#: ../../glossary.rst:408 msgid "file object" msgstr "file object(檔案物件)" -#: ../../glossary.rst:388 +#: ../../glossary.rst:410 msgid "" "An object exposing a file-oriented API (with methods such as :meth:`!read` " "or :meth:`!write`) to an underlying resource. Depending on the way it was " @@ -906,7 +962,7 @@ msgstr "" "衝區、socket(插座)、管線 (pipe) 等)的存取。檔案物件也被稱為\\ :dfn:`類檔案" "物件 (file-like object)` 或\\ :dfn:`串流 (stream)`。" -#: ../../glossary.rst:396 +#: ../../glossary.rst:418 msgid "" "There are actually three categories of file objects: raw :term:`binary files " "`, buffered :term:`binary files ` and :term:`text " @@ -918,19 +974,19 @@ msgstr "" "term:`二進位檔案 `\\ 和\\ :term:`文字檔案 `。它們的介" "面在 :mod:`io` 模組中被定義。建立檔案物件的標準方法是使用 :func:`open` 函式。" -#: ../../glossary.rst:401 +#: ../../glossary.rst:423 msgid "file-like object" msgstr "file-like object(類檔案物件)" -#: ../../glossary.rst:403 +#: ../../glossary.rst:425 msgid "A synonym for :term:`file object`." msgstr ":term:`file object`\\ (檔案物件)的同義字。" -#: ../../glossary.rst:404 +#: ../../glossary.rst:426 msgid "filesystem encoding and error handler" msgstr "filesystem encoding and error handler(檔案系統編碼和錯誤處理函式)" -#: ../../glossary.rst:406 +#: ../../glossary.rst:428 msgid "" "Encoding and error handler used by Python to decode bytes from the operating " "system and encode Unicode to the operating system." @@ -938,7 +994,7 @@ msgstr "" "Python 所使用的一種編碼和錯誤處理函式,用來解碼來自作業系統的位元組,以及將 " "Unicode 編碼到作業系統。" -#: ../../glossary.rst:409 +#: ../../glossary.rst:431 msgid "" "The filesystem encoding must guarantee to successfully decode all bytes " "below 128. If the file system encoding fails to provide this guarantee, API " @@ -947,7 +1003,7 @@ msgstr "" "檔案系統編碼必須保證能成功解碼所有小於 128 的位元組。如果檔案系統編碼無法提供" "此保證,則 API 函式會引發 :exc:`UnicodeError`。" -#: ../../glossary.rst:413 +#: ../../glossary.rst:435 msgid "" "The :func:`sys.getfilesystemencoding` and :func:`sys." "getfilesystemencodeerrors` functions can be used to get the filesystem " @@ -956,7 +1012,7 @@ msgstr "" ":func:`sys.getfilesystemencoding` 和 :func:`sys.getfilesystemencodeerrors` 函" "式可用於取得檔案系統編碼和錯誤處理函式。" -#: ../../glossary.rst:417 +#: ../../glossary.rst:439 msgid "" "The :term:`filesystem encoding and error handler` are configured at Python " "startup by the :c:func:`PyConfig_Read` function: see :c:member:`~PyConfig." @@ -968,22 +1024,22 @@ msgstr "" "member:`~PyConfig.filesystem_encoding`,以及 :c:type:`PyConfig` 的成員 :c:" "member:`~PyConfig.filesystem_errors`。" -#: ../../glossary.rst:422 +#: ../../glossary.rst:444 msgid "See also the :term:`locale encoding`." msgstr "另請參閱 :term:`locale encoding`\\ (區域編碼)。" -#: ../../glossary.rst:423 +#: ../../glossary.rst:445 msgid "finder" msgstr "finder(尋檢器)" -#: ../../glossary.rst:425 +#: ../../glossary.rst:447 msgid "" "An object that tries to find the :term:`loader` for a module that is being " "imported." msgstr "" "一個物件,它會嘗試為正在被 import 的模組尋找 :term:`loader`\\ (載入器)。" -#: ../../glossary.rst:428 +#: ../../glossary.rst:450 msgid "" "There are two types of finder: :term:`meta path finders ` " "for use with :data:`sys.meta_path`, and :term:`path entry finders ` 會使用 :data:`sys.meta_path`,而\\ :term:`路徑項目尋檢器 (path " "entry finder) ` 會使用 :data:`sys.path_hooks`。" -#: ../../glossary.rst:432 -msgid "See :ref:`importsystem` and :mod:`importlib` for much more detail." -msgstr "請參閱 :ref:`importsystem` 和 :mod:`importlib` 以了解更多細節。" +#: ../../glossary.rst:454 +msgid "" +"See :ref:`finders-and-loaders` and :mod:`importlib` for much more detail." +msgstr "請參閱 :ref:`finders-and-loaders` 和 :mod:`importlib` 以了解更多細節。" -#: ../../glossary.rst:433 +#: ../../glossary.rst:455 msgid "floor division" msgstr "floor division(向下取整除法)" -#: ../../glossary.rst:435 +#: ../../glossary.rst:457 msgid "" "Mathematical division that rounds down to nearest integer. The floor " "division operator is ``//``. For example, the expression ``11 // 4`` " @@ -1014,11 +1071,11 @@ msgstr "" "``2.75`` 不同。請注意,``(-11) // 4`` 的結果是 ``-3``,因為是 ``-2.75`` 被\\ " "*向下*\\ 無條件捨去。請參閱 :pep:`238`。" -#: ../../glossary.rst:440 +#: ../../glossary.rst:462 msgid "free threading" msgstr "free threading(自由執行緒)" -#: ../../glossary.rst:442 +#: ../../glossary.rst:464 msgid "" "A threading model where multiple threads can run Python bytecode " "simultaneously within the same interpreter. This is in contrast to the :" @@ -1029,11 +1086,25 @@ msgstr "" "\\ :term:`全域直譯器鎖 `\\ 形成對比,後者一次只允許" "一個執行緒執行 Python 位元組碼。請參閱 :pep:`703`。" -#: ../../glossary.rst:446 +#: ../../glossary.rst:468 +msgid "free variable" +msgstr "free variable(自由變數)" + +#: ../../glossary.rst:470 +msgid "" +"Formally, as defined in the :ref:`language execution model `, a " +"free variable is any variable used in a namespace which is not a local " +"variable in that namespace. See :term:`closure variable` for an example. " +"Pragmatically, due to the name of the :attr:`codeobject.co_freevars` " +"attribute, the term is also sometimes used as a synonym for :term:`closure " +"variable`." +msgstr "" + +#: ../../glossary.rst:475 msgid "function" msgstr "function(函式)" -#: ../../glossary.rst:448 +#: ../../glossary.rst:477 msgid "" "A series of statements which returns some value to a caller. It can also be " "passed zero or more :term:`arguments ` which may be used in the " @@ -1045,15 +1116,15 @@ msgstr "" "`parameter`\\ (參數)、:term:`method`\\ (方法),以及\\ :ref:`function`\\ " "章節。" -#: ../../glossary.rst:452 +#: ../../glossary.rst:481 msgid "function annotation" msgstr "function annotation(函式註釋)" -#: ../../glossary.rst:454 +#: ../../glossary.rst:483 msgid "An :term:`annotation` of a function parameter or return value." msgstr "函式參數或回傳值的一個 :term:`annotation`\\ (註釋)。" -#: ../../glossary.rst:456 +#: ../../glossary.rst:485 msgid "" "Function annotations are usually used for :term:`type hints `: " "for example, this function is expected to take two :class:`int` arguments " @@ -1062,7 +1133,7 @@ msgstr "" "函式註釋通常被使用於\\ :term:`型別提示 `:例如,這個函式預期會得到" "兩個 :class:`int` 引數,並會有一個 :class:`int` 回傳值: ::" -#: ../../glossary.rst:461 +#: ../../glossary.rst:490 msgid "" "def sum_two_numbers(a: int, b: int) -> int:\n" " return a + b" @@ -1070,11 +1141,11 @@ msgstr "" "def sum_two_numbers(a: int, b: int) -> int:\n" " return a + b" -#: ../../glossary.rst:464 +#: ../../glossary.rst:493 msgid "Function annotation syntax is explained in section :ref:`function`." msgstr "函式註釋的語法在\\ :ref:`function`\\ 章節有詳細解釋。" -#: ../../glossary.rst:466 +#: ../../glossary.rst:495 msgid "" "See :term:`variable annotation` and :pep:`484`, which describe this " "functionality. Also see :ref:`annotations-howto` for best practices on " @@ -1083,11 +1154,11 @@ msgstr "" "請參閱 :term:`variable annotation` 和 :pep:`484`,皆有此功能的描述。關於註釋" "的最佳實踐方法,另請參閱 :ref:`annotations-howto`。" -#: ../../glossary.rst:470 +#: ../../glossary.rst:499 msgid "__future__" msgstr "__future__" -#: ../../glossary.rst:472 +#: ../../glossary.rst:501 msgid "" "A :ref:`future statement `, ``from __future__ import ``, " "directs the compiler to compile the current module using syntax or semantics " @@ -1103,7 +1174,7 @@ msgstr "" "import 此模組並對其變數求值,你可以看見一個新的功能是何時首次被新增到此語言" "中,以及它何時將會(或已經)成為預設的功能: ::" -#: ../../glossary.rst:480 +#: ../../glossary.rst:509 msgid "" ">>> import __future__\n" ">>> __future__.division\n" @@ -1113,11 +1184,11 @@ msgstr "" ">>> __future__.division\n" "_Feature((2, 2, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 8192)" -#: ../../glossary.rst:483 +#: ../../glossary.rst:512 msgid "garbage collection" msgstr "garbage collection(垃圾回收)" -#: ../../glossary.rst:485 +#: ../../glossary.rst:514 msgid "" "The process of freeing memory when it is not used anymore. Python performs " "garbage collection via reference counting and a cyclic garbage collector " @@ -1129,11 +1200,11 @@ msgstr "" "垃圾回收器 (cyclic garbage collector) 來完成。垃圾回收器可以使用 :mod:`gc` 模" "組對其進行控制。" -#: ../../glossary.rst:490 ../../glossary.rst:491 +#: ../../glossary.rst:519 ../../glossary.rst:520 msgid "generator" msgstr "generator(產生器)" -#: ../../glossary.rst:493 +#: ../../glossary.rst:522 msgid "" "A function which returns a :term:`generator iterator`. It looks like a " "normal function except that it contains :keyword:`yield` expressions for " @@ -1144,7 +1215,7 @@ msgstr "" "個正常的函式,但不同的是它包含了 :keyword:`yield` 運算式,能產生一系列的值," "這些值可用於 for 迴圈,或是以 :func:`next` 函式,每次檢索其中的一個值。" -#: ../../glossary.rst:498 +#: ../../glossary.rst:527 msgid "" "Usually refers to a generator function, but may refer to a *generator " "iterator* in some contexts. In cases where the intended meaning isn't " @@ -1153,15 +1224,15 @@ msgstr "" "這個術語通常用來表示一個產生器函式,但在某些情境中,也可能是表示\\ *產生器疊" "代器*。萬一想表達的意思不夠清楚,那就使用完整的術語,以避免歧義。" -#: ../../glossary.rst:501 +#: ../../glossary.rst:530 msgid "generator iterator" msgstr "generator iterator(產生器疊代器)" -#: ../../glossary.rst:503 +#: ../../glossary.rst:532 msgid "An object created by a :term:`generator` function." msgstr "一個由 :term:`generator`\\ (產生器)函式所建立的物件。" -#: ../../glossary.rst:505 +#: ../../glossary.rst:534 msgid "" "Each :keyword:`yield` temporarily suspends processing, remembering the " "location execution state (including local variables and pending try-" @@ -1172,11 +1243,11 @@ msgstr "" "中的 try 陳述式)。當\\ *產生器疊代器*\\ 回復時,它會從停止的地方繼續執行(與" "那些每次調用時都要重新開始的函式有所不同)。" -#: ../../glossary.rst:511 ../../glossary.rst:512 +#: ../../glossary.rst:540 ../../glossary.rst:541 msgid "generator expression" msgstr "generator expression(產生器運算式)" -#: ../../glossary.rst:514 +#: ../../glossary.rst:543 msgid "" "An :term:`expression` that returns an :term:`iterator`. It looks like a " "normal expression followed by a :keyword:`!for` clause defining a loop " @@ -1188,7 +1259,7 @@ msgstr "" "變數、範圍以及一個選擇性的 :keyword:`!if` 子句。該組合運算式會為外層函式產生" "多個值: ::" -#: ../../glossary.rst:519 +#: ../../glossary.rst:548 msgid "" ">>> sum(i*i for i in range(10)) # sum of squares 0, 1, 4, ... 81\n" "285" @@ -1196,11 +1267,11 @@ msgstr "" ">>> sum(i*i for i in range(10)) # 平方之和 0, 1, 4, ... 81\n" "285" -#: ../../glossary.rst:521 +#: ../../glossary.rst:550 msgid "generic function" msgstr "generic function(泛型函式)" -#: ../../glossary.rst:523 +#: ../../glossary.rst:552 msgid "" "A function composed of multiple functions implementing the same operation " "for different types. Which implementation should be used during a call is " @@ -1209,7 +1280,7 @@ msgstr "" "一個由多個函式組成的函式,該函式會對不同的型別實作相同的運算。呼叫期間應該使" "用哪種實作,是由調度演算法 (dispatch algorithm) 來決定。" -#: ../../glossary.rst:527 +#: ../../glossary.rst:556 msgid "" "See also the :term:`single dispatch` glossary entry, the :func:`functools." "singledispatch` decorator, and :pep:`443`." @@ -1217,11 +1288,11 @@ msgstr "" "另請參閱 :term:`single dispatch`\\ (單一調度)術語表條目、:func:`functools." "singledispatch` 裝飾器和 :pep:`443`。" -#: ../../glossary.rst:529 +#: ../../glossary.rst:558 msgid "generic type" msgstr "generic type(泛型型別)" -#: ../../glossary.rst:531 +#: ../../glossary.rst:560 msgid "" "A :term:`type` that can be parameterized; typically a :ref:`container " "class` such as :class:`list` or :class:`dict`. Used for :" @@ -1231,7 +1302,7 @@ msgstr "" "`容器型別 `,像是 :class:`list` 和 :class:`dict`。它被用於" "\\ :term:`型別提示 `\\ 和\\ :term:`註釋 `。" -#: ../../glossary.rst:536 +#: ../../glossary.rst:565 msgid "" "For more details, see :ref:`generic alias types`, :pep:" "`483`, :pep:`484`, :pep:`585`, and the :mod:`typing` module." @@ -1239,19 +1310,19 @@ msgstr "" "詳情請參閱\\ :ref:`泛型別名型別 `、:pep:`483`、:pep:" "`484`、:pep:`585` 和 :mod:`typing` 模組。" -#: ../../glossary.rst:538 +#: ../../glossary.rst:567 msgid "GIL" msgstr "GIL" -#: ../../glossary.rst:540 +#: ../../glossary.rst:569 msgid "See :term:`global interpreter lock`." msgstr "請參閱 :term:`global interpreter lock`\\ (全域直譯器鎖)。" -#: ../../glossary.rst:541 +#: ../../glossary.rst:570 msgid "global interpreter lock" msgstr "global interpreter lock(全域直譯器鎖)" -#: ../../glossary.rst:543 +#: ../../glossary.rst:572 msgid "" "The mechanism used by the :term:`CPython` interpreter to assure that only " "one thread executes Python :term:`bytecode` at a time. This simplifies the " @@ -1268,7 +1339,7 @@ msgstr "" "(multi-threaded),但代價是會犧牲掉多處理器的機器能夠提供的一大部分平行性 " "(parallelism)。" -#: ../../glossary.rst:552 +#: ../../glossary.rst:581 msgid "" "However, some extension modules, either standard or third-party, are " "designed so as to release the GIL when doing computationally intensive tasks " @@ -1279,26 +1350,26 @@ msgstr "" "計算密集 (computationally intensive) 的任務時,可以解除 GIL。另外,在執行 I/" "O 時,GIL 總是會被解除。" -#: ../../glossary.rst:557 +#: ../../glossary.rst:586 msgid "" "As of Python 3.13, the GIL can be disabled using the :option:`--disable-gil` " "build configuration. After building Python with this option, code must be " -"run with :option:`-X gil 0 <-X>` or after setting the :envvar:`PYTHON_GIL=0 " +"run with :option:`-X gil=0 <-X>` or after setting the :envvar:`PYTHON_GIL=0 " "` environment variable. This feature enables improved " "performance for multi-threaded applications and makes it easier to use multi-" "core CPUs efficiently. For more details, see :pep:`703`." msgstr "" "從 Python 3.13 開始可以使用 :option:`--disable-gil` 建置設定來停用 GIL。使用" -"此選項建立 Python 後,必須使用 :option:`-X gil 0 <-X>` 來執行程式碼,或者設" +"此選項建立 Python 後,必須使用 :option:`-X gil=0 <-X>` 來執行程式碼,或者設" "定 :envvar:`PYTHON_GIL=0 ` 環境變數後再執行程式碼。此功能可以提高" "多執行緒應用程式的效能,並使多核心 CPU 的高效使用變得更加容易。有關更多詳細資" "訊,請參閱 :pep:`703`。" -#: ../../glossary.rst:563 +#: ../../glossary.rst:592 msgid "hash-based pyc" msgstr "hash-based pyc(雜湊架構的 pyc)" -#: ../../glossary.rst:565 +#: ../../glossary.rst:594 msgid "" "A bytecode cache file that uses the hash rather than the last-modified time " "of the corresponding source file to determine its validity. See :ref:`pyc-" @@ -1307,11 +1378,11 @@ msgstr "" "一個位元組碼 (bytecode) 暫存檔,它使用雜湊值而不是對應原始檔案的最後修改時" "間,來確定其有效性。請參閱\\ :ref:`pyc-invalidation`。" -#: ../../glossary.rst:568 +#: ../../glossary.rst:597 msgid "hashable" msgstr "hashable(可雜湊的)" -#: ../../glossary.rst:570 +#: ../../glossary.rst:599 msgid "" "An object is *hashable* if it has a hash value which never changes during " "its lifetime (it needs a :meth:`~object.__hash__` method), and can be " @@ -1323,7 +1394,7 @@ msgstr "" "`~object.__eq__` method),那麼它就是一個\\ *可雜湊*\\ 物件。比較結果為相等的" "多個可雜湊物件,它們必須擁有相同的雜湊值。" -#: ../../glossary.rst:576 +#: ../../glossary.rst:605 msgid "" "Hashability makes an object usable as a dictionary key and a set member, " "because these data structures use the hash value internally." @@ -1331,7 +1402,7 @@ msgstr "" "可雜湊性 (hashability) 使一個物件可用作 dictionary(字典)的鍵和 set(集合)" "的成員,因為這些資料結構都在其內部使用了雜湊值。" -#: ../../glossary.rst:579 +#: ../../glossary.rst:608 msgid "" "Most of Python's immutable built-in objects are hashable; mutable containers " "(such as lists or dictionaries) are not; immutable containers (such as " @@ -1346,11 +1417,11 @@ msgstr "" "則這些物件會被預設為可雜湊的。它們在互相比較時都是不相等的(除非它們與自己比" "較),而它們的雜湊值則是衍生自它們的 :func:`id`。" -#: ../../glossary.rst:586 +#: ../../glossary.rst:615 msgid "IDLE" msgstr "IDLE" -#: ../../glossary.rst:588 +#: ../../glossary.rst:617 msgid "" "An Integrated Development and Learning Environment for Python. :ref:`idle` " "is a basic editor and interpreter environment which ships with the standard " @@ -1360,17 +1431,17 @@ msgstr "" "境)。:ref:`idle` 是一個基本的編輯器和直譯器環境,它和 Python 的標準發行版本" "一起被提供。" -#: ../../glossary.rst:591 +#: ../../glossary.rst:620 msgid "immortal" msgstr "immportal(不滅)" -#: ../../glossary.rst:593 +#: ../../glossary.rst:622 msgid "" "*Immortal objects* are a CPython implementation detail introduced in :pep:" "`683`." msgstr "*不滅物件 (Immortal objects)* 是 :pep:`683` 引入的 CPython 實作細節。" -#: ../../glossary.rst:596 +#: ../../glossary.rst:625 msgid "" "If an object is immortal, its :term:`reference count` is never modified, and " "therefore it is never deallocated while the interpreter is running. For " @@ -1380,11 +1451,11 @@ msgstr "" "修改,因此在直譯器運行時它永遠不會被釋放。例如,:const:`True` 和 :const:" "`None` 在 CPython 中是不滅的。" -#: ../../glossary.rst:599 +#: ../../glossary.rst:628 msgid "immutable" msgstr "immutable(不可變物件)" -#: ../../glossary.rst:601 +#: ../../glossary.rst:630 msgid "" "An object with a fixed value. Immutable objects include numbers, strings " "and tuples. Such an object cannot be altered. A new object has to be " @@ -1396,11 +1467,11 @@ msgstr "" "能被改變的。如果一個不同的值必須被儲存,則必須建立一個新的物件。它們在需要恆" "定雜湊值的地方,扮演重要的角色,例如 dictionary(字典)中的一個鍵。" -#: ../../glossary.rst:606 +#: ../../glossary.rst:635 msgid "import path" msgstr "import path(引入路徑)" -#: ../../glossary.rst:608 +#: ../../glossary.rst:637 msgid "" "A list of locations (or :term:`path entries `) that are searched " "by the :term:`path based finder` for modules to import. During import, this " @@ -1412,11 +1483,11 @@ msgstr "" "的位置。在 import 期間,此位置列表通常是來自 :data:`sys.path`,但對於子套件 " "(subpackage) 而言,它也可能是來自父套件的 ``__path__`` 屬性。" -#: ../../glossary.rst:613 +#: ../../glossary.rst:642 msgid "importing" msgstr "importing(引入)" -#: ../../glossary.rst:615 +#: ../../glossary.rst:644 msgid "" "The process by which Python code in one module is made available to Python " "code in another module." @@ -1424,11 +1495,11 @@ msgstr "" "一個過程。一個模組中的 Python 程式碼可以透過此過程,被另一個模組中的 Python " "程式碼使用。" -#: ../../glossary.rst:617 +#: ../../glossary.rst:646 msgid "importer" msgstr "importer(引入器)" -#: ../../glossary.rst:619 +#: ../../glossary.rst:648 msgid "" "An object that both finds and loads a module; both a :term:`finder` and :" "term:`loader` object." @@ -1436,11 +1507,11 @@ msgstr "" "一個能夠尋找及載入模組的物件;它既是 :term:`finder`\\ (尋檢器)也是 :term:" "`loader`\\ (載入器)物件。" -#: ../../glossary.rst:621 +#: ../../glossary.rst:650 msgid "interactive" msgstr "interactive(互動的)" -#: ../../glossary.rst:623 +#: ../../glossary.rst:652 msgid "" "Python has an interactive interpreter which means you can enter statements " "and expressions at the interpreter prompt, immediately execute them and see " @@ -1454,11 +1525,11 @@ msgstr "" "從你的電腦的主選單選擇它)。這是測試新想法或檢查模塊和包的非常強大的方法(請" "記住help(x))。更多互動式模式相關資訊請見 :ref:`tut-interac`。" -#: ../../glossary.rst:630 +#: ../../glossary.rst:659 msgid "interpreted" msgstr "interpreted(直譯的)" -#: ../../glossary.rst:632 +#: ../../glossary.rst:661 msgid "" "Python is an interpreted language, as opposed to a compiled one, though the " "distinction can be blurry because of the presence of the bytecode compiler. " @@ -1472,11 +1543,11 @@ msgstr "" "一個執行檔,然後再執行它。直譯語言通常比編譯語言有更短的開發/除錯週期,不過" "它們的程式通常也運行得較慢。另請參閱 :term:`interactive`\\ (互動的)。" -#: ../../glossary.rst:639 +#: ../../glossary.rst:668 msgid "interpreter shutdown" msgstr "interpreter shutdown(直譯器關閉)" -#: ../../glossary.rst:641 +#: ../../glossary.rst:670 msgid "" "When asked to shut down, the Python interpreter enters a special phase where " "it gradually releases all allocated resources, such as modules and various " @@ -1494,18 +1565,18 @@ msgstr "" "段被執行的程式碼會遇到各種例外,因為它所依賴的資源可能不再有作用了(常見的例" "子是函式庫模組或是警告機制)。" -#: ../../glossary.rst:650 +#: ../../glossary.rst:679 msgid "" "The main reason for interpreter shutdown is that the ``__main__`` module or " "the script being run has finished executing." msgstr "" "直譯器關閉的主要原因,是 ``__main__`` 模組或正被運行的腳本已經執行完成。" -#: ../../glossary.rst:652 +#: ../../glossary.rst:681 msgid "iterable" msgstr "iterable(可疊代物件)" -#: ../../glossary.rst:654 +#: ../../glossary.rst:683 msgid "" "An object capable of returning its members one at a time. Examples of " "iterables include all sequence types (such as :class:`list`, :class:`str`, " @@ -1521,7 +1592,7 @@ msgstr "" "`sequence`\\ (序列)語意的 :meth:`~object.__getitem__` method,該物件就是可" "疊代物件。" -#: ../../glossary.rst:662 +#: ../../glossary.rst:691 msgid "" "Iterables can be used in a :keyword:`for` loop and in many other places " "where a sequence is needed (:func:`zip`, :func:`map`, ...). When an " @@ -1541,11 +1612,11 @@ msgstr "" "數,用於在迴圈期間保有該疊代器。另請參閱 :term:`iterator`\\ (疊代器)、:" "term:`sequence`\\ (序列)和 :term:`generator`\\ (產生器)。" -#: ../../glossary.rst:672 +#: ../../glossary.rst:701 msgid "iterator" msgstr "iterator(疊代器)" -#: ../../glossary.rst:674 +#: ../../glossary.rst:703 msgid "" "An object representing a stream of data. Repeated calls to the iterator's :" "meth:`~iterator.__next__` method (or passing it to the built-in function :" @@ -1574,11 +1645,11 @@ msgstr "" "此事(多遍疊代)時,只會回傳在前一遍疊代中被用過的、同一個已被用盡的疊代器物" "件,使其看起來就像一個空的容器。" -#: ../../glossary.rst:689 +#: ../../glossary.rst:718 msgid "More information can be found in :ref:`typeiter`." msgstr "在\\ :ref:`typeiter`\\ 文中可以找到更多資訊。" -#: ../../glossary.rst:693 +#: ../../glossary.rst:722 msgid "" "CPython does not consistently apply the requirement that an iterator define :" "meth:`~iterator.__iter__`. And also please note that the free-threading " @@ -1588,11 +1659,11 @@ msgstr "" "__iter__`\\ 」這個規定。另請注意,free-threading(自由執行緒)CPython 不保證" "疊代器操作的執行緒安全。" -#: ../../glossary.rst:698 +#: ../../glossary.rst:727 msgid "key function" msgstr "key function(鍵函式)" -#: ../../glossary.rst:700 +#: ../../glossary.rst:729 msgid "" "A key function or collation function is a callable that returns a value used " "for sorting or ordering. For example, :func:`locale.strxfrm` is used to " @@ -1602,7 +1673,7 @@ msgstr "" "一個用於排序 (sorting) 或定序 (ordering) 的值。例如,:func:`locale.strxfrm` " "被用來產生一個了解區域特定排序慣例的排序鍵。" -#: ../../glossary.rst:705 +#: ../../glossary.rst:734 msgid "" "A number of tools in Python accept key functions to control how elements are " "ordered or grouped. They include :func:`min`, :func:`max`, :func:`sorted`, :" @@ -1614,7 +1685,7 @@ msgstr "" "merge`、:func:`heapq.nsmallest`、:func:`heapq.nlargest` 和 :func:`itertools." "groupby`。" -#: ../../glossary.rst:711 +#: ../../glossary.rst:740 msgid "" "There are several ways to create a key function. For example. the :meth:" "`str.lower` method can serve as a key function for case insensitive sorts. " @@ -1631,19 +1702,19 @@ msgstr "" "式 (constructor)。關於如何建立和使用鍵函式的範例,請參閱\\ :ref:`如何排序 " "`。" -#: ../../glossary.rst:718 +#: ../../glossary.rst:747 msgid "keyword argument" msgstr "keyword argument(關鍵字引數)" -#: ../../glossary.rst:720 ../../glossary.rst:1019 +#: ../../glossary.rst:749 ../../glossary.rst:1053 msgid "See :term:`argument`." msgstr "請參閱 :term:`argument`\\ (引數)。" -#: ../../glossary.rst:721 +#: ../../glossary.rst:750 msgid "lambda" msgstr "lambda" -#: ../../glossary.rst:723 +#: ../../glossary.rst:752 msgid "" "An anonymous inline function consisting of a single :term:`expression` which " "is evaluated when the function is called. The syntax to create a lambda " @@ -1653,11 +1724,11 @@ msgstr "" "function),於該函式被呼叫時求值。建立 lambda 函式的語法是 ``lambda " "[parameters]: expression``" -#: ../../glossary.rst:726 +#: ../../glossary.rst:755 msgid "LBYL" msgstr "LBYL" -#: ../../glossary.rst:728 +#: ../../glossary.rst:757 msgid "" "Look before you leap. This coding style explicitly tests for pre-conditions " "before making calls or lookups. This style contrasts with the :term:`EAFP` " @@ -1668,7 +1739,7 @@ msgstr "" "地測試先決條件。這種風格與 :term:`EAFP` 方式形成對比,且它的特色是會有許多 :" "keyword:`if` 陳述式的存在。" -#: ../../glossary.rst:733 +#: ../../glossary.rst:762 msgid "" "In a multi-threaded environment, the LBYL approach can risk introducing a " "race condition between \"the looking\" and \"the leaping\". For example, " @@ -1682,11 +1753,11 @@ msgstr "" "了 *key*,則該程式碼就會失效。這個問題可以用鎖 (lock) 或使用 EAFP 編碼方式來" "解決。" -#: ../../glossary.rst:738 +#: ../../glossary.rst:767 msgid "list" msgstr "list(串列)" -#: ../../glossary.rst:740 +#: ../../glossary.rst:769 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 " @@ -1696,11 +1767,11 @@ msgstr "" "似其他語言中的一個陣列 (array) 而較不像一個鏈結串列 (linked list),因為存取元" "素的時間複雜度是 *O*\\ (1)。" -#: ../../glossary.rst:743 +#: ../../glossary.rst:772 msgid "list comprehension" msgstr "list comprehension(串列綜合運算)" -#: ../../glossary.rst:745 +#: ../../glossary.rst:774 msgid "" "A compact way to process all or part of the elements in a sequence and " "return a list with the results. ``result = ['{:#04x}'.format(x) for x in " @@ -1714,27 +1785,35 @@ msgstr "" "keyword:`if` 子句是選擇性的。如果省略它,則 ``range(256)`` 中的所有元素都會被" "處理。" -#: ../../glossary.rst:751 +#: ../../glossary.rst:780 msgid "loader" msgstr "loader(載入器)" -#: ../../glossary.rst:753 +#: ../../glossary.rst:782 msgid "" "An object that loads a module. It must define a method named :meth:" -"`load_module`. A loader is typically returned by a :term:`finder`. See :pep:" -"`302` for details and :class:`importlib.abc.Loader` for an :term:`abstract " -"base class`." +"`load_module`. A loader is typically returned by a :term:`finder`. See also:" msgstr "" "一個能夠載入模組的物件。它必須定義一個名為 :meth:`load_module` 的 method(方" -"法)。載入器通常是被 :term:`finder`\\ (尋檢器)回傳。更多細節請參閱 :pep:" -"`302`,關於 :term:`abstract base class`\\ (抽象基底類別),請參閱 :class:" -"`importlib.abc.Loader`。" +"法)。載入器通常是被 :term:`finder`\\ (尋檢器)回傳。更多細節請參閱:" -#: ../../glossary.rst:757 +#: ../../glossary.rst:786 +msgid ":ref:`finders-and-loaders`" +msgstr ":ref:`finders-and-loaders`" + +#: ../../glossary.rst:787 +msgid ":class:`importlib.abc.Loader`" +msgstr ":class:`importlib.abc.Loader`" + +#: ../../glossary.rst:788 +msgid ":pep:`302`" +msgstr ":pep:`302`" + +#: ../../glossary.rst:789 msgid "locale encoding" msgstr "locale encoding(區域編碼)" -#: ../../glossary.rst:759 +#: ../../glossary.rst:791 msgid "" "On Unix, it is the encoding of the LC_CTYPE locale. It can be set with :func:" "`locale.setlocale(locale.LC_CTYPE, new_locale) `." @@ -1742,36 +1821,36 @@ msgstr "" "在 Unix 上,它是 LC_CTYPE 區域設定的編碼。它可以用 :func:`locale." "setlocale(locale.LC_CTYPE, new_locale) ` 來設定。" -#: ../../glossary.rst:762 +#: ../../glossary.rst:794 msgid "On Windows, it is the ANSI code page (ex: ``\"cp1252\"``)." msgstr "在 Windows 上,它是 ANSI 代碼頁(code page,例如 ``\"cp1252\"``\\ )。" -#: ../../glossary.rst:764 +#: ../../glossary.rst:796 msgid "" "On Android and VxWorks, Python uses ``\"utf-8\"`` as the locale encoding." msgstr "在 Android 和 VxWorks 上,Python 使用 ``\"utf-8\"`` 作為區域編碼。" -#: ../../glossary.rst:766 +#: ../../glossary.rst:798 msgid ":func:`locale.getencoding` can be used to get the locale encoding." msgstr ":func:`locale.getencoding` 可以用來取得區域編碼。" -#: ../../glossary.rst:768 +#: ../../glossary.rst:800 msgid "See also the :term:`filesystem encoding and error handler`." msgstr "也請參考 :term:`filesystem encoding and error handler`。" -#: ../../glossary.rst:769 +#: ../../glossary.rst:801 msgid "magic method" msgstr "magic method(魔術方法)" -#: ../../glossary.rst:773 +#: ../../glossary.rst:805 msgid "An informal synonym for :term:`special method`." msgstr ":term:`special method`\\ (特殊方法)的一個非正式同義詞。" -#: ../../glossary.rst:774 +#: ../../glossary.rst:806 msgid "mapping" msgstr "mapping(對映)" -#: ../../glossary.rst:776 +#: ../../glossary.rst:808 msgid "" "A container object that supports arbitrary key lookups and implements the " "methods specified in the :class:`collections.abc.Mapping` or :class:" @@ -1786,11 +1865,11 @@ msgstr "" "包括 :class:`dict`、:class:`collections.defaultdict`、:class:`collections." "OrderedDict` 和 :class:`collections.Counter`。" -#: ../../glossary.rst:782 +#: ../../glossary.rst:814 msgid "meta path finder" msgstr "meta path finder(元路徑尋檢器)" -#: ../../glossary.rst:784 +#: ../../glossary.rst:816 msgid "" "A :term:`finder` returned by a search of :data:`sys.meta_path`. Meta path " "finders are related to, but different from :term:`path entry finders ` " "相關但是不同。" -#: ../../glossary.rst:788 +#: ../../glossary.rst:820 msgid "" "See :class:`importlib.abc.MetaPathFinder` for the methods that meta path " "finders implement." msgstr "" "關於元路徑尋檢器實作的 method,請參閱 :class:`importlib.abc.MetaPathFinder`。" -#: ../../glossary.rst:790 +#: ../../glossary.rst:822 msgid "metaclass" msgstr "metaclass(元類別)" -#: ../../glossary.rst:792 +#: ../../glossary.rst:824 msgid "" "The class of a class. Class definitions create a class name, a class " "dictionary, and a list of base classes. The metaclass is responsible for " @@ -1831,15 +1910,15 @@ msgstr "" "性存取、增加執行緒安全性、追蹤物件建立、實作單例模式 (singleton),以及許多其" "他的任務。" -#: ../../glossary.rst:802 +#: ../../glossary.rst:834 msgid "More information can be found in :ref:`metaclasses`." msgstr "更多資訊可以在\\ :ref:`metaclasses`\\ 章節中找到。" -#: ../../glossary.rst:771 ../../glossary.rst:803 ../../glossary.rst:1168 +#: ../../glossary.rst:803 ../../glossary.rst:835 ../../glossary.rst:1198 msgid "method" msgstr "method(方法)" -#: ../../glossary.rst:805 +#: ../../glossary.rst:837 msgid "" "A function which is defined inside a class body. If called as an attribute " "of an instance of that class, the method will get the instance object as its " @@ -1851,11 +1930,11 @@ msgstr "" "通常被稱為 ``self``)。請參閱 :term:`function`\\ (函式)和 :term:`nested " "scope`\\ (巢狀作用域)。" -#: ../../glossary.rst:809 +#: ../../glossary.rst:841 msgid "method resolution order" msgstr "method resolution order(方法解析順序)" -#: ../../glossary.rst:811 +#: ../../glossary.rst:843 msgid "" "Method Resolution Order is the order in which base classes are searched for " "a member during lookup. See :ref:`python_2.3_mro` for details of the " @@ -1864,11 +1943,11 @@ msgstr "" "方法解析順序是在查找某個成員的過程中,base class(基底類別)被搜尋的順序。關" "於 Python 自 2.3 版直譯器所使用的演算法細節,請參閱 :ref:`python_2.3_mro`。" -#: ../../glossary.rst:814 +#: ../../glossary.rst:846 msgid "module" msgstr "module(模組)" -#: ../../glossary.rst:816 +#: ../../glossary.rst:848 msgid "" "An object that serves as an organizational unit of Python code. Modules " "have a namespace containing arbitrary Python objects. Modules are loaded " @@ -1878,15 +1957,15 @@ msgstr "" "空間,它包含任意的 Python 物件。模組是藉由 :term:`importing` 的過程,被載入" "至 Python。" -#: ../../glossary.rst:820 +#: ../../glossary.rst:852 msgid "See also :term:`package`." msgstr "另請參閱 :term:`package`\\ (套件)。" -#: ../../glossary.rst:821 +#: ../../glossary.rst:853 msgid "module spec" msgstr "module spec(模組規格)" -#: ../../glossary.rst:823 +#: ../../glossary.rst:855 msgid "" "A namespace containing the import-related information used to load a module. " "An instance of :class:`importlib.machinery.ModuleSpec`." @@ -1894,19 +1973,23 @@ msgstr "" "一個命名空間,它包含用於載入模組的 import 相關資訊。它是 :class:`importlib." "machinery.ModuleSpec` 的一個實例。" -#: ../../glossary.rst:825 +#: ../../glossary.rst:858 +msgid "See also :ref:`module-specs`." +msgstr "另請參閱 :ref:`module-specs`。" + +#: ../../glossary.rst:859 msgid "MRO" msgstr "MRO" -#: ../../glossary.rst:827 +#: ../../glossary.rst:861 msgid "See :term:`method resolution order`." msgstr "請參閱 :term:`method resolution order`\\ (方法解析順序)。" -#: ../../glossary.rst:828 +#: ../../glossary.rst:862 msgid "mutable" msgstr "mutable(可變物件)" -#: ../../glossary.rst:830 +#: ../../glossary.rst:864 msgid "" "Mutable objects can change their value but keep their :func:`id`. See also :" "term:`immutable`." @@ -1914,11 +1997,11 @@ msgstr "" "可變物件可以改變它們的值,但維持它們的 :func:`id`。另請參閱 :term:" "`immutable`\\ (不可變物件)。" -#: ../../glossary.rst:832 +#: ../../glossary.rst:866 msgid "named tuple" msgstr "named tuple(附名元組)" -#: ../../glossary.rst:834 +#: ../../glossary.rst:868 msgid "" "The term \"named tuple\" applies to any type or class that inherits from " "tuple and whose indexable elements are also accessible using named " @@ -1928,7 +2011,7 @@ msgstr "" "索引 (indexable) 元素也可以用附名屬性來存取。這些型別或 class 也可以具有其他" "的特性。" -#: ../../glossary.rst:838 +#: ../../glossary.rst:872 msgid "" "Several built-in types are named tuples, including the values returned by :" "func:`time.localtime` and :func:`os.stat`. Another example is :data:`sys." @@ -1937,7 +2020,7 @@ msgstr "" "有些內建型別是 named tuple,包括由 :func:`time.localtime` 和 :func:`os.stat` " "回傳的值。另一個例子是 :data:`sys.float_info`: ::" -#: ../../glossary.rst:842 +#: ../../glossary.rst:876 msgid "" ">>> sys.float_info[1] # indexed access\n" "1024\n" @@ -1947,7 +2030,7 @@ msgid "" "True" msgstr "" -#: ../../glossary.rst:849 +#: ../../glossary.rst:883 msgid "" "Some named tuples are built-in types (such as the above examples). " "Alternatively, a named tuple can be created from a regular class definition " @@ -1964,11 +2047,11 @@ msgstr "" "namedtuple` 來建立。後者技術也增加了一些額外的 method,這些 method 可能是在手" "寫或內建的 named tuple 中,無法找到的。" -#: ../../glossary.rst:857 +#: ../../glossary.rst:891 msgid "namespace" msgstr "namespace(命名空間)" -#: ../../glossary.rst:859 +#: ../../glossary.rst:893 msgid "" "The place where a variable is stored. Namespaces are implemented as " "dictionaries. There are the local, global and built-in namespaces as well " @@ -1988,11 +2071,11 @@ msgstr "" "func:`itertools.islice` 明確地表示,這些函式分別是由 :mod:`random` 和 :mod:" "`itertools` 模組在實作。" -#: ../../glossary.rst:869 +#: ../../glossary.rst:903 msgid "namespace package" msgstr "namespace package(命名空間套件)" -#: ../../glossary.rst:871 +#: ../../glossary.rst:905 msgid "" "A :pep:`420` :term:`package` which serves only as a container for " "subpackages. Namespace packages may have no physical representation, and " @@ -2003,15 +2086,15 @@ msgstr "" "一個容器。命名空間套件可能沒有實體的表示法,而且具體來說它們不像是一個 :term:" "`regular package`\\ (正規套件),因為它們並沒有 ``__init__.py`` 這個檔案。" -#: ../../glossary.rst:876 +#: ../../glossary.rst:910 msgid "See also :term:`module`." msgstr "另請參閱 :term:`module`\\ (模組)。" -#: ../../glossary.rst:877 +#: ../../glossary.rst:911 msgid "nested scope" msgstr "nested scope(巢狀作用域)" -#: ../../glossary.rst:879 +#: ../../glossary.rst:913 msgid "" "The ability to refer to a variable in an enclosing definition. For " "instance, a function defined inside another function can refer to variables " @@ -2026,11 +2109,11 @@ msgstr "" "寫入。同樣地,全域變數是在全域命名空間中讀取及寫入。:keyword:`nonlocal` 容許" "對外層作用域進行寫入。" -#: ../../glossary.rst:886 +#: ../../glossary.rst:920 msgid "new-style class" msgstr "new-style class(新式類別)" -#: ../../glossary.rst:888 +#: ../../glossary.rst:922 msgid "" "Old name for the flavor of classes now used for all class objects. In " "earlier Python versions, only new-style classes could use Python's newer, " @@ -2042,11 +2125,11 @@ msgstr "" "__slots__`、描述器 (descriptor)、屬性 (property)、:meth:`~object." "__getattribute__`、class method(類別方法)和 static method(靜態方法)。" -#: ../../glossary.rst:893 +#: ../../glossary.rst:927 msgid "object" msgstr "object(物件)" -#: ../../glossary.rst:895 +#: ../../glossary.rst:929 msgid "" "Any data with state (attributes or value) and defined behavior (methods). " "Also the ultimate base class of any :term:`new-style class`." @@ -2054,11 +2137,11 @@ msgstr "" "具有狀態(屬性或值)及被定義的行為(method)的任何資料。它也是任何 :term:" "`new-style class`\\ (新式類別)的最終 base class(基底類別)。" -#: ../../glossary.rst:898 +#: ../../glossary.rst:932 msgid "optimized scope" msgstr "optimized scope(最佳化作用域)" -#: ../../glossary.rst:900 +#: ../../glossary.rst:934 msgid "" "A scope where target local variable names are reliably known to the compiler " "when the code is compiled, allowing optimization of read and write access to " @@ -2069,11 +2152,11 @@ msgid "" "to optimized scopes." msgstr "" -#: ../../glossary.rst:907 +#: ../../glossary.rst:941 msgid "package" msgstr "package(套件)" -#: ../../glossary.rst:909 +#: ../../glossary.rst:943 msgid "" "A Python :term:`module` which can contain submodules or recursively, " "subpackages. Technically, a package is a Python module with a ``__path__`` " @@ -2083,17 +2166,17 @@ msgstr "" "迴的子套件 (subpackage)。技術上而言,套件就是具有 ``__path__`` 屬性的一個 " "Python 模組。" -#: ../../glossary.rst:913 +#: ../../glossary.rst:947 msgid "See also :term:`regular package` and :term:`namespace package`." msgstr "" "另請參閱 :term:`regular package`\\ (正規套件)和 :term:`namespace " "package`\\ (命名空間套件)。" -#: ../../glossary.rst:914 +#: ../../glossary.rst:948 msgid "parameter" msgstr "parameter(參數)" -#: ../../glossary.rst:916 +#: ../../glossary.rst:950 msgid "" "A named entity in a :term:`function` (or method) definition that specifies " "an :term:`argument` (or in some cases, arguments) that the function can " @@ -2103,7 +2186,7 @@ msgstr "" "它指明該函式能夠接受的一個 :term:`argument`\\ (引數),或在某些情況下指示多" "個引數。共有有五種不同的參數類型:" -#: ../../glossary.rst:920 +#: ../../glossary.rst:954 msgid "" ":dfn:`positional-or-keyword`: specifies an argument that can be passed " "either :term:`positionally ` or as a :term:`keyword argument " @@ -2114,11 +2197,11 @@ msgstr "" "置 `\\ 或是作為\\ :term:`關鍵字引數 `\\ 被傳遞的引數。這" "是參數的預設類型,例如以下的 *foo* 和 *bar*: ::" -#: ../../glossary.rst:925 +#: ../../glossary.rst:959 msgid "def func(foo, bar=None): ..." msgstr "def func(foo, bar=None): ..." -#: ../../glossary.rst:929 +#: ../../glossary.rst:963 msgid "" ":dfn:`positional-only`: specifies an argument that can be supplied only by " "position. Positional-only parameters can be defined by including a ``/`` " @@ -2129,11 +2212,11 @@ msgstr "" "式定義的參數列表中包含一個 ``/`` 字元,就可以在該字元前面定義僅限位置參數,例" "如以下的 *posonly1* 和 *posonly2*: ::" -#: ../../glossary.rst:934 +#: ../../glossary.rst:968 msgid "def func(posonly1, posonly2, /, positional_or_keyword): ..." msgstr "def func(posonly1, posonly2, /, positional_or_keyword): ..." -#: ../../glossary.rst:938 +#: ../../glossary.rst:972 msgid "" ":dfn:`keyword-only`: specifies an argument that can be supplied only by " "keyword. Keyword-only parameters can be defined by including a single var-" @@ -2146,11 +2229,11 @@ msgstr "" "單純的 ``*`` 字元,就可以在其後方定義僅限關鍵字參數,例如以下的 *kw_only1* " "和 *kw_only2*: ::" -#: ../../glossary.rst:944 +#: ../../glossary.rst:978 msgid "def func(arg, *, kw_only1, kw_only2): ..." msgstr "def func(arg, *, kw_only1, kw_only2): ..." -#: ../../glossary.rst:946 +#: ../../glossary.rst:980 msgid "" ":dfn:`var-positional`: specifies that an arbitrary sequence of positional " "arguments can be provided (in addition to any positional arguments already " @@ -2162,11 +2245,11 @@ msgstr "" "數(在已被其他參數接受的任何位置引數之外)。這類參數是透過在其參數名稱字首加" "上 ``*`` 來定義的,例如以下的 *args*: ::" -#: ../../glossary.rst:952 +#: ../../glossary.rst:986 msgid "def func(*args, **kwargs): ..." msgstr "def func(*args, **kwargs): ..." -#: ../../glossary.rst:954 +#: ../../glossary.rst:988 msgid "" ":dfn:`var-keyword`: specifies that arbitrarily many keyword arguments can be " "provided (in addition to any keyword arguments already accepted by other " @@ -2177,14 +2260,14 @@ msgstr "" "已被其他參數接受的任何關鍵字引數之外)。這類參數是透過在其參數名稱字首加上 " "``**`` 來定義的,例如上面範例中的 *kwargs*。" -#: ../../glossary.rst:960 +#: ../../glossary.rst:994 msgid "" "Parameters can specify both optional and required arguments, as well as " "default values for some optional arguments." msgstr "" "參數可以指明引數是選擇性的或必需的,也可以為一些選擇性的引數指定預設值。" -#: ../../glossary.rst:963 +#: ../../glossary.rst:997 msgid "" "See also the :term:`argument` glossary entry, the FAQ question on :ref:`the " "difference between arguments and parameters `, " @@ -2195,11 +2278,11 @@ msgstr "" "參數之間的差異 `、:class:`inspect.Parameter` " "class、:ref:`function`\\ 章節,以及 :pep:`362`。" -#: ../../glossary.rst:967 +#: ../../glossary.rst:1001 msgid "path entry" msgstr "path entry(路徑項目)" -#: ../../glossary.rst:969 +#: ../../glossary.rst:1003 msgid "" "A single location on the :term:`import path` which the :term:`path based " "finder` consults to find modules for importing." @@ -2207,11 +2290,11 @@ msgstr "" "在 :term:`import path`\\ (引入路徑)中的一個位置,而 :term:`path based " "finder` (基於路徑的尋檢器)會參考該位置來尋找要 import 的模組。" -#: ../../glossary.rst:971 +#: ../../glossary.rst:1005 msgid "path entry finder" msgstr "path entry finder(路徑項目尋檢器)" -#: ../../glossary.rst:973 +#: ../../glossary.rst:1007 msgid "" "A :term:`finder` returned by a callable on :data:`sys.path_hooks` (i.e. a :" "term:`path entry hook`) which knows how to locate modules given a :term:" @@ -2221,7 +2304,7 @@ msgstr "" "`path entry hook`\\ )所回傳的一種 :term:`finder`,它知道如何以一個 :term:" "`path entry`\\ 定位模組。" -#: ../../glossary.rst:977 +#: ../../glossary.rst:1011 msgid "" "See :class:`importlib.abc.PathEntryFinder` for the methods that path entry " "finders implement." @@ -2229,11 +2312,11 @@ msgstr "" "關於路徑項目尋檢器實作的 method,請參閱 :class:`importlib.abc." "PathEntryFinder`。" -#: ../../glossary.rst:979 +#: ../../glossary.rst:1013 msgid "path entry hook" msgstr "path entry hook(路徑項目鉤)" -#: ../../glossary.rst:981 +#: ../../glossary.rst:1015 msgid "" "A callable on the :data:`sys.path_hooks` list which returns a :term:`path " "entry finder` if it knows how to find modules on a specific :term:`path " @@ -2243,11 +2326,11 @@ msgstr "" "個特定的 :term:`path entry` 中尋找模組,則會回傳一個 :term:`path entry " "finder`\\ (路徑項目尋檢器)。" -#: ../../glossary.rst:984 +#: ../../glossary.rst:1018 msgid "path based finder" msgstr "path based finder(基於路徑的尋檢器)" -#: ../../glossary.rst:986 +#: ../../glossary.rst:1020 msgid "" "One of the default :term:`meta path finders ` which " "searches an :term:`import path` for modules." @@ -2255,11 +2338,11 @@ msgstr "" "預設的\\ :term:`元路徑尋檢器 (meta path finder) ` 之一,它" "會在一個 :term:`import path` 中搜尋模組。" -#: ../../glossary.rst:988 +#: ../../glossary.rst:1022 msgid "path-like object" msgstr "path-like object(類路徑物件)" -#: ../../glossary.rst:990 +#: ../../glossary.rst:1024 msgid "" "An object representing a file system path. A path-like object is either a :" "class:`str` or :class:`bytes` object representing a path, or an object " @@ -2277,11 +2360,11 @@ msgstr "" "`os.fsencode` 則分別可用於確保 :class:`str` 及 :class:`bytes` 的結果。由 :" "pep:`519` 引入。" -#: ../../glossary.rst:998 +#: ../../glossary.rst:1032 msgid "PEP" msgstr "PEP" -#: ../../glossary.rst:1000 +#: ../../glossary.rst:1034 msgid "" "Python Enhancement Proposal. A PEP is a design document providing " "information to the Python community, or describing a new feature for Python " @@ -2292,7 +2375,7 @@ msgstr "" "為 Python 社群提供資訊,或是描述 Python 的一個新功能或該功能的程序和環境。" "PEP 應該要提供簡潔的技術規範以及被提案功能的運作原理。" -#: ../../glossary.rst:1006 +#: ../../glossary.rst:1040 msgid "" "PEPs are intended to be the primary mechanisms for proposing major new " "features, for collecting community input on an issue, and for documenting " @@ -2304,15 +2387,15 @@ msgstr "" "已納入 Python 的設計決策的記錄,這些過程的主要機制。PEP 的作者要負責在社群內" "建立共識並記錄反對意見。" -#: ../../glossary.rst:1012 +#: ../../glossary.rst:1046 msgid "See :pep:`1`." msgstr "請參閱 :pep:`1`。" -#: ../../glossary.rst:1013 +#: ../../glossary.rst:1047 msgid "portion" msgstr "portion(部分)" -#: ../../glossary.rst:1015 +#: ../../glossary.rst:1049 msgid "" "A set of files in a single directory (possibly stored in a zip file) that " "contribute to a namespace package, as defined in :pep:`420`." @@ -2320,15 +2403,15 @@ msgstr "" "在單一目錄中的一組檔案(也可能儲存在一個 zip 檔中),這些檔案能對一個命名空間" "套件 (namespace package) 有所貢獻,如同 :pep:`420` 中的定義。" -#: ../../glossary.rst:1017 +#: ../../glossary.rst:1051 msgid "positional argument" msgstr "positional argument(位置引數)" -#: ../../glossary.rst:1020 +#: ../../glossary.rst:1054 msgid "provisional API" msgstr "provisional API(暫行 API)" -#: ../../glossary.rst:1022 +#: ../../glossary.rst:1056 msgid "" "A provisional API is one which has been deliberately excluded from the " "standard library's backwards compatibility guarantees. While major changes " @@ -2344,7 +2427,7 @@ msgstr "" "該介面)。這種變更並不會無端地產生——只有 API 被納入之前未察覺的嚴重基本缺陷被" "揭露時,它們才會發生。" -#: ../../glossary.rst:1031 +#: ../../glossary.rst:1065 msgid "" "Even for provisional APIs, backwards incompatible changes are seen as a " "\"solution of last resort\" - every attempt will still be made to find a " @@ -2353,7 +2436,7 @@ msgstr "" "即使對於暫行 API,向後不相容的變更也會被視為「最後的解決方案」——對於任何被發" "現的問題,仍然會盡可能找出一個向後相容的解決方案。" -#: ../../glossary.rst:1035 +#: ../../glossary.rst:1069 msgid "" "This process allows the standard library to continue to evolve over time, " "without locking in problematic design errors for extended periods of time. " @@ -2362,19 +2445,19 @@ msgstr "" "這個過程使得標準函式庫能隨著時間不斷進化,而避免耗費過長的時間去鎖定有問題的" "設計錯誤。請參閱 :pep:`411` 了解更多細節。" -#: ../../glossary.rst:1038 +#: ../../glossary.rst:1072 msgid "provisional package" msgstr "provisional package(暫行套件)" -#: ../../glossary.rst:1040 +#: ../../glossary.rst:1074 msgid "See :term:`provisional API`." msgstr "請參閱 :term:`provisional API`\\ (暫行 API)。" -#: ../../glossary.rst:1041 +#: ../../glossary.rst:1075 msgid "Python 3000" msgstr "Python 3000" -#: ../../glossary.rst:1043 +#: ../../glossary.rst:1077 msgid "" "Nickname for the Python 3.x release line (coined long ago when the release " "of version 3 was something in the distant future.) This is also abbreviated " @@ -2383,11 +2466,11 @@ msgstr "" "Python 3.x 系列版本的暱稱(很久以前創造的,當時第 3 版的發布是在遙遠的未" "來。)也可以縮寫為「Py3k」。" -#: ../../glossary.rst:1046 +#: ../../glossary.rst:1080 msgid "Pythonic" msgstr "Pythonic(Python 風格的)" -#: ../../glossary.rst:1048 +#: ../../glossary.rst:1082 msgid "" "An idea or piece of code which closely follows the most common idioms of the " "Python language, rather than implementing code using concepts common to " @@ -2401,7 +2484,7 @@ msgstr "" "keyword:`for` 陳述式,對一個可疊代物件的所有元素進行迴圈。許多其他語言並沒有" "這種類型的架構,所以不熟悉 Python 的人有時會使用一個數值計數器來代替: ::" -#: ../../glossary.rst:1055 +#: ../../glossary.rst:1089 msgid "" "for i in range(len(food)):\n" " print(food[i])" @@ -2409,11 +2492,11 @@ msgstr "" "for i in range(len(food)):\n" " print(food[i])" -#: ../../glossary.rst:1058 +#: ../../glossary.rst:1092 msgid "As opposed to the cleaner, Pythonic method::" msgstr "相較之下,以下方法更簡潔、更具有 Python 風格: ::" -#: ../../glossary.rst:1060 +#: ../../glossary.rst:1094 msgid "" "for piece in food:\n" " print(piece)" @@ -2421,11 +2504,11 @@ msgstr "" "for piece in food:\n" " print(piece)" -#: ../../glossary.rst:1062 +#: ../../glossary.rst:1096 msgid "qualified name" msgstr "qualified name(限定名稱)" -#: ../../glossary.rst:1064 +#: ../../glossary.rst:1098 msgid "" "A dotted name showing the \"path\" from a module's global scope to a class, " "function or method defined in that module, as defined in :pep:`3155`. For " @@ -2436,7 +2519,7 @@ msgstr "" "或 method 的「路徑」,如 :pep:`3155` 中的定義。對於頂層的函式和 class 而言," "限定名稱與其物件名稱相同: ::" -#: ../../glossary.rst:1069 +#: ../../glossary.rst:1103 msgid "" ">>> class C:\n" "... class D:\n" @@ -2462,7 +2545,7 @@ msgstr "" ">>> C.D.meth.__qualname__\n" "'C.D.meth'" -#: ../../glossary.rst:1081 +#: ../../glossary.rst:1115 msgid "" "When used to refer to modules, the *fully qualified name* means the entire " "dotted path to the module, including any parent packages, e.g. ``email.mime." @@ -2471,7 +2554,7 @@ msgstr "" "當用於引用模組時,*完全限定名稱 (fully qualified name)* 是表示該模組的完整點" "分隔路徑,包括任何的父套件,例如 ``email.mime.text``: ::" -#: ../../glossary.rst:1085 +#: ../../glossary.rst:1119 msgid "" ">>> import email.mime.text\n" ">>> email.mime.text.__name__\n" @@ -2481,11 +2564,11 @@ msgstr "" ">>> email.mime.text.__name__\n" "'email.mime.text'" -#: ../../glossary.rst:1088 +#: ../../glossary.rst:1122 msgid "reference count" msgstr "reference count(參照計數)" -#: ../../glossary.rst:1090 +#: ../../glossary.rst:1124 msgid "" "The number of references to an object. When the reference count of an " "object drops to zero, it is deallocated. Some objects are :term:`immortal` " @@ -2501,11 +2584,11 @@ msgstr "" "看不到,但它卻是 :term:`CPython` 實作的一個關鍵元素。程式設計師可以呼叫 :" "func:`~sys.getrefcount` 函式來回傳一個特定物件的參照計數。" -#: ../../glossary.rst:1098 +#: ../../glossary.rst:1132 msgid "regular package" msgstr "regular package(正規套件)" -#: ../../glossary.rst:1100 +#: ../../glossary.rst:1134 msgid "" "A traditional :term:`package`, such as a directory containing an ``__init__." "py`` file." @@ -2513,15 +2596,15 @@ msgstr "" "一個傳統的 :term:`package`\\ (套件),例如一個包含 ``__init__.py`` 檔案的目" "錄。" -#: ../../glossary.rst:1103 +#: ../../glossary.rst:1137 msgid "See also :term:`namespace package`." msgstr "另請參閱 :term:`namespace package`\\ (命名空間套件)。" -#: ../../glossary.rst:1104 +#: ../../glossary.rst:1138 msgid "REPL" msgstr "REPL" -#: ../../glossary.rst:1106 +#: ../../glossary.rst:1140 msgid "" "An acronym for the \"read–eval–print loop\", another name for the :term:" "`interactive` interpreter shell." @@ -2529,11 +2612,11 @@ msgstr "" "「read-eval-print 迴圈 (read–eval–print loop)」的縮寫,是\\ :term:`互動式 " "`\\ 直譯器 shell 的另一個名稱。" -#: ../../glossary.rst:1108 +#: ../../glossary.rst:1142 msgid "__slots__" msgstr "__slots__" -#: ../../glossary.rst:1110 +#: ../../glossary.rst:1144 msgid "" "A declaration inside a class that saves memory by pre-declaring space for " "instance attributes and eliminating instance dictionaries. Though popular, " @@ -2546,11 +2629,11 @@ msgstr "" "最好保留給那種在一個記憶體關鍵 (memory-critical) 的應用程式中存在大量實例的罕" "見情況。" -#: ../../glossary.rst:1115 +#: ../../glossary.rst:1149 msgid "sequence" msgstr "sequence(序列)" -#: ../../glossary.rst:1117 +#: ../../glossary.rst:1151 msgid "" "An :term:`iterable` which supports efficient element access using integer " "indices via the :meth:`~object.__getitem__` special method and defines a :" @@ -2569,7 +2652,7 @@ msgstr "" "為對映 (mapping) 而不是序列,因為其查找方式是使用任意的 :term:`hashable` 鍵," "而不是整數。" -#: ../../glossary.rst:1126 +#: ../../glossary.rst:1160 msgid "" "The :class:`collections.abc.Sequence` abstract base class defines a much " "richer interface that goes beyond just :meth:`~object.__getitem__` and :meth:" @@ -2586,11 +2669,11 @@ msgstr "" "用 :func:`~abc.ABCMeta.register` 被明確地註冊。更多關於序列方法的文件,請見" "\\ :ref:`常見序列操作 `。" -#: ../../glossary.rst:1135 +#: ../../glossary.rst:1169 msgid "set comprehension" msgstr "set comprehension(集合綜合運算)" -#: ../../glossary.rst:1137 +#: ../../glossary.rst:1171 msgid "" "A compact way to process all or part of the elements in an iterable and " "return a set with the results. ``results = {c for c in 'abracadabra' if c " @@ -2601,11 +2684,11 @@ msgstr "" "set 回傳。``results = {c for c in 'abracadabra' if c not in 'abc'}`` 會產生一" "個字串 set:``{'r', 'd'}``。請參閱\\ :ref:`comprehensions`。" -#: ../../glossary.rst:1141 +#: ../../glossary.rst:1175 msgid "single dispatch" msgstr "single dispatch(單一調度)" -#: ../../glossary.rst:1143 +#: ../../glossary.rst:1177 msgid "" "A form of :term:`generic function` dispatch where the implementation is " "chosen based on the type of a single argument." @@ -2613,11 +2696,11 @@ msgstr "" ":term:`generic function`\\ (泛型函式)調度的一種形式,在此,實作的選擇是基於" "單一引數的型別。" -#: ../../glossary.rst:1145 +#: ../../glossary.rst:1179 msgid "slice" msgstr "slice(切片)" -#: ../../glossary.rst:1147 +#: ../../glossary.rst:1181 msgid "" "An object usually containing a portion of a :term:`sequence`. A slice is " "created using the subscript notation, ``[]`` with colons between numbers " @@ -2629,34 +2712,26 @@ msgstr "" "之間使用冒號,例如 ``variable_name[1:3:5]``。在括號(下標)符號的內部,會使" "用 :class:`slice` 物件。" -#: ../../glossary.rst:1151 +#: ../../glossary.rst:1185 msgid "soft deprecated" msgstr "soft deprecated(軟性棄用)" -#: ../../glossary.rst:1153 +#: ../../glossary.rst:1187 msgid "" -"A soft deprecation can be used when using an API which should no longer be " -"used to write new code, but it remains safe to continue using it in existing " -"code. The API remains documented and tested, but will not be developed " -"further (no enhancement)." +"A soft deprecated API should not be used in new code, but it is safe for " +"already existing code to use it. The API remains documented and tested, but " +"will not be enhanced further." msgstr "" -"軟性棄用代表 API 不應再用來編寫新程式碼,但在現有程式碼中繼續使用它仍然是安全" -"的。API 仍會以文件記錄並會被測試,但不會進一步開發(不會繼續改進)。" +"被軟性棄用的 API 代表不應再用於新程式碼中,但在現有程式碼中繼續使用它仍會是安" +"全的。API 仍會以文件記錄並會被測試,但不會被繼續改進。" -#: ../../glossary.rst:1158 +#: ../../glossary.rst:1191 msgid "" -"The main difference between a \"soft\" and a (regular) \"hard\" deprecation " -"is that the soft deprecation does not imply scheduling the removal of the " -"deprecated API." -msgstr "" -"「軟性」棄用和(常規的)「硬性」棄用之間的主要區別在於,軟性棄用並不代表已經" -"確定要什麼時候刪除已棄用的 API。" - -#: ../../glossary.rst:1162 -msgid "Another difference is that a soft deprecation does not issue a warning." -msgstr "另一個區別是軟性棄用不會發出警告。" +"Soft deprecation, unlike normal deprecation, does not plan on removing the " +"API and will not emit warnings." +msgstr "與正常棄用不同,軟性棄用沒有刪除 API 的規劃,也不會發出警告。" -#: ../../glossary.rst:1164 +#: ../../glossary.rst:1194 msgid "" "See `PEP 387: Soft Deprecation `_." @@ -2664,11 +2739,11 @@ msgstr "" "請參閱 `PEP 387:軟性棄用 `_。" -#: ../../glossary.rst:1166 +#: ../../glossary.rst:1196 msgid "special method" msgstr "special method(特殊方法)" -#: ../../glossary.rst:1170 +#: ../../glossary.rst:1200 msgid "" "A method that is called implicitly by Python to execute a certain operation " "on a type, such as addition. Such methods have names starting and ending " @@ -2679,11 +2754,11 @@ msgstr "" "種 method 的名稱會在開頭和結尾有兩個下底線。Special method 在\\ :ref:" "`specialnames`\\ 中有詳細說明。" -#: ../../glossary.rst:1174 +#: ../../glossary.rst:1204 msgid "statement" msgstr "statement(陳述式)" -#: ../../glossary.rst:1176 +#: ../../glossary.rst:1206 msgid "" "A statement is part of a suite (a \"block\" of code). A statement is either " "an :term:`expression` or one of several constructs with a keyword, such as :" @@ -2693,11 +2768,11 @@ msgstr "" "term:`expression`\\ (運算式),或是含有關鍵字(例如 :keyword:`if`、:keyword:" "`while` 或 :keyword:`for`\\ )的多種結構之一。" -#: ../../glossary.rst:1179 +#: ../../glossary.rst:1209 msgid "static type checker" msgstr "static type checker(靜態型別檢查器)" -#: ../../glossary.rst:1181 +#: ../../glossary.rst:1211 msgid "" "An external tool that reads Python code and analyzes it, looking for issues " "such as incorrect types. See also :term:`type hints ` and the :" @@ -2707,11 +2782,11 @@ msgstr "" "另請參閱\\ :term:`型別提示 (type hints) ` 以及 :mod:`typing` 模" "組。" -#: ../../glossary.rst:1184 +#: ../../glossary.rst:1214 msgid "strong reference" msgstr "strong reference(強參照)" -#: ../../glossary.rst:1186 +#: ../../glossary.rst:1216 msgid "" "In Python's C API, a strong reference is a reference to an object which is " "owned by the code holding the reference. The strong reference is taken by " @@ -2722,7 +2797,7 @@ msgstr "" "有。建立參照時透過呼叫 :c:func:`Py_INCREF` 來獲得強參照、刪除參照時透過 :c:" "func:`Py_DECREF` 釋放強參照。" -#: ../../glossary.rst:1192 +#: ../../glossary.rst:1222 msgid "" "The :c:func:`Py_NewRef` function can be used to create a strong reference to " "an object. Usually, the :c:func:`Py_DECREF` function must be called on the " @@ -2732,15 +2807,15 @@ msgstr "" ":c:func:`Py_NewRef` 函式可用於建立一個對物件的強參照。通常,在退出強參照的作" "用域之前,必須在該強參照上呼叫 :c:func:`Py_DECREF` 函式,以避免洩漏一個參照。" -#: ../../glossary.rst:1197 +#: ../../glossary.rst:1227 msgid "See also :term:`borrowed reference`." msgstr "另請參閱 :term:`borrowed reference`\\ (借用參照)。" -#: ../../glossary.rst:1198 +#: ../../glossary.rst:1228 msgid "text encoding" msgstr "text encoding(文字編碼)" -#: ../../glossary.rst:1200 +#: ../../glossary.rst:1230 msgid "" "A string in Python is a sequence of Unicode code points (in range " "``U+0000``--``U+10FFFF``). To store or transfer a string, it needs to be " @@ -2749,7 +2824,7 @@ msgstr "" "Python 中的字串是一個 Unicode 碼點 (code point) 的序列(範圍在 ``U+0000`` -- " "``U+10FFFF`` 之間)。若要儲存或傳送一個字串,它必須被序列化為一個位元組序列。" -#: ../../glossary.rst:1204 +#: ../../glossary.rst:1234 msgid "" "Serializing a string into a sequence of bytes is known as \"encoding\", and " "recreating the string from the sequence of bytes is known as \"decoding\"." @@ -2757,7 +2832,7 @@ msgstr "" "將一個字串序列化為位元組序列,稱為「編碼」,而從位元組序列重新建立該字串則稱" "為「解碼 (decoding)」。" -#: ../../glossary.rst:1207 +#: ../../glossary.rst:1237 msgid "" "There are a variety of different text serialization :ref:`codecs `, which are collectively referred to as \"text encodings\"." @@ -2765,11 +2840,11 @@ msgstr "" "有多種不同的文字序列化編解碼器 (:ref:`codecs `),它們被統" "稱為「文字編碼」。" -#: ../../glossary.rst:1210 +#: ../../glossary.rst:1240 msgid "text file" msgstr "text file(文字檔案)" -#: ../../glossary.rst:1212 +#: ../../glossary.rst:1242 msgid "" "A :term:`file object` able to read and write :class:`str` objects. Often, a " "text file actually accesses a byte-oriented datastream and handles the :term:" @@ -2783,7 +2858,7 @@ msgstr "" "有:以文字模式(``'r'`` 或 ``'w'``)開啟的檔案、:data:`sys.stdin`、:data:" "`sys.stdout` 以及 :class:`io.StringIO` 的實例。" -#: ../../glossary.rst:1219 +#: ../../glossary.rst:1249 msgid "" "See also :term:`binary file` for a file object able to read and write :term:" "`bytes-like objects `." @@ -2791,11 +2866,11 @@ msgstr "" "另請參閱 :term:`binary file`\\ (二進位檔案),它是一個能夠讀取和寫入\\ :" "term:`類位元組串物件 (bytes-like object) ` 的檔案物件。" -#: ../../glossary.rst:1221 +#: ../../glossary.rst:1251 msgid "triple-quoted string" msgstr "triple-quoted string(三引號內字串)" -#: ../../glossary.rst:1223 +#: ../../glossary.rst:1253 msgid "" "A string which is bound by three instances of either a quotation mark (\") " "or an apostrophe ('). While they don't provide any functionality not " @@ -2810,11 +2885,11 @@ msgstr "" "中包含未跳脫 (unescaped) 的單引號和雙引號,而且它們不需使用連續字元 " "(continuation character) 就可以跨越多行,這使得它們在編寫說明字串時特別有用。" -#: ../../glossary.rst:1230 +#: ../../glossary.rst:1260 msgid "type" msgstr "type(型別)" -#: ../../glossary.rst:1232 +#: ../../glossary.rst:1262 msgid "" "The type of a Python object determines what kind of object it is; every " "object has a type. An object's type is accessible as its :attr:`~object." @@ -2824,22 +2899,22 @@ msgstr "" "件的型別可以用它的 :attr:`~object.__class__` 屬性來存取,或以 ``type(obj)`` " "來檢索。" -#: ../../glossary.rst:1236 +#: ../../glossary.rst:1266 msgid "type alias" msgstr "type alias(型別別名)" -#: ../../glossary.rst:1238 +#: ../../glossary.rst:1268 msgid "A synonym for a type, created by assigning the type to an identifier." msgstr "一個型別的同義詞,透過將型別指定給一個識別符 (identifier) 來建立。" -#: ../../glossary.rst:1240 +#: ../../glossary.rst:1270 msgid "" "Type aliases are useful for simplifying :term:`type hints `. For " "example::" msgstr "" "型別別名對於簡化\\ :term:`型別提示 (type hint) ` 很有用。例如: ::" -#: ../../glossary.rst:1243 +#: ../../glossary.rst:1273 msgid "" "def remove_gray_shades(\n" " colors: list[tuple[int, int, int]]) -> list[tuple[int, int, int]]:\n" @@ -2849,11 +2924,11 @@ msgstr "" " colors: list[tuple[int, int, int]]) -> list[tuple[int, int, int]]:\n" " pass" -#: ../../glossary.rst:1247 +#: ../../glossary.rst:1277 msgid "could be made more readable like this::" msgstr "可以寫成這樣,更具有可讀性: ::" -#: ../../glossary.rst:1249 +#: ../../glossary.rst:1279 msgid "" "Color = tuple[int, int, int]\n" "\n" @@ -2865,15 +2940,15 @@ msgstr "" "def remove_gray_shades(colors: list[Color]) -> list[Color]:\n" " pass" -#: ../../glossary.rst:1254 ../../glossary.rst:1268 +#: ../../glossary.rst:1284 ../../glossary.rst:1298 msgid "See :mod:`typing` and :pep:`484`, which describe this functionality." msgstr "請參閱 :mod:`typing` 和 :pep:`484`,有此功能的描述。" -#: ../../glossary.rst:1255 +#: ../../glossary.rst:1285 msgid "type hint" msgstr "type hint(型別提示)" -#: ../../glossary.rst:1257 +#: ../../glossary.rst:1287 msgid "" "An :term:`annotation` that specifies the expected type for a variable, a " "class attribute, or a function parameter or return value." @@ -2881,7 +2956,7 @@ msgstr "" "一種 :term:`annotation`\\ (註釋),它指定一個變數、一個 class 屬性或一個函式" "的參數或回傳值的預期型別。" -#: ../../glossary.rst:1260 +#: ../../glossary.rst:1290 msgid "" "Type hints are optional and are not enforced by Python but they are useful " "to :term:`static type checkers `. They can also aid " @@ -2891,7 +2966,7 @@ msgstr "" "(static type checkers) `\\ 很有用,並能協助 IDE 完成程式" "碼的補全 (completion) 和重構 (refactoring)。" -#: ../../glossary.rst:1264 +#: ../../glossary.rst:1294 msgid "" "Type hints of global variables, class attributes, and functions, but not " "local variables, can be accessed using :func:`typing.get_type_hints`." @@ -2899,11 +2974,11 @@ msgstr "" "全域變數、class 屬性和函式(不含區域變數)的型別提示,都可以使用 :func:" "`typing.get_type_hints` 來存取。" -#: ../../glossary.rst:1269 +#: ../../glossary.rst:1299 msgid "universal newlines" msgstr "universal newlines(通用換行字元)" -#: ../../glossary.rst:1271 +#: ../../glossary.rst:1301 msgid "" "A manner of interpreting text streams in which all of the following are " "recognized as ending a line: the Unix end-of-line convention ``'\\n'``, the " @@ -2916,20 +2991,20 @@ msgstr "" "``'\\r'``。請參閱 :pep:`278` 和 :pep:`3116`,以及用於 :func:`bytes." "splitlines` 的附加用途。" -#: ../../glossary.rst:1276 +#: ../../glossary.rst:1306 msgid "variable annotation" msgstr "variable annotation(變數註釋)" -#: ../../glossary.rst:1278 +#: ../../glossary.rst:1308 msgid "An :term:`annotation` of a variable or a class attribute." msgstr "一個變數或 class 屬性的 :term:`annotation`\\ (註釋)。" -#: ../../glossary.rst:1280 +#: ../../glossary.rst:1310 msgid "" "When annotating a variable or a class attribute, assignment is optional::" msgstr "註釋變數或 class 屬性時,賦值是選擇性的: ::" -#: ../../glossary.rst:1282 +#: ../../glossary.rst:1312 msgid "" "class C:\n" " field: 'annotation'" @@ -2937,7 +3012,7 @@ msgstr "" "class C:\n" " field: 'annotation'" -#: ../../glossary.rst:1285 +#: ../../glossary.rst:1315 msgid "" "Variable annotations are usually used for :term:`type hints `: " "for example this variable is expected to take :class:`int` values::" @@ -2945,15 +3020,15 @@ msgstr "" "變數註釋通常用於\\ :term:`型別提示 (type hint) `:例如,這個變數預" "期會取得 :class:`int`\\ (整數)值: ::" -#: ../../glossary.rst:1289 +#: ../../glossary.rst:1319 msgid "count: int = 0" msgstr "count: int = 0" -#: ../../glossary.rst:1291 +#: ../../glossary.rst:1321 msgid "Variable annotation syntax is explained in section :ref:`annassign`." msgstr "變數註釋的語法在\\ :ref:`annassign`\\ 章節有詳細的解釋。" -#: ../../glossary.rst:1293 +#: ../../glossary.rst:1323 msgid "" "See :term:`function annotation`, :pep:`484` and :pep:`526`, which describe " "this functionality. Also see :ref:`annotations-howto` for best practices on " @@ -2962,11 +3037,11 @@ msgstr "" "請參閱 :term:`function annotation`\\ (函式註釋)、:pep:`484` 和 :pep:`526`," "皆有此功能的描述。關於註釋的最佳實踐方法,另請參閱 :ref:`annotations-howto`。" -#: ../../glossary.rst:1297 +#: ../../glossary.rst:1327 msgid "virtual environment" msgstr "virtual environment(虛擬環境)" -#: ../../glossary.rst:1299 +#: ../../glossary.rst:1329 msgid "" "A cooperatively isolated runtime environment that allows Python users and " "applications to install and upgrade Python distribution packages without " @@ -2977,15 +3052,15 @@ msgstr "" "程式得以安裝和升級 Python 發佈套件,而不會對同一個系統上運行的其他 Python 應" "用程式的行為產生干擾。" -#: ../../glossary.rst:1304 +#: ../../glossary.rst:1334 msgid "See also :mod:`venv`." msgstr "另請參閱 :mod:`venv`。" -#: ../../glossary.rst:1305 +#: ../../glossary.rst:1335 msgid "virtual machine" msgstr "virtual machine(虛擬機器)" -#: ../../glossary.rst:1307 +#: ../../glossary.rst:1337 msgid "" "A computer defined entirely in software. Python's virtual machine executes " "the :term:`bytecode` emitted by the bytecode compiler." @@ -2993,11 +3068,11 @@ msgstr "" "一部完全由軟體所定義的電腦 (computer)。Python 的虛擬機器會執行由 :term:" "`bytecode`\\ (位元組碼)編譯器所發出的位元組碼。" -#: ../../glossary.rst:1309 +#: ../../glossary.rst:1339 msgid "Zen of Python" msgstr "Zen of Python(Python 之禪)" -#: ../../glossary.rst:1311 +#: ../../glossary.rst:1341 msgid "" "Listing of Python design principles and philosophies that are helpful in " "understanding and using the language. The listing can be found by typing " @@ -3006,22 +3081,34 @@ msgstr "" "Python 設計原則與哲學的列表,其內容有助於理解和使用此語言。此列表可以透過在互" "動式提式字元後輸入「``import this``」來找到它。" -#: ../../glossary.rst:256 +#: ../../glossary.rst:278 msgid "C-contiguous" msgstr "C-contiguous(C 連續的)" -#: ../../glossary.rst:256 +#: ../../glossary.rst:278 msgid "Fortran contiguous" msgstr "Fortran contiguous(Fortran 連續的)" -#: ../../glossary.rst:771 +#: ../../glossary.rst:803 msgid "magic" msgstr "magic" -#: ../../glossary.rst:1168 +#: ../../glossary.rst:1198 msgid "special" msgstr "special" +#~ msgid "" +#~ "The main difference between a \"soft\" and a (regular) \"hard\" " +#~ "deprecation is that the soft deprecation does not imply scheduling the " +#~ "removal of the deprecated API." +#~ msgstr "" +#~ "「軟性」棄用和(常規的)「硬性」棄用之間的主要區別在於,軟性棄用並不代表已" +#~ "經確定要什麼時候刪除已棄用的 API。" + +#~ msgid "" +#~ "Another difference is that a soft deprecation does not issue a warning." +#~ msgstr "另一個區別是軟性棄用不會發出警告。" + #~ msgid "2to3" #~ msgstr "2to3" diff --git a/howto/argparse-optparse.po b/howto/argparse-optparse.po new file mode 100644 index 0000000000..d54b85eb9c --- /dev/null +++ b/howto/argparse-optparse.po @@ -0,0 +1,119 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2024, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-10-09 00:13+0000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../../howto/argparse-optparse.rst:7 +msgid "Upgrading optparse code" +msgstr "" + +#: ../../howto/argparse-optparse.rst:9 +msgid "" +"Originally, the :mod:`argparse` module had attempted to maintain " +"compatibility with :mod:`optparse`. However, :mod:`optparse` was difficult " +"to extend transparently, particularly with the changes required to support " +"``nargs=`` specifiers and better usage messages. When most everything in :" +"mod:`optparse` had either been copy-pasted over or monkey-patched, it no " +"longer seemed practical to try to maintain the backwards compatibility." +msgstr "" + +#: ../../howto/argparse-optparse.rst:16 +msgid "" +"The :mod:`argparse` module improves on the :mod:`optparse` module in a " +"number of ways including:" +msgstr "" + +#: ../../howto/argparse-optparse.rst:19 +msgid "Handling positional arguments." +msgstr "" + +#: ../../howto/argparse-optparse.rst:20 +msgid "Supporting subcommands." +msgstr "" + +#: ../../howto/argparse-optparse.rst:21 +msgid "Allowing alternative option prefixes like ``+`` and ``/``." +msgstr "" + +#: ../../howto/argparse-optparse.rst:22 +msgid "Handling zero-or-more and one-or-more style arguments." +msgstr "" + +#: ../../howto/argparse-optparse.rst:23 +msgid "Producing more informative usage messages." +msgstr "" + +#: ../../howto/argparse-optparse.rst:24 +msgid "Providing a much simpler interface for custom ``type`` and ``action``." +msgstr "" + +#: ../../howto/argparse-optparse.rst:26 +msgid "A partial upgrade path from :mod:`optparse` to :mod:`argparse`:" +msgstr "" + +#: ../../howto/argparse-optparse.rst:28 +msgid "" +"Replace all :meth:`optparse.OptionParser.add_option` calls with :meth:" +"`ArgumentParser.add_argument` calls." +msgstr "" + +#: ../../howto/argparse-optparse.rst:31 +msgid "" +"Replace ``(options, args) = parser.parse_args()`` with ``args = parser." +"parse_args()`` and add additional :meth:`ArgumentParser.add_argument` calls " +"for the positional arguments. Keep in mind that what was previously called " +"``options``, now in the :mod:`argparse` context is called ``args``." +msgstr "" + +#: ../../howto/argparse-optparse.rst:36 +msgid "" +"Replace :meth:`optparse.OptionParser.disable_interspersed_args` by using :" +"meth:`~ArgumentParser.parse_intermixed_args` instead of :meth:" +"`~ArgumentParser.parse_args`." +msgstr "" + +#: ../../howto/argparse-optparse.rst:40 +msgid "" +"Replace callback actions and the ``callback_*`` keyword arguments with " +"``type`` or ``action`` arguments." +msgstr "" + +#: ../../howto/argparse-optparse.rst:43 +msgid "" +"Replace string names for ``type`` keyword arguments with the corresponding " +"type objects (e.g. int, float, complex, etc)." +msgstr "" + +#: ../../howto/argparse-optparse.rst:46 +msgid "" +"Replace :class:`optparse.Values` with :class:`Namespace` and :exc:`optparse." +"OptionError` and :exc:`optparse.OptionValueError` with :exc:`ArgumentError`." +msgstr "" + +#: ../../howto/argparse-optparse.rst:50 +msgid "" +"Replace strings with implicit arguments such as ``%default`` or ``%prog`` " +"with the standard Python syntax to use dictionaries to format strings, that " +"is, ``%(default)s`` and ``%(prog)s``." +msgstr "" + +#: ../../howto/argparse-optparse.rst:54 +msgid "" +"Replace the OptionParser constructor ``version`` argument with a call to " +"``parser.add_argument('--version', action='version', version='')``." +msgstr "" diff --git a/howto/argparse.po b/howto/argparse.po index aeb863ddff..c71d110388 100644 --- a/howto/argparse.po +++ b/howto/argparse.po @@ -12,7 +12,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-18 00:14+0000\n" "PO-Revision-Date: 2023-12-11 17:33+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1222,6 +1222,7 @@ msgstr "" " print(answer)" #: ../../howto/argparse.rst:618 ../../howto/argparse.rst:656 +#: ../../howto/argparse.rst:872 msgid "Output:" msgstr "結果:" @@ -1633,10 +1634,95 @@ msgid "" msgstr "若要在 :mod:`argparse` 輸出中翻譯你自己的字串,請使用 :mod:`gettext`。" #: ../../howto/argparse.rst:845 +msgid "Custom type converters" +msgstr "" + +#: ../../howto/argparse.rst:847 +msgid "" +"The :mod:`argparse` module allows you to specify custom type converters for " +"your command-line arguments. This allows you to modify user input before " +"it's stored in the :class:`argparse.Namespace`. This can be useful when you " +"need to pre-process the input before it is used in your program." +msgstr "" + +#: ../../howto/argparse.rst:852 +msgid "" +"When using a custom type converter, you can use any callable that takes a " +"single string argument (the argument value) and returns the converted value. " +"However, if you need to handle more complex scenarios, you can use a custom " +"action class with the **action** parameter instead." +msgstr "" + +#: ../../howto/argparse.rst:857 +msgid "" +"For example, let's say you want to handle arguments with different prefixes " +"and process them accordingly::" +msgstr "" + +#: ../../howto/argparse.rst:860 +msgid "" +"import argparse\n" +"\n" +"parser = argparse.ArgumentParser(prefix_chars='-+')\n" +"\n" +"parser.add_argument('-a', metavar='', action='append',\n" +" type=lambda x: ('-', x))\n" +"parser.add_argument('+a', metavar='', action='append',\n" +" type=lambda x: ('+', x))\n" +"\n" +"args = parser.parse_args()\n" +"print(args)" +msgstr "" +"import argparse\n" +"\n" +"parser = argparse.ArgumentParser(prefix_chars='-+')\n" +"\n" +"parser.add_argument('-a', metavar='', action='append',\n" +" type=lambda x: ('-', x))\n" +"parser.add_argument('+a', metavar='', action='append',\n" +" type=lambda x: ('+', x))\n" +"\n" +"args = parser.parse_args()\n" +"print(args)" + +#: ../../howto/argparse.rst:874 +msgid "" +"$ python prog.py -a value1 +a value2\n" +"Namespace(a=[('-', 'value1'), ('+', 'value2')])" +msgstr "" +"$ python prog.py -a value1 +a value2\n" +"Namespace(a=[('-', 'value1'), ('+', 'value2')])" + +#: ../../howto/argparse.rst:879 +msgid "In this example, we:" +msgstr "在這個範例當中,我們:" + +#: ../../howto/argparse.rst:881 +msgid "" +"Created a parser with custom prefix characters using the ``prefix_chars`` " +"parameter." +msgstr "" + +#: ../../howto/argparse.rst:884 +msgid "" +"Defined two arguments, ``-a`` and ``+a``, which used the ``type`` parameter " +"to create custom type converters to store the value in a tuple with the " +"prefix." +msgstr "" + +#: ../../howto/argparse.rst:887 +msgid "" +"Without the custom type converters, the arguments would have treated the ``-" +"a`` and ``+a`` as the same argument, which would have been undesirable. By " +"using custom type converters, we were able to differentiate between the two " +"arguments." +msgstr "" + +#: ../../howto/argparse.rst:892 msgid "Conclusion" msgstr "結論" -#: ../../howto/argparse.rst:847 +#: ../../howto/argparse.rst:894 msgid "" "The :mod:`argparse` module offers a lot more than shown here. Its docs are " "quite detailed and thorough, and full of examples. Having gone through this " diff --git a/includes/wasm-notavail.po b/includes/wasm-notavail.po deleted file mode 100644 index 0dad50cab5..0000000000 --- a/includes/wasm-notavail.po +++ /dev/null @@ -1,29 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation -# This file is distributed under the same license as the Python package. -# FIRST AUTHOR , YEAR. -# -msgid "" -msgstr "" -"Project-Id-Version: Python 3.13\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:17+0000\n" -"PO-Revision-Date: 2022-10-16 07:40+0800\n" -"Last-Translator: \n" -"Language-Team: \n" -"Language: zh_TW\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 3.1.1\n" - -#: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not Emscripten, not WASI." -msgstr "" - -#: ../../includes/wasm-notavail.rst:5 -msgid "" -"This module does not work or is not available on WebAssembly platforms " -"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " -"more information." -msgstr "" diff --git a/library/_thread.po b/library/_thread.po index c36a47a237..91130e2cc2 100644 --- a/library/_thread.po +++ b/library/_thread.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.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-12 00:13+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -172,18 +171,13 @@ msgstr "" "的值可用於在整個系統中唯一標識此特定執行緒(直到執行緒終止後,該值可能被操作" "系統重新使用)。" -#: ../../library/_thread.rst:123 -#, fuzzy -msgid "" -":ref:`Availability `: Windows, FreeBSD, Linux, macOS, OpenBSD, " -"NetBSD, AIX, DragonFlyBSD, GNU/kFreeBSD." +#: ../../library/_thread.rst:123 ../../library/_thread.rst:148 +msgid "Availability" msgstr "" -":ref:`適用 `:Windows、FreeBSD、Linux、macOS、OpenBSD、NetBSD、" -"AIX、DragonFlyBSD。" #: ../../library/_thread.rst:127 msgid "Added support for GNU/kFreeBSD." -msgstr "" +msgstr "新增了對 GNU/kFreeBSD 的支援。" #: ../../library/_thread.rst:133 msgid "" @@ -213,10 +207,6 @@ msgstr "" "分配。應參考平台文檔以獲取更多訊息(4 KiB 頁面是比較普遍的;在缺乏更具體訊息" "的情況下,建議使用 4096 的倍數作為堆疊大小)。" -#: ../../library/_thread.rst:148 -msgid ":ref:`Availability `: Windows, pthreads." -msgstr ":ref:`適用 `:Windows、pthreads。" - #: ../../library/_thread.rst:150 msgid "Unix platforms with POSIX threads support." msgstr "Unix 平台上支援 POSIX 執行緒。" @@ -307,6 +297,12 @@ msgid "" "with a_lock:\n" " print(\"a_lock is locked while this executes\")" msgstr "" +"import _thread\n" +"\n" +"a_lock = _thread.allocate_lock()\n" +"\n" +"with a_lock:\n" +" print(\"a_lock 在執行這裡時被鎖定\")" #: ../../library/_thread.rst:212 msgid "**Caveats:**" @@ -314,15 +310,11 @@ msgstr "**注意事項:**" #: ../../library/_thread.rst:216 msgid "" -"Threads interact strangely with interrupts: the :exc:`KeyboardInterrupt` " -"exception will be received by an arbitrary thread. (When the :mod:`signal` " -"module is available, interrupts always go to the main thread.)" -msgstr "" -"執行緒與中斷的互動可能會有奇怪的情況:任何一個執行緒都有可能收到 :exc:" -"`KeyboardInterrupt` 例外。(當 :mod:`signal` 模組可用時,中斷總是會進入主執行" -"緒。)" +"Interrupts always go to the main thread (the :exc:`KeyboardInterrupt` " +"exception will be received by that thread.)" +msgstr "中斷總會跳到主執行緒(該執行緒將接收 :exc:`KeyboardInterrupt` 例外。)" -#: ../../library/_thread.rst:220 +#: ../../library/_thread.rst:219 msgid "" "Calling :func:`sys.exit` or raising the :exc:`SystemExit` exception is " "equivalent to calling :func:`_thread.exit`." @@ -330,16 +322,19 @@ msgstr "" "呼叫 :func:`sys.exit` 函數或引發 :exc:`SystemExit` 例外等同於呼叫 :func:" "`_thread.exit` 函式。" -#: ../../library/_thread.rst:223 +#: ../../library/_thread.rst:222 msgid "" -"It is not possible to interrupt the :meth:`~threading.Lock.acquire` method " -"on a lock --- the :exc:`KeyboardInterrupt` exception will happen after the " -"lock has been acquired." +"It is platform-dependent whether the :meth:`~threading.Lock.acquire` method " +"on a lock can be interrupted (so that the :exc:`KeyboardInterrupt` exception " +"will happen immediately, rather than only after the lock has been acquired " +"or the operation has timed out). It can be interrupted on POSIX, but not on " +"Windows." msgstr "" -"無法在鎖的 :meth:`~threading.Lock.acquire` 方法上中斷執行, :exc:" -"`KeyboardInterrupt` 例外會在鎖被獲取後發生。" +"鎖的 :meth:`~threading.Lock.acquire` 方法是否可以中斷(如此一來 :exc:" +"`KeyboardInterrupt` 例外會立即發生,而不是僅在取得鎖或操作逾時後)是取決於平" +"台的。在 POSIX 上可以中斷,但在 Windows 上則不行。" -#: ../../library/_thread.rst:227 +#: ../../library/_thread.rst:228 msgid "" "When the main thread exits, it is system defined whether the other threads " "survive. On most systems, they are killed without executing :keyword:" @@ -349,15 +344,6 @@ msgstr "" "終止,而不會執行 :keyword:`try` ... :keyword:`finally` 子句或執行物件的解構函" "式。" -#: ../../library/_thread.rst:232 -msgid "" -"When the main thread exits, it does not do any of its usual cleanup (except " -"that :keyword:`try` ... :keyword:`finally` clauses are honored), and the " -"standard I/O files are not flushed." -msgstr "" -"當主執行緒退出時,它不會執行任何通常的清理操作(除非有 :keyword:`try` ... :" -"keyword:`finally` 子句),並且標準 I/O 檔案不會被刷新。" - #: ../../library/_thread.rst:7 msgid "light-weight processes" msgstr "light-weight processes(輕量級行程)" diff --git a/library/argparse.po b/library/argparse.po index 958fbaa23f..9c267fb807 100644 --- a/library/argparse.po +++ b/library/argparse.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 23:08+0000\n" +"POT-Creation-Date: 2024-10-16 00:13+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-" @@ -20,8 +20,8 @@ msgstr "" #: ../../library/argparse.rst:2 msgid "" -":mod:`!argparse` --- Parser for command-line options, arguments and sub-" -"commands" +":mod:`!argparse` --- Parser for command-line options, arguments and " +"subcommands" msgstr "" #: ../../library/argparse.rst:12 @@ -41,27 +41,23 @@ msgstr "" #: ../../library/argparse.rst:22 msgid "" -"The :mod:`argparse` module makes it easy to write user-friendly command-line " -"interfaces. The program defines what arguments it requires, and :mod:" -"`argparse` will figure out how to parse those out of :data:`sys.argv`. The :" -"mod:`argparse` module also automatically generates help and usage messages. " -"The module will also issue errors when users give the program invalid " -"arguments." +"The :mod:`!argparse` module makes it easy to write user-friendly command-" +"line interfaces. The program defines what arguments it requires, and :mod:`!" +"argparse` will figure out how to parse those out of :data:`sys.argv`. The :" +"mod:`!argparse` module also automatically generates help and usage " +"messages. The module will also issue errors when users give the program " +"invalid arguments." msgstr "" -#: ../../library/argparse.rst:30 -msgid "Core Functionality" -msgstr "" - -#: ../../library/argparse.rst:32 +#: ../../library/argparse.rst:28 msgid "" -"The :mod:`argparse` module's support for command-line interfaces is built " +"The :mod:`!argparse` module's support for command-line interfaces is built " "around an instance of :class:`argparse.ArgumentParser`. It is a container " "for argument specifications and has options that apply to the parser as " "whole::" msgstr "" -#: ../../library/argparse.rst:36 +#: ../../library/argparse.rst:32 msgid "" "parser = argparse.ArgumentParser(\n" " prog='ProgramName',\n" @@ -69,14 +65,14 @@ msgid "" " epilog='Text at the bottom of help')" msgstr "" -#: ../../library/argparse.rst:41 +#: ../../library/argparse.rst:37 msgid "" "The :meth:`ArgumentParser.add_argument` method attaches individual argument " "specifications to the parser. It supports positional arguments, options " "that accept values, and on/off flags::" msgstr "" -#: ../../library/argparse.rst:45 +#: ../../library/argparse.rst:41 msgid "" "parser.add_argument('filename') # positional argument\n" "parser.add_argument('-c', '--count') # option that takes a value\n" @@ -84,509 +80,161 @@ msgid "" " action='store_true') # on/off flag" msgstr "" -#: ../../library/argparse.rst:50 +#: ../../library/argparse.rst:46 msgid "" "The :meth:`ArgumentParser.parse_args` method runs the parser and places the " "extracted data in a :class:`argparse.Namespace` object::" msgstr "" -#: ../../library/argparse.rst:53 +#: ../../library/argparse.rst:49 msgid "" "args = parser.parse_args()\n" "print(args.filename, args.count, args.verbose)" msgstr "" -#: ../../library/argparse.rst:58 -msgid "Quick Links for add_argument()" -msgstr "" - -#: ../../library/argparse.rst:61 -msgid "Name" -msgstr "名稱" - -#: ../../library/argparse.rst:61 -msgid "Description" -msgstr "描述" - -#: ../../library/argparse.rst:61 -msgid "Values" -msgstr "數值" - -#: ../../library/argparse.rst:63 -msgid "action_" -msgstr "action_" - -#: ../../library/argparse.rst:63 -msgid "Specify how an argument should be handled" -msgstr "" - -#: ../../library/argparse.rst:63 -msgid "" -"``'store'``, ``'store_const'``, ``'store_true'``, ``'append'``, " -"``'append_const'``, ``'count'``, ``'help'``, ``'version'``" -msgstr "" -"``'store'``, ``'store_const'``, ``'store_true'``, ``'append'``, " -"``'append_const'``, ``'count'``, ``'help'``, ``'version'``" - -#: ../../library/argparse.rst:64 -msgid "choices_" -msgstr "choices_" - -#: ../../library/argparse.rst:64 -msgid "Limit values to a specific set of choices" -msgstr "" - -#: ../../library/argparse.rst:64 -msgid "" -"``['foo', 'bar']``, ``range(1, 10)``, or :class:`~collections.abc.Container` " -"instance" -msgstr "" - -#: ../../library/argparse.rst:65 -msgid "const_" -msgstr "const_" - -#: ../../library/argparse.rst:65 -msgid "Store a constant value" -msgstr "" - -#: ../../library/argparse.rst:66 -msgid "default_" -msgstr "default_" - -#: ../../library/argparse.rst:66 -msgid "Default value used when an argument is not provided" -msgstr "" - -#: ../../library/argparse.rst:66 -msgid "Defaults to ``None``" -msgstr "" - -#: ../../library/argparse.rst:67 -msgid "dest_" -msgstr "dest_" - -#: ../../library/argparse.rst:67 -msgid "Specify the attribute name used in the result namespace" -msgstr "" - -#: ../../library/argparse.rst:68 -msgid "help_" -msgstr "help_" - -#: ../../library/argparse.rst:68 -msgid "Help message for an argument" -msgstr "" - -#: ../../library/argparse.rst:69 -msgid "metavar_" -msgstr "metavar_" - -#: ../../library/argparse.rst:69 -msgid "Alternate display name for the argument as shown in help" -msgstr "" - -#: ../../library/argparse.rst:70 -msgid "nargs_" -msgstr "nargs_" - -#: ../../library/argparse.rst:70 -msgid "Number of times the argument can be used" -msgstr "" - -#: ../../library/argparse.rst:70 -msgid ":class:`int`, ``'?'``, ``'*'``, or ``'+'``" -msgstr ":class:`int`, ``'?'``, ``'*'``, or ``'+'``" - -#: ../../library/argparse.rst:71 -msgid "required_" -msgstr "required_" - -#: ../../library/argparse.rst:71 -msgid "Indicate whether an argument is required or optional" -msgstr "" - -#: ../../library/argparse.rst:71 -msgid "``True`` or ``False``" -msgstr "``True`` 或 ``False``" - -#: ../../library/argparse.rst:72 -msgid ":ref:`type `" -msgstr "" - -#: ../../library/argparse.rst:72 -msgid "Automatically convert an argument to the given type" -msgstr "" - -#: ../../library/argparse.rst:72 -msgid "" -":class:`int`, :class:`float`, ``argparse.FileType('w')``, or callable " -"function" -msgstr "" -":class:`int`、:class:`float`、``argparse.FileType('w')`` 或可呼叫的函式" - -#: ../../library/argparse.rst:77 -msgid "Example" -msgstr "範例" - -#: ../../library/argparse.rst:79 -msgid "" -"The following code is a Python program that takes a list of integers and " -"produces either the sum or the max::" -msgstr "" - -#: ../../library/argparse.rst:82 -msgid "" -"import argparse\n" -"\n" -"parser = argparse.ArgumentParser(description='Process some integers.')\n" -"parser.add_argument('integers', metavar='N', type=int, nargs='+',\n" -" help='an integer for the accumulator')\n" -"parser.add_argument('--sum', dest='accumulate', action='store_const',\n" -" const=sum, default=max,\n" -" help='sum the integers (default: find the max)')\n" -"\n" -"args = parser.parse_args()\n" -"print(args.accumulate(args.integers))" -msgstr "" -"import argparse\n" -"\n" -"parser = argparse.ArgumentParser(description='Process some integers.')\n" -"parser.add_argument('integers', metavar='N', type=int, nargs='+',\n" -" help='an integer for the accumulator')\n" -"parser.add_argument('--sum', dest='accumulate', action='store_const',\n" -" const=sum, default=max,\n" -" help='sum the integers (default: find the max)')\n" -"\n" -"args = parser.parse_args()\n" -"print(args.accumulate(args.integers))" - -#: ../../library/argparse.rst:94 -msgid "" -"Assuming the above Python code is saved into a file called ``prog.py``, it " -"can be run at the command line and it provides useful help messages:" -msgstr "" - -#: ../../library/argparse.rst:97 -msgid "" -"$ python prog.py -h\n" -"usage: prog.py [-h] [--sum] N [N ...]\n" -"\n" -"Process some integers.\n" -"\n" -"positional arguments:\n" -" N an integer for the accumulator\n" -"\n" -"options:\n" -" -h, --help show this help message and exit\n" -" --sum sum the integers (default: find the max)" -msgstr "" -"$ python prog.py -h\n" -"usage: prog.py [-h] [--sum] N [N ...]\n" -"\n" -"Process some integers.\n" -"\n" -"positional arguments:\n" -" N an integer for the accumulator\n" -"\n" -"options:\n" -" -h, --help show this help message and exit\n" -" --sum sum the integers (default: find the max)" - -#: ../../library/argparse.rst:111 -msgid "" -"When run with the appropriate arguments, it prints either the sum or the max " -"of the command-line integers:" -msgstr "" - -#: ../../library/argparse.rst:114 -msgid "" -"$ python prog.py 1 2 3 4\n" -"4\n" -"\n" -"$ python prog.py 1 2 3 4 --sum\n" -"10" -msgstr "" -"$ python prog.py 1 2 3 4\n" -"4\n" -"\n" -"$ python prog.py 1 2 3 4 --sum\n" -"10" - -#: ../../library/argparse.rst:122 -msgid "If invalid arguments are passed in, an error will be displayed:" -msgstr "" - -#: ../../library/argparse.rst:124 -msgid "" -"$ python prog.py a b c\n" -"usage: prog.py [-h] [--sum] N [N ...]\n" -"prog.py: error: argument N: invalid int value: 'a'" -msgstr "" -"$ python prog.py a b c\n" -"usage: prog.py [-h] [--sum] N [N ...]\n" -"prog.py: error: argument N: invalid int value: 'a'" - -#: ../../library/argparse.rst:130 -msgid "The following sections walk you through this example." -msgstr "" - -#: ../../library/argparse.rst:134 -msgid "Creating a parser" -msgstr "建立一個剖析器" - -#: ../../library/argparse.rst:136 -msgid "" -"The first step in using the :mod:`argparse` is creating an :class:" -"`ArgumentParser` object::" -msgstr "" - -#: ../../library/argparse.rst:139 -msgid "" -">>> parser = argparse.ArgumentParser(description='Process some integers.')" -msgstr "" -">>> parser = argparse.ArgumentParser(description='Process some integers.')" - -#: ../../library/argparse.rst:141 -msgid "" -"The :class:`ArgumentParser` object will hold all the information necessary " -"to parse the command line into Python data types." -msgstr "" - -#: ../../library/argparse.rst:146 -msgid "Adding arguments" -msgstr "增加引數" - -#: ../../library/argparse.rst:148 -msgid "" -"Filling an :class:`ArgumentParser` with information about program arguments " -"is done by making calls to the :meth:`~ArgumentParser.add_argument` method. " -"Generally, these calls tell the :class:`ArgumentParser` how to take the " -"strings on the command line and turn them into objects. This information is " -"stored and used when :meth:`~ArgumentParser.parse_args` is called. For " -"example::" -msgstr "" - -#: ../../library/argparse.rst:154 -msgid "" -">>> parser.add_argument('integers', metavar='N', type=int, nargs='+',\n" -"... help='an integer for the accumulator')\n" -">>> parser.add_argument('--sum', dest='accumulate', action='store_const',\n" -"... const=sum, default=max,\n" -"... help='sum the integers (default: find the max)')" -msgstr "" -">>> parser.add_argument('integers', metavar='N', type=int, nargs='+',\n" -"... help='an integer for the accumulator')\n" -">>> parser.add_argument('--sum', dest='accumulate', action='store_const',\n" -"... const=sum, default=max,\n" -"... help='sum the integers (default: find the max)')" - -#: ../../library/argparse.rst:160 -msgid "" -"Later, calling :meth:`~ArgumentParser.parse_args` will return an object with " -"two attributes, ``integers`` and ``accumulate``. The ``integers`` attribute " -"will be a list of one or more integers, and the ``accumulate`` attribute " -"will be either the :func:`sum` function, if ``--sum`` was specified at the " -"command line, or the :func:`max` function if it was not." -msgstr "" - -#: ../../library/argparse.rst:168 -msgid "Parsing arguments" -msgstr "剖析引數" - -#: ../../library/argparse.rst:170 -msgid "" -":class:`ArgumentParser` parses arguments through the :meth:`~ArgumentParser." -"parse_args` method. This will inspect the command line, convert each " -"argument to the appropriate type and then invoke the appropriate action. In " -"most cases, this means a simple :class:`Namespace` object will be built up " -"from attributes parsed out of the command line::" -msgstr "" - -#: ../../library/argparse.rst:176 -msgid "" -">>> parser.parse_args(['--sum', '7', '-1', '42'])\n" -"Namespace(accumulate=, integers=[7, -1, 42])" -msgstr "" -">>> parser.parse_args(['--sum', '7', '-1', '42'])\n" -"Namespace(accumulate=, integers=[7, -1, 42])" - -#: ../../library/argparse.rst:179 +#: ../../library/argparse.rst:53 msgid "" -"In a script, :meth:`~ArgumentParser.parse_args` will typically be called " -"with no arguments, and the :class:`ArgumentParser` will automatically " -"determine the command-line arguments from :data:`sys.argv`." +"If you're looking a guide about how to upgrade optparse code to argparse, " +"see :ref:`Upgrading Optparse Code `." msgstr "" -#: ../../library/argparse.rst:185 +#: ../../library/argparse.rst:57 msgid "ArgumentParser objects" msgstr "ArgumentParser 物件" -#: ../../library/argparse.rst:194 +#: ../../library/argparse.rst:66 msgid "" "Create a new :class:`ArgumentParser` object. All parameters should be passed " "as keyword arguments. Each parameter has its own more detailed description " "below, but in short they are:" msgstr "" -#: ../../library/argparse.rst:198 +#: ../../library/argparse.rst:70 msgid "" "prog_ - The name of the program (default: ``os.path.basename(sys.argv[0])``)" msgstr "" -#: ../../library/argparse.rst:201 +#: ../../library/argparse.rst:73 msgid "" "usage_ - The string describing the program usage (default: generated from " "arguments added to parser)" msgstr "" -#: ../../library/argparse.rst:204 +#: ../../library/argparse.rst:76 msgid "" "description_ - Text to display before the argument help (by default, no text)" msgstr "" -#: ../../library/argparse.rst:207 +#: ../../library/argparse.rst:79 msgid "epilog_ - Text to display after the argument help (by default, no text)" msgstr "" -#: ../../library/argparse.rst:209 +#: ../../library/argparse.rst:81 msgid "" "parents_ - A list of :class:`ArgumentParser` objects whose arguments should " "also be included" msgstr "" -#: ../../library/argparse.rst:212 +#: ../../library/argparse.rst:84 msgid "formatter_class_ - A class for customizing the help output" msgstr "" -#: ../../library/argparse.rst:214 +#: ../../library/argparse.rst:86 msgid "" "prefix_chars_ - The set of characters that prefix optional arguments " "(default: '-')" msgstr "" -#: ../../library/argparse.rst:217 +#: ../../library/argparse.rst:89 msgid "" "fromfile_prefix_chars_ - The set of characters that prefix files from which " "additional arguments should be read (default: ``None``)" msgstr "" -#: ../../library/argparse.rst:220 +#: ../../library/argparse.rst:92 msgid "" "argument_default_ - The global default value for arguments (default: " "``None``)" msgstr "" -#: ../../library/argparse.rst:223 +#: ../../library/argparse.rst:95 msgid "" "conflict_handler_ - The strategy for resolving conflicting optionals " "(usually unnecessary)" msgstr "" -#: ../../library/argparse.rst:226 +#: ../../library/argparse.rst:98 msgid "" "add_help_ - Add a ``-h/--help`` option to the parser (default: ``True``)" msgstr "" -#: ../../library/argparse.rst:228 +#: ../../library/argparse.rst:100 msgid "" "allow_abbrev_ - Allows long options to be abbreviated if the abbreviation is " "unambiguous. (default: ``True``)" msgstr "" -#: ../../library/argparse.rst:231 +#: ../../library/argparse.rst:103 msgid "" "exit_on_error_ - Determines whether or not ArgumentParser exits with error " "info when an error occurs. (default: ``True``)" msgstr "" -#: ../../library/argparse.rst:234 +#: ../../library/argparse.rst:106 msgid "*allow_abbrev* parameter was added." msgstr "新增 *allow_abbrev* 參數。" -#: ../../library/argparse.rst:237 +#: ../../library/argparse.rst:109 msgid "" "In previous versions, *allow_abbrev* also disabled grouping of short flags " "such as ``-vv`` to mean ``-v -v``." msgstr "" -#: ../../library/argparse.rst:241 +#: ../../library/argparse.rst:113 msgid "*exit_on_error* parameter was added." msgstr "新增 *exit_on_error* 參數。" -#: ../../library/argparse.rst:244 ../../library/argparse.rst:783 +#: ../../library/argparse.rst:116 ../../library/argparse.rst:598 msgid "The following sections describe how each of these are used." msgstr "" -#: ../../library/argparse.rst:250 +#: ../../library/argparse.rst:122 msgid "prog" msgstr "" -#: ../../library/argparse.rst:252 +#: ../../library/argparse.rst:125 msgid "" -"By default, :class:`ArgumentParser` objects use the base name (see :func:`os." -"path.basename`) of ``sys.argv[0]`` to determine how to display the name of " -"the program in help messages. This default is almost always desirable " -"because it will make the help messages match the name that was used to " -"invoke the program on the command line. For example, consider a file named " -"``myprogram.py`` with the following code::" +"By default, :class:`ArgumentParser` calculates the name of the program to " +"display in help messages depending on the way the Python interpreter was run:" msgstr "" -#: ../../library/argparse.rst:259 ../../library/argparse.rst:679 +#: ../../library/argparse.rst:128 msgid "" -"import argparse\n" -"parser = argparse.ArgumentParser()\n" -"parser.add_argument('--foo', help='foo help')\n" -"args = parser.parse_args()" +"The :func:`base name ` of ``sys.argv[0]`` if a file was " +"passed as argument." msgstr "" -"import argparse\n" -"parser = argparse.ArgumentParser()\n" -"parser.add_argument('--foo', help='foo help')\n" -"args = parser.parse_args()" -#: ../../library/argparse.rst:264 +#: ../../library/argparse.rst:130 msgid "" -"The help for this program will display ``myprogram.py`` as the program name " -"(regardless of where the program was invoked from):" +"The Python interpreter name followed by ``sys.argv[0]`` if a directory or a " +"zipfile was passed as argument." msgstr "" -#: ../../library/argparse.rst:267 +#: ../../library/argparse.rst:132 msgid "" -"$ python myprogram.py --help\n" -"usage: myprogram.py [-h] [--foo FOO]\n" -"\n" -"options:\n" -" -h, --help show this help message and exit\n" -" --foo FOO foo help\n" -"$ cd ..\n" -"$ python subdir/myprogram.py --help\n" -"usage: myprogram.py [-h] [--foo FOO]\n" -"\n" -"options:\n" -" -h, --help show this help message and exit\n" -" --foo FOO foo help" +"The Python interpreter name followed by ``-m`` followed by the module or " +"package name if the :option:`-m` option was used." msgstr "" -"$ python myprogram.py --help\n" -"usage: myprogram.py [-h] [--foo FOO]\n" -"\n" -"options:\n" -" -h, --help show this help message and exit\n" -" --foo FOO foo help\n" -"$ cd ..\n" -"$ python subdir/myprogram.py --help\n" -"usage: myprogram.py [-h] [--foo FOO]\n" -"\n" -"options:\n" -" -h, --help show this help message and exit\n" -" --foo FOO foo help" -#: ../../library/argparse.rst:283 +#: ../../library/argparse.rst:135 msgid "" -"To change this default behavior, another value can be supplied using the " -"``prog=`` argument to :class:`ArgumentParser`::" +"This default is almost always desirable because it will make the help " +"messages match the string that was used to invoke the program on the command " +"line. However, to change this default behavior, another value can be " +"supplied using the ``prog=`` argument to :class:`ArgumentParser`::" msgstr "" -#: ../../library/argparse.rst:286 +#: ../../library/argparse.rst:140 msgid "" ">>> parser = argparse.ArgumentParser(prog='myprogram')\n" ">>> parser.print_help()\n" @@ -602,14 +250,14 @@ msgstr "" "options:\n" " -h, --help show this help message and exit" -#: ../../library/argparse.rst:293 +#: ../../library/argparse.rst:147 msgid "" "Note that the program name, whether determined from ``sys.argv[0]`` or from " "the ``prog=`` argument, is available to help messages using the ``%(prog)s`` " "format specifier." msgstr "" -#: ../../library/argparse.rst:299 +#: ../../library/argparse.rst:153 msgid "" ">>> parser = argparse.ArgumentParser(prog='myprogram')\n" ">>> parser.add_argument('--foo', help='foo of the %(prog)s program')\n" @@ -629,50 +277,18 @@ msgstr "" " -h, --help show this help message and exit\n" " --foo FOO foo of the myprogram program" -#: ../../library/argparse.rst:310 +#: ../../library/argparse.rst:164 msgid "usage" msgstr "" -#: ../../library/argparse.rst:312 +#: ../../library/argparse.rst:166 msgid "" "By default, :class:`ArgumentParser` calculates the usage message from the " -"arguments it contains::" +"arguments it contains. The default message can be overridden with the " +"``usage=`` keyword argument::" msgstr "" -#: ../../library/argparse.rst:315 -msgid "" -">>> parser = argparse.ArgumentParser(prog='PROG')\n" -">>> parser.add_argument('--foo', nargs='?', help='foo help')\n" -">>> parser.add_argument('bar', nargs='+', help='bar help')\n" -">>> parser.print_help()\n" -"usage: PROG [-h] [--foo [FOO]] bar [bar ...]\n" -"\n" -"positional arguments:\n" -" bar bar help\n" -"\n" -"options:\n" -" -h, --help show this help message and exit\n" -" --foo [FOO] foo help" -msgstr "" -">>> parser = argparse.ArgumentParser(prog='PROG')\n" -">>> parser.add_argument('--foo', nargs='?', help='foo help')\n" -">>> parser.add_argument('bar', nargs='+', help='bar help')\n" -">>> parser.print_help()\n" -"usage: PROG [-h] [--foo [FOO]] bar [bar ...]\n" -"\n" -"positional arguments:\n" -" bar bar help\n" -"\n" -"options:\n" -" -h, --help show this help message and exit\n" -" --foo [FOO] foo help" - -#: ../../library/argparse.rst:328 -msgid "" -"The default message can be overridden with the ``usage=`` keyword argument::" -msgstr "" - -#: ../../library/argparse.rst:330 +#: ../../library/argparse.rst:170 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', usage='%(prog)s " "[options]')\n" @@ -702,63 +318,43 @@ msgstr "" " -h, --help show this help message and exit\n" " --foo [FOO] foo help" -#: ../../library/argparse.rst:343 +#: ../../library/argparse.rst:183 msgid "" "The ``%(prog)s`` format specifier is available to fill in the program name " "in your usage messages." msgstr "" -#: ../../library/argparse.rst:350 +#: ../../library/argparse.rst:190 msgid "description" msgstr "描述" -#: ../../library/argparse.rst:352 +#: ../../library/argparse.rst:192 msgid "" "Most calls to the :class:`ArgumentParser` constructor will use the " "``description=`` keyword argument. This argument gives a brief description " "of what the program does and how it works. In help messages, the " "description is displayed between the command-line usage string and the help " -"messages for the various arguments::" +"messages for the various arguments." msgstr "" -#: ../../library/argparse.rst:358 -msgid "" -">>> parser = argparse.ArgumentParser(description='A foo that bars')\n" -">>> parser.print_help()\n" -"usage: argparse.py [-h]\n" -"\n" -"A foo that bars\n" -"\n" -"options:\n" -" -h, --help show this help message and exit" -msgstr "" -">>> parser = argparse.ArgumentParser(description='A foo that bars')\n" -">>> parser.print_help()\n" -"usage: argparse.py [-h]\n" -"\n" -"A foo that bars\n" -"\n" -"options:\n" -" -h, --help show this help message and exit" - -#: ../../library/argparse.rst:367 +#: ../../library/argparse.rst:198 msgid "" "By default, the description will be line-wrapped so that it fits within the " "given space. To change this behavior, see the formatter_class_ argument." msgstr "" -#: ../../library/argparse.rst:372 +#: ../../library/argparse.rst:203 msgid "epilog" msgstr "" -#: ../../library/argparse.rst:374 +#: ../../library/argparse.rst:205 msgid "" "Some programs like to display additional description of the program after " "the description of the arguments. Such text can be specified using the " "``epilog=`` argument to :class:`ArgumentParser`::" msgstr "" -#: ../../library/argparse.rst:378 +#: ../../library/argparse.rst:209 msgid "" ">>> parser = argparse.ArgumentParser(\n" "... description='A foo that bars',\n" @@ -786,18 +382,18 @@ msgstr "" "\n" "And that's how you'd foo a bar" -#: ../../library/argparse.rst:391 +#: ../../library/argparse.rst:222 msgid "" "As with the description_ argument, the ``epilog=`` text is by default line-" "wrapped, but this behavior can be adjusted with the formatter_class_ " "argument to :class:`ArgumentParser`." msgstr "" -#: ../../library/argparse.rst:397 +#: ../../library/argparse.rst:228 msgid "parents" msgstr "" -#: ../../library/argparse.rst:399 +#: ../../library/argparse.rst:230 msgid "" "Sometimes, several parsers share a common set of arguments. Rather than " "repeating the definitions of these arguments, a single parser with all the " @@ -808,7 +404,7 @@ msgid "" "object being constructed::" msgstr "" -#: ../../library/argparse.rst:406 +#: ../../library/argparse.rst:237 msgid "" ">>> parent_parser = argparse.ArgumentParser(add_help=False)\n" ">>> parent_parser.add_argument('--parent', type=int)\n" @@ -836,32 +432,32 @@ msgstr "" ">>> bar_parser.parse_args(['--bar', 'YYY'])\n" "Namespace(bar='YYY', parent=None)" -#: ../../library/argparse.rst:419 +#: ../../library/argparse.rst:250 msgid "" "Note that most parent parsers will specify ``add_help=False``. Otherwise, " "the :class:`ArgumentParser` will see two ``-h/--help`` options (one in the " "parent and one in the child) and raise an error." msgstr "" -#: ../../library/argparse.rst:424 +#: ../../library/argparse.rst:255 msgid "" "You must fully initialize the parsers before passing them via ``parents=``. " "If you change the parent parsers after the child parser, those changes will " "not be reflected in the child." msgstr "" -#: ../../library/argparse.rst:432 +#: ../../library/argparse.rst:263 msgid "formatter_class" msgstr "formatter_class" -#: ../../library/argparse.rst:434 +#: ../../library/argparse.rst:265 msgid "" ":class:`ArgumentParser` objects allow the help formatting to be customized " "by specifying an alternate formatting class. Currently, there are four such " "classes:" msgstr "" -#: ../../library/argparse.rst:443 +#: ../../library/argparse.rst:274 msgid "" ":class:`RawDescriptionHelpFormatter` and :class:`RawTextHelpFormatter` give " "more control over how textual descriptions are displayed. By default, :class:" @@ -869,7 +465,7 @@ msgid "" "command-line help messages::" msgstr "" -#: ../../library/argparse.rst:448 +#: ../../library/argparse.rst:279 msgid "" ">>> parser = argparse.ArgumentParser(\n" "... prog='PROG',\n" @@ -893,14 +489,14 @@ msgid "" "will be wrapped across a couple lines" msgstr "" -#: ../../library/argparse.rst:468 +#: ../../library/argparse.rst:299 msgid "" "Passing :class:`RawDescriptionHelpFormatter` as ``formatter_class=`` " "indicates that description_ and epilog_ are already correctly formatted and " "should not be line-wrapped::" msgstr "" -#: ../../library/argparse.rst:472 +#: ../../library/argparse.rst:303 msgid "" ">>> parser = argparse.ArgumentParser(\n" "... prog='PROG',\n" @@ -925,21 +521,21 @@ msgid "" " -h, --help show this help message and exit" msgstr "" -#: ../../library/argparse.rst:494 +#: ../../library/argparse.rst:325 msgid "" ":class:`RawTextHelpFormatter` maintains whitespace for all sorts of help " -"text, including argument descriptions. However, multiple new lines are " +"text, including argument descriptions. However, multiple newlines are " "replaced with one. If you wish to preserve multiple blank lines, add spaces " "between the newlines." msgstr "" -#: ../../library/argparse.rst:499 +#: ../../library/argparse.rst:330 msgid "" ":class:`ArgumentDefaultsHelpFormatter` automatically adds information about " "default values to each of the argument help messages::" msgstr "" -#: ../../library/argparse.rst:502 +#: ../../library/argparse.rst:333 msgid "" ">>> parser = argparse.ArgumentParser(\n" "... prog='PROG',\n" @@ -971,14 +567,14 @@ msgstr "" " -h, --help show this help message and exit\n" " --foo FOO FOO! (default: 42)" -#: ../../library/argparse.rst:517 +#: ../../library/argparse.rst:348 msgid "" ":class:`MetavarTypeHelpFormatter` uses the name of the type_ argument for " "each argument as the display name for its values (rather than using the " "dest_ as the regular formatter does)::" msgstr "" -#: ../../library/argparse.rst:521 +#: ../../library/argparse.rst:352 msgid "" ">>> parser = argparse.ArgumentParser(\n" "... prog='PROG',\n" @@ -1010,11 +606,11 @@ msgstr "" " -h, --help show this help message and exit\n" " --foo int" -#: ../../library/argparse.rst:538 +#: ../../library/argparse.rst:369 msgid "prefix_chars" msgstr "prefix_chars" -#: ../../library/argparse.rst:540 +#: ../../library/argparse.rst:371 msgid "" "Most command-line options will use ``-`` as the prefix, e.g. ``-f/--foo``. " "Parsers that need to support different or additional prefix characters, e.g. " @@ -1022,7 +618,7 @@ msgid "" "``prefix_chars=`` argument to the ArgumentParser constructor::" msgstr "" -#: ../../library/argparse.rst:546 +#: ../../library/argparse.rst:377 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', prefix_chars='-+')\n" ">>> parser.add_argument('+f')\n" @@ -1036,18 +632,18 @@ msgstr "" ">>> parser.parse_args('+f X ++bar Y'.split())\n" "Namespace(bar='Y', f='X')" -#: ../../library/argparse.rst:552 +#: ../../library/argparse.rst:383 msgid "" "The ``prefix_chars=`` argument defaults to ``'-'``. Supplying a set of " "characters that does not include ``-`` will cause ``-f/--foo`` options to be " "disallowed." msgstr "" -#: ../../library/argparse.rst:558 +#: ../../library/argparse.rst:389 msgid "fromfile_prefix_chars" msgstr "fromfile_prefix_chars" -#: ../../library/argparse.rst:560 +#: ../../library/argparse.rst:391 msgid "" "Sometimes, when dealing with a particularly long argument list, it may make " "sense to keep the list of arguments in a file rather than typing it out at " @@ -1057,7 +653,7 @@ msgid "" "by the arguments they contain. For example::" msgstr "" -#: ../../library/argparse.rst:567 +#: ../../library/argparse.rst:398 msgid "" ">>> with open('args.txt', 'w', encoding=sys.getfilesystemencoding()) as fp:\n" "... fp.write('-f\\nbar')\n" @@ -1075,7 +671,7 @@ msgstr "" ">>> parser.parse_args(['-f', 'foo', '@args.txt'])\n" "Namespace(f='bar')" -#: ../../library/argparse.rst:575 +#: ../../library/argparse.rst:406 msgid "" "Arguments read from a file must by default be one per line (but see also :" "meth:`~ArgumentParser.convert_arg_line_to_args`) and are treated as if they " @@ -1085,32 +681,32 @@ msgid "" "f', 'bar']``." msgstr "" -#: ../../library/argparse.rst:581 +#: ../../library/argparse.rst:412 msgid "" ":class:`ArgumentParser` uses :term:`filesystem encoding and error handler` " "to read the file containing arguments." msgstr "" -#: ../../library/argparse.rst:584 +#: ../../library/argparse.rst:415 msgid "" "The ``fromfile_prefix_chars=`` argument defaults to ``None``, meaning that " "arguments will never be treated as file references." msgstr "" -#: ../../library/argparse.rst:587 +#: ../../library/argparse.rst:418 msgid "" ":class:`ArgumentParser` changed encoding and errors to read arguments files " "from default (e.g. :func:`locale.getpreferredencoding(False) ` and ``\"strict\"``) to :term:`filesystem encoding and " -"error handler`. Arguments file should be encoded in UTF-8 instead of ANSI " -"Codepage on Windows." +"getpreferredencoding>` and ``\"strict\"``) to the :term:`filesystem encoding " +"and error handler`. Arguments file should be encoded in UTF-8 instead of " +"ANSI Codepage on Windows." msgstr "" -#: ../../library/argparse.rst:595 +#: ../../library/argparse.rst:426 msgid "argument_default" msgstr "argument_default" -#: ../../library/argparse.rst:597 +#: ../../library/argparse.rst:428 msgid "" "Generally, argument defaults are specified either by passing a default to :" "meth:`~ArgumentParser.add_argument` or by calling the :meth:`~ArgumentParser." @@ -1122,7 +718,7 @@ msgid "" "supply ``argument_default=SUPPRESS``::" msgstr "" -#: ../../library/argparse.rst:606 +#: ../../library/argparse.rst:437 msgid "" ">>> parser = argparse.ArgumentParser(argument_default=argparse.SUPPRESS)\n" ">>> parser.add_argument('--foo')\n" @@ -1140,22 +736,22 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace()" -#: ../../library/argparse.rst:617 +#: ../../library/argparse.rst:448 msgid "allow_abbrev" msgstr "allow_abbrev" -#: ../../library/argparse.rst:619 +#: ../../library/argparse.rst:450 msgid "" "Normally, when you pass an argument list to the :meth:`~ArgumentParser." "parse_args` method of an :class:`ArgumentParser`, it :ref:`recognizes " "abbreviations ` of long options." msgstr "" -#: ../../library/argparse.rst:623 +#: ../../library/argparse.rst:454 msgid "This feature can be disabled by setting ``allow_abbrev`` to ``False``::" msgstr "" -#: ../../library/argparse.rst:625 +#: ../../library/argparse.rst:456 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', allow_abbrev=False)\n" ">>> parser.add_argument('--foobar', action='store_true')\n" @@ -1171,11 +767,11 @@ msgstr "" "usage: PROG [-h] [--foobar] [--foonley]\n" "PROG: error: unrecognized arguments: --foon" -#: ../../library/argparse.rst:636 +#: ../../library/argparse.rst:467 msgid "conflict_handler" msgstr "conflict_handler" -#: ../../library/argparse.rst:638 +#: ../../library/argparse.rst:469 msgid "" ":class:`ArgumentParser` objects do not allow two actions with the same " "option string. By default, :class:`ArgumentParser` objects raise an " @@ -1183,7 +779,7 @@ msgid "" "that is already in use::" msgstr "" -#: ../../library/argparse.rst:643 +#: ../../library/argparse.rst:474 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-f', '--foo', help='old foo help')\n" @@ -1199,7 +795,7 @@ msgstr "" " ..\n" "ArgumentError: argument --foo: conflicting option string(s): --foo" -#: ../../library/argparse.rst:650 +#: ../../library/argparse.rst:481 msgid "" "Sometimes (e.g. when using parents_) it may be useful to simply override any " "older arguments with the same option string. To get this behavior, the " @@ -1207,7 +803,7 @@ msgid "" "of :class:`ArgumentParser`::" msgstr "" -#: ../../library/argparse.rst:655 +#: ../../library/argparse.rst:486 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', " "conflict_handler='resolve')\n" @@ -1233,7 +829,7 @@ msgstr "" " -f FOO old foo help\n" " --foo FOO new foo help" -#: ../../library/argparse.rst:666 +#: ../../library/argparse.rst:497 msgid "" "Note that :class:`ArgumentParser` objects only remove an action if all of " "its option strings are overridden. So, in the example above, the old ``-f/--" @@ -1241,47 +837,25 @@ msgid "" "option string was overridden." msgstr "" -#: ../../library/argparse.rst:673 +#: ../../library/argparse.rst:504 msgid "add_help" msgstr "add_help" -#: ../../library/argparse.rst:675 +#: ../../library/argparse.rst:506 msgid "" "By default, ArgumentParser objects add an option which simply displays the " -"parser's help message. For example, consider a file named ``myprogram.py`` " -"containing the following code::" -msgstr "" - -#: ../../library/argparse.rst:684 -msgid "" -"If ``-h`` or ``--help`` is supplied at the command line, the ArgumentParser " -"help will be printed:" +"parser's help message. If ``-h`` or ``--help`` is supplied at the command " +"line, the ArgumentParser help will be printed." msgstr "" -#: ../../library/argparse.rst:687 -msgid "" -"$ python myprogram.py --help\n" -"usage: myprogram.py [-h] [--foo FOO]\n" -"\n" -"options:\n" -" -h, --help show this help message and exit\n" -" --foo FOO foo help" -msgstr "" -"$ python myprogram.py --help\n" -"usage: myprogram.py [-h] [--foo FOO]\n" -"\n" -"options:\n" -" -h, --help show this help message and exit\n" -" --foo FOO foo help" - -#: ../../library/argparse.rst:696 +#: ../../library/argparse.rst:510 msgid "" "Occasionally, it may be useful to disable the addition of this help option. " "This can be achieved by passing ``False`` as the ``add_help=`` argument to :" "class:`ArgumentParser`::" msgstr "" -#: ../../library/argparse.rst:700 +#: ../../library/argparse.rst:514 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" ">>> parser.add_argument('--foo', help='foo help')\n" @@ -1299,7 +873,7 @@ msgstr "" "options:\n" " --foo FOO foo help" -#: ../../library/argparse.rst:708 +#: ../../library/argparse.rst:522 msgid "" "The help option is typically ``-h/--help``. The exception to this is if the " "``prefix_chars=`` is specified and does not include ``-``, in which case ``-" @@ -1307,7 +881,7 @@ msgid "" "in ``prefix_chars`` is used to prefix the help options::" msgstr "" -#: ../../library/argparse.rst:714 +#: ../../library/argparse.rst:528 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', prefix_chars='+/')\n" ">>> parser.print_help()\n" @@ -1323,24 +897,24 @@ msgstr "" "options:\n" " +h, ++help show this help message and exit" -#: ../../library/argparse.rst:723 +#: ../../library/argparse.rst:537 msgid "exit_on_error" msgstr "exit_on_error" -#: ../../library/argparse.rst:725 +#: ../../library/argparse.rst:539 msgid "" "Normally, when you pass an invalid argument list to the :meth:" "`~ArgumentParser.parse_args` method of an :class:`ArgumentParser`, it will " -"exit with error info." +"print a *message* to :data:`sys.stderr` and exit with a status code of 2." msgstr "" -#: ../../library/argparse.rst:728 +#: ../../library/argparse.rst:543 msgid "" "If the user would like to catch errors manually, the feature can be enabled " "by setting ``exit_on_error`` to ``False``::" msgstr "" -#: ../../library/argparse.rst:731 +#: ../../library/argparse.rst:546 msgid "" ">>> parser = argparse.ArgumentParser(exit_on_error=False)\n" ">>> parser.add_argument('--integers', type=int)\n" @@ -1366,81 +940,81 @@ msgstr "" "...\n" "Catching an argumentError" -#: ../../library/argparse.rst:745 +#: ../../library/argparse.rst:560 msgid "The add_argument() method" msgstr "" -#: ../../library/argparse.rst:751 +#: ../../library/argparse.rst:566 msgid "" "Define how a single command-line argument should be parsed. Each parameter " "has its own more detailed description below, but in short they are:" msgstr "" -#: ../../library/argparse.rst:754 +#: ../../library/argparse.rst:569 msgid "" "`name or flags`_ - Either a name or a list of option strings, e.g. ``foo`` " "or ``-f, --foo``." msgstr "" -#: ../../library/argparse.rst:757 +#: ../../library/argparse.rst:572 msgid "" "action_ - The basic type of action to be taken when this argument is " "encountered at the command line." msgstr "" -#: ../../library/argparse.rst:760 +#: ../../library/argparse.rst:575 msgid "nargs_ - The number of command-line arguments that should be consumed." msgstr "" -#: ../../library/argparse.rst:762 +#: ../../library/argparse.rst:577 msgid "" "const_ - A constant value required by some action_ and nargs_ selections." msgstr "" -#: ../../library/argparse.rst:764 +#: ../../library/argparse.rst:579 msgid "" "default_ - The value produced if the argument is absent from the command " "line and if it is absent from the namespace object." msgstr "" -#: ../../library/argparse.rst:767 +#: ../../library/argparse.rst:582 msgid "" "type_ - The type to which the command-line argument should be converted." msgstr "" -#: ../../library/argparse.rst:769 +#: ../../library/argparse.rst:584 msgid "choices_ - A sequence of the allowable values for the argument." msgstr "" -#: ../../library/argparse.rst:771 +#: ../../library/argparse.rst:586 msgid "" "required_ - Whether or not the command-line option may be omitted (optionals " "only)." msgstr "" -#: ../../library/argparse.rst:774 +#: ../../library/argparse.rst:589 msgid "help_ - A brief description of what the argument does." msgstr "" -#: ../../library/argparse.rst:776 +#: ../../library/argparse.rst:591 msgid "metavar_ - A name for the argument in usage messages." msgstr "" -#: ../../library/argparse.rst:778 +#: ../../library/argparse.rst:593 msgid "" "dest_ - The name of the attribute to be added to the object returned by :" "meth:`parse_args`." msgstr "" -#: ../../library/argparse.rst:781 +#: ../../library/argparse.rst:596 msgid "deprecated_ - Whether or not use of the argument is deprecated." msgstr "" -#: ../../library/argparse.rst:789 +#: ../../library/argparse.rst:604 msgid "name or flags" msgstr "" -#: ../../library/argparse.rst:791 +#: ../../library/argparse.rst:606 msgid "" "The :meth:`~ArgumentParser.add_argument` method must know whether an " "optional argument, like ``-f`` or ``--foo``, or a positional argument, like " @@ -1449,30 +1023,30 @@ msgid "" "or a simple argument name." msgstr "" -#: ../../library/argparse.rst:797 +#: ../../library/argparse.rst:612 msgid "For example, an optional argument could be created like::" msgstr "" -#: ../../library/argparse.rst:799 +#: ../../library/argparse.rst:614 msgid ">>> parser.add_argument('-f', '--foo')" msgstr ">>> parser.add_argument('-f', '--foo')" -#: ../../library/argparse.rst:801 +#: ../../library/argparse.rst:616 msgid "while a positional argument could be created like::" msgstr "" -#: ../../library/argparse.rst:803 +#: ../../library/argparse.rst:618 msgid ">>> parser.add_argument('bar')" msgstr ">>> parser.add_argument('bar')" -#: ../../library/argparse.rst:805 +#: ../../library/argparse.rst:620 msgid "" "When :meth:`~ArgumentParser.parse_args` is called, optional arguments will " "be identified by the ``-`` prefix, and the remaining arguments will be " "assumed to be positional::" msgstr "" -#: ../../library/argparse.rst:809 +#: ../../library/argparse.rst:624 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-f', '--foo')\n" @@ -1496,11 +1070,11 @@ msgstr "" "usage: PROG [-h] [-f FOO] bar\n" "PROG: error: the following arguments are required: bar" -#: ../../library/argparse.rst:824 +#: ../../library/argparse.rst:639 msgid "action" msgstr "" -#: ../../library/argparse.rst:826 +#: ../../library/argparse.rst:641 msgid "" ":class:`ArgumentParser` objects associate command-line arguments with " "actions. These actions can do just about anything with the command-line " @@ -1510,25 +1084,13 @@ msgid "" "be handled. The supplied actions are:" msgstr "" -#: ../../library/argparse.rst:832 +#: ../../library/argparse.rst:647 msgid "" "``'store'`` - This just stores the argument's value. This is the default " -"action. For example::" +"action." msgstr "" -#: ../../library/argparse.rst:835 -msgid "" -">>> parser = argparse.ArgumentParser()\n" -">>> parser.add_argument('--foo')\n" -">>> parser.parse_args('--foo 1'.split())\n" -"Namespace(foo='1')" -msgstr "" -">>> parser = argparse.ArgumentParser()\n" -">>> parser.add_argument('--foo')\n" -">>> parser.parse_args('--foo 1'.split())\n" -"Namespace(foo='1')" - -#: ../../library/argparse.rst:840 +#: ../../library/argparse.rst:650 msgid "" "``'store_const'`` - This stores the value specified by the const_ keyword " "argument; note that the const_ keyword argument defaults to ``None``. The " @@ -1536,7 +1098,7 @@ msgid "" "specify some sort of flag. For example::" msgstr "" -#: ../../library/argparse.rst:845 +#: ../../library/argparse.rst:655 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', action='store_const', const=42)\n" @@ -1548,15 +1110,15 @@ msgstr "" ">>> parser.parse_args(['--foo'])\n" "Namespace(foo=42)" -#: ../../library/argparse.rst:850 +#: ../../library/argparse.rst:660 msgid "" "``'store_true'`` and ``'store_false'`` - These are special cases of " "``'store_const'`` used for storing the values ``True`` and ``False`` " "respectively. In addition, they create default values of ``False`` and " -"``True`` respectively. For example::" +"``True`` respectively::" msgstr "" -#: ../../library/argparse.rst:855 +#: ../../library/argparse.rst:665 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', action='store_true')\n" @@ -1572,7 +1134,7 @@ msgstr "" ">>> parser.parse_args('--foo --bar'.split())\n" "Namespace(foo=True, bar=False, baz=True)" -#: ../../library/argparse.rst:862 +#: ../../library/argparse.rst:672 msgid "" "``'append'`` - This stores a list, and appends each argument value to the " "list. It is useful to allow an option to be specified multiple times. If the " @@ -1581,7 +1143,7 @@ msgid "" "after those default values. Example usage::" msgstr "" -#: ../../library/argparse.rst:868 +#: ../../library/argparse.rst:678 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', action='append')\n" @@ -1593,7 +1155,7 @@ msgstr "" ">>> parser.parse_args('--foo 1 --foo 2'.split())\n" "Namespace(foo=['1', '2'])" -#: ../../library/argparse.rst:873 +#: ../../library/argparse.rst:683 msgid "" "``'append_const'`` - This stores a list, and appends the value specified by " "the const_ keyword argument to the list; note that the const_ keyword " @@ -1602,7 +1164,7 @@ msgid "" "example::" msgstr "" -#: ../../library/argparse.rst:879 +#: ../../library/argparse.rst:689 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--str', dest='types', action='append_const', " @@ -1620,13 +1182,13 @@ msgstr "" ">>> parser.parse_args('--str --int'.split())\n" "Namespace(types=[, ])" -#: ../../library/argparse.rst:885 +#: ../../library/argparse.rst:695 msgid "" "``'count'`` - This counts the number of times a keyword argument occurs. For " "example, this is useful for increasing verbosity levels::" msgstr "" -#: ../../library/argparse.rst:888 +#: ../../library/argparse.rst:698 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--verbose', '-v', action='count', default=0)\n" @@ -1634,11 +1196,11 @@ msgid "" "Namespace(verbose=3)" msgstr "" -#: ../../library/argparse.rst:893 +#: ../../library/argparse.rst:703 msgid "Note, the *default* will be ``None`` unless explicitly set to *0*." msgstr "" -#: ../../library/argparse.rst:895 +#: ../../library/argparse.rst:705 msgid "" "``'help'`` - This prints a complete help message for all the options in the " "current parser and then exits. By default a help action is automatically " @@ -1646,14 +1208,14 @@ msgid "" "output is created." msgstr "" -#: ../../library/argparse.rst:900 +#: ../../library/argparse.rst:710 msgid "" "``'version'`` - This expects a ``version=`` keyword argument in the :meth:" "`~ArgumentParser.add_argument` call, and prints version information and " "exits when invoked::" msgstr "" -#: ../../library/argparse.rst:904 +#: ../../library/argparse.rst:714 msgid "" ">>> import argparse\n" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" @@ -1669,13 +1231,13 @@ msgstr "" ">>> parser.parse_args(['--version'])\n" "PROG 2.0" -#: ../../library/argparse.rst:910 +#: ../../library/argparse.rst:720 msgid "" "``'extend'`` - This stores a list, and extends each argument value to the " "list. Example usage::" msgstr "" -#: ../../library/argparse.rst:914 +#: ../../library/argparse.rst:724 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument(\"--foo\", action=\"extend\", nargs=\"+\", " @@ -1691,7 +1253,13 @@ msgstr "" "\"f4\"])\n" "Namespace(foo=['f1', 'f2', 'f3', 'f4'])" -#: ../../library/argparse.rst:921 +#: ../../library/argparse.rst:731 +msgid "" +"Only actions that consume command-line arguments (e.g. ``'store'``, " +"``'append'`` or ``'extend'``) can be used with positional arguments." +msgstr "" + +#: ../../library/argparse.rst:734 msgid "" "You may also specify an arbitrary action by passing an Action subclass or " "other object that implements the same interface. The " @@ -1699,7 +1267,7 @@ msgid "" "boolean actions such as ``--foo`` and ``--no-foo``::" msgstr "" -#: ../../library/argparse.rst:926 +#: ../../library/argparse.rst:739 msgid "" ">>> import argparse\n" ">>> parser = argparse.ArgumentParser()\n" @@ -1713,18 +1281,18 @@ msgstr "" ">>> parser.parse_args(['--no-foo'])\n" "Namespace(foo=False)" -#: ../../library/argparse.rst:934 +#: ../../library/argparse.rst:747 msgid "" "The recommended way to create a custom action is to extend :class:`Action`, " "overriding the ``__call__`` method and optionally the ``__init__`` and " "``format_usage`` methods." msgstr "" -#: ../../library/argparse.rst:938 +#: ../../library/argparse.rst:751 msgid "An example of a custom action::" msgstr "" -#: ../../library/argparse.rst:940 +#: ../../library/argparse.rst:753 msgid "" ">>> class FooAction(argparse.Action):\n" "... def __init__(self, option_strings, dest, nargs=None, **kwargs):\n" @@ -1745,15 +1313,15 @@ msgid "" "Namespace(bar='1', foo='2')" msgstr "" -#: ../../library/argparse.rst:958 +#: ../../library/argparse.rst:771 msgid "For more details, see :class:`Action`." msgstr "" -#: ../../library/argparse.rst:964 +#: ../../library/argparse.rst:777 msgid "nargs" msgstr "" -#: ../../library/argparse.rst:966 +#: ../../library/argparse.rst:779 msgid "" "ArgumentParser objects usually associate a single command-line argument with " "a single action to be taken. The ``nargs`` keyword argument associates a " @@ -1761,13 +1329,13 @@ msgid "" "ref:`specifying-ambiguous-arguments`. The supported values are:" msgstr "" -#: ../../library/argparse.rst:971 +#: ../../library/argparse.rst:784 msgid "" "``N`` (an integer). ``N`` arguments from the command line will be gathered " "together into a list. For example::" msgstr "" -#: ../../library/argparse.rst:974 +#: ../../library/argparse.rst:787 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', nargs=2)\n" @@ -1781,13 +1349,13 @@ msgstr "" ">>> parser.parse_args('c --foo a b'.split())\n" "Namespace(bar=['c'], foo=['a', 'b'])" -#: ../../library/argparse.rst:980 +#: ../../library/argparse.rst:793 msgid "" "Note that ``nargs=1`` produces a list of one item. This is different from " "the default, in which the item is produced by itself." msgstr "" -#: ../../library/argparse.rst:985 +#: ../../library/argparse.rst:798 msgid "" "``'?'``. One argument will be consumed from the command line if possible, " "and produced as a single item. If no command-line argument is present, the " @@ -1797,7 +1365,7 @@ msgid "" "produced. Some examples to illustrate this::" msgstr "" -#: ../../library/argparse.rst:992 +#: ../../library/argparse.rst:805 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', nargs='?', const='c', default='d')\n" @@ -1819,13 +1387,13 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace(bar='d', foo='d')" -#: ../../library/argparse.rst:1002 +#: ../../library/argparse.rst:815 msgid "" "One of the more common uses of ``nargs='?'`` is to allow optional input and " "output files::" msgstr "" -#: ../../library/argparse.rst:1005 +#: ../../library/argparse.rst:818 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('infile', nargs='?', type=argparse.FileType('r'),\n" @@ -1851,7 +1419,7 @@ msgstr "" "Namespace(infile=<_io.TextIOWrapper name='' encoding='UTF-8'>,\n" " outfile=<_io.TextIOWrapper name='' encoding='UTF-8'>)" -#: ../../library/argparse.rst:1019 +#: ../../library/argparse.rst:832 msgid "" "``'*'``. All command-line arguments present are gathered into a list. Note " "that it generally doesn't make much sense to have more than one positional " @@ -1859,7 +1427,7 @@ msgid "" "``nargs='*'`` is possible. For example::" msgstr "" -#: ../../library/argparse.rst:1024 +#: ../../library/argparse.rst:837 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', nargs='*')\n" @@ -1875,14 +1443,14 @@ msgstr "" ">>> parser.parse_args('a b --foo x y --bar 1 2'.split())\n" "Namespace(bar=['1', '2'], baz=['a', 'b'], foo=['x', 'y'])" -#: ../../library/argparse.rst:1033 +#: ../../library/argparse.rst:846 msgid "" "``'+'``. Just like ``'*'``, all command-line args present are gathered into " "a list. Additionally, an error message will be generated if there wasn't at " "least one command-line argument present. For example::" msgstr "" -#: ../../library/argparse.rst:1037 +#: ../../library/argparse.rst:850 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('foo', nargs='+')\n" @@ -1900,19 +1468,20 @@ msgstr "" "usage: PROG [-h] foo [foo ...]\n" "PROG: error: the following arguments are required: foo" -#: ../../library/argparse.rst:1045 +#: ../../library/argparse.rst:858 msgid "" "If the ``nargs`` keyword argument is not provided, the number of arguments " "consumed is determined by the action_. Generally this means a single " "command-line argument will be consumed and a single item (not a list) will " -"be produced." +"be produced. Actions that do not consume command-line arguments (e.g. " +"``'store_const'``) set ``nargs=0``." msgstr "" -#: ../../library/argparse.rst:1053 +#: ../../library/argparse.rst:868 msgid "const" msgstr "" -#: ../../library/argparse.rst:1055 +#: ../../library/argparse.rst:870 msgid "" "The ``const`` argument of :meth:`~ArgumentParser.add_argument` is used to " "hold constant values that are not read from the command line but are " @@ -1920,7 +1489,7 @@ msgid "" "common uses of it are:" msgstr "" -#: ../../library/argparse.rst:1059 +#: ../../library/argparse.rst:874 msgid "" "When :meth:`~ArgumentParser.add_argument` is called with " "``action='store_const'`` or ``action='append_const'``. These actions add " @@ -1930,7 +1499,7 @@ msgid "" "receive a default value of ``None``." msgstr "" -#: ../../library/argparse.rst:1067 +#: ../../library/argparse.rst:882 msgid "" "When :meth:`~ArgumentParser.add_argument` is called with option strings " "(like ``-f`` or ``--foo``) and ``nargs='?'``. This creates an optional " @@ -1940,17 +1509,17 @@ msgid "" "to be ``None`` instead. See the nargs_ description for examples." msgstr "" -#: ../../library/argparse.rst:1074 +#: ../../library/argparse.rst:889 msgid "" "``const=None`` by default, including when ``action='append_const'`` or " "``action='store_const'``." msgstr "" -#: ../../library/argparse.rst:1081 +#: ../../library/argparse.rst:896 msgid "default" msgstr "" -#: ../../library/argparse.rst:1083 +#: ../../library/argparse.rst:898 msgid "" "All optional arguments and some positional arguments may be omitted at the " "command line. The ``default`` keyword argument of :meth:`~ArgumentParser." @@ -1960,7 +1529,7 @@ msgid "" "command line::" msgstr "" -#: ../../library/argparse.rst:1090 +#: ../../library/argparse.rst:905 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default=42)\n" @@ -1976,13 +1545,13 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace(foo=42)" -#: ../../library/argparse.rst:1097 +#: ../../library/argparse.rst:912 msgid "" "If the target namespace already has an attribute set, the action *default* " -"will not over write it::" +"will not overwrite it::" msgstr "" -#: ../../library/argparse.rst:1100 +#: ../../library/argparse.rst:915 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default=42)\n" @@ -1994,7 +1563,7 @@ msgstr "" ">>> parser.parse_args([], namespace=argparse.Namespace(foo=101))\n" "Namespace(foo=101)" -#: ../../library/argparse.rst:1105 +#: ../../library/argparse.rst:920 msgid "" "If the ``default`` value is a string, the parser parses the value as if it " "were a command-line argument. In particular, the parser applies any type_ " @@ -2002,7 +1571,7 @@ msgid "" "`Namespace` return value. Otherwise, the parser uses the value as is::" msgstr "" -#: ../../library/argparse.rst:1110 +#: ../../library/argparse.rst:925 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--length', default='10', type=int)\n" @@ -2016,13 +1585,13 @@ msgstr "" ">>> parser.parse_args()\n" "Namespace(length=10, width=10.5)" -#: ../../library/argparse.rst:1116 +#: ../../library/argparse.rst:931 msgid "" "For positional arguments with nargs_ equal to ``?`` or ``*``, the " "``default`` value is used when no command-line argument was present::" msgstr "" -#: ../../library/argparse.rst:1119 +#: ../../library/argparse.rst:934 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('foo', nargs='?', default=42)\n" @@ -2038,20 +1607,20 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace(foo=42)" -#: ../../library/argparse.rst:1126 +#: ../../library/argparse.rst:941 msgid "" "For required_ arguments, the ``default`` value is ignored. For example, this " "applies to positional arguments with nargs_ values other than ``?`` or " "``*``, or optional arguments marked as ``required=True``." msgstr "" -#: ../../library/argparse.rst:1130 +#: ../../library/argparse.rst:945 msgid "" "Providing ``default=argparse.SUPPRESS`` causes no attribute to be added if " "the command-line argument was not present::" msgstr "" -#: ../../library/argparse.rst:1133 +#: ../../library/argparse.rst:948 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default=argparse.SUPPRESS)\n" @@ -2067,11 +1636,11 @@ msgstr "" ">>> parser.parse_args(['--foo', '1'])\n" "Namespace(foo='1')" -#: ../../library/argparse.rst:1144 +#: ../../library/argparse.rst:959 msgid "type" msgstr "" -#: ../../library/argparse.rst:1146 +#: ../../library/argparse.rst:961 msgid "" "By default, the parser reads command-line arguments in as simple strings. " "However, quite often the command-line string should instead be interpreted " @@ -2080,13 +1649,13 @@ msgid "" "checking and type conversions to be performed." msgstr "" -#: ../../library/argparse.rst:1152 +#: ../../library/argparse.rst:967 msgid "" "If the type_ keyword is used with the default_ keyword, the type converter " "is only applied if the default is a string." msgstr "" -#: ../../library/argparse.rst:1155 +#: ../../library/argparse.rst:970 msgid "" "The argument to ``type`` can be any callable that accepts a single string. " "If the function raises :exc:`ArgumentTypeError`, :exc:`TypeError`, or :exc:" @@ -2094,11 +1663,11 @@ msgid "" "is displayed. No other exception types are handled." msgstr "" -#: ../../library/argparse.rst:1160 +#: ../../library/argparse.rst:975 msgid "Common built-in types and functions can be used as type converters:" msgstr "" -#: ../../library/argparse.rst:1162 +#: ../../library/argparse.rst:977 msgid "" "import argparse\n" "import pathlib\n" @@ -2108,7 +1677,6 @@ msgid "" "parser.add_argument('distance', type=float)\n" "parser.add_argument('street', type=ascii)\n" "parser.add_argument('code_point', type=ord)\n" -"parser.add_argument('source_file', type=open)\n" "parser.add_argument('dest_file', type=argparse.FileType('w', " "encoding='latin-1'))\n" "parser.add_argument('datapath', type=pathlib.Path)" @@ -2121,16 +1689,15 @@ msgstr "" "parser.add_argument('distance', type=float)\n" "parser.add_argument('street', type=ascii)\n" "parser.add_argument('code_point', type=ord)\n" -"parser.add_argument('source_file', type=open)\n" "parser.add_argument('dest_file', type=argparse.FileType('w', " "encoding='latin-1'))\n" "parser.add_argument('datapath', type=pathlib.Path)" -#: ../../library/argparse.rst:1176 +#: ../../library/argparse.rst:990 msgid "User defined functions can be used as well:" msgstr "" -#: ../../library/argparse.rst:1178 +#: ../../library/argparse.rst:992 msgid "" ">>> def hyphenated(string):\n" "... return '-'.join([word[:4] for word in string.casefold().split()])\n" @@ -2148,14 +1715,14 @@ msgstr "" ">>> parser.parse_args(['\"The Tale of Two Cities\"'])\n" "Namespace(short_title='\"the-tale-of-two-citi')" -#: ../../library/argparse.rst:1188 +#: ../../library/argparse.rst:1002 msgid "" "The :func:`bool` function is not recommended as a type converter. All it " "does is convert empty strings to ``False`` and non-empty strings to " "``True``. This is usually not what is desired." msgstr "" -#: ../../library/argparse.rst:1192 +#: ../../library/argparse.rst:1006 msgid "" "In general, the ``type`` keyword is a convenience that should only be used " "for simple conversions that can only raise one of the three supported " @@ -2163,7 +1730,7 @@ msgid "" "management should be done downstream after the arguments are parsed." msgstr "" -#: ../../library/argparse.rst:1197 +#: ../../library/argparse.rst:1011 msgid "" "For example, JSON or YAML conversions have complex error cases that require " "better reporting than can be given by the ``type`` keyword. A :exc:`~json." @@ -2171,26 +1738,27 @@ msgid "" "exception would not be handled at all." msgstr "" -#: ../../library/argparse.rst:1202 +#: ../../library/argparse.rst:1016 msgid "" "Even :class:`~argparse.FileType` has its limitations for use with the " -"``type`` keyword. If one argument uses *FileType* and then a subsequent " -"argument fails, an error is reported but the file is not automatically " -"closed. In this case, it would be better to wait until after the parser has " -"run and then use the :keyword:`with`-statement to manage the files." +"``type`` keyword. If one argument uses :class:`~argparse.FileType` and then " +"a subsequent argument fails, an error is reported but the file is not " +"automatically closed. In this case, it would be better to wait until after " +"the parser has run and then use the :keyword:`with`-statement to manage the " +"files." msgstr "" -#: ../../library/argparse.rst:1208 +#: ../../library/argparse.rst:1023 msgid "" "For type checkers that simply check against a fixed set of values, consider " "using the choices_ keyword instead." msgstr "" -#: ../../library/argparse.rst:1215 +#: ../../library/argparse.rst:1030 msgid "choices" msgstr "" -#: ../../library/argparse.rst:1217 +#: ../../library/argparse.rst:1032 msgid "" "Some command-line arguments should be selected from a restricted set of " "values. These can be handled by passing a sequence object as the *choices* " @@ -2199,7 +1767,7 @@ msgid "" "be displayed if the argument was not one of the acceptable values::" msgstr "" -#: ../../library/argparse.rst:1223 +#: ../../library/argparse.rst:1038 msgid "" ">>> parser = argparse.ArgumentParser(prog='game.py')\n" ">>> parser.add_argument('move', choices=['rock', 'paper', 'scissors'])\n" @@ -2219,44 +1787,26 @@ msgstr "" "game.py: error: argument move: invalid choice: 'fire' (choose from 'rock',\n" "'paper', 'scissors')" -#: ../../library/argparse.rst:1232 +#: ../../library/argparse.rst:1047 msgid "" "Note that inclusion in the *choices* sequence is checked after any type_ " "conversions have been performed, so the type of the objects in the *choices* " -"sequence should match the type_ specified::" +"sequence should match the type_ specified." msgstr "" -#: ../../library/argparse.rst:1236 -msgid "" -">>> parser = argparse.ArgumentParser(prog='doors.py')\n" -">>> parser.add_argument('door', type=int, choices=range(1, 4))\n" -">>> print(parser.parse_args(['3']))\n" -"Namespace(door=3)\n" -">>> parser.parse_args(['4'])\n" -"usage: doors.py [-h] {1,2,3}\n" -"doors.py: error: argument door: invalid choice: 4 (choose from 1, 2, 3)" -msgstr "" -">>> parser = argparse.ArgumentParser(prog='doors.py')\n" -">>> parser.add_argument('door', type=int, choices=range(1, 4))\n" -">>> print(parser.parse_args(['3']))\n" -"Namespace(door=3)\n" -">>> parser.parse_args(['4'])\n" -"usage: doors.py [-h] {1,2,3}\n" -"doors.py: error: argument door: invalid choice: 4 (choose from 1, 2, 3)" - -#: ../../library/argparse.rst:1244 +#: ../../library/argparse.rst:1051 msgid "" "Any sequence can be passed as the *choices* value, so :class:`list` " "objects, :class:`tuple` objects, and custom sequences are all supported." msgstr "" -#: ../../library/argparse.rst:1247 +#: ../../library/argparse.rst:1054 msgid "" "Use of :class:`enum.Enum` is not recommended because it is difficult to " "control its appearance in usage, help, and error messages." msgstr "" -#: ../../library/argparse.rst:1250 +#: ../../library/argparse.rst:1057 msgid "" "Formatted choices override the default *metavar* which is normally derived " "from *dest*. This is usually what you want because the user never sees the " @@ -2264,11 +1814,11 @@ msgid "" "are many choices), just specify an explicit metavar_." msgstr "" -#: ../../library/argparse.rst:1259 +#: ../../library/argparse.rst:1066 msgid "required" msgstr "" -#: ../../library/argparse.rst:1261 +#: ../../library/argparse.rst:1068 msgid "" "In general, the :mod:`argparse` module assumes that flags like ``-f`` and " "``--bar`` indicate *optional* arguments, which can always be omitted at the " @@ -2276,7 +1826,7 @@ msgid "" "the ``required=`` keyword argument to :meth:`~ArgumentParser.add_argument`::" msgstr "" -#: ../../library/argparse.rst:1266 +#: ../../library/argparse.rst:1073 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', required=True)\n" @@ -2294,64 +1844,32 @@ msgstr "" "usage: [-h] --foo FOO\n" ": error: the following arguments are required: --foo" -#: ../../library/argparse.rst:1274 +#: ../../library/argparse.rst:1081 msgid "" "As the example shows, if an option is marked as ``required``, :meth:" "`~ArgumentParser.parse_args` will report an error if that option is not " "present at the command line." msgstr "" -#: ../../library/argparse.rst:1280 +#: ../../library/argparse.rst:1087 msgid "" "Required options are generally considered bad form because users expect " "*options* to be *optional*, and thus they should be avoided when possible." msgstr "" -#: ../../library/argparse.rst:1287 +#: ../../library/argparse.rst:1094 msgid "help" msgstr "幫助" -#: ../../library/argparse.rst:1289 +#: ../../library/argparse.rst:1096 msgid "" "The ``help`` value is a string containing a brief description of the " "argument. When a user requests help (usually by using ``-h`` or ``--help`` " "at the command line), these ``help`` descriptions will be displayed with " -"each argument::" +"each argument." msgstr "" -#: ../../library/argparse.rst:1294 -msgid "" -">>> parser = argparse.ArgumentParser(prog='frobble')\n" -">>> parser.add_argument('--foo', action='store_true',\n" -"... help='foo the bars before frobbling')\n" -">>> parser.add_argument('bar', nargs='+',\n" -"... help='one of the bars to be frobbled')\n" -">>> parser.parse_args(['-h'])\n" -"usage: frobble [-h] [--foo] bar [bar ...]\n" -"\n" -"positional arguments:\n" -" bar one of the bars to be frobbled\n" -"\n" -"options:\n" -" -h, --help show this help message and exit\n" -" --foo foo the bars before frobbling" -msgstr "" -">>> parser = argparse.ArgumentParser(prog='frobble')\n" -">>> parser.add_argument('--foo', action='store_true',\n" -"... help='foo the bars before frobbling')\n" -">>> parser.add_argument('bar', nargs='+',\n" -"... help='one of the bars to be frobbled')\n" -">>> parser.parse_args(['-h'])\n" -"usage: frobble [-h] [--foo] bar [bar ...]\n" -"\n" -"positional arguments:\n" -" bar one of the bars to be frobbled\n" -"\n" -"options:\n" -" -h, --help show this help message and exit\n" -" --foo foo the bars before frobbling" - -#: ../../library/argparse.rst:1309 +#: ../../library/argparse.rst:1101 msgid "" "The ``help`` strings can include various format specifiers to avoid " "repetition of things like the program name or the argument default_. The " @@ -2360,7 +1878,7 @@ msgid "" "``%(type)s``, etc.::" msgstr "" -#: ../../library/argparse.rst:1314 +#: ../../library/argparse.rst:1106 msgid "" ">>> parser = argparse.ArgumentParser(prog='frobble')\n" ">>> parser.add_argument('bar', nargs='?', type=int, default=42,\n" @@ -2386,19 +1904,19 @@ msgstr "" "options:\n" " -h, --help show this help message and exit" -#: ../../library/argparse.rst:1326 +#: ../../library/argparse.rst:1118 msgid "" "As the help string supports %-formatting, if you want a literal ``%`` to " "appear in the help string, you must escape it as ``%%``." msgstr "" -#: ../../library/argparse.rst:1329 +#: ../../library/argparse.rst:1121 msgid "" ":mod:`argparse` supports silencing the help entry for certain options, by " "setting the ``help`` value to ``argparse.SUPPRESS``::" msgstr "" -#: ../../library/argparse.rst:1332 +#: ../../library/argparse.rst:1124 msgid "" ">>> parser = argparse.ArgumentParser(prog='frobble')\n" ">>> parser.add_argument('--foo', help=argparse.SUPPRESS)\n" @@ -2416,11 +1934,11 @@ msgstr "" "options:\n" " -h, --help show this help message and exit" -#: ../../library/argparse.rst:1344 +#: ../../library/argparse.rst:1136 msgid "metavar" msgstr "" -#: ../../library/argparse.rst:1346 +#: ../../library/argparse.rst:1138 msgid "" "When :class:`ArgumentParser` generates help messages, it needs some way to " "refer to each expected argument. By default, ArgumentParser objects use the " @@ -2432,7 +1950,7 @@ msgid "" "argument will be referred to as ``FOO``. An example::" msgstr "" -#: ../../library/argparse.rst:1355 +#: ../../library/argparse.rst:1147 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo')\n" @@ -2464,11 +1982,11 @@ msgstr "" " -h, --help show this help message and exit\n" " --foo FOO" -#: ../../library/argparse.rst:1370 +#: ../../library/argparse.rst:1162 msgid "An alternative name can be specified with ``metavar``::" msgstr "" -#: ../../library/argparse.rst:1372 +#: ../../library/argparse.rst:1164 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', metavar='YYY')\n" @@ -2500,21 +2018,21 @@ msgstr "" " -h, --help show this help message and exit\n" " --foo YYY" -#: ../../library/argparse.rst:1387 +#: ../../library/argparse.rst:1179 msgid "" "Note that ``metavar`` only changes the *displayed* name - the name of the " "attribute on the :meth:`~ArgumentParser.parse_args` object is still " "determined by the dest_ value." msgstr "" -#: ../../library/argparse.rst:1391 +#: ../../library/argparse.rst:1183 msgid "" "Different values of ``nargs`` may cause the metavar to be used multiple " "times. Providing a tuple to ``metavar`` specifies a different display for " "each of the arguments::" msgstr "" -#: ../../library/argparse.rst:1395 +#: ../../library/argparse.rst:1187 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x', nargs=2)\n" @@ -2538,11 +2056,11 @@ msgstr "" " -x X X\n" " --foo bar baz" -#: ../../library/argparse.rst:1410 +#: ../../library/argparse.rst:1202 msgid "dest" msgstr "" -#: ../../library/argparse.rst:1412 +#: ../../library/argparse.rst:1204 msgid "" "Most :class:`ArgumentParser` actions add some value as an attribute of the " "object returned by :meth:`~ArgumentParser.parse_args`. The name of this " @@ -2552,7 +2070,7 @@ msgid "" "add_argument`::" msgstr "" -#: ../../library/argparse.rst:1419 +#: ../../library/argparse.rst:1211 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('bar')\n" @@ -2564,7 +2082,7 @@ msgstr "" ">>> parser.parse_args(['XXX'])\n" "Namespace(bar='XXX')" -#: ../../library/argparse.rst:1424 +#: ../../library/argparse.rst:1216 msgid "" "For optional argument actions, the value of ``dest`` is normally inferred " "from the option strings. :class:`ArgumentParser` generates the value of " @@ -2576,7 +2094,7 @@ msgid "" "below illustrate this behavior::" msgstr "" -#: ../../library/argparse.rst:1433 +#: ../../library/argparse.rst:1225 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('-f', '--foo-bar', '--foo')\n" @@ -2594,11 +2112,11 @@ msgstr "" ">>> parser.parse_args('--foo 1 -y 2'.split())\n" "Namespace(foo_bar='1', x='2')" -#: ../../library/argparse.rst:1441 +#: ../../library/argparse.rst:1233 msgid "``dest`` allows a custom attribute name to be provided::" msgstr "" -#: ../../library/argparse.rst:1443 +#: ../../library/argparse.rst:1235 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', dest='bar')\n" @@ -2610,11 +2128,11 @@ msgstr "" ">>> parser.parse_args('--foo XXX'.split())\n" "Namespace(bar='XXX')" -#: ../../library/argparse.rst:1452 +#: ../../library/argparse.rst:1244 msgid "deprecated" msgstr "" -#: ../../library/argparse.rst:1454 +#: ../../library/argparse.rst:1246 msgid "" "During a project's lifetime, some arguments may need to be removed from the " "command line. Before removing them, you should inform your users that the " @@ -2625,8 +2143,7 @@ msgid "" "will be printed to :data:`sys.stderr` when the argument is used::" msgstr "" -#: ../../library/argparse.rst:1464 -#, fuzzy +#: ../../library/argparse.rst:1256 msgid "" ">>> import argparse\n" ">>> parser = argparse.ArgumentParser(prog='snake.py')\n" @@ -2637,18 +2154,20 @@ msgid "" "snake.py: warning: option '--legs' is deprecated\n" "Namespace(legs=4)" msgstr "" -">>> parser = argparse.ArgumentParser()\n" -">>> parser.add_argument('--foo', default=argparse.SUPPRESS)\n" +">>> import argparse\n" +">>> parser = argparse.ArgumentParser(prog='snake.py')\n" +">>> parser.add_argument('--legs', default=0, type=int, deprecated=True)\n" ">>> parser.parse_args([])\n" -"Namespace()\n" -">>> parser.parse_args(['--foo', '1'])\n" -"Namespace(foo='1')" +"Namespace(legs=0)\n" +">>> parser.parse_args(['--legs', '4']) \n" +"snake.py: warning: option '--legs' is deprecated\n" +"Namespace(legs=4)" -#: ../../library/argparse.rst:1477 +#: ../../library/argparse.rst:1269 msgid "Action classes" msgstr "" -#: ../../library/argparse.rst:1479 +#: ../../library/argparse.rst:1271 msgid "" "Action classes implement the Action API, a callable which returns a callable " "which processes arguments from the command-line. Any object which follows " @@ -2656,7 +2175,7 @@ msgid "" "add_argument`." msgstr "" -#: ../../library/argparse.rst:1488 +#: ../../library/argparse.rst:1280 msgid "" "Action objects are used by an ArgumentParser to represent the information " "needed to parse a single argument from one or more strings from the command " @@ -2665,7 +2184,7 @@ msgid "" "the ``action`` itself." msgstr "" -#: ../../library/argparse.rst:1494 +#: ../../library/argparse.rst:1286 msgid "" "Instances of Action (or return value of any callable to the ``action`` " "parameter) should have attributes \"dest\", \"option_strings\", \"default\", " @@ -2673,91 +2192,102 @@ msgid "" "these attributes are defined is to call ``Action.__init__``." msgstr "" -#: ../../library/argparse.rst:1499 +#: ../../library/argparse.rst:1291 msgid "" "Action instances should be callable, so subclasses must override the " "``__call__`` method, which should accept four parameters:" msgstr "" -#: ../../library/argparse.rst:1502 -msgid "``parser`` - The ArgumentParser object which contains this action." +#: ../../library/argparse.rst:1294 +msgid "*parser* - The ArgumentParser object which contains this action." +msgstr "" + +#: ../../library/argparse.rst:1296 +msgid "*namespace* - The :class:`Namespace` object that will be returned by" +msgstr "" + +#: ../../library/argparse.rst:1297 +msgid "" +":meth:`~ArgumentParser.parse_args`. Most actions add an attribute to this " +"object using :func:`setattr`." msgstr "" -#: ../../library/argparse.rst:1504 +#: ../../library/argparse.rst:1300 msgid "" -"``namespace`` - The :class:`Namespace` object that will be returned by :meth:" -"`~ArgumentParser.parse_args`. Most actions add an attribute to this object " -"using :func:`setattr`." +"*values* - The associated command-line arguments, with any type conversions" msgstr "" -#: ../../library/argparse.rst:1508 +#: ../../library/argparse.rst:1301 msgid "" -"``values`` - The associated command-line arguments, with any type " -"conversions applied. Type conversions are specified with the type_ keyword " -"argument to :meth:`~ArgumentParser.add_argument`." +"applied. Type conversions are specified with the type_ keyword argument to :" +"meth:`~ArgumentParser.add_argument`." msgstr "" -#: ../../library/argparse.rst:1512 +#: ../../library/argparse.rst:1304 +msgid "" +"*option_string* - The option string that was used to invoke this action." +msgstr "" + +#: ../../library/argparse.rst:1305 msgid "" -"``option_string`` - The option string that was used to invoke this action. " "The ``option_string`` argument is optional, and will be absent if the action " "is associated with a positional argument." msgstr "" -#: ../../library/argparse.rst:1516 +#: ../../library/argparse.rst:1308 msgid "" "The ``__call__`` method may perform arbitrary actions, but will typically " "set attributes on the ``namespace`` based on ``dest`` and ``values``." msgstr "" -#: ../../library/argparse.rst:1519 +#: ../../library/argparse.rst:1311 msgid "" "Action subclasses can define a ``format_usage`` method that takes no " "argument and return a string which will be used when printing the usage of " "the program. If such method is not provided, a sensible default will be used." msgstr "" -#: ../../library/argparse.rst:1524 +#: ../../library/argparse.rst:1317 msgid "The parse_args() method" msgstr "" -#: ../../library/argparse.rst:1528 +#: ../../library/argparse.rst:1321 msgid "" "Convert argument strings to objects and assign them as attributes of the " "namespace. Return the populated namespace." msgstr "" -#: ../../library/argparse.rst:1531 +#: ../../library/argparse.rst:1324 msgid "" "Previous calls to :meth:`add_argument` determine exactly what objects are " "created and how they are assigned. See the documentation for :meth:" "`add_argument` for details." msgstr "" -#: ../../library/argparse.rst:1535 +#: ../../library/argparse.rst:1328 msgid "" "args_ - List of strings to parse. The default is taken from :data:`sys." "argv`." msgstr "" -#: ../../library/argparse.rst:1538 +#: ../../library/argparse.rst:1331 msgid "" "namespace_ - An object to take the attributes. The default is a new empty :" "class:`Namespace` object." msgstr "" -#: ../../library/argparse.rst:1543 +#: ../../library/argparse.rst:1336 msgid "Option value syntax" msgstr "" -#: ../../library/argparse.rst:1545 +#: ../../library/argparse.rst:1338 msgid "" "The :meth:`~ArgumentParser.parse_args` method supports several ways of " "specifying the value of an option (if it takes one). In the simplest case, " "the option and its value are passed as two separate arguments::" msgstr "" -#: ../../library/argparse.rst:1549 +#: ../../library/argparse.rst:1342 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x')\n" @@ -2775,14 +2305,14 @@ msgstr "" ">>> parser.parse_args(['--foo', 'FOO'])\n" "Namespace(foo='FOO', x=None)" -#: ../../library/argparse.rst:1557 +#: ../../library/argparse.rst:1350 msgid "" "For long options (options with names longer than a single character), the " "option and value can also be passed as a single command-line argument, using " "``=`` to separate them::" msgstr "" -#: ../../library/argparse.rst:1561 +#: ../../library/argparse.rst:1354 msgid "" ">>> parser.parse_args(['--foo=FOO'])\n" "Namespace(foo='FOO', x=None)" @@ -2790,13 +2320,13 @@ msgstr "" ">>> parser.parse_args(['--foo=FOO'])\n" "Namespace(foo='FOO', x=None)" -#: ../../library/argparse.rst:1564 +#: ../../library/argparse.rst:1357 msgid "" "For short options (options only one character long), the option and its " "value can be concatenated::" msgstr "" -#: ../../library/argparse.rst:1567 +#: ../../library/argparse.rst:1360 msgid "" ">>> parser.parse_args(['-xX'])\n" "Namespace(foo=None, x='X')" @@ -2804,13 +2334,13 @@ msgstr "" ">>> parser.parse_args(['-xX'])\n" "Namespace(foo=None, x='X')" -#: ../../library/argparse.rst:1570 +#: ../../library/argparse.rst:1363 msgid "" "Several short options can be joined together, using only a single ``-`` " "prefix, as long as only the last option (or none of them) requires a value::" msgstr "" -#: ../../library/argparse.rst:1573 +#: ../../library/argparse.rst:1366 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x', action='store_true')\n" @@ -2826,11 +2356,11 @@ msgstr "" ">>> parser.parse_args(['-xyzZ'])\n" "Namespace(x=True, y=True, z='Z')" -#: ../../library/argparse.rst:1582 +#: ../../library/argparse.rst:1375 msgid "Invalid arguments" msgstr "" -#: ../../library/argparse.rst:1584 +#: ../../library/argparse.rst:1377 msgid "" "While parsing the command line, :meth:`~ArgumentParser.parse_args` checks " "for a variety of errors, including ambiguous options, invalid types, invalid " @@ -2838,7 +2368,7 @@ msgid "" "an error, it exits and prints the error along with a usage message::" msgstr "" -#: ../../library/argparse.rst:1589 +#: ../../library/argparse.rst:1382 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('--foo', type=int)\n" @@ -2860,11 +2390,11 @@ msgid "" "PROG: error: extra arguments found: badger" msgstr "" -#: ../../library/argparse.rst:1610 +#: ../../library/argparse.rst:1403 msgid "Arguments containing ``-``" msgstr "" -#: ../../library/argparse.rst:1612 +#: ../../library/argparse.rst:1405 msgid "" "The :meth:`~ArgumentParser.parse_args` method attempts to give errors " "whenever the user has clearly made a mistake, but some situations are " @@ -2876,7 +2406,7 @@ msgid "" "negative numbers::" msgstr "" -#: ../../library/argparse.rst:1620 +#: ../../library/argparse.rst:1413 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x')\n" @@ -2909,7 +2439,7 @@ msgid "" "PROG: error: argument -1: expected one argument" msgstr "" -#: ../../library/argparse.rst:1650 +#: ../../library/argparse.rst:1443 msgid "" "If you have positional arguments that must begin with ``-`` and don't look " "like negative numbers, you can insert the pseudo-argument ``'--'`` which " @@ -2917,7 +2447,7 @@ msgid "" "positional argument::" msgstr "" -#: ../../library/argparse.rst:1655 +#: ../../library/argparse.rst:1448 msgid "" ">>> parser.parse_args(['--', '-f'])\n" "Namespace(foo='-f', one=None)" @@ -2925,24 +2455,24 @@ msgstr "" ">>> parser.parse_args(['--', '-f'])\n" "Namespace(foo='-f', one=None)" -#: ../../library/argparse.rst:1658 +#: ../../library/argparse.rst:1451 msgid "" "See also :ref:`the argparse howto on ambiguous arguments ` for more details." msgstr "" -#: ../../library/argparse.rst:1664 +#: ../../library/argparse.rst:1457 msgid "Argument abbreviations (prefix matching)" msgstr "" -#: ../../library/argparse.rst:1666 +#: ../../library/argparse.rst:1459 msgid "" "The :meth:`~ArgumentParser.parse_args` method :ref:`by default " "` allows long options to be abbreviated to a prefix, if the " "abbreviation is unambiguous (the prefix matches a unique option)::" msgstr "" -#: ../../library/argparse.rst:1670 +#: ../../library/argparse.rst:1463 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-bacon')\n" @@ -2966,17 +2496,17 @@ msgstr "" "usage: PROG [-h] [-bacon BACON] [-badger BADGER]\n" "PROG: error: ambiguous option: -ba could match -badger, -bacon" -#: ../../library/argparse.rst:1681 +#: ../../library/argparse.rst:1474 msgid "" "An error is produced for arguments that could produce more than one options. " "This feature can be disabled by setting :ref:`allow_abbrev` to ``False``." msgstr "" -#: ../../library/argparse.rst:1687 +#: ../../library/argparse.rst:1480 msgid "Beyond ``sys.argv``" msgstr "" -#: ../../library/argparse.rst:1689 +#: ../../library/argparse.rst:1482 msgid "" "Sometimes it may be useful to have an ArgumentParser parse arguments other " "than those of :data:`sys.argv`. This can be accomplished by passing a list " @@ -2984,7 +2514,7 @@ msgid "" "testing at the interactive prompt::" msgstr "" -#: ../../library/argparse.rst:1694 +#: ../../library/argparse.rst:1487 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument(\n" @@ -3010,24 +2540,24 @@ msgstr "" ">>> parser.parse_args(['1', '2', '3', '4', '--sum'])\n" "Namespace(accumulate=, integers=[1, 2, 3, 4])" -#: ../../library/argparse.rst:1709 +#: ../../library/argparse.rst:1502 msgid "The Namespace object" msgstr "" -#: ../../library/argparse.rst:1713 +#: ../../library/argparse.rst:1506 msgid "" "Simple class used by default by :meth:`~ArgumentParser.parse_args` to create " "an object holding attributes and return it." msgstr "" -#: ../../library/argparse.rst:1716 +#: ../../library/argparse.rst:1509 msgid "" "This class is deliberately simple, just an :class:`object` subclass with a " "readable string representation. If you prefer to have dict-like view of the " "attributes, you can use the standard Python idiom, :func:`vars`::" msgstr "" -#: ../../library/argparse.rst:1720 +#: ../../library/argparse.rst:1513 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo')\n" @@ -3041,14 +2571,14 @@ msgstr "" ">>> vars(args)\n" "{'foo': 'BAR'}" -#: ../../library/argparse.rst:1726 +#: ../../library/argparse.rst:1519 msgid "" "It may also be useful to have an :class:`ArgumentParser` assign attributes " "to an already existing object, rather than a new :class:`Namespace` object. " "This can be achieved by specifying the ``namespace=`` keyword argument::" msgstr "" -#: ../../library/argparse.rst:1730 +#: ../../library/argparse.rst:1523 msgid "" ">>> class C:\n" "... pass\n" @@ -3070,98 +2600,97 @@ msgstr "" ">>> c.foo\n" "'BAR'" -#: ../../library/argparse.rst:1742 +#: ../../library/argparse.rst:1535 msgid "Other utilities" msgstr "" -#: ../../library/argparse.rst:1745 +#: ../../library/argparse.rst:1538 msgid "Sub-commands" msgstr "" -#: ../../library/argparse.rst:1752 +#: ../../library/argparse.rst:1545 msgid "" -"Many programs split up their functionality into a number of sub-commands, " -"for example, the ``svn`` program can invoke sub-commands like ``svn " -"checkout``, ``svn update``, and ``svn commit``. Splitting up functionality " -"this way can be a particularly good idea when a program performs several " -"different functions which require different kinds of command-line " -"arguments. :class:`ArgumentParser` supports the creation of such sub-" -"commands with the :meth:`add_subparsers` method. The :meth:`add_subparsers` " -"method is normally called with no arguments and returns a special action " -"object. This object has a single method, :meth:`~_SubParsersAction." -"add_parser`, which takes a command name and any :class:`ArgumentParser` " -"constructor arguments, and returns an :class:`ArgumentParser` object that " -"can be modified as usual." +"Many programs split up their functionality into a number of subcommands, for " +"example, the ``svn`` program can invoke subcommands like ``svn checkout``, " +"``svn update``, and ``svn commit``. Splitting up functionality this way can " +"be a particularly good idea when a program performs several different " +"functions which require different kinds of command-line arguments. :class:" +"`ArgumentParser` supports the creation of such subcommands with the :meth:" +"`add_subparsers` method. The :meth:`add_subparsers` method is normally " +"called with no arguments and returns a special action object. This object " +"has a single method, :meth:`~_SubParsersAction.add_parser`, which takes a " +"command name and any :class:`ArgumentParser` constructor arguments, and " +"returns an :class:`ArgumentParser` object that can be modified as usual." msgstr "" -#: ../../library/argparse.rst:1764 +#: ../../library/argparse.rst:1557 msgid "Description of parameters:" msgstr "" -#: ../../library/argparse.rst:1766 +#: ../../library/argparse.rst:1559 msgid "" -"title - title for the sub-parser group in help output; by default " +"*title* - title for the sub-parser group in help output; by default " "\"subcommands\" if description is provided, otherwise uses title for " "positional arguments" msgstr "" -#: ../../library/argparse.rst:1770 +#: ../../library/argparse.rst:1563 msgid "" -"description - description for the sub-parser group in help output, by " +"*description* - description for the sub-parser group in help output, by " "default ``None``" msgstr "" -#: ../../library/argparse.rst:1773 +#: ../../library/argparse.rst:1566 msgid "" -"prog - usage information that will be displayed with sub-command help, by " +"*prog* - usage information that will be displayed with sub-command help, by " "default the name of the program and any positional arguments before the " "subparser argument" msgstr "" -#: ../../library/argparse.rst:1777 +#: ../../library/argparse.rst:1570 msgid "" -"parser_class - class which will be used to create sub-parser instances, by " +"*parser_class* - class which will be used to create sub-parser instances, by " "default the class of the current parser (e.g. ArgumentParser)" msgstr "" -#: ../../library/argparse.rst:1780 +#: ../../library/argparse.rst:1573 msgid "" "action_ - the basic type of action to be taken when this argument is " "encountered at the command line" msgstr "" -#: ../../library/argparse.rst:1783 +#: ../../library/argparse.rst:1576 msgid "" "dest_ - name of the attribute under which sub-command name will be stored; " "by default ``None`` and no value is stored" msgstr "" -#: ../../library/argparse.rst:1786 +#: ../../library/argparse.rst:1579 msgid "" "required_ - Whether or not a subcommand must be provided, by default " "``False`` (added in 3.7)" msgstr "" -#: ../../library/argparse.rst:1789 +#: ../../library/argparse.rst:1582 msgid "help_ - help for sub-parser group in help output, by default ``None``" msgstr "" -#: ../../library/argparse.rst:1791 +#: ../../library/argparse.rst:1584 msgid "" -"metavar_ - string presenting available sub-commands in help; by default it " -"is ``None`` and presents sub-commands in form {cmd1, cmd2, ..}" +"metavar_ - string presenting available subcommands in help; by default it is " +"``None`` and presents subcommands in form {cmd1, cmd2, ..}" msgstr "" -#: ../../library/argparse.rst:1794 +#: ../../library/argparse.rst:1587 msgid "Some example usage::" msgstr "一些使用範例: ::" -#: ../../library/argparse.rst:1796 +#: ../../library/argparse.rst:1589 msgid "" ">>> # create the top-level parser\n" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('--foo', action='store_true', help='foo help')\n" -">>> subparsers = parser.add_subparsers(help='sub-command help')\n" +">>> subparsers = parser.add_subparsers(help='subcommand help')\n" ">>>\n" ">>> # create the parser for the \"a\" command\n" ">>> parser_a = subparsers.add_parser('a', help='a help')\n" @@ -3169,7 +2698,8 @@ msgid "" ">>>\n" ">>> # create the parser for the \"b\" command\n" ">>> parser_b = subparsers.add_parser('b', help='b help')\n" -">>> parser_b.add_argument('--baz', choices='XYZ', help='baz help')\n" +">>> parser_b.add_argument('--baz', choices=('X', 'Y', 'Z'), help='baz " +"help')\n" ">>>\n" ">>> # parse some argument lists\n" ">>> parser.parse_args(['a', '12'])\n" @@ -3178,7 +2708,7 @@ msgid "" "Namespace(baz='Z', foo=True)" msgstr "" -#: ../../library/argparse.rst:1815 +#: ../../library/argparse.rst:1608 msgid "" "Note that the object returned by :meth:`parse_args` will only contain " "attributes for the main parser and the subparser that was selected by the " @@ -3188,7 +2718,7 @@ msgid "" "``baz`` attributes are present." msgstr "" -#: ../../library/argparse.rst:1822 +#: ../../library/argparse.rst:1615 msgid "" "Similarly, when a help message is requested from a subparser, only the help " "for that particular parser will be printed. The help message will not " @@ -3197,13 +2727,13 @@ msgid "" "to :meth:`~_SubParsersAction.add_parser` as above.)" msgstr "" -#: ../../library/argparse.rst:1830 +#: ../../library/argparse.rst:1623 msgid "" ">>> parser.parse_args(['--help'])\n" "usage: PROG [-h] [--foo] {a,b} ...\n" "\n" "positional arguments:\n" -" {a,b} sub-command help\n" +" {a,b} subcommand help\n" " a a help\n" " b b help\n" "\n" @@ -3231,7 +2761,7 @@ msgstr "" "usage: PROG [-h] [--foo] {a,b} ...\n" "\n" "positional arguments:\n" -" {a,b} sub-command help\n" +" {a,b} subcommand help\n" " a a help\n" " b b help\n" "\n" @@ -3255,14 +2785,14 @@ msgstr "" " -h, --help show this help message and exit\n" " --baz {X,Y,Z} baz help" -#: ../../library/argparse.rst:1858 +#: ../../library/argparse.rst:1651 msgid "" "The :meth:`add_subparsers` method also supports ``title`` and " "``description`` keyword arguments. When either is present, the subparser's " "commands will appear in their own group in the help output. For example::" msgstr "" -#: ../../library/argparse.rst:1862 +#: ../../library/argparse.rst:1655 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> subparsers = parser.add_subparsers(title='subcommands',\n" @@ -3298,7 +2828,7 @@ msgstr "" "\n" " {foo,bar} additional help" -#: ../../library/argparse.rst:1879 +#: ../../library/argparse.rst:1672 msgid "" "Furthermore, :meth:`~_SubParsersAction.add_parser` supports an additional " "*aliases* argument, which allows multiple strings to refer to the same " @@ -3306,7 +2836,7 @@ msgid "" "``checkout``::" msgstr "" -#: ../../library/argparse.rst:1884 +#: ../../library/argparse.rst:1677 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> subparsers = parser.add_subparsers()\n" @@ -3322,23 +2852,23 @@ msgstr "" ">>> parser.parse_args(['co', 'bar'])\n" "Namespace(foo='bar')" -#: ../../library/argparse.rst:1891 +#: ../../library/argparse.rst:1684 msgid "" ":meth:`~_SubParsersAction.add_parser` supports also an additional " "*deprecated* argument, which allows to deprecate the subparser." msgstr "" -#: ../../library/argparse.rst:1905 +#: ../../library/argparse.rst:1698 msgid "" -"One particularly effective way of handling sub-commands is to combine the " -"use of the :meth:`add_subparsers` method with calls to :meth:`set_defaults` " -"so that each subparser knows which Python function it should execute. For " +"One particularly effective way of handling subcommands is to combine the use " +"of the :meth:`add_subparsers` method with calls to :meth:`set_defaults` so " +"that each subparser knows which Python function it should execute. For " "example::" msgstr "" -#: ../../library/argparse.rst:1910 +#: ../../library/argparse.rst:1703 msgid "" -">>> # sub-command functions\n" +">>> # subcommand functions\n" ">>> def foo(args):\n" "... print(args.x * args.y)\n" "...\n" @@ -3371,7 +2901,7 @@ msgid "" "((XYZYX))" msgstr "" -#: ../../library/argparse.rst:1942 +#: ../../library/argparse.rst:1735 msgid "" "This way, you can let :meth:`parse_args` do the job of calling the " "appropriate function after argument parsing is complete. Associating " @@ -3381,7 +2911,7 @@ msgid "" "argument to the :meth:`add_subparsers` call will work::" msgstr "" -#: ../../library/argparse.rst:1949 +#: ../../library/argparse.rst:1742 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> subparsers = parser.add_subparsers(dest='subparser_name')\n" @@ -3401,15 +2931,15 @@ msgstr "" ">>> parser.parse_args(['2', 'frobble'])\n" "Namespace(subparser_name='2', y='frobble')" -#: ../../library/argparse.rst:1958 +#: ../../library/argparse.rst:1751 msgid "New *required* keyword argument." msgstr "" -#: ../../library/argparse.rst:1963 +#: ../../library/argparse.rst:1756 msgid "FileType objects" msgstr "FileType 物件" -#: ../../library/argparse.rst:1967 +#: ../../library/argparse.rst:1760 msgid "" "The :class:`FileType` factory creates objects that can be passed to the type " "argument of :meth:`ArgumentParser.add_argument`. Arguments that have :class:" @@ -3418,7 +2948,7 @@ msgid "" "the :func:`open` function for more details)::" msgstr "" -#: ../../library/argparse.rst:1973 +#: ../../library/argparse.rst:1766 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--raw', type=argparse.FileType('wb', 0))\n" @@ -3436,14 +2966,14 @@ msgstr "" "Namespace(out=<_io.TextIOWrapper name='file.txt' mode='w' encoding='UTF-8'>, " "raw=<_io.FileIO name='raw.dat' mode='wb'>)" -#: ../../library/argparse.rst:1979 +#: ../../library/argparse.rst:1772 msgid "" "FileType objects understand the pseudo-argument ``'-'`` and automatically " "convert this into :data:`sys.stdin` for readable :class:`FileType` objects " "and :data:`sys.stdout` for writable :class:`FileType` objects::" msgstr "" -#: ../../library/argparse.rst:1983 +#: ../../library/argparse.rst:1776 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('infile', type=argparse.FileType('r'))\n" @@ -3455,15 +2985,15 @@ msgstr "" ">>> parser.parse_args(['-'])\n" "Namespace(infile=<_io.TextIOWrapper name='' encoding='UTF-8'>)" -#: ../../library/argparse.rst:1988 +#: ../../library/argparse.rst:1781 msgid "Added the *encodings* and *errors* parameters." msgstr "" -#: ../../library/argparse.rst:1993 +#: ../../library/argparse.rst:1786 msgid "Argument groups" msgstr "" -#: ../../library/argparse.rst:1997 +#: ../../library/argparse.rst:1791 msgid "" "By default, :class:`ArgumentParser` groups command-line arguments into " "\"positional arguments\" and \"options\" when displaying help messages. When " @@ -3472,7 +3002,7 @@ msgid "" "method::" msgstr "" -#: ../../library/argparse.rst:2003 +#: ../../library/argparse.rst:1797 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" ">>> group = parser.add_argument_group('group')\n" @@ -3496,7 +3026,7 @@ msgstr "" " bar bar help\n" " --foo FOO foo help" -#: ../../library/argparse.rst:2014 +#: ../../library/argparse.rst:1808 msgid "" "The :meth:`add_argument_group` method returns an argument group object which " "has an :meth:`~ArgumentParser.add_argument` method just like a regular :" @@ -3507,7 +3037,7 @@ msgid "" "this display::" msgstr "" -#: ../../library/argparse.rst:2022 +#: ../../library/argparse.rst:1816 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" ">>> group1 = parser.add_argument_group('group1', 'group1 description')\n" @@ -3545,13 +3075,22 @@ msgstr "" "\n" " --bar BAR bar help" -#: ../../library/argparse.rst:2040 +#: ../../library/argparse.rst:1834 +msgid "" +"The optional, keyword-only parameters argument_default_ and " +"conflict_handler_ allow for finer-grained control of the behavior of the " +"argument group. These parameters have the same meaning as in the :class:" +"`ArgumentParser` constructor, but apply specifically to the argument group " +"rather than the entire parser." +msgstr "" + +#: ../../library/argparse.rst:1839 msgid "" "Note that any arguments not in your user-defined groups will end up back in " "the usual \"positional arguments\" and \"optional arguments\" sections." msgstr "" -#: ../../library/argparse.rst:2043 +#: ../../library/argparse.rst:1842 msgid "" "Calling :meth:`add_argument_group` on an argument group is deprecated. This " "feature was never supported and does not always work correctly. The function " @@ -3559,18 +3098,18 @@ msgid "" "future." msgstr "" -#: ../../library/argparse.rst:2051 +#: ../../library/argparse.rst:1850 msgid "Mutual exclusion" msgstr "" -#: ../../library/argparse.rst:2055 +#: ../../library/argparse.rst:1854 msgid "" "Create a mutually exclusive group. :mod:`argparse` will make sure that only " "one of the arguments in the mutually exclusive group was present on the " "command line::" msgstr "" -#: ../../library/argparse.rst:2059 +#: ../../library/argparse.rst:1858 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> group = parser.add_mutually_exclusive_group()\n" @@ -3596,14 +3135,14 @@ msgstr "" "usage: PROG [-h] [--foo | --bar]\n" "PROG: error: argument --bar: not allowed with argument --foo" -#: ../../library/argparse.rst:2071 +#: ../../library/argparse.rst:1870 msgid "" "The :meth:`add_mutually_exclusive_group` method also accepts a *required* " "argument, to indicate that at least one of the mutually exclusive arguments " "is required::" msgstr "" -#: ../../library/argparse.rst:2075 +#: ../../library/argparse.rst:1874 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> group = parser.add_mutually_exclusive_group(required=True)\n" @@ -3621,7 +3160,7 @@ msgstr "" "usage: PROG [-h] (--foo | --bar)\n" "PROG: error: one of the arguments --foo --bar is required" -#: ../../library/argparse.rst:2083 +#: ../../library/argparse.rst:1882 msgid "" "Note that currently mutually exclusive argument groups do not support the " "*title* and *description* arguments of :meth:`~ArgumentParser." @@ -3629,7 +3168,7 @@ msgid "" "argument group that has a title and description. For example::" msgstr "" -#: ../../library/argparse.rst:2089 +#: ../../library/argparse.rst:1888 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> group = parser.add_argument_group('Group title', 'Group description')\n" @@ -3665,7 +3204,7 @@ msgstr "" " --foo FOO foo help\n" " --bar BAR bar help" -#: ../../library/argparse.rst:2106 +#: ../../library/argparse.rst:1905 msgid "" "Calling :meth:`add_argument_group` or :meth:`add_mutually_exclusive_group` " "on a mutually exclusive group is deprecated. These features were never " @@ -3673,11 +3212,11 @@ msgid "" "by accident through inheritance and will be removed in the future." msgstr "" -#: ../../library/argparse.rst:2114 +#: ../../library/argparse.rst:1913 msgid "Parser defaults" msgstr "" -#: ../../library/argparse.rst:2118 +#: ../../library/argparse.rst:1917 msgid "" "Most of the time, the attributes of the object returned by :meth:" "`parse_args` will be fully determined by inspecting the command-line " @@ -3686,7 +3225,7 @@ msgid "" "command line to be added::" msgstr "" -#: ../../library/argparse.rst:2124 +#: ../../library/argparse.rst:1923 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('foo', type=int)\n" @@ -3700,12 +3239,12 @@ msgstr "" ">>> parser.parse_args(['736'])\n" "Namespace(bar=42, baz='badger', foo=736)" -#: ../../library/argparse.rst:2130 +#: ../../library/argparse.rst:1929 msgid "" "Note that parser-level defaults always override argument-level defaults::" msgstr "" -#: ../../library/argparse.rst:2132 +#: ../../library/argparse.rst:1931 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default='bar')\n" @@ -3719,20 +3258,20 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace(foo='spam')" -#: ../../library/argparse.rst:2138 +#: ../../library/argparse.rst:1937 msgid "" "Parser-level defaults can be particularly useful when working with multiple " "parsers. See the :meth:`~ArgumentParser.add_subparsers` method for an " "example of this type." msgstr "" -#: ../../library/argparse.rst:2144 +#: ../../library/argparse.rst:1943 msgid "" "Get the default value for a namespace attribute, as set by either :meth:" "`~ArgumentParser.add_argument` or by :meth:`~ArgumentParser.set_defaults`::" msgstr "" -#: ../../library/argparse.rst:2148 +#: ../../library/argparse.rst:1947 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default='badger')\n" @@ -3744,54 +3283,54 @@ msgstr "" ">>> parser.get_default('foo')\n" "'badger'" -#: ../../library/argparse.rst:2155 +#: ../../library/argparse.rst:1954 msgid "Printing help" msgstr "" -#: ../../library/argparse.rst:2157 +#: ../../library/argparse.rst:1956 msgid "" "In most typical applications, :meth:`~ArgumentParser.parse_args` will take " "care of formatting and printing any usage or error messages. However, " "several formatting methods are available:" msgstr "" -#: ../../library/argparse.rst:2163 +#: ../../library/argparse.rst:1962 msgid "" "Print a brief description of how the :class:`ArgumentParser` should be " "invoked on the command line. If *file* is ``None``, :data:`sys.stdout` is " "assumed." msgstr "" -#: ../../library/argparse.rst:2169 +#: ../../library/argparse.rst:1968 msgid "" "Print a help message, including the program usage and information about the " "arguments registered with the :class:`ArgumentParser`. If *file* is " "``None``, :data:`sys.stdout` is assumed." msgstr "" -#: ../../library/argparse.rst:2173 +#: ../../library/argparse.rst:1972 msgid "" "There are also variants of these methods that simply return a string instead " "of printing it:" msgstr "" -#: ../../library/argparse.rst:2178 +#: ../../library/argparse.rst:1977 msgid "" "Return a string containing a brief description of how the :class:" "`ArgumentParser` should be invoked on the command line." msgstr "" -#: ../../library/argparse.rst:2183 +#: ../../library/argparse.rst:1982 msgid "" "Return a string containing a help message, including the program usage and " "information about the arguments registered with the :class:`ArgumentParser`." msgstr "" -#: ../../library/argparse.rst:2188 +#: ../../library/argparse.rst:1987 msgid "Partial parsing" msgstr "" -#: ../../library/argparse.rst:2192 +#: ../../library/argparse.rst:1991 msgid "" "Sometimes a script may only parse a few of the command-line arguments, " "passing the remaining arguments on to another script or program. In these " @@ -3802,7 +3341,7 @@ msgid "" "remaining argument strings." msgstr "" -#: ../../library/argparse.rst:2201 +#: ../../library/argparse.rst:2000 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', action='store_true')\n" @@ -3816,7 +3355,7 @@ msgstr "" ">>> parser.parse_known_args(['--foo', '--badger', 'BAR', 'spam'])\n" "(Namespace(bar='BAR', foo=True), ['--badger', 'spam'])" -#: ../../library/argparse.rst:2208 +#: ../../library/argparse.rst:2007 msgid "" ":ref:`Prefix matching ` rules apply to :meth:" "`~ArgumentParser.parse_known_args`. The parser may consume an option even if " @@ -3824,11 +3363,11 @@ msgid "" "remaining arguments list." msgstr "" -#: ../../library/argparse.rst:2215 +#: ../../library/argparse.rst:2014 msgid "Customizing file parsing" msgstr "" -#: ../../library/argparse.rst:2219 +#: ../../library/argparse.rst:2018 msgid "" "Arguments that are read from a file (see the *fromfile_prefix_chars* keyword " "argument to the :class:`ArgumentParser` constructor) are read one argument " @@ -3836,20 +3375,20 @@ msgid "" "reading." msgstr "" -#: ../../library/argparse.rst:2224 +#: ../../library/argparse.rst:2023 msgid "" "This method takes a single argument *arg_line* which is a string read from " "the argument file. It returns a list of arguments parsed from this string. " "The method is called once per line read from the argument file, in order." msgstr "" -#: ../../library/argparse.rst:2228 +#: ../../library/argparse.rst:2027 msgid "" "A useful override of this method is one that treats each space-separated " "word as an argument. The following example demonstrates how to do this::" msgstr "" -#: ../../library/argparse.rst:2231 +#: ../../library/argparse.rst:2030 msgid "" "class MyArgumentParser(argparse.ArgumentParser):\n" " def convert_arg_line_to_args(self, arg_line):\n" @@ -3859,18 +3398,18 @@ msgstr "" " def convert_arg_line_to_args(self, arg_line):\n" " return arg_line.split()" -#: ../../library/argparse.rst:2237 +#: ../../library/argparse.rst:2036 msgid "Exiting methods" msgstr "" -#: ../../library/argparse.rst:2241 +#: ../../library/argparse.rst:2040 msgid "" "This method terminates the program, exiting with the specified *status* and, " "if given, it prints a *message* to :data:`sys.stderr` before that. The user " "can override this method to handle these steps differently::" msgstr "" -#: ../../library/argparse.rst:2245 +#: ../../library/argparse.rst:2044 msgid "" "class ErrorCatchingArgumentParser(argparse.ArgumentParser):\n" " def exit(self, status=0, message=None):\n" @@ -3884,17 +3423,17 @@ msgstr "" " raise Exception(f'Exiting because of an error: {message}')\n" " exit(status)" -#: ../../library/argparse.rst:2253 +#: ../../library/argparse.rst:2052 msgid "" "This method prints a usage message, including the *message*, to :data:`sys." "stderr` and terminates the program with a status code of 2." msgstr "" -#: ../../library/argparse.rst:2258 +#: ../../library/argparse.rst:2057 msgid "Intermixed parsing" msgstr "" -#: ../../library/argparse.rst:2263 +#: ../../library/argparse.rst:2062 msgid "" "A number of Unix commands allow the user to intermix optional arguments with " "positional arguments. The :meth:`~ArgumentParser.parse_intermixed_args` " @@ -3902,7 +3441,7 @@ msgid "" "parsing style." msgstr "" -#: ../../library/argparse.rst:2268 +#: ../../library/argparse.rst:2067 msgid "" "These parsers do not support all the argparse features, and will raise " "exceptions if unsupported features are used. In particular, subparsers, and " @@ -3910,7 +3449,7 @@ msgid "" "not supported." msgstr "" -#: ../../library/argparse.rst:2273 +#: ../../library/argparse.rst:2072 msgid "" "The following example shows the difference between :meth:`~ArgumentParser." "parse_known_args` and :meth:`~ArgumentParser.parse_intermixed_args`: the " @@ -3918,7 +3457,7 @@ msgid "" "collects all the positionals into ``rest``. ::" msgstr "" -#: ../../library/argparse.rst:2279 +#: ../../library/argparse.rst:2078 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo')\n" @@ -3938,7 +3477,7 @@ msgstr "" ">>> parser.parse_intermixed_args('doit 1 --foo bar 2 3'.split())\n" "Namespace(cmd='doit', foo='bar', rest=[1, 2, 3])" -#: ../../library/argparse.rst:2288 +#: ../../library/argparse.rst:2087 msgid "" ":meth:`~ArgumentParser.parse_known_intermixed_args` returns a two item tuple " "containing the populated namespace and the list of remaining argument " @@ -3946,143 +3485,371 @@ msgid "" "there are any remaining unparsed argument strings." msgstr "" -#: ../../library/argparse.rst:2298 -msgid "Upgrading optparse code" -msgstr "" - -#: ../../library/argparse.rst:2300 -msgid "" -"Originally, the :mod:`argparse` module had attempted to maintain " -"compatibility with :mod:`optparse`. However, :mod:`optparse` was difficult " -"to extend transparently, particularly with the changes required to support " -"the new ``nargs=`` specifiers and better usage messages. When most " -"everything in :mod:`optparse` had either been copy-pasted over or monkey-" -"patched, it no longer seemed practical to try to maintain the backwards " -"compatibility." -msgstr "" - -#: ../../library/argparse.rst:2307 -msgid "" -"The :mod:`argparse` module improves on the standard library :mod:`optparse` " -"module in a number of ways including:" -msgstr "" - -#: ../../library/argparse.rst:2310 -msgid "Handling positional arguments." -msgstr "" - -#: ../../library/argparse.rst:2311 -msgid "Supporting sub-commands." -msgstr "" - -#: ../../library/argparse.rst:2312 -msgid "Allowing alternative option prefixes like ``+`` and ``/``." -msgstr "" - -#: ../../library/argparse.rst:2313 -msgid "Handling zero-or-more and one-or-more style arguments." -msgstr "" - -#: ../../library/argparse.rst:2314 -msgid "Producing more informative usage messages." -msgstr "" - -#: ../../library/argparse.rst:2315 -msgid "Providing a much simpler interface for custom ``type`` and ``action``." -msgstr "" - -#: ../../library/argparse.rst:2317 -msgid "A partial upgrade path from :mod:`optparse` to :mod:`argparse`:" -msgstr "" - -#: ../../library/argparse.rst:2319 -msgid "" -"Replace all :meth:`optparse.OptionParser.add_option` calls with :meth:" -"`ArgumentParser.add_argument` calls." -msgstr "" - -#: ../../library/argparse.rst:2322 -msgid "" -"Replace ``(options, args) = parser.parse_args()`` with ``args = parser." -"parse_args()`` and add additional :meth:`ArgumentParser.add_argument` calls " -"for the positional arguments. Keep in mind that what was previously called " -"``options``, now in the :mod:`argparse` context is called ``args``." -msgstr "" - -#: ../../library/argparse.rst:2327 -msgid "" -"Replace :meth:`optparse.OptionParser.disable_interspersed_args` by using :" -"meth:`~ArgumentParser.parse_intermixed_args` instead of :meth:" -"`~ArgumentParser.parse_args`." -msgstr "" - -#: ../../library/argparse.rst:2331 -msgid "" -"Replace callback actions and the ``callback_*`` keyword arguments with " -"``type`` or ``action`` arguments." -msgstr "" - -#: ../../library/argparse.rst:2334 -msgid "" -"Replace string names for ``type`` keyword arguments with the corresponding " -"type objects (e.g. int, float, complex, etc)." -msgstr "" - -#: ../../library/argparse.rst:2337 -msgid "" -"Replace :class:`optparse.Values` with :class:`Namespace` and :exc:`optparse." -"OptionError` and :exc:`optparse.OptionValueError` with :exc:`ArgumentError`." -msgstr "" - -#: ../../library/argparse.rst:2341 -msgid "" -"Replace strings with implicit arguments such as ``%default`` or ``%prog`` " -"with the standard Python syntax to use dictionaries to format strings, that " -"is, ``%(default)s`` and ``%(prog)s``." -msgstr "" - -#: ../../library/argparse.rst:2345 -msgid "" -"Replace the OptionParser constructor ``version`` argument with a call to " -"``parser.add_argument('--version', action='version', version='')``." -msgstr "" - -#: ../../library/argparse.rst:2349 +#: ../../library/argparse.rst:2096 msgid "Exceptions" msgstr "" -#: ../../library/argparse.rst:2353 +#: ../../library/argparse.rst:2100 msgid "An error from creating or using an argument (optional or positional)." msgstr "" -#: ../../library/argparse.rst:2355 +#: ../../library/argparse.rst:2102 msgid "" "The string value of this exception is the message, augmented with " "information about the argument that caused it." msgstr "" -#: ../../library/argparse.rst:2360 +#: ../../library/argparse.rst:2107 msgid "" "Raised when something goes wrong converting a command line string to a type." msgstr "" -#: ../../library/argparse.rst:983 +#: ../../library/argparse.rst:2111 +msgid "Guides and Tutorials" +msgstr "" + +#: ../../library/argparse.rst:796 msgid "? (question mark)" msgstr "? (問號)" -#: ../../library/argparse.rst:983 ../../library/argparse.rst:1017 -#: ../../library/argparse.rst:1031 +#: ../../library/argparse.rst:796 ../../library/argparse.rst:830 +#: ../../library/argparse.rst:844 msgid "in argparse module" msgstr "於 argparse 模組中" -#: ../../library/argparse.rst:1017 +#: ../../library/argparse.rst:830 msgid "* (asterisk)" msgstr "* (星號)" -#: ../../library/argparse.rst:1031 +#: ../../library/argparse.rst:844 msgid "+ (plus)" msgstr "+ (加號)" +#~ msgid "Name" +#~ msgstr "名稱" + +#~ msgid "Description" +#~ msgstr "描述" + +#~ msgid "Values" +#~ msgstr "數值" + +#~ msgid "action_" +#~ msgstr "action_" + +#~ msgid "" +#~ "``'store'``, ``'store_const'``, ``'store_true'``, ``'append'``, " +#~ "``'append_const'``, ``'count'``, ``'help'``, ``'version'``" +#~ msgstr "" +#~ "``'store'``, ``'store_const'``, ``'store_true'``, ``'append'``, " +#~ "``'append_const'``, ``'count'``, ``'help'``, ``'version'``" + +#~ msgid "choices_" +#~ msgstr "choices_" + +#~ msgid "const_" +#~ msgstr "const_" + +#~ msgid "default_" +#~ msgstr "default_" + +#~ msgid "dest_" +#~ msgstr "dest_" + +#~ msgid "help_" +#~ msgstr "help_" + +#~ msgid "metavar_" +#~ msgstr "metavar_" + +#~ msgid "nargs_" +#~ msgstr "nargs_" + +#~ msgid ":class:`int`, ``'?'``, ``'*'``, or ``'+'``" +#~ msgstr ":class:`int`, ``'?'``, ``'*'``, or ``'+'``" + +#~ msgid "required_" +#~ msgstr "required_" + +#~ msgid "``True`` or ``False``" +#~ msgstr "``True`` 或 ``False``" + +#~ msgid "" +#~ ":class:`int`, :class:`float`, ``argparse.FileType('w')``, or callable " +#~ "function" +#~ msgstr "" +#~ ":class:`int`、:class:`float`、``argparse.FileType('w')`` 或可呼叫的函式" + +#~ msgid "Example" +#~ msgstr "範例" + +#~ msgid "" +#~ "import argparse\n" +#~ "\n" +#~ "parser = argparse.ArgumentParser(description='Process some integers.')\n" +#~ "parser.add_argument('integers', metavar='N', type=int, nargs='+',\n" +#~ " help='an integer for the accumulator')\n" +#~ "parser.add_argument('--sum', dest='accumulate', action='store_const',\n" +#~ " const=sum, default=max,\n" +#~ " help='sum the integers (default: find the max)')\n" +#~ "\n" +#~ "args = parser.parse_args()\n" +#~ "print(args.accumulate(args.integers))" +#~ msgstr "" +#~ "import argparse\n" +#~ "\n" +#~ "parser = argparse.ArgumentParser(description='Process some integers.')\n" +#~ "parser.add_argument('integers', metavar='N', type=int, nargs='+',\n" +#~ " help='an integer for the accumulator')\n" +#~ "parser.add_argument('--sum', dest='accumulate', action='store_const',\n" +#~ " const=sum, default=max,\n" +#~ " help='sum the integers (default: find the max)')\n" +#~ "\n" +#~ "args = parser.parse_args()\n" +#~ "print(args.accumulate(args.integers))" + +#~ msgid "" +#~ "$ python prog.py -h\n" +#~ "usage: prog.py [-h] [--sum] N [N ...]\n" +#~ "\n" +#~ "Process some integers.\n" +#~ "\n" +#~ "positional arguments:\n" +#~ " N an integer for the accumulator\n" +#~ "\n" +#~ "options:\n" +#~ " -h, --help show this help message and exit\n" +#~ " --sum sum the integers (default: find the max)" +#~ msgstr "" +#~ "$ python prog.py -h\n" +#~ "usage: prog.py [-h] [--sum] N [N ...]\n" +#~ "\n" +#~ "Process some integers.\n" +#~ "\n" +#~ "positional arguments:\n" +#~ " N an integer for the accumulator\n" +#~ "\n" +#~ "options:\n" +#~ " -h, --help show this help message and exit\n" +#~ " --sum sum the integers (default: find the max)" + +#~ msgid "" +#~ "$ python prog.py 1 2 3 4\n" +#~ "4\n" +#~ "\n" +#~ "$ python prog.py 1 2 3 4 --sum\n" +#~ "10" +#~ msgstr "" +#~ "$ python prog.py 1 2 3 4\n" +#~ "4\n" +#~ "\n" +#~ "$ python prog.py 1 2 3 4 --sum\n" +#~ "10" + +#~ msgid "" +#~ "$ python prog.py a b c\n" +#~ "usage: prog.py [-h] [--sum] N [N ...]\n" +#~ "prog.py: error: argument N: invalid int value: 'a'" +#~ msgstr "" +#~ "$ python prog.py a b c\n" +#~ "usage: prog.py [-h] [--sum] N [N ...]\n" +#~ "prog.py: error: argument N: invalid int value: 'a'" + +#~ msgid "Creating a parser" +#~ msgstr "建立一個剖析器" + +#~ msgid "" +#~ ">>> parser = argparse.ArgumentParser(description='Process some integers.')" +#~ msgstr "" +#~ ">>> parser = argparse.ArgumentParser(description='Process some integers.')" + +#~ msgid "Adding arguments" +#~ msgstr "增加引數" + +#~ msgid "" +#~ ">>> parser.add_argument('integers', metavar='N', type=int, nargs='+',\n" +#~ "... help='an integer for the accumulator')\n" +#~ ">>> parser.add_argument('--sum', dest='accumulate', " +#~ "action='store_const',\n" +#~ "... const=sum, default=max,\n" +#~ "... help='sum the integers (default: find the max)')" +#~ msgstr "" +#~ ">>> parser.add_argument('integers', metavar='N', type=int, nargs='+',\n" +#~ "... help='an integer for the accumulator')\n" +#~ ">>> parser.add_argument('--sum', dest='accumulate', " +#~ "action='store_const',\n" +#~ "... const=sum, default=max,\n" +#~ "... help='sum the integers (default: find the max)')" + +#~ msgid "Parsing arguments" +#~ msgstr "剖析引數" + +#~ msgid "" +#~ ">>> parser.parse_args(['--sum', '7', '-1', '42'])\n" +#~ "Namespace(accumulate=, integers=[7, -1, 42])" +#~ msgstr "" +#~ ">>> parser.parse_args(['--sum', '7', '-1', '42'])\n" +#~ "Namespace(accumulate=, integers=[7, -1, 42])" + +#~ msgid "" +#~ "import argparse\n" +#~ "parser = argparse.ArgumentParser()\n" +#~ "parser.add_argument('--foo', help='foo help')\n" +#~ "args = parser.parse_args()" +#~ msgstr "" +#~ "import argparse\n" +#~ "parser = argparse.ArgumentParser()\n" +#~ "parser.add_argument('--foo', help='foo help')\n" +#~ "args = parser.parse_args()" + +#~ msgid "" +#~ "$ python myprogram.py --help\n" +#~ "usage: myprogram.py [-h] [--foo FOO]\n" +#~ "\n" +#~ "options:\n" +#~ " -h, --help show this help message and exit\n" +#~ " --foo FOO foo help\n" +#~ "$ cd ..\n" +#~ "$ python subdir/myprogram.py --help\n" +#~ "usage: myprogram.py [-h] [--foo FOO]\n" +#~ "\n" +#~ "options:\n" +#~ " -h, --help show this help message and exit\n" +#~ " --foo FOO foo help" +#~ msgstr "" +#~ "$ python myprogram.py --help\n" +#~ "usage: myprogram.py [-h] [--foo FOO]\n" +#~ "\n" +#~ "options:\n" +#~ " -h, --help show this help message and exit\n" +#~ " --foo FOO foo help\n" +#~ "$ cd ..\n" +#~ "$ python subdir/myprogram.py --help\n" +#~ "usage: myprogram.py [-h] [--foo FOO]\n" +#~ "\n" +#~ "options:\n" +#~ " -h, --help show this help message and exit\n" +#~ " --foo FOO foo help" + +#~ msgid "" +#~ ">>> parser = argparse.ArgumentParser(prog='PROG')\n" +#~ ">>> parser.add_argument('--foo', nargs='?', help='foo help')\n" +#~ ">>> parser.add_argument('bar', nargs='+', help='bar help')\n" +#~ ">>> parser.print_help()\n" +#~ "usage: PROG [-h] [--foo [FOO]] bar [bar ...]\n" +#~ "\n" +#~ "positional arguments:\n" +#~ " bar bar help\n" +#~ "\n" +#~ "options:\n" +#~ " -h, --help show this help message and exit\n" +#~ " --foo [FOO] foo help" +#~ msgstr "" +#~ ">>> parser = argparse.ArgumentParser(prog='PROG')\n" +#~ ">>> parser.add_argument('--foo', nargs='?', help='foo help')\n" +#~ ">>> parser.add_argument('bar', nargs='+', help='bar help')\n" +#~ ">>> parser.print_help()\n" +#~ "usage: PROG [-h] [--foo [FOO]] bar [bar ...]\n" +#~ "\n" +#~ "positional arguments:\n" +#~ " bar bar help\n" +#~ "\n" +#~ "options:\n" +#~ " -h, --help show this help message and exit\n" +#~ " --foo [FOO] foo help" + +#~ msgid "" +#~ ">>> parser = argparse.ArgumentParser(description='A foo that bars')\n" +#~ ">>> parser.print_help()\n" +#~ "usage: argparse.py [-h]\n" +#~ "\n" +#~ "A foo that bars\n" +#~ "\n" +#~ "options:\n" +#~ " -h, --help show this help message and exit" +#~ msgstr "" +#~ ">>> parser = argparse.ArgumentParser(description='A foo that bars')\n" +#~ ">>> parser.print_help()\n" +#~ "usage: argparse.py [-h]\n" +#~ "\n" +#~ "A foo that bars\n" +#~ "\n" +#~ "options:\n" +#~ " -h, --help show this help message and exit" + +#~ msgid "" +#~ "$ python myprogram.py --help\n" +#~ "usage: myprogram.py [-h] [--foo FOO]\n" +#~ "\n" +#~ "options:\n" +#~ " -h, --help show this help message and exit\n" +#~ " --foo FOO foo help" +#~ msgstr "" +#~ "$ python myprogram.py --help\n" +#~ "usage: myprogram.py [-h] [--foo FOO]\n" +#~ "\n" +#~ "options:\n" +#~ " -h, --help show this help message and exit\n" +#~ " --foo FOO foo help" + +#~ msgid "" +#~ ">>> parser = argparse.ArgumentParser()\n" +#~ ">>> parser.add_argument('--foo')\n" +#~ ">>> parser.parse_args('--foo 1'.split())\n" +#~ "Namespace(foo='1')" +#~ msgstr "" +#~ ">>> parser = argparse.ArgumentParser()\n" +#~ ">>> parser.add_argument('--foo')\n" +#~ ">>> parser.parse_args('--foo 1'.split())\n" +#~ "Namespace(foo='1')" + +#~ msgid "" +#~ ">>> parser = argparse.ArgumentParser(prog='doors.py')\n" +#~ ">>> parser.add_argument('door', type=int, choices=range(1, 4))\n" +#~ ">>> print(parser.parse_args(['3']))\n" +#~ "Namespace(door=3)\n" +#~ ">>> parser.parse_args(['4'])\n" +#~ "usage: doors.py [-h] {1,2,3}\n" +#~ "doors.py: error: argument door: invalid choice: 4 (choose from 1, 2, 3)" +#~ msgstr "" +#~ ">>> parser = argparse.ArgumentParser(prog='doors.py')\n" +#~ ">>> parser.add_argument('door', type=int, choices=range(1, 4))\n" +#~ ">>> print(parser.parse_args(['3']))\n" +#~ "Namespace(door=3)\n" +#~ ">>> parser.parse_args(['4'])\n" +#~ "usage: doors.py [-h] {1,2,3}\n" +#~ "doors.py: error: argument door: invalid choice: 4 (choose from 1, 2, 3)" + +#~ msgid "" +#~ ">>> parser = argparse.ArgumentParser(prog='frobble')\n" +#~ ">>> parser.add_argument('--foo', action='store_true',\n" +#~ "... help='foo the bars before frobbling')\n" +#~ ">>> parser.add_argument('bar', nargs='+',\n" +#~ "... help='one of the bars to be frobbled')\n" +#~ ">>> parser.parse_args(['-h'])\n" +#~ "usage: frobble [-h] [--foo] bar [bar ...]\n" +#~ "\n" +#~ "positional arguments:\n" +#~ " bar one of the bars to be frobbled\n" +#~ "\n" +#~ "options:\n" +#~ " -h, --help show this help message and exit\n" +#~ " --foo foo the bars before frobbling" +#~ msgstr "" +#~ ">>> parser = argparse.ArgumentParser(prog='frobble')\n" +#~ ">>> parser.add_argument('--foo', action='store_true',\n" +#~ "... help='foo the bars before frobbling')\n" +#~ ">>> parser.add_argument('bar', nargs='+',\n" +#~ "... help='one of the bars to be frobbled')\n" +#~ ">>> parser.parse_args(['-h'])\n" +#~ "usage: frobble [-h] [--foo] bar [bar ...]\n" +#~ "\n" +#~ "positional arguments:\n" +#~ " bar one of the bars to be frobbled\n" +#~ "\n" +#~ "options:\n" +#~ " -h, --help show this help message and exit\n" +#~ " --foo foo the bars before frobbling" + #~ msgid "type_" #~ msgstr "type_" diff --git a/library/ast.po b/library/ast.po index bf6a46b3ed..2bfa5f5ae3 100644 --- a/library/ast.po +++ b/library/ast.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-27 00:14+0000\n" +"POT-Creation-Date: 2024-10-10 00:13+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-" @@ -1630,12 +1630,12 @@ msgid "" "(indicating a \"simple\" target). A \"simple\" target consists solely of a :" "class:`Name` node that does not appear between parentheses; all other " "targets are considered complex. Only simple targets appear in the :attr:" -"`__annotations__` dictionary of modules and classes." +"`~object.__annotations__` dictionary of modules and classes." msgstr "" "``simple`` 總會是 0(表示一個「複雜」目標)或 1(表示一個「簡單」目標)。一個" "「簡單」目標僅包含一個 :class:`Name` 節點,且不出現在括號之間;所有其他目標都" -"被視為是複雜的。只有簡單目標會出現在模組和類別的 :attr:`__annotations__` 字典" -"中。" +"被視為是複雜的。只有簡單目標會出現在模組和類別的 :attr:`~object." +"__annotations__` 字典中。" #: ../../library/ast.rst:902 msgid "" diff --git a/library/asyncio-eventloop.po b/library/asyncio-eventloop.po index 3e07964e9d..8cb8efab1e 100644 --- a/library/asyncio-eventloop.po +++ b/library/asyncio-eventloop.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-11 00:13+0000\n" "PO-Revision-Date: 2022-02-20 12:36+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1087,8 +1087,10 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:652 #: ../../library/asyncio-eventloop.rst:806 #: ../../library/asyncio-eventloop.rst:1249 -msgid ":ref:`Availability `: Unix." -msgstr ":ref:`適用 `:Unix。" +#: ../../library/asyncio-eventloop.rst:1782 +#: ../../library/asyncio-eventloop.rst:1789 +msgid "Availability" +msgstr "" #: ../../library/asyncio-eventloop.rst:654 msgid "" @@ -2675,10 +2677,6 @@ msgstr "" "\n" "asyncio.set_event_loop_policy(MyPolicy())" -#: ../../library/asyncio-eventloop.rst:1782 -msgid ":ref:`Availability `: Unix, Windows." -msgstr ":ref:`適用 `:Unix、Windows。" - #: ../../library/asyncio-eventloop.rst:1787 #, fuzzy msgid "" @@ -2686,10 +2684,6 @@ msgid "" "Completion Ports\" (IOCP)." msgstr "用於 Windows 的事件迴圈,使用\"I/O 完成埠\"(IOCP)。" -#: ../../library/asyncio-eventloop.rst:1789 -msgid ":ref:`Availability `: Windows." -msgstr ":ref:`適用 `:Windows。" - #: ../../library/asyncio-eventloop.rst:1793 msgid "" "`MSDN documentation on I/O Completion Ports \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -160,8 +160,8 @@ msgid "" msgstr "" #: ../../library/asyncio-policy.rst:131 ../../library/asyncio-policy.rst:139 -msgid ":ref:`Availability `: Windows." -msgstr ":ref:`適用 `:Windows。" +msgid "Availability" +msgstr "" #: ../../library/asyncio-policy.rst:136 msgid "" diff --git a/library/asyncio-stream.po b/library/asyncio-stream.po index a89301bcf9..667acc44fd 100644 --- a/library/asyncio-stream.po +++ b/library/asyncio-stream.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-11 00:13+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-" @@ -208,8 +208,8 @@ msgid "See also the documentation of :meth:`loop.create_unix_connection`." msgstr "另請參閱 :meth:`loop.create_unix_connection` 文件。" #: ../../library/asyncio-stream.rst:151 ../../library/asyncio-stream.rst:181 -msgid ":ref:`Availability `: Unix." -msgstr ":ref:`適用 `:Unix。" +msgid "Availability" +msgstr "" #: ../../library/asyncio-stream.rst:153 msgid "" diff --git a/library/asyncio-task.po b/library/asyncio-task.po index b4dd13ea2f..61341b2013 100644 --- a/library/asyncio-task.po +++ b/library/asyncio-task.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 23:08+0000\n" +"POT-Creation-Date: 2024-10-13 00:14+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-" @@ -262,7 +262,7 @@ msgid "" " # Nothing happens if we just call \"nested()\".\n" " # A coroutine object is created but not awaited,\n" " # so it *won't run at all*.\n" -" nested()\n" +" nested() # will raise a \"RuntimeWarning\".\n" "\n" " # Let's do it differently now and await it:\n" " print(await nested()) # will print \"42\".\n" diff --git a/library/asyncio.po b/library/asyncio.po index 56727e33e5..3d069c4f74 100644 --- a/library/asyncio.po +++ b/library/asyncio.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-11 00:13+0000\n" "PO-Revision-Date: 2021-11-23 12:40+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -148,8 +148,8 @@ msgstr "" "based) 的函式庫與程式碼。" #: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not WASI." -msgstr ":ref:`適用 `:非 WASI。" +msgid "Availability" +msgstr "" #: ../../includes/wasm-notavail.rst:5 msgid "" diff --git a/library/codecs.po b/library/codecs.po index aa60cd8b84..5ccfe0b8b7 100644 --- a/library/codecs.po +++ b/library/codecs.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-11 00:13+0000\n" "PO-Revision-Date: 2018-05-23 14:40+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2652,8 +2652,8 @@ msgid "This module implements the ANSI codepage (CP_ACP)." msgstr "" #: ../../library/codecs.rst:1542 -msgid ":ref:`Availability `: Windows." -msgstr ":ref:`適用 `:Windows。" +msgid "Availability" +msgstr "" #: ../../library/codecs.rst:1544 msgid "" @@ -2766,8 +2766,3 @@ msgstr "\\N" #: ../../library/codecs.rst:387 msgid "surrogatepass" msgstr "surrogatepass" - -#, fuzzy -#~ msgid "" -#~ ":meth:`!uu.encode` / :meth:`!uu.decode` (Note: :mod:`uu` is deprecated.)" -#~ msgstr ":meth:`uu.encode` / :meth:`uu.decode`" diff --git a/library/compileall.po b/library/compileall.po index 78cbc5fb98..da2c078c4b 100644 --- a/library/compileall.po +++ b/library/compileall.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-11 00:13+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-" @@ -36,8 +36,8 @@ msgid "" msgstr "" #: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not WASI." -msgstr ":ref:`適用 `:非 WASI。" +msgid "Availability" +msgstr "" #: ../../includes/wasm-notavail.rst:5 msgid "" diff --git a/library/concurrent.futures.po b/library/concurrent.futures.po index 1a8ea4d243..682bcbacad 100644 --- a/library/concurrent.futures.po +++ b/library/concurrent.futures.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-11 00:13+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-" @@ -51,8 +51,8 @@ msgstr "" "相同的介面,該介面由抽象的 :class:`Executor` 類別定義。" #: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not WASI." -msgstr ":ref:`適用 `:非 WASI。" +msgid "Availability" +msgstr "" #: ../../includes/wasm-notavail.rst:5 msgid "" diff --git a/library/configparser.po b/library/configparser.po index 0943f36e02..3bc3843a4c 100644 --- a/library/configparser.po +++ b/library/configparser.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-12 00:13+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-" @@ -69,15 +69,15 @@ msgid "" "sometimes used for configuration, but does not support comments." msgstr "" -#: ../../library/configparser.rst:60 +#: ../../library/configparser.rst:61 msgid "Quick Start" msgstr "" -#: ../../library/configparser.rst:62 +#: ../../library/configparser.rst:63 msgid "Let's take a very basic configuration file that looks like this:" msgstr "" -#: ../../library/configparser.rst:64 +#: ../../library/configparser.rst:65 msgid "" "[DEFAULT]\n" "ServerAliveInterval = 45\n" @@ -105,7 +105,7 @@ msgstr "" "Port = 50022\n" "ForwardX11 = no" -#: ../../library/configparser.rst:79 +#: ../../library/configparser.rst:80 msgid "" "The structure of INI files is described `in the following section " "<#supported-ini-file-structure>`_. Essentially, the file consists of " @@ -114,7 +114,7 @@ msgid "" "configuration file programmatically." msgstr "" -#: ../../library/configparser.rst:85 +#: ../../library/configparser.rst:86 msgid "" ">>> import configparser\n" ">>> config = configparser.ConfigParser()\n" @@ -133,20 +133,20 @@ msgid "" "..." msgstr "" -#: ../../library/configparser.rst:103 +#: ../../library/configparser.rst:104 msgid "" "As you can see, we can treat a config parser much like a dictionary. There " "are differences, `outlined later <#mapping-protocol-access>`_, but the " "behavior is very close to what you would expect from a dictionary." msgstr "" -#: ../../library/configparser.rst:107 +#: ../../library/configparser.rst:108 msgid "" "Now that we have created and saved a configuration file, let's read it back " "and explore the data it holds." msgstr "" -#: ../../library/configparser.rst:110 +#: ../../library/configparser.rst:111 msgid "" ">>> config = configparser.ConfigParser()\n" ">>> config.sections()\n" @@ -179,7 +179,7 @@ msgid "" "'yes'" msgstr "" -#: ../../library/configparser.rst:142 +#: ../../library/configparser.rst:143 msgid "" "As we can see above, the API is pretty straightforward. The only bit of " "magic involves the ``DEFAULT`` section which provides default values for all " @@ -187,7 +187,7 @@ msgid "" "and stored in lowercase [1]_." msgstr "" -#: ../../library/configparser.rst:147 ../../library/configparser.rst:992 +#: ../../library/configparser.rst:148 ../../library/configparser.rst:993 msgid "" "It is possible to read several configurations into a single :class:" "`ConfigParser`, where the most recently added configuration has the highest " @@ -197,7 +197,7 @@ msgid "" "``example.ini`` file." msgstr "" -#: ../../library/configparser.rst:154 ../../library/configparser.rst:999 +#: ../../library/configparser.rst:155 ../../library/configparser.rst:1000 msgid "" "[DEFAULT]\n" "ServerAliveInterval = -1" @@ -205,7 +205,7 @@ msgstr "" "[DEFAULT]\n" "ServerAliveInterval = -1" -#: ../../library/configparser.rst:159 ../../library/configparser.rst:1004 +#: ../../library/configparser.rst:160 ../../library/configparser.rst:1005 msgid "" ">>> config_override = configparser.ConfigParser()\n" ">>> config_override['DEFAULT'] = {'ServerAliveInterval': '-1'}\n" @@ -229,24 +229,24 @@ msgstr "" ">>> print(config_override.get('DEFAULT', 'ServerAliveInterval'))\n" "-1" -#: ../../library/configparser.rst:173 +#: ../../library/configparser.rst:174 msgid "" "This behaviour is equivalent to a :meth:`ConfigParser.read` call with " "several files passed to the *filenames* parameter." msgstr "" -#: ../../library/configparser.rst:178 +#: ../../library/configparser.rst:179 msgid "Supported Datatypes" msgstr "" -#: ../../library/configparser.rst:180 +#: ../../library/configparser.rst:181 msgid "" "Config parsers do not guess datatypes of values in configuration files, " "always storing them internally as strings. This means that if you need " "other datatypes, you should convert on your own:" msgstr "" -#: ../../library/configparser.rst:184 +#: ../../library/configparser.rst:185 msgid "" ">>> int(topsecret['Port'])\n" "50022\n" @@ -258,7 +258,7 @@ msgstr "" ">>> float(topsecret['CompressionLevel'])\n" "9.0" -#: ../../library/configparser.rst:191 +#: ../../library/configparser.rst:192 msgid "" "Since this task is so common, config parsers provide a range of handy getter " "methods to handle integers, floats and booleans. The last one is the most " @@ -269,7 +269,7 @@ msgid "" "``'true'``/``'false'`` and ``'1'``/``'0'`` [1]_. For example:" msgstr "" -#: ../../library/configparser.rst:199 +#: ../../library/configparser.rst:200 msgid "" ">>> topsecret.getboolean('ForwardX11')\n" "False\n" @@ -285,7 +285,7 @@ msgstr "" ">>> config.getboolean('forge.example', 'Compression')\n" "True" -#: ../../library/configparser.rst:208 +#: ../../library/configparser.rst:209 msgid "" "Apart from :meth:`~ConfigParser.getboolean`, config parsers also provide " "equivalent :meth:`~ConfigParser.getint` and :meth:`~ConfigParser.getfloat` " @@ -293,17 +293,17 @@ msgid "" "ones. [1]_" msgstr "" -#: ../../library/configparser.rst:214 +#: ../../library/configparser.rst:215 msgid "Fallback Values" msgstr "" -#: ../../library/configparser.rst:216 +#: ../../library/configparser.rst:217 msgid "" "As with a dictionary, you can use a section's :meth:`~ConfigParser.get` " "method to provide fallback values:" msgstr "" -#: ../../library/configparser.rst:219 +#: ../../library/configparser.rst:220 msgid "" ">>> topsecret.get('Port')\n" "'50022'\n" @@ -321,7 +321,7 @@ msgstr "" ">>> topsecret.get('Cipher', '3des-cbc')\n" "'3des-cbc'" -#: ../../library/configparser.rst:229 +#: ../../library/configparser.rst:230 msgid "" "Please note that default values have precedence over fallback values. For " "instance, in our example the ``'CompressionLevel'`` key was specified only " @@ -330,7 +330,7 @@ msgid "" "specify a fallback:" msgstr "" -#: ../../library/configparser.rst:235 +#: ../../library/configparser.rst:236 msgid "" ">>> topsecret.get('CompressionLevel', '3')\n" "'9'" @@ -338,7 +338,7 @@ msgstr "" ">>> topsecret.get('CompressionLevel', '3')\n" "'9'" -#: ../../library/configparser.rst:240 +#: ../../library/configparser.rst:241 msgid "" "One more thing to be aware of is that the parser-level :meth:`~ConfigParser." "get` method provides a custom, more complex interface, maintained for " @@ -346,21 +346,21 @@ msgid "" "provided via the ``fallback`` keyword-only argument:" msgstr "" -#: ../../library/configparser.rst:245 +#: ../../library/configparser.rst:246 msgid "" ">>> config.get('forge.example', 'monster',\n" "... fallback='No such things as monsters')\n" "'No such things as monsters'" msgstr "" -#: ../../library/configparser.rst:251 +#: ../../library/configparser.rst:252 msgid "" "The same ``fallback`` argument can be used with the :meth:`~ConfigParser." "getint`, :meth:`~ConfigParser.getfloat` and :meth:`~ConfigParser.getboolean` " "methods, for example:" msgstr "" -#: ../../library/configparser.rst:255 +#: ../../library/configparser.rst:256 msgid "" ">>> 'BatchMode' in topsecret\n" "False\n" @@ -378,11 +378,11 @@ msgstr "" ">>> topsecret.getboolean('BatchMode', fallback=True)\n" "False" -#: ../../library/configparser.rst:267 +#: ../../library/configparser.rst:268 msgid "Supported INI File Structure" msgstr "" -#: ../../library/configparser.rst:269 +#: ../../library/configparser.rst:270 msgid "" "A configuration file consists of sections, each led by a ``[section]`` " "header, followed by key/value entries separated by a specific string (``=`` " @@ -395,13 +395,13 @@ msgid "" "parts of multiline values or ignored." msgstr "" -#: ../../library/configparser.rst:279 +#: ../../library/configparser.rst:280 msgid "" "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:282 +#: ../../library/configparser.rst:283 msgid "" "The first section name may be omitted if the parser is configured to allow " "an unnamed top level section with ``allow_unnamed_section=True``. In this " @@ -409,18 +409,18 @@ msgid "" "``config[UNNAMED_SECTION]``." msgstr "" -#: ../../library/configparser.rst:287 +#: ../../library/configparser.rst:288 msgid "" "Configuration files may include comments, prefixed by specific characters " "(``#`` and ``;`` by default [1]_). Comments may appear on their own on an " "otherwise empty line, possibly indented. [1]_" msgstr "" -#: ../../library/configparser.rst:291 ../../library/configparser.rst:375 +#: ../../library/configparser.rst:292 ../../library/configparser.rst:376 msgid "For example:" msgstr "舉例來說:" -#: ../../library/configparser.rst:293 +#: ../../library/configparser.rst:294 msgid "" "[Simple Values]\n" "key=value\n" @@ -465,17 +465,17 @@ msgid "" " # Did I mention we can indent comments, too?" msgstr "" -#: ../../library/configparser.rst:341 +#: ../../library/configparser.rst:342 msgid "Unnamed Sections" msgstr "" -#: ../../library/configparser.rst:343 +#: ../../library/configparser.rst:344 msgid "" "The name of the first section (or unique) may be omitted and values " "retrieved by the :const:`UNNAMED_SECTION` attribute." msgstr "" -#: ../../library/configparser.rst:346 +#: ../../library/configparser.rst:347 msgid "" ">>> config = \"\"\"\n" "... option = value\n" @@ -489,18 +489,18 @@ msgid "" "'value'" msgstr "" -#: ../../library/configparser.rst:360 +#: ../../library/configparser.rst:361 msgid "Interpolation of values" msgstr "" -#: ../../library/configparser.rst:362 +#: ../../library/configparser.rst:363 msgid "" "On top of the core functionality, :class:`ConfigParser` supports " "interpolation. This means values can be preprocessed before returning them " "from ``get()`` calls." msgstr "" -#: ../../library/configparser.rst:370 +#: ../../library/configparser.rst:371 msgid "" "The default implementation used by :class:`ConfigParser`. It enables values " "to contain format strings which refer to other values in the same section, " @@ -508,7 +508,7 @@ msgid "" "can be provided on initialization." msgstr "" -#: ../../library/configparser.rst:377 +#: ../../library/configparser.rst:378 msgid "" "[Paths]\n" "home_dir: /Users\n" @@ -521,7 +521,7 @@ msgid "" "gain: 80%%" msgstr "" -#: ../../library/configparser.rst:388 +#: ../../library/configparser.rst:389 msgid "" "In the example above, :class:`ConfigParser` with *interpolation* set to " "``BasicInterpolation()`` would resolve ``%(home_dir)s`` to the value of " @@ -531,14 +531,14 @@ msgid "" "specific order in the configuration file." msgstr "" -#: ../../library/configparser.rst:395 +#: ../../library/configparser.rst:396 msgid "" "With ``interpolation`` set to ``None``, the parser would simply return " "``%(my_dir)s/Pictures`` as the value of ``my_pictures`` and ``%(home_dir)s/" "lumberjack`` as the value of ``my_dir``." msgstr "" -#: ../../library/configparser.rst:403 +#: ../../library/configparser.rst:404 msgid "" "An alternative handler for interpolation which implements a more advanced " "syntax, used for instance in ``zc.buildout``. Extended interpolation is " @@ -548,13 +548,13 @@ msgid "" "possibly the default values from the special section)." msgstr "" -#: ../../library/configparser.rst:410 +#: ../../library/configparser.rst:411 msgid "" "For example, the configuration specified above with basic interpolation, " "would look like this with extended interpolation:" msgstr "" -#: ../../library/configparser.rst:413 +#: ../../library/configparser.rst:414 msgid "" "[Paths]\n" "home_dir: /Users\n" @@ -567,11 +567,11 @@ msgid "" "cost: $$80" msgstr "" -#: ../../library/configparser.rst:424 +#: ../../library/configparser.rst:425 msgid "Values from other sections can be fetched as well:" msgstr "" -#: ../../library/configparser.rst:426 +#: ../../library/configparser.rst:427 msgid "" "[Common]\n" "home_dir: /Users\n" @@ -607,11 +607,11 @@ msgstr "" "my_pictures: ${my_dir}/Pictures\n" "python_dir: ${Frameworks:path}/Python/Versions/${Frameworks:Python}" -#: ../../library/configparser.rst:446 +#: ../../library/configparser.rst:447 msgid "Mapping Protocol Access" msgstr "" -#: ../../library/configparser.rst:450 +#: ../../library/configparser.rst:451 msgid "" "Mapping protocol access is a generic name for functionality that enables " "using custom objects as if they were dictionaries. In case of :mod:" @@ -619,7 +619,7 @@ msgid "" "``parser['section']['option']`` notation." msgstr "" -#: ../../library/configparser.rst:455 +#: ../../library/configparser.rst:456 msgid "" "``parser['section']`` in particular returns a proxy for the section's data " "in the parser. This means that the values are not copied but they are taken " @@ -628,7 +628,7 @@ msgid "" "original parser." msgstr "" -#: ../../library/configparser.rst:461 +#: ../../library/configparser.rst:462 msgid "" ":mod:`configparser` objects behave as close to actual dictionaries as " "possible. The mapping interface is complete and adheres to the :class:" @@ -636,7 +636,7 @@ msgid "" "that should be taken into account:" msgstr "" -#: ../../library/configparser.rst:466 +#: ../../library/configparser.rst:467 msgid "" "By default, all keys in sections are accessible in a case-insensitive manner " "[1]_. E.g. ``for option in parser[\"section\"]`` yields only " @@ -645,7 +645,7 @@ msgid "" "expressions return ``True``::" msgstr "" -#: ../../library/configparser.rst:471 +#: ../../library/configparser.rst:472 msgid "" "\"a\" in parser[\"section\"]\n" "\"A\" in parser[\"section\"]" @@ -653,7 +653,7 @@ msgstr "" "\"a\" in parser[\"section\"]\n" "\"A\" in parser[\"section\"]" -#: ../../library/configparser.rst:474 +#: ../../library/configparser.rst:475 msgid "" "All sections include ``DEFAULTSECT`` values as well which means that ``." "clear()`` on a section may not leave the section visibly empty. This is " @@ -663,30 +663,30 @@ msgid "" "default value causes a :exc:`KeyError`." msgstr "" -#: ../../library/configparser.rst:481 +#: ../../library/configparser.rst:482 msgid "``DEFAULTSECT`` cannot be removed from the parser:" msgstr "" -#: ../../library/configparser.rst:483 +#: ../../library/configparser.rst:484 msgid "trying to delete it raises :exc:`ValueError`," msgstr "" -#: ../../library/configparser.rst:485 +#: ../../library/configparser.rst:486 msgid "``parser.clear()`` leaves it intact," msgstr "" -#: ../../library/configparser.rst:487 +#: ../../library/configparser.rst:488 msgid "``parser.popitem()`` never returns it." msgstr "" -#: ../../library/configparser.rst:489 +#: ../../library/configparser.rst:490 msgid "" "``parser.get(section, option, **kwargs)`` - the second argument is **not** a " "fallback value. Note however that the section-level ``get()`` methods are " "compatible both with the mapping protocol and the classic configparser API." msgstr "" -#: ../../library/configparser.rst:493 +#: ../../library/configparser.rst:494 msgid "" "``parser.items()`` is compatible with the mapping protocol (returns a list " "of *section_name*, *section_proxy* pairs including the DEFAULTSECT). " @@ -696,18 +696,18 @@ msgid "" "(unless ``raw=True`` is provided)." msgstr "" -#: ../../library/configparser.rst:500 +#: ../../library/configparser.rst:501 msgid "" "The mapping protocol is implemented on top of the existing legacy API so " "that subclasses overriding the original interface still should have mappings " "working as expected." msgstr "" -#: ../../library/configparser.rst:506 +#: ../../library/configparser.rst:507 msgid "Customizing Parser Behaviour" msgstr "" -#: ../../library/configparser.rst:508 +#: ../../library/configparser.rst:509 msgid "" "There are nearly as many INI format variants as there are applications using " "it. :mod:`configparser` goes a long way to provide support for the largest " @@ -716,17 +716,17 @@ msgid "" "customize some of the features." msgstr "" -#: ../../library/configparser.rst:514 +#: ../../library/configparser.rst:515 msgid "" "The most common way to change the way a specific config parser works is to " "use the :meth:`!__init__` options:" msgstr "" -#: ../../library/configparser.rst:517 +#: ../../library/configparser.rst:518 msgid "*defaults*, default value: ``None``" msgstr "" -#: ../../library/configparser.rst:519 +#: ../../library/configparser.rst:520 msgid "" "This option accepts a dictionary of key-value pairs which will be initially " "put in the ``DEFAULT`` section. This makes for an elegant way to support " @@ -734,17 +734,17 @@ msgid "" "the documented default." msgstr "" -#: ../../library/configparser.rst:524 +#: ../../library/configparser.rst:525 msgid "" "Hint: if you want to specify default values for a specific section, use :" "meth:`~ConfigParser.read_dict` before you read the actual file." msgstr "" -#: ../../library/configparser.rst:527 +#: ../../library/configparser.rst:528 msgid "*dict_type*, default value: :class:`dict`" msgstr "" -#: ../../library/configparser.rst:529 +#: ../../library/configparser.rst:530 msgid "" "This option has a major impact on how the mapping protocol will behave and " "how the written configuration files look. With the standard dictionary, " @@ -752,20 +752,20 @@ msgid "" "goes for options within sections." msgstr "" -#: ../../library/configparser.rst:534 +#: ../../library/configparser.rst:535 msgid "" "An alternative dictionary type can be used for example to sort sections and " "options on write-back." msgstr "" -#: ../../library/configparser.rst:537 +#: ../../library/configparser.rst:538 msgid "" "Please note: there are ways to add a set of key-value pairs in a single " "operation. When you use a regular dictionary in those operations, the order " "of the keys will be ordered. For example:" msgstr "" -#: ../../library/configparser.rst:541 +#: ../../library/configparser.rst:542 msgid "" ">>> parser = configparser.ConfigParser()\n" ">>> parser.read_dict({'section1': {'key1': 'value1',\n" @@ -799,11 +799,11 @@ msgstr "" ">>> [option for option in parser['section3']]\n" "['foo', 'bar', 'baz']" -#: ../../library/configparser.rst:559 +#: ../../library/configparser.rst:560 msgid "*allow_no_value*, default value: ``False``" msgstr "" -#: ../../library/configparser.rst:561 +#: ../../library/configparser.rst:562 msgid "" "Some configuration files are known to include settings without values, but " "which otherwise conform to the syntax supported by :mod:`configparser`. The " @@ -811,7 +811,7 @@ msgid "" "such values should be accepted:" msgstr "" -#: ../../library/configparser.rst:566 +#: ../../library/configparser.rst:567 msgid "" ">>> import configparser\n" "\n" @@ -842,32 +842,32 @@ msgid "" "KeyError: 'does-not-exist'" msgstr "" -#: ../../library/configparser.rst:596 +#: ../../library/configparser.rst:597 msgid "*delimiters*, default value: ``('=', ':')``" msgstr "" -#: ../../library/configparser.rst:598 +#: ../../library/configparser.rst:599 msgid "" "Delimiters are substrings that delimit keys from values within a section. " "The first occurrence of a delimiting substring on a line is considered a " "delimiter. This means values (but not keys) can contain the delimiters." msgstr "" -#: ../../library/configparser.rst:602 +#: ../../library/configparser.rst:603 msgid "" "See also the *space_around_delimiters* argument to :meth:`ConfigParser." "write`." msgstr "" -#: ../../library/configparser.rst:605 +#: ../../library/configparser.rst:606 msgid "*comment_prefixes*, default value: ``('#', ';')``" msgstr "" -#: ../../library/configparser.rst:607 +#: ../../library/configparser.rst:608 msgid "*inline_comment_prefixes*, default value: ``None``" msgstr "" -#: ../../library/configparser.rst:609 +#: ../../library/configparser.rst:610 msgid "" "Comment prefixes are strings that indicate the start of a valid comment " "within a config file. *comment_prefixes* are used only on otherwise empty " @@ -877,13 +877,13 @@ msgid "" "used as prefixes for whole line comments." msgstr "" -#: ../../library/configparser.rst:616 +#: ../../library/configparser.rst:617 msgid "" "In previous versions of :mod:`configparser` behaviour matched " "``comment_prefixes=('#',';')`` and ``inline_comment_prefixes=(';',)``." msgstr "" -#: ../../library/configparser.rst:620 +#: ../../library/configparser.rst:621 msgid "" "Please note that config parsers don't support escaping of comment prefixes " "so using *inline_comment_prefixes* may prevent users from specifying option " @@ -893,7 +893,7 @@ msgid "" "values is to interpolate the prefix, for example::" msgstr "" -#: ../../library/configparser.rst:627 +#: ../../library/configparser.rst:628 msgid "" ">>> from configparser import ConfigParser, ExtendedInterpolation\n" ">>> parser = ConfigParser(interpolation=ExtendedInterpolation())\n" @@ -935,11 +935,11 @@ msgid "" "line #3" msgstr "" -#: ../../library/configparser.rst:666 +#: ../../library/configparser.rst:667 msgid "*strict*, default value: ``True``" msgstr "" -#: ../../library/configparser.rst:668 +#: ../../library/configparser.rst:669 msgid "" "When set to ``True``, the parser will not allow for any section or option " "duplicates while reading from a single source (using :meth:`~ConfigParser." @@ -947,17 +947,17 @@ msgid "" "read_dict`). It is recommended to use strict parsers in new applications." msgstr "" -#: ../../library/configparser.rst:673 +#: ../../library/configparser.rst:674 msgid "" "In previous versions of :mod:`configparser` behaviour matched " "``strict=False``." msgstr "" -#: ../../library/configparser.rst:677 +#: ../../library/configparser.rst:678 msgid "*empty_lines_in_values*, default value: ``True``" msgstr "" -#: ../../library/configparser.rst:679 +#: ../../library/configparser.rst:680 msgid "" "In config parsers, values can span multiple lines as long as they are " "indented more than the key that holds them. By default parsers also let " @@ -967,7 +967,7 @@ msgid "" "lose track of the file structure. Take for instance:" msgstr "" -#: ../../library/configparser.rst:686 +#: ../../library/configparser.rst:687 msgid "" "[Section]\n" "key = multiline\n" @@ -976,7 +976,7 @@ msgid "" " this = is still a part of the multiline value of 'key'" msgstr "" -#: ../../library/configparser.rst:694 +#: ../../library/configparser.rst:695 msgid "" "This can be especially problematic for the user to see if she's using a " "proportional font to edit the file. That is why when your application does " @@ -985,13 +985,13 @@ msgid "" "would produce two keys, ``key`` and ``this``." msgstr "" -#: ../../library/configparser.rst:700 +#: ../../library/configparser.rst:701 msgid "" "*default_section*, default value: ``configparser.DEFAULTSECT`` (that is: " "``\"DEFAULT\"``)" msgstr "" -#: ../../library/configparser.rst:703 +#: ../../library/configparser.rst:704 msgid "" "The convention of allowing a special section of default values for other " "sections or interpolation purposes is a powerful concept of this library, " @@ -1005,11 +1005,11 @@ msgid "" "files from one format to another)." msgstr "" -#: ../../library/configparser.rst:714 +#: ../../library/configparser.rst:715 msgid "*interpolation*, default value: ``configparser.BasicInterpolation``" msgstr "" -#: ../../library/configparser.rst:716 +#: ../../library/configparser.rst:717 msgid "" "Interpolation behaviour may be customized by providing a custom handler " "through the *interpolation* argument. ``None`` can be used to turn off " @@ -1019,11 +1019,11 @@ msgid "" "`RawConfigParser` has a default value of ``None``." msgstr "" -#: ../../library/configparser.rst:723 +#: ../../library/configparser.rst:724 msgid "*converters*, default value: not set" msgstr "" -#: ../../library/configparser.rst:725 +#: ../../library/configparser.rst:726 msgid "" "Config parsers provide option value getters that perform type conversion. " "By default :meth:`~ConfigParser.getint`, :meth:`~ConfigParser.getfloat`, " @@ -1037,7 +1037,7 @@ msgid "" "``parser_instance['section'].getdecimal('key', 0)``." msgstr "" -#: ../../library/configparser.rst:736 +#: ../../library/configparser.rst:737 msgid "" "If the converter needs to access the state of the parser, it can be " "implemented as a method on a config parser subclass. If the name of this " @@ -1045,14 +1045,14 @@ msgid "" "the dict-compatible form (see the ``getdecimal()`` example above)." msgstr "" -#: ../../library/configparser.rst:741 +#: ../../library/configparser.rst:742 msgid "" "More advanced customization may be achieved by overriding default values of " "these parser attributes. The defaults are defined on the classes, so they " "may be overridden by subclasses or by attribute assignment." msgstr "" -#: ../../library/configparser.rst:747 +#: ../../library/configparser.rst:748 msgid "" "By default when using :meth:`~ConfigParser.getboolean`, config parsers " "consider the following values ``True``: ``'1'``, ``'yes'``, ``'true'``, " @@ -1061,7 +1061,7 @@ msgid "" "strings and their Boolean outcomes. For example:" msgstr "" -#: ../../library/configparser.rst:753 +#: ../../library/configparser.rst:754 msgid "" ">>> custom = configparser.ConfigParser()\n" ">>> custom['section1'] = {'funky': 'nope'}\n" @@ -1083,13 +1083,13 @@ msgstr "" ">>> custom['section1'].getboolean('funky')\n" "False" -#: ../../library/configparser.rst:765 +#: ../../library/configparser.rst:766 msgid "" "Other typical Boolean pairs include ``accept``/``reject`` or ``enabled``/" "``disabled``." msgstr "" -#: ../../library/configparser.rst:771 +#: ../../library/configparser.rst:772 msgid "" "This method transforms option names on every read, get, or set operation. " "The default converts the name to lowercase. This also means that when a " @@ -1097,7 +1097,7 @@ msgid "" "method if that's unsuitable. For example:" msgstr "" -#: ../../library/configparser.rst:777 +#: ../../library/configparser.rst:778 msgid "" ">>> config = \"\"\"\n" "... [Section1]\n" @@ -1141,14 +1141,14 @@ msgstr "" ">>> list(custom['Section2'].keys())\n" "['AnotherKey']" -#: ../../library/configparser.rst:801 +#: ../../library/configparser.rst:802 msgid "" "The optionxform function transforms option names to a canonical form. This " "should be an idempotent function: if the name is already in canonical form, " "it should be returned unchanged." msgstr "" -#: ../../library/configparser.rst:808 +#: ../../library/configparser.rst:809 msgid "" "A compiled regular expression used to parse section headers. The default " "matches ``[section]`` to the name ``\"section\"``. Whitespace is considered " @@ -1157,7 +1157,7 @@ msgid "" "example:" msgstr "" -#: ../../library/configparser.rst:814 +#: ../../library/configparser.rst:815 msgid "" ">>> import re\n" ">>> config = \"\"\"\n" @@ -1195,18 +1195,18 @@ msgstr "" ">>> custom.sections()\n" "['Section 1', 'Section 2']" -#: ../../library/configparser.rst:836 +#: ../../library/configparser.rst:837 msgid "" "While ConfigParser objects also use an ``OPTCRE`` attribute for recognizing " "option lines, it's not recommended to override it because that would " "interfere with constructor options *allow_no_value* and *delimiters*." msgstr "" -#: ../../library/configparser.rst:842 +#: ../../library/configparser.rst:843 msgid "Legacy API Examples" msgstr "" -#: ../../library/configparser.rst:844 +#: ../../library/configparser.rst:845 msgid "" "Mainly because of backwards compatibility concerns, :mod:`configparser` " "provides also a legacy API with explicit ``get``/``set`` methods. While " @@ -1215,11 +1215,11 @@ msgid "" "advanced, low-level and downright counterintuitive." msgstr "" -#: ../../library/configparser.rst:850 +#: ../../library/configparser.rst:851 msgid "An example of writing to a configuration file::" msgstr "" -#: ../../library/configparser.rst:852 +#: ../../library/configparser.rst:853 msgid "" "import configparser\n" "\n" @@ -1243,11 +1243,11 @@ msgid "" " config.write(configfile)" msgstr "" -#: ../../library/configparser.rst:873 +#: ../../library/configparser.rst:874 msgid "An example of reading the configuration file again::" msgstr "" -#: ../../library/configparser.rst:875 +#: ../../library/configparser.rst:876 msgid "" "import configparser\n" "\n" @@ -1266,11 +1266,11 @@ msgid "" " print(config.get('Section1', 'foo'))" msgstr "" -#: ../../library/configparser.rst:891 +#: ../../library/configparser.rst:892 msgid "To get interpolation, use :class:`ConfigParser`::" msgstr "" -#: ../../library/configparser.rst:893 +#: ../../library/configparser.rst:894 msgid "" "import configparser\n" "\n" @@ -1305,13 +1305,13 @@ msgid "" " # -> None" msgstr "" -#: ../../library/configparser.rst:924 +#: ../../library/configparser.rst:925 msgid "" "Default values are available in both types of ConfigParsers. They are used " "in interpolation if an option used is not defined elsewhere. ::" msgstr "" -#: ../../library/configparser.rst:927 +#: ../../library/configparser.rst:928 msgid "" "import configparser\n" "\n" @@ -1325,11 +1325,11 @@ msgid "" "print(config.get('Section1', 'foo')) # -> \"Life is hard!\"" msgstr "" -#: ../../library/configparser.rst:942 +#: ../../library/configparser.rst:943 msgid "ConfigParser Objects" msgstr "ConfigParser 物件" -#: ../../library/configparser.rst:946 +#: ../../library/configparser.rst:947 msgid "" "The main configuration parser. When *defaults* is given, it is initialized " "into the dictionary of intrinsic defaults. When *dict_type* is given, it " @@ -1337,7 +1337,7 @@ msgid "" "the options within a section, and for the default values." msgstr "" -#: ../../library/configparser.rst:951 +#: ../../library/configparser.rst:952 msgid "" "When *delimiters* is given, it is used as the set of substrings that divide " "keys from values. When *comment_prefixes* is given, it will be used as the " @@ -1346,7 +1346,7 @@ msgid "" "as the set of substrings that prefix comments in non-empty lines." msgstr "" -#: ../../library/configparser.rst:957 +#: ../../library/configparser.rst:958 msgid "" "When *strict* is ``True`` (the default), the parser won't allow for any " "section or option duplicates while reading from a single source (file, " @@ -1359,7 +1359,7 @@ msgid "" "without the trailing delimiter." msgstr "" -#: ../../library/configparser.rst:967 +#: ../../library/configparser.rst:968 msgid "" "When *default_section* is given, it specifies the name for the special " "section holding default values for other sections and interpolation purposes " @@ -1369,7 +1369,7 @@ msgid "" "settings to a new config file." msgstr "" -#: ../../library/configparser.rst:974 +#: ../../library/configparser.rst:975 msgid "" "Interpolation behaviour may be customized by providing a custom handler " "through the *interpolation* argument. ``None`` can be used to turn off " @@ -1378,7 +1378,7 @@ msgid "" "`dedicated documentation section <#interpolation-of-values>`_." msgstr "" -#: ../../library/configparser.rst:980 +#: ../../library/configparser.rst:981 msgid "" "All option names used in interpolation will be passed through the :meth:" "`optionxform` method just like any other option name reference. For " @@ -1387,7 +1387,7 @@ msgid "" "%(BAR)s`` are equivalent." msgstr "" -#: ../../library/configparser.rst:986 +#: ../../library/configparser.rst:987 msgid "" "When *converters* is given, it should be a dictionary where each key " "represents the name of a type converter and each value is a callable " @@ -1396,50 +1396,50 @@ msgid "" "object and section proxies." msgstr "" -#: ../../library/configparser.rst:1017 +#: ../../library/configparser.rst:1018 msgid "The default *dict_type* is :class:`collections.OrderedDict`." msgstr "" -#: ../../library/configparser.rst:1020 +#: ../../library/configparser.rst:1021 msgid "" "*allow_no_value*, *delimiters*, *comment_prefixes*, *strict*, " "*empty_lines_in_values*, *default_section* and *interpolation* were added." msgstr "" -#: ../../library/configparser.rst:1025 +#: ../../library/configparser.rst:1026 msgid "The *converters* argument was added." msgstr "新增 *converters* 引數。" -#: ../../library/configparser.rst:1028 +#: ../../library/configparser.rst:1029 msgid "" "The *defaults* argument is read with :meth:`read_dict`, providing consistent " "behavior across the parser: non-string keys and values are implicitly " "converted to strings." msgstr "" -#: ../../library/configparser.rst:1033 ../../library/configparser.rst:1305 +#: ../../library/configparser.rst:1034 ../../library/configparser.rst:1306 msgid "" "The default *dict_type* is :class:`dict`, since it now preserves insertion " "order." msgstr "" -#: ../../library/configparser.rst:1037 +#: ../../library/configparser.rst:1038 msgid "" "Raise a :exc:`MultilineContinuationError` when *allow_no_value* is ``True``, " "and a key without a value is continued with an indented line." msgstr "" -#: ../../library/configparser.rst:1043 +#: ../../library/configparser.rst:1044 msgid "Return a dictionary containing the instance-wide defaults." msgstr "" -#: ../../library/configparser.rst:1048 +#: ../../library/configparser.rst:1049 msgid "" "Return a list of the sections available; the *default section* is not " "included in the list." msgstr "" -#: ../../library/configparser.rst:1054 +#: ../../library/configparser.rst:1055 msgid "" "Add a section named *section* to the instance. If a section by the given " "name already exists, :exc:`DuplicateSectionError` is raised. If the " @@ -1447,34 +1447,34 @@ msgid "" "the section must be a string; if not, :exc:`TypeError` is raised." msgstr "" -#: ../../library/configparser.rst:1059 +#: ../../library/configparser.rst:1060 msgid "Non-string section names raise :exc:`TypeError`." msgstr "" -#: ../../library/configparser.rst:1065 +#: ../../library/configparser.rst:1066 msgid "" "Indicates whether the named *section* is present in the configuration. The " "*default section* is not acknowledged." msgstr "" -#: ../../library/configparser.rst:1071 +#: ../../library/configparser.rst:1072 msgid "Return a list of options available in the specified *section*." msgstr "" -#: ../../library/configparser.rst:1076 +#: ../../library/configparser.rst:1077 msgid "" "If the given *section* exists, and contains the given *option*, return :" "const:`True`; otherwise return :const:`False`. If the specified *section* " "is :const:`None` or an empty string, DEFAULT is assumed." msgstr "" -#: ../../library/configparser.rst:1083 +#: ../../library/configparser.rst:1084 msgid "" "Attempt to read and parse an iterable of filenames, returning a list of " "filenames which were successfully parsed." msgstr "" -#: ../../library/configparser.rst:1086 +#: ../../library/configparser.rst:1087 msgid "" "If *filenames* is a string, a :class:`bytes` object or a :term:`path-like " "object`, it is treated as a single filename. If a file named in *filenames* " @@ -1485,7 +1485,7 @@ msgid "" "be read." msgstr "" -#: ../../library/configparser.rst:1095 +#: ../../library/configparser.rst:1096 msgid "" "If none of the named files exist, the :class:`ConfigParser` instance will " "contain an empty dataset. An application which requires initial values to " @@ -1493,7 +1493,7 @@ msgid "" "`read_file` before calling :meth:`read` for any optional files::" msgstr "" -#: ../../library/configparser.rst:1101 +#: ../../library/configparser.rst:1102 msgid "" "import configparser, os\n" "\n" @@ -1509,49 +1509,49 @@ msgstr "" "config.read(['site.cfg', os.path.expanduser('~/.myapp.cfg')],\n" " encoding='cp1250')" -#: ../../library/configparser.rst:1108 +#: ../../library/configparser.rst:1109 msgid "" "Added the *encoding* parameter. Previously, all files were read using the " "default encoding for :func:`open`." msgstr "" -#: ../../library/configparser.rst:1112 +#: ../../library/configparser.rst:1113 msgid "The *filenames* parameter accepts a :term:`path-like object`." msgstr "" -#: ../../library/configparser.rst:1115 +#: ../../library/configparser.rst:1116 msgid "The *filenames* parameter accepts a :class:`bytes` object." msgstr "" -#: ../../library/configparser.rst:1121 +#: ../../library/configparser.rst:1122 msgid "" "Read and parse configuration data from *f* which must be an iterable " "yielding Unicode strings (for example files opened in text mode)." msgstr "" -#: ../../library/configparser.rst:1124 +#: ../../library/configparser.rst:1125 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*; " "the default is ``''``." msgstr "" -#: ../../library/configparser.rst:1128 +#: ../../library/configparser.rst:1129 msgid "Replaces :meth:`!readfp`." msgstr "取代 :meth:`!readfp`。" -#: ../../library/configparser.rst:1133 +#: ../../library/configparser.rst:1134 msgid "Parse configuration data from a string." msgstr "" -#: ../../library/configparser.rst:1135 +#: ../../library/configparser.rst:1136 msgid "" "Optional argument *source* specifies a context-specific name of the string " "passed. If not given, ``''`` is used. This should commonly be a " "filesystem path or a URL." msgstr "" -#: ../../library/configparser.rst:1144 +#: ../../library/configparser.rst:1145 msgid "" "Load configuration from any object that provides a dict-like ``items()`` " "method. Keys are section names, values are dictionaries with keys and " @@ -1560,17 +1560,17 @@ msgid "" "automatically converted to strings." msgstr "" -#: ../../library/configparser.rst:1150 +#: ../../library/configparser.rst:1151 msgid "" "Optional argument *source* specifies a context-specific name of the " "dictionary passed. If not given, ```` is used." msgstr "" -#: ../../library/configparser.rst:1153 +#: ../../library/configparser.rst:1154 msgid "This method can be used to copy state between parsers." msgstr "" -#: ../../library/configparser.rst:1160 +#: ../../library/configparser.rst:1161 msgid "" "Get an *option* value for the named *section*. If *vars* is provided, it " "must be a dictionary. The *option* is looked up in *vars* (if provided), " @@ -1579,35 +1579,35 @@ msgid "" "provided as a *fallback* value." msgstr "" -#: ../../library/configparser.rst:1166 +#: ../../library/configparser.rst:1167 msgid "" "All the ``'%'`` interpolations are expanded in the return values, unless the " "*raw* argument is true. Values for interpolation keys are looked up in the " "same manner as the option." msgstr "" -#: ../../library/configparser.rst:1170 +#: ../../library/configparser.rst:1171 msgid "" "Arguments *raw*, *vars* and *fallback* are keyword only to protect users " "from trying to use the third argument as the *fallback* fallback (especially " "when using the mapping protocol)." msgstr "" -#: ../../library/configparser.rst:1178 +#: ../../library/configparser.rst:1179 msgid "" "A convenience method which coerces the *option* in the specified *section* " "to an integer. See :meth:`get` for explanation of *raw*, *vars* and " "*fallback*." msgstr "" -#: ../../library/configparser.rst:1185 +#: ../../library/configparser.rst:1186 msgid "" "A convenience method which coerces the *option* in the specified *section* " "to a floating-point number. See :meth:`get` for explanation of *raw*, " "*vars* and *fallback*." msgstr "" -#: ../../library/configparser.rst:1192 +#: ../../library/configparser.rst:1193 msgid "" "A convenience method which coerces the *option* in the specified *section* " "to a Boolean value. Note that the accepted values for the option are " @@ -1619,34 +1619,34 @@ msgid "" "*fallback*." msgstr "" -#: ../../library/configparser.rst:1205 +#: ../../library/configparser.rst:1206 msgid "" "When *section* is not given, return a list of *section_name*, " "*section_proxy* pairs, including DEFAULTSECT." msgstr "" -#: ../../library/configparser.rst:1208 +#: ../../library/configparser.rst:1209 msgid "" "Otherwise, return a list of *name*, *value* pairs for the options in the " "given *section*. Optional arguments have the same meaning as for the :meth:" "`get` method." msgstr "" -#: ../../library/configparser.rst:1212 +#: ../../library/configparser.rst:1213 msgid "" "Items present in *vars* no longer appear in the result. The previous " "behaviour mixed actual parser options with variables provided for " "interpolation." msgstr "" -#: ../../library/configparser.rst:1220 +#: ../../library/configparser.rst:1221 msgid "" "If the given section exists, set the given option to the specified value; " "otherwise raise :exc:`NoSectionError`. *option* and *value* must be " "strings; if not, :exc:`TypeError` is raised." msgstr "" -#: ../../library/configparser.rst:1227 +#: ../../library/configparser.rst:1228 msgid "" "Write a representation of the configuration to the specified :term:`file " "object`, which must be opened in text mode (accepting strings). This " @@ -1655,27 +1655,27 @@ msgid "" "surrounded by spaces." msgstr "" -#: ../../library/configparser.rst:1235 +#: ../../library/configparser.rst:1236 msgid "" "Comments in the original configuration file are not preserved when writing " "the configuration back. What is considered a comment, depends on the given " "values for *comment_prefix* and *inline_comment_prefix*." msgstr "" -#: ../../library/configparser.rst:1243 +#: ../../library/configparser.rst:1244 msgid "" "Remove the specified *option* from the specified *section*. If the section " "does not exist, raise :exc:`NoSectionError`. If the option existed to be " "removed, return :const:`True`; otherwise return :const:`False`." msgstr "" -#: ../../library/configparser.rst:1251 +#: ../../library/configparser.rst:1252 msgid "" "Remove the specified *section* from the configuration. If the section in " "fact existed, return ``True``. Otherwise return ``False``." msgstr "" -#: ../../library/configparser.rst:1257 +#: ../../library/configparser.rst:1258 msgid "" "Transforms the option name *option* as found in an input file or as passed " "in by client code to the form that should be used in the internal " @@ -1684,7 +1684,7 @@ msgid "" "of this name on instances to affect this behavior." msgstr "" -#: ../../library/configparser.rst:1263 +#: ../../library/configparser.rst:1264 msgid "" "You don't need to subclass the parser to use this method, you can also set " "it on an instance, to a function that takes a string argument and returns a " @@ -1692,7 +1692,7 @@ msgid "" "sensitive::" msgstr "" -#: ../../library/configparser.rst:1268 +#: ../../library/configparser.rst:1269 msgid "" "cfgparser = ConfigParser()\n" "cfgparser.optionxform = str" @@ -1700,30 +1700,30 @@ msgstr "" "cfgparser = ConfigParser()\n" "cfgparser.optionxform = str" -#: ../../library/configparser.rst:1271 +#: ../../library/configparser.rst:1272 msgid "" "Note that when reading configuration files, whitespace around the option " "names is stripped before :meth:`optionxform` is called." msgstr "" -#: ../../library/configparser.rst:1277 +#: ../../library/configparser.rst:1278 msgid "" "A special object representing a section name used to reference the unnamed " "section (see :ref:`unnamed-sections`)." msgstr "" -#: ../../library/configparser.rst:1282 +#: ../../library/configparser.rst:1283 msgid "" "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:1290 +#: ../../library/configparser.rst:1291 msgid "RawConfigParser Objects" msgstr "RawConfigParser 物件" -#: ../../library/configparser.rst:1300 +#: ../../library/configparser.rst:1301 msgid "" "Legacy variant of the :class:`ConfigParser`. It has interpolation disabled " "by default and allows for non-string section names, option names, and values " @@ -1731,27 +1731,27 @@ msgid "" "``defaults=`` keyword argument handling." msgstr "" -#: ../../library/configparser.rst:1310 +#: ../../library/configparser.rst:1311 msgid "" "Consider using :class:`ConfigParser` instead which checks types of the " "values to be stored internally. If you don't want interpolation, you can " "use ``ConfigParser(interpolation=None)``." msgstr "" -#: ../../library/configparser.rst:1317 +#: ../../library/configparser.rst:1318 msgid "" "Add a section named *section* to the instance. If a section by the given " "name already exists, :exc:`DuplicateSectionError` is raised. If the " "*default section* name is passed, :exc:`ValueError` is raised." msgstr "" -#: ../../library/configparser.rst:1321 +#: ../../library/configparser.rst:1322 msgid "" "Type of *section* is not checked which lets users create non-string named " "sections. This behaviour is unsupported and may cause internal errors." msgstr "" -#: ../../library/configparser.rst:1327 +#: ../../library/configparser.rst:1328 msgid "" "If the given section exists, set the given option to the specified value; " "otherwise raise :exc:`NoSectionError`. While it is possible to use :class:" @@ -1761,7 +1761,7 @@ msgid "" "string values." msgstr "" -#: ../../library/configparser.rst:1334 +#: ../../library/configparser.rst:1335 msgid "" "This method lets users assign non-string values to keys internally. This " "behaviour is unsupported and will cause errors when attempting to write to a " @@ -1769,32 +1769,32 @@ msgid "" "not allow such assignments to take place." msgstr "" -#: ../../library/configparser.rst:1341 +#: ../../library/configparser.rst:1342 msgid "Exceptions" msgstr "例外" -#: ../../library/configparser.rst:1345 +#: ../../library/configparser.rst:1346 msgid "Base class for all other :mod:`configparser` exceptions." msgstr "" -#: ../../library/configparser.rst:1350 +#: ../../library/configparser.rst:1351 msgid "Exception raised when a specified section is not found." msgstr "" -#: ../../library/configparser.rst:1355 +#: ../../library/configparser.rst:1356 msgid "" "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:1359 +#: ../../library/configparser.rst:1360 msgid "" "Added the optional *source* and *lineno* attributes and parameters to :meth:" "`!__init__`." msgstr "" -#: ../../library/configparser.rst:1366 +#: ../../library/configparser.rst:1367 msgid "" "Exception raised by strict parsers if a single option appears twice during " "reading from a single file, string or dictionary. This catches misspellings " @@ -1802,64 +1802,64 @@ msgid "" "representing the same case-insensitive configuration key." msgstr "" -#: ../../library/configparser.rst:1374 +#: ../../library/configparser.rst:1375 msgid "" "Exception raised when a specified option is not found in the specified " "section." msgstr "" -#: ../../library/configparser.rst:1380 +#: ../../library/configparser.rst:1381 msgid "" "Base class for exceptions raised when problems occur performing string " "interpolation." msgstr "" -#: ../../library/configparser.rst:1386 +#: ../../library/configparser.rst:1387 msgid "" "Exception raised when string interpolation cannot be completed because the " "number of iterations exceeds :const:`MAX_INTERPOLATION_DEPTH`. Subclass of :" "exc:`InterpolationError`." msgstr "" -#: ../../library/configparser.rst:1393 +#: ../../library/configparser.rst:1394 msgid "" "Exception raised when an option referenced from a value does not exist. " "Subclass of :exc:`InterpolationError`." msgstr "" -#: ../../library/configparser.rst:1399 +#: ../../library/configparser.rst:1400 msgid "" "Exception raised when the source text into which substitutions are made does " "not conform to the required syntax. Subclass of :exc:`InterpolationError`." msgstr "" -#: ../../library/configparser.rst:1405 +#: ../../library/configparser.rst:1406 msgid "" "Exception raised when attempting to parse a file which has no section " "headers." msgstr "" -#: ../../library/configparser.rst:1411 +#: ../../library/configparser.rst:1412 msgid "Exception raised when errors occur attempting to parse a file." msgstr "" -#: ../../library/configparser.rst:1413 +#: ../../library/configparser.rst:1414 msgid "" "The ``filename`` attribute and :meth:`!__init__` constructor argument were " "removed. They have been available using the name ``source`` since 3.2." msgstr "" -#: ../../library/configparser.rst:1419 +#: ../../library/configparser.rst:1420 msgid "" "Exception raised when a key without a corresponding value is continued with " "an indented line." msgstr "" -#: ../../library/configparser.rst:1425 +#: ../../library/configparser.rst:1426 msgid "Footnotes" msgstr "註解" -#: ../../library/configparser.rst:1426 +#: ../../library/configparser.rst:1427 msgid "" "Config parsers allow for heavy customization. If you are interested in " "changing the behaviour outlined by the footnote reference, consult the " @@ -1886,14 +1886,14 @@ msgstr "ini file(ini 檔案)" msgid "Windows ini file" msgstr "Windows ini file(Windows ini 檔案)" -#: ../../library/configparser.rst:366 +#: ../../library/configparser.rst:367 msgid "% (percent)" msgstr "% (百分號)" -#: ../../library/configparser.rst:366 ../../library/configparser.rst:399 +#: ../../library/configparser.rst:367 ../../library/configparser.rst:400 msgid "interpolation in configuration files" msgstr "interpolation in configuration files(設定檔中的插值)" -#: ../../library/configparser.rst:399 +#: ../../library/configparser.rst:400 msgid "$ (dollar)" msgstr "$ (金錢符號)" diff --git a/library/ctypes.po b/library/ctypes.po index 4d41b963bb..0fb1ee514b 100644 --- a/library/ctypes.po +++ b/library/ctypes.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-09 00:13+0000\n" "PO-Revision-Date: 2023-04-26 02:59+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -4065,14 +4065,14 @@ msgid "" "attribute to 0 is the same as not setting it at all." msgstr "" -#: ../../library/ctypes.rst:2545 +#: ../../library/ctypes.rst:2547 msgid "" "An optional sequence that lists the names of unnamed (anonymous) fields. :" "attr:`_anonymous_` must be already defined when :attr:`_fields_` is " "assigned, otherwise it will have no effect." msgstr "" -#: ../../library/ctypes.rst:2549 +#: ../../library/ctypes.rst:2551 msgid "" "The fields listed in this variable must be structure or union type fields. :" "mod:`ctypes` will create descriptors in the structure type that allows " @@ -4080,11 +4080,11 @@ msgid "" "structure or union field." msgstr "" -#: ../../library/ctypes.rst:2554 +#: ../../library/ctypes.rst:2556 msgid "Here is an example type (Windows)::" msgstr "" -#: ../../library/ctypes.rst:2556 +#: ../../library/ctypes.rst:2558 msgid "" "class _U(Union):\n" " _fields_ = [(\"lptdesc\", POINTER(TYPEDESC)),\n" @@ -4106,7 +4106,7 @@ msgstr "" " _fields_ = [(\"u\", _U),\n" " (\"vt\", VARTYPE)]" -#: ../../library/ctypes.rst:2567 +#: ../../library/ctypes.rst:2569 msgid "" "The ``TYPEDESC`` structure describes a COM data type, the ``vt`` field " "specifies which one of the union fields is valid. Since the ``u`` field is " @@ -4116,7 +4116,7 @@ msgid "" "temporary union instance::" msgstr "" -#: ../../library/ctypes.rst:2574 +#: ../../library/ctypes.rst:2576 msgid "" "td = TYPEDESC()\n" "td.vt = VT_PTR\n" @@ -4128,7 +4128,7 @@ msgstr "" "td.lptdesc = POINTER(some_type)\n" "td.u.lptdesc = POINTER(some_type)" -#: ../../library/ctypes.rst:2579 +#: ../../library/ctypes.rst:2581 msgid "" "It is possible to define sub-subclasses of structures, they inherit the " "fields of the base class. If the subclass definition has a separate :attr:" @@ -4136,7 +4136,7 @@ msgid "" "of the base class." msgstr "" -#: ../../library/ctypes.rst:2584 +#: ../../library/ctypes.rst:2586 msgid "" "Structure and union constructors accept both positional and keyword " "arguments. Positional arguments are used to initialize member fields in the " @@ -4146,15 +4146,15 @@ msgid "" "names not present in :attr:`_fields_`." msgstr "" -#: ../../library/ctypes.rst:2595 +#: ../../library/ctypes.rst:2597 msgid "Arrays and pointers" msgstr "" -#: ../../library/ctypes.rst:2599 +#: ../../library/ctypes.rst:2601 msgid "Abstract base class for arrays." msgstr "" -#: ../../library/ctypes.rst:2601 +#: ../../library/ctypes.rst:2603 msgid "" "The recommended way to create concrete array types is by multiplying any :" "mod:`ctypes` data type with a non-negative integer. Alternatively, you can " @@ -4164,46 +4164,46 @@ msgid "" "an :class:`Array`." msgstr "" -#: ../../library/ctypes.rst:2611 +#: ../../library/ctypes.rst:2613 msgid "" "A positive integer specifying the number of elements in the array. Out-of-" "range subscripts result in an :exc:`IndexError`. Will be returned by :func:" "`len`." msgstr "" -#: ../../library/ctypes.rst:2618 +#: ../../library/ctypes.rst:2620 msgid "Specifies the type of each element in the array." msgstr "" -#: ../../library/ctypes.rst:2621 +#: ../../library/ctypes.rst:2623 msgid "" "Array subclass constructors accept positional arguments, used to initialize " "the elements in order." msgstr "" -#: ../../library/ctypes.rst:2626 +#: ../../library/ctypes.rst:2628 msgid "" "Create an array. Equivalent to ``type * length``, where *type* is a :mod:" "`ctypes` data type and *length* an integer." msgstr "" -#: ../../library/ctypes.rst:2630 +#: ../../library/ctypes.rst:2632 msgid "" "This function is :term:`soft deprecated` in favor of multiplication. There " "are no plans to remove it." msgstr "" -#: ../../library/ctypes.rst:2636 +#: ../../library/ctypes.rst:2638 msgid "Private, abstract base class for pointers." msgstr "" -#: ../../library/ctypes.rst:2638 +#: ../../library/ctypes.rst:2640 msgid "" "Concrete pointer types are created by calling :func:`POINTER` with the type " "that will be pointed to; this is done automatically by :func:`pointer`." msgstr "" -#: ../../library/ctypes.rst:2642 +#: ../../library/ctypes.rst:2644 msgid "" "If a pointer points to an array, its elements can be read and written using " "standard subscript and slice accesses. Pointer objects have no size, so :" @@ -4212,11 +4212,11 @@ msgid "" "probably crash with an access violation (if you're lucky)." msgstr "" -#: ../../library/ctypes.rst:2652 +#: ../../library/ctypes.rst:2654 msgid "Specifies the type pointed to." msgstr "" -#: ../../library/ctypes.rst:2656 +#: ../../library/ctypes.rst:2658 msgid "" "Returns the object to which to pointer points. Assigning to this attribute " "changes the pointer to point to the assigned object." diff --git a/library/curses.po b/library/curses.po index 0640ee51c5..669c6cc5dc 100644 --- a/library/curses.po +++ b/library/curses.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-11 00:13+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-" @@ -41,8 +41,8 @@ msgid "" msgstr "" #: ../../includes/wasm-mobile-notavail.rst:3 -msgid ":ref:`Availability `: not Android, not iOS, not WASI." -msgstr ":ref:`適用 `:非 Android、非 iOS、非 WASI。" +msgid "Availability" +msgstr "" #: ../../includes/wasm-mobile-notavail.rst:5 msgid "" diff --git a/library/datetime.po b/library/datetime.po index 21b3d8a2d7..5fcda8bc81 100644 --- a/library/datetime.po +++ b/library/datetime.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 00:13+0000\n" +"POT-Creation-Date: 2024-10-15 00:14+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-" @@ -270,7 +270,8 @@ msgid "" msgstr "" #: ../../library/datetime.rst:183 -msgid "A :class:`.datetime` object *d* is aware if both of the following hold:" +msgid "" +"A :class:`.datetime` object ``d`` is aware if both of the following hold:" msgstr "" #: ../../library/datetime.rst:185 @@ -282,11 +283,11 @@ msgid "``d.tzinfo.utcoffset(d)`` does not return ``None``" msgstr "``d.tzinfo.utcoffset(d)`` 不會回傳 ``None``" #: ../../library/datetime.rst:188 -msgid "Otherwise, *d* is naive." -msgstr "否則 *d* 會是 naive 的。" +msgid "Otherwise, ``d`` is naive." +msgstr "否則 ``d`` 會是 naive 的。" #: ../../library/datetime.rst:190 -msgid "A :class:`.time` object *t* is aware if both of the following hold:" +msgid "A :class:`.time` object ``t`` is aware if both of the following hold:" msgstr "" #: ../../library/datetime.rst:192 @@ -298,8 +299,8 @@ msgid "``t.tzinfo.utcoffset(None)`` does not return ``None``." msgstr "``t.tzinfo.utcoffset(None)`` 沒有回傳 ``None``。" #: ../../library/datetime.rst:195 -msgid "Otherwise, *t* is naive." -msgstr "" +msgid "Otherwise, ``t`` is naive." +msgstr "否則 ``t`` 會是 naive 的。" #: ../../library/datetime.rst:197 msgid "" @@ -423,8 +424,8 @@ msgstr "" "(-1, 86399, 999999)" #: ../../library/datetime.rst:265 ../../library/datetime.rst:566 -#: ../../library/datetime.rst:1122 ../../library/datetime.rst:1760 -#: ../../library/datetime.rst:2365 +#: ../../library/datetime.rst:1126 ../../library/datetime.rst:1764 +#: ../../library/datetime.rst:2369 msgid "Class attributes:" msgstr "類別屬性:" @@ -452,7 +453,7 @@ msgid "" msgstr "" #: ../../library/datetime.rst:287 ../../library/datetime.rst:584 -#: ../../library/datetime.rst:1142 ../../library/datetime.rst:1780 +#: ../../library/datetime.rst:1146 ../../library/datetime.rst:1784 msgid "Instance attributes (read-only):" msgstr "" @@ -492,17 +493,17 @@ msgid "Between 0 and 999,999 inclusive." msgstr "在 0 到 999,999 (含)之間" #: ../../library/datetime.rst:318 ../../library/datetime.rst:601 -#: ../../library/datetime.rst:1195 +#: ../../library/datetime.rst:1199 msgid "Supported operations:" msgstr "" #: ../../library/datetime.rst:323 ../../library/datetime.rst:604 -#: ../../library/datetime.rst:1198 +#: ../../library/datetime.rst:1202 msgid "Operation" msgstr "" #: ../../library/datetime.rst:323 ../../library/datetime.rst:604 -#: ../../library/datetime.rst:1198 +#: ../../library/datetime.rst:1202 msgid "Result" msgstr "" @@ -595,7 +596,7 @@ msgstr "``q, r = divmod(t1, t2)``" #: ../../library/datetime.rst:359 msgid "" "Computes the quotient and the remainder: ``q = t1 // t2`` (3) and ``r = t1 % " -"t2``. q is an integer and r is a :class:`timedelta` object." +"t2``. ``q`` is an integer and ``r`` is a :class:`timedelta` object." msgstr "" #: ../../library/datetime.rst:364 @@ -615,6 +616,8 @@ msgid "" "Equivalent to ``timedelta(-t1.days, -t1.seconds, -t1.microseconds)``, and to " "``t1 * -1``. (1)(4)" msgstr "" +"等價於 ``timedelta(-t1.days, -t1.seconds, -t1.microseconds)``,也等價於 ``t1 " +"* -1``。 (1)(4)" #: ../../library/datetime.rst:371 msgid "``abs(t)``" @@ -647,7 +650,7 @@ msgid "" msgstr "" #: ../../library/datetime.rst:384 ../../library/datetime.rst:623 -#: ../../library/datetime.rst:2596 +#: ../../library/datetime.rst:2600 msgid "Notes:" msgstr "註解:" @@ -719,7 +722,7 @@ msgid "" msgstr "" #: ../../library/datetime.rst:428 ../../library/datetime.rst:665 -#: ../../library/datetime.rst:1285 ../../library/datetime.rst:1887 +#: ../../library/datetime.rst:1289 ../../library/datetime.rst:1891 msgid "Instance methods:" msgstr "實例方法:" @@ -876,7 +879,7 @@ msgstr "" #: ../../library/datetime.rst:528 msgid "" ":exc:`ValueError` is raised unless ``1 <= ordinal <= date.max.toordinal()``. " -"For any date *d*, ``date.fromordinal(d.toordinal()) == d``." +"For any date ``d``, ``date.fromordinal(d.toordinal()) == d``." msgstr "" #: ../../library/datetime.rst:535 @@ -885,23 +888,23 @@ msgid "" "ISO 8601 format, with the following exceptions:" msgstr "" -#: ../../library/datetime.rst:538 ../../library/datetime.rst:1044 +#: ../../library/datetime.rst:538 ../../library/datetime.rst:1048 msgid "" "Reduced precision dates are not currently supported (``YYYY-MM``, ``YYYY``)." msgstr "" -#: ../../library/datetime.rst:540 ../../library/datetime.rst:1046 +#: ../../library/datetime.rst:540 ../../library/datetime.rst:1050 msgid "" "Extended date representations are not currently supported (``±YYYYYY-MM-" "DD``)." msgstr "" -#: ../../library/datetime.rst:542 ../../library/datetime.rst:1048 +#: ../../library/datetime.rst:542 ../../library/datetime.rst:1052 msgid "Ordinal dates are not currently supported (``YYYY-OOO``)." msgstr "" -#: ../../library/datetime.rst:544 ../../library/datetime.rst:1050 -#: ../../library/datetime.rst:1516 +#: ../../library/datetime.rst:544 ../../library/datetime.rst:1054 +#: ../../library/datetime.rst:1520 msgid "Examples::" msgstr "範例: ::" @@ -948,15 +951,15 @@ msgid "" "``timedelta(days=1)``." msgstr "" -#: ../../library/datetime.rst:588 ../../library/datetime.rst:1146 +#: ../../library/datetime.rst:588 ../../library/datetime.rst:1150 msgid "Between :const:`MINYEAR` and :const:`MAXYEAR` inclusive." msgstr "" -#: ../../library/datetime.rst:593 ../../library/datetime.rst:1151 +#: ../../library/datetime.rst:593 ../../library/datetime.rst:1155 msgid "Between 1 and 12 inclusive." msgstr "在 1 到 12 (含)之間。" -#: ../../library/datetime.rst:598 ../../library/datetime.rst:1156 +#: ../../library/datetime.rst:598 ../../library/datetime.rst:1160 msgid "Between 1 and the number of days in the given month of the given year." msgstr "" @@ -980,7 +983,7 @@ msgstr "" msgid "``timedelta = date1 - date2``" msgstr "``timedelta = date1 - date2``" -#: ../../library/datetime.rst:612 ../../library/datetime.rst:1204 +#: ../../library/datetime.rst:612 ../../library/datetime.rst:1208 msgid "\\(3)" msgstr "\\(3)" @@ -992,7 +995,7 @@ msgstr "``date1 == date2``" msgid "``date1 != date2``" msgstr "``date1 != date2``" -#: ../../library/datetime.rst:614 ../../library/datetime.rst:1206 +#: ../../library/datetime.rst:614 ../../library/datetime.rst:1210 msgid "Equality comparison. (4)" msgstr "" @@ -1012,7 +1015,7 @@ msgstr "``date1 <= date2``" msgid "``date1 >= date2``" msgstr "``date1 >= date2``" -#: ../../library/datetime.rst:617 ../../library/datetime.rst:1209 +#: ../../library/datetime.rst:617 ../../library/datetime.rst:1213 msgid "Order comparison. (5)" msgstr "" @@ -1059,7 +1062,7 @@ msgid "" "datetime` instance and a :class:`!datetime` object raises :exc:`TypeError`." msgstr "" -#: ../../library/datetime.rst:655 ../../library/datetime.rst:1277 +#: ../../library/datetime.rst:655 ../../library/datetime.rst:1281 msgid "" "Comparison between :class:`.datetime` object and an instance of the :class:" "`date` subclass that is not a :class:`!datetime` subclass no longer converts " @@ -1079,7 +1082,7 @@ msgid "" "values by whichever keyword arguments are specified." msgstr "" -#: ../../library/datetime.rst:672 ../../library/datetime.rst:1933 +#: ../../library/datetime.rst:672 ../../library/datetime.rst:1937 msgid "Example::" msgstr "範例: ::" @@ -1101,7 +1104,7 @@ msgid "" "replace`." msgstr "" -#: ../../library/datetime.rst:685 ../../library/datetime.rst:1401 +#: ../../library/datetime.rst:685 ../../library/datetime.rst:1405 msgid "" "Return a :class:`time.struct_time` such as returned by :func:`time." "localtime`." @@ -1112,7 +1115,7 @@ msgstr "" msgid "The hours, minutes and seconds are 0, and the DST flag is -1." msgstr "" -#: ../../library/datetime.rst:689 ../../library/datetime.rst:1403 +#: ../../library/datetime.rst:689 ../../library/datetime.rst:1407 msgid "``d.timetuple()`` is equivalent to::" msgstr "``d.timetuple()`` 等價於: ::" @@ -1131,7 +1134,7 @@ msgstr "" #: ../../library/datetime.rst:699 msgid "" "Return the proleptic Gregorian ordinal of the date, where January 1 of year " -"1 has ordinal 1. For any :class:`date` object *d*, ``date.fromordinal(d." +"1 has ordinal 1. For any :class:`date` object ``d``, ``date.fromordinal(d." "toordinal()) == d``." msgstr "" @@ -1211,7 +1214,7 @@ msgstr "" "'2002-12-04'" #: ../../library/datetime.rst:752 -msgid "For a date *d*, ``str(d)`` is equivalent to ``d.isoformat()``." +msgid "For a date ``d``, ``str(d)`` is equivalent to ``d.isoformat()``." msgstr "" #: ../../library/datetime.rst:757 @@ -1228,11 +1231,11 @@ msgstr "" ">>> date(2002, 12, 4).ctime()\n" "'Wed Dec 4 00:00:00 2002'" -#: ../../library/datetime.rst:763 ../../library/datetime.rst:1587 +#: ../../library/datetime.rst:763 ../../library/datetime.rst:1591 msgid "``d.ctime()`` is equivalent to::" msgstr "``d.ctime()`` 等價於: ::" -#: ../../library/datetime.rst:765 ../../library/datetime.rst:1589 +#: ../../library/datetime.rst:765 ../../library/datetime.rst:1593 msgid "time.ctime(time.mktime(d.timetuple()))" msgstr "time.ctime(time.mktime(d.timetuple()))" @@ -1392,28 +1395,28 @@ msgstr "``1 <= month <= 12``," msgid "``1 <= day <= number of days in the given month and year``," msgstr "" -#: ../../library/datetime.rst:877 ../../library/datetime.rst:1751 +#: ../../library/datetime.rst:877 ../../library/datetime.rst:1755 msgid "``0 <= hour < 24``," msgstr "``0 <= hour < 24``," -#: ../../library/datetime.rst:878 ../../library/datetime.rst:1752 +#: ../../library/datetime.rst:878 ../../library/datetime.rst:1756 msgid "``0 <= minute < 60``," msgstr "``0 <= minute < 60``," -#: ../../library/datetime.rst:879 ../../library/datetime.rst:1753 +#: ../../library/datetime.rst:879 ../../library/datetime.rst:1757 msgid "``0 <= second < 60``," msgstr "``0 <= second < 60``," -#: ../../library/datetime.rst:880 ../../library/datetime.rst:1754 +#: ../../library/datetime.rst:880 ../../library/datetime.rst:1758 msgid "``0 <= microsecond < 1000000``," msgstr "``0 <= microsecond < 1000000``," -#: ../../library/datetime.rst:881 ../../library/datetime.rst:1755 +#: ../../library/datetime.rst:881 ../../library/datetime.rst:1759 msgid "``fold in [0, 1]``." msgstr "" -#: ../../library/datetime.rst:885 ../../library/datetime.rst:1322 -#: ../../library/datetime.rst:1900 +#: ../../library/datetime.rst:885 ../../library/datetime.rst:1326 +#: ../../library/datetime.rst:1904 msgid "Added the *fold* parameter." msgstr "新增 *fold* 參數。" @@ -1464,18 +1467,24 @@ msgstr "" msgid "This function is preferred over :meth:`today` and :meth:`utcnow`." msgstr "" -#: ../../library/datetime.rst:921 +#: ../../library/datetime.rst:920 +msgid "" +"Subsequent calls to :meth:`!datetime.now` may return the same instant " +"depending on the precision of the underlying clock." +msgstr "" + +#: ../../library/datetime.rst:925 msgid "Return the current UTC date and time, with :attr:`.tzinfo` ``None``." msgstr "" -#: ../../library/datetime.rst:923 +#: ../../library/datetime.rst:927 msgid "" "This is like :meth:`now`, but returns the current UTC date and time, as a " "naive :class:`.datetime` object. An aware current UTC datetime can be " "obtained by calling ``datetime.now(timezone.utc)``. See also :meth:`now`." msgstr "" -#: ../../library/datetime.rst:929 +#: ../../library/datetime.rst:933 msgid "" "Because naive ``datetime`` objects are treated by many ``datetime`` methods " "as local times, it is preferred to use aware datetimes to represent times in " @@ -1483,11 +1492,11 @@ msgid "" "current time in UTC is by calling ``datetime.now(timezone.utc)``." msgstr "" -#: ../../library/datetime.rst:936 +#: ../../library/datetime.rst:940 msgid "Use :meth:`datetime.now` with :attr:`UTC` instead." msgstr "" -#: ../../library/datetime.rst:941 +#: ../../library/datetime.rst:945 msgid "" "Return the local date and time corresponding to the POSIX timestamp, such as " "is returned by :func:`time.time`. If optional argument *tz* is ``None`` or " @@ -1495,13 +1504,13 @@ msgid "" "time, and the returned :class:`.datetime` object is naive." msgstr "" -#: ../../library/datetime.rst:946 +#: ../../library/datetime.rst:950 msgid "" "If *tz* is not ``None``, it must be an instance of a :class:`tzinfo` " "subclass, and the timestamp is converted to *tz*’s time zone." msgstr "" -#: ../../library/datetime.rst:949 +#: ../../library/datetime.rst:953 msgid "" ":meth:`fromtimestamp` may raise :exc:`OverflowError`, if the timestamp is " "out of the range of values supported by the platform C :c:func:`localtime` " @@ -1514,7 +1523,7 @@ msgid "" "preferred over :meth:`utcfromtimestamp`." msgstr "" -#: ../../library/datetime.rst:960 +#: ../../library/datetime.rst:964 msgid "" "Raise :exc:`OverflowError` instead of :exc:`ValueError` if the timestamp is " "out of the range of values supported by the platform C :c:func:`localtime` " @@ -1522,17 +1531,17 @@ msgid "" "`ValueError` on :c:func:`localtime` or :c:func:`gmtime` failure." msgstr "" -#: ../../library/datetime.rst:967 +#: ../../library/datetime.rst:971 msgid ":meth:`fromtimestamp` may return instances with :attr:`.fold` set to 1." msgstr "" -#: ../../library/datetime.rst:972 +#: ../../library/datetime.rst:976 msgid "" "Return the UTC :class:`.datetime` corresponding to the POSIX timestamp, " "with :attr:`.tzinfo` ``None``. (The resulting object is naive.)" msgstr "" -#: ../../library/datetime.rst:975 +#: ../../library/datetime.rst:979 msgid "" "This may raise :exc:`OverflowError`, if the timestamp is out of the range of " "values supported by the platform C :c:func:`gmtime` function, and :exc:" @@ -1540,33 +1549,33 @@ msgid "" "to years in 1970 through 2038." msgstr "" -#: ../../library/datetime.rst:980 +#: ../../library/datetime.rst:984 msgid "To get an aware :class:`.datetime` object, call :meth:`fromtimestamp`::" msgstr "" -#: ../../library/datetime.rst:982 +#: ../../library/datetime.rst:986 msgid "datetime.fromtimestamp(timestamp, timezone.utc)" msgstr "datetime.fromtimestamp(timestamp, timezone.utc)" -#: ../../library/datetime.rst:984 +#: ../../library/datetime.rst:988 msgid "" "On the POSIX compliant platforms, it is equivalent to the following " "expression::" msgstr "" -#: ../../library/datetime.rst:987 +#: ../../library/datetime.rst:991 msgid "" "datetime(1970, 1, 1, tzinfo=timezone.utc) + timedelta(seconds=timestamp)" msgstr "" "datetime(1970, 1, 1, tzinfo=timezone.utc) + timedelta(seconds=timestamp)" -#: ../../library/datetime.rst:989 +#: ../../library/datetime.rst:993 msgid "" "except the latter formula always supports the full years range: between :" "const:`MINYEAR` and :const:`MAXYEAR` inclusive." msgstr "" -#: ../../library/datetime.rst:994 +#: ../../library/datetime.rst:998 msgid "" "Because naive ``datetime`` objects are treated by many ``datetime`` methods " "as local times, it is preferred to use aware datetimes to represent times in " @@ -1575,7 +1584,7 @@ msgid "" "tz=timezone.utc)``." msgstr "" -#: ../../library/datetime.rst:1000 +#: ../../library/datetime.rst:1004 msgid "" "Raise :exc:`OverflowError` instead of :exc:`ValueError` if the timestamp is " "out of the range of values supported by the platform C :c:func:`gmtime` " @@ -1583,11 +1592,11 @@ msgid "" "`gmtime` failure." msgstr "" -#: ../../library/datetime.rst:1008 +#: ../../library/datetime.rst:1012 msgid "Use :meth:`datetime.fromtimestamp` with :attr:`UTC` instead." msgstr "" -#: ../../library/datetime.rst:1013 +#: ../../library/datetime.rst:1017 msgid "" "Return the :class:`.datetime` corresponding to the proleptic Gregorian " "ordinal, where January 1 of year 1 has ordinal 1. :exc:`ValueError` is " @@ -1596,7 +1605,7 @@ msgid "" "is ``None``." msgstr "" -#: ../../library/datetime.rst:1021 +#: ../../library/datetime.rst:1025 msgid "" "Return a new :class:`.datetime` object whose date components are equal to " "the given :class:`date` object's, and whose time components are equal to the " @@ -1607,35 +1616,35 @@ msgid "" "attr:`.tzinfo` attributes are ignored." msgstr "" -#: ../../library/datetime.rst:1029 +#: ../../library/datetime.rst:1033 msgid "" -"For any :class:`.datetime` object *d*, ``d == datetime.combine(d.date(), d." +"For any :class:`.datetime` object ``d``, ``d == datetime.combine(d.date(), d." "time(), d.tzinfo)``." msgstr "" -#: ../../library/datetime.rst:1032 +#: ../../library/datetime.rst:1036 msgid "Added the *tzinfo* argument." msgstr "新增 *tzinfo* 引數。" -#: ../../library/datetime.rst:1038 +#: ../../library/datetime.rst:1042 msgid "" "Return a :class:`.datetime` corresponding to a *date_string* in any valid " "ISO 8601 format, with the following exceptions:" msgstr "" -#: ../../library/datetime.rst:1041 ../../library/datetime.rst:1851 +#: ../../library/datetime.rst:1045 ../../library/datetime.rst:1855 msgid "Time zone offsets may have fractional seconds." msgstr "" -#: ../../library/datetime.rst:1042 +#: ../../library/datetime.rst:1046 msgid "The ``T`` separator may be replaced by any single unicode character." msgstr "" -#: ../../library/datetime.rst:1043 ../../library/datetime.rst:1856 +#: ../../library/datetime.rst:1047 ../../library/datetime.rst:1860 msgid "Fractional hours and minutes are not supported." msgstr "" -#: ../../library/datetime.rst:1052 +#: ../../library/datetime.rst:1056 msgid "" ">>> from datetime import datetime\n" ">>> datetime.fromisoformat('2011-11-04')\n" @@ -1681,13 +1690,13 @@ msgstr "" "datetime.datetime(2011, 11, 4, 0, 5, 23,\n" " tzinfo=datetime.timezone(datetime.timedelta(seconds=14400)))" -#: ../../library/datetime.rst:1074 +#: ../../library/datetime.rst:1078 msgid "" "Previously, this method only supported formats that could be emitted by :" "meth:`date.isoformat` or :meth:`datetime.isoformat`." msgstr "" -#: ../../library/datetime.rst:1081 +#: ../../library/datetime.rst:1085 msgid "" "Return a :class:`.datetime` corresponding to the ISO calendar date specified " "by year, week and day. The non-date components of the datetime are populated " @@ -1695,23 +1704,23 @@ msgid "" "`datetime.isocalendar`." msgstr "" -#: ../../library/datetime.rst:1090 +#: ../../library/datetime.rst:1094 msgid "" "Return a :class:`.datetime` corresponding to *date_string*, parsed according " "to *format*." msgstr "" -#: ../../library/datetime.rst:1093 +#: ../../library/datetime.rst:1097 msgid "" "If *format* does not contain microseconds or time zone information, this is " "equivalent to::" msgstr "" -#: ../../library/datetime.rst:1095 ../../library/datetime.rst:2576 +#: ../../library/datetime.rst:1099 ../../library/datetime.rst:2580 msgid "datetime(*(time.strptime(date_string, format)[0:6]))" msgstr "datetime(*(time.strptime(date_string, format)[0:6]))" -#: ../../library/datetime.rst:1097 +#: ../../library/datetime.rst:1101 msgid "" ":exc:`ValueError` is raised if the date_string and format can't be parsed " "by :func:`time.strptime` or if it returns a value which isn't a time tuple. " @@ -1719,7 +1728,7 @@ msgid "" "fromisoformat`." msgstr "" -#: ../../library/datetime.rst:1104 +#: ../../library/datetime.rst:1108 msgid "" "If *format* specifies a day of month without a year a :exc:" "`DeprecationWarning` is now emitted. This is to avoid a quadrennial leap " @@ -1730,7 +1739,7 @@ msgid "" "not have a year, explicitly add a year that is a leap year before parsing:" msgstr "" -#: ../../library/datetime.rst:1113 +#: ../../library/datetime.rst:1117 msgid "" ">>> from datetime import datetime\n" ">>> date_string = \"02/29\"\n" @@ -1740,44 +1749,44 @@ msgid "" "'February 29'" msgstr "" -#: ../../library/datetime.rst:1126 +#: ../../library/datetime.rst:1130 msgid "" "The earliest representable :class:`.datetime`, ``datetime(MINYEAR, 1, 1, " "tzinfo=None)``." msgstr "" -#: ../../library/datetime.rst:1132 +#: ../../library/datetime.rst:1136 msgid "" "The latest representable :class:`.datetime`, ``datetime(MAXYEAR, 12, 31, 23, " "59, 59, 999999, tzinfo=None)``." msgstr "" -#: ../../library/datetime.rst:1138 +#: ../../library/datetime.rst:1142 msgid "" "The smallest possible difference between non-equal :class:`.datetime` " "objects, ``timedelta(microseconds=1)``." msgstr "" -#: ../../library/datetime.rst:1161 ../../library/datetime.rst:1784 +#: ../../library/datetime.rst:1165 ../../library/datetime.rst:1788 msgid "In ``range(24)``." msgstr "" -#: ../../library/datetime.rst:1166 ../../library/datetime.rst:1171 -#: ../../library/datetime.rst:1789 ../../library/datetime.rst:1794 +#: ../../library/datetime.rst:1170 ../../library/datetime.rst:1175 +#: ../../library/datetime.rst:1793 ../../library/datetime.rst:1798 msgid "In ``range(60)``." msgstr "" -#: ../../library/datetime.rst:1176 ../../library/datetime.rst:1799 +#: ../../library/datetime.rst:1180 ../../library/datetime.rst:1803 msgid "In ``range(1000000)``." msgstr "" -#: ../../library/datetime.rst:1181 +#: ../../library/datetime.rst:1185 msgid "" "The object passed as the *tzinfo* argument to the :class:`.datetime` " "constructor, or ``None`` if none was passed." msgstr "" -#: ../../library/datetime.rst:1187 ../../library/datetime.rst:1810 +#: ../../library/datetime.rst:1191 ../../library/datetime.rst:1814 msgid "" "In ``[0, 1]``. Used to disambiguate wall times during a repeated interval. " "(A repeated interval occurs when clocks are rolled back at the end of " @@ -1787,26 +1796,26 @@ msgid "" "time representation." msgstr "" -#: ../../library/datetime.rst:1200 +#: ../../library/datetime.rst:1204 msgid "``datetime2 = datetime1 + timedelta``" msgstr "``datetime2 = datetime1 + timedelta``" -#: ../../library/datetime.rst:1200 ../../library/datetime.rst:2423 -#: ../../library/datetime.rst:2428 ../../library/datetime.rst:2440 -#: ../../library/datetime.rst:2445 ../../library/datetime.rst:2505 -#: ../../library/datetime.rst:2510 ../../library/datetime.rst:2514 +#: ../../library/datetime.rst:1204 ../../library/datetime.rst:2427 +#: ../../library/datetime.rst:2432 ../../library/datetime.rst:2444 +#: ../../library/datetime.rst:2449 ../../library/datetime.rst:2509 +#: ../../library/datetime.rst:2514 ../../library/datetime.rst:2518 msgid "\\(1)" msgstr "\\(1)" -#: ../../library/datetime.rst:1202 +#: ../../library/datetime.rst:1206 msgid "``datetime2 = datetime1 - timedelta``" msgstr "``datetime2 = datetime1 - timedelta``" -#: ../../library/datetime.rst:1202 ../../library/datetime.rst:2456 +#: ../../library/datetime.rst:1206 ../../library/datetime.rst:2460 msgid "\\(2)" msgstr "\\(2)" -#: ../../library/datetime.rst:1204 +#: ../../library/datetime.rst:1208 msgid "``timedelta = datetime1 - datetime2``" msgstr "``timedelta = datetime1 - datetime2``" @@ -1834,7 +1843,7 @@ msgstr "``datetime1 <= datetime2``" msgid "``datetime1 >= datetime2``" msgstr "``datetime1 >= datetime2``" -#: ../../library/datetime.rst:1216 +#: ../../library/datetime.rst:1220 msgid "" "``datetime2`` is a duration of ``timedelta`` removed from ``datetime1``, " "moving forward in time if ``timedelta.days > 0``, or backward if ``timedelta." @@ -1845,7 +1854,7 @@ msgid "" "adjustments are done even if the input is an aware object." msgstr "" -#: ../../library/datetime.rst:1225 +#: ../../library/datetime.rst:1229 msgid "" "Computes the ``datetime2`` such that ``datetime2 + timedelta == datetime1``. " "As for addition, the result has the same :attr:`~.datetime.tzinfo` attribute " @@ -1853,41 +1862,41 @@ msgid "" "input is aware." msgstr "" -#: ../../library/datetime.rst:1230 +#: ../../library/datetime.rst:1234 msgid "" "Subtraction of a :class:`.datetime` from a :class:`.datetime` is defined " "only if both operands are naive, or if both are aware. If one is aware and " "the other is naive, :exc:`TypeError` is raised." msgstr "" -#: ../../library/datetime.rst:1234 +#: ../../library/datetime.rst:1238 msgid "" "If both are naive, or both are aware and have the same :attr:`~.datetime." "tzinfo` attribute, the :attr:`~.datetime.tzinfo` attributes are ignored, and " -"the result is a :class:`timedelta` object *t* such that ``datetime2 + t == " +"the result is a :class:`timedelta` object ``t`` such that ``datetime2 + t == " "datetime1``. No time zone adjustments are done in this case." msgstr "" -#: ../../library/datetime.rst:1239 +#: ../../library/datetime.rst:1243 msgid "" "If both are aware and have different :attr:`~.datetime.tzinfo` attributes, " -"``a-b`` acts as if *a* and *b* were first converted to naive UTC datetimes. " -"The result is ``(a.replace(tzinfo=None) - a.utcoffset()) - (b." +"``a-b`` acts as if ``a`` and ``b`` were first converted to naive UTC " +"datetimes. The result is ``(a.replace(tzinfo=None) - a.utcoffset()) - (b." "replace(tzinfo=None) - b.utcoffset())`` except that the implementation never " "overflows." msgstr "" -#: ../../library/datetime.rst:1245 +#: ../../library/datetime.rst:1249 msgid "" ":class:`.datetime` objects are equal if they represent the same date and " "time, taking into account the time zone." msgstr "" -#: ../../library/datetime.rst:1248 +#: ../../library/datetime.rst:1252 msgid "Naive and aware :class:`!datetime` objects are never equal." msgstr "" -#: ../../library/datetime.rst:1250 +#: ../../library/datetime.rst:1254 msgid "" "If both comparands are aware, and have the same :attr:`!tzinfo` attribute, " "the :attr:`!tzinfo` and :attr:`~.datetime.fold` attributes are ignored and " @@ -1898,19 +1907,19 @@ msgid "" "interval are never equal to :class:`!datetime` instances in other time zone." msgstr "" -#: ../../library/datetime.rst:1260 +#: ../../library/datetime.rst:1264 msgid "" "*datetime1* is considered less than *datetime2* when *datetime1* precedes " "*datetime2* in time, taking into account the time zone." msgstr "" -#: ../../library/datetime.rst:1263 +#: ../../library/datetime.rst:1267 msgid "" "Order comparison between naive and aware :class:`.datetime` objects raises :" "exc:`TypeError`." msgstr "" -#: ../../library/datetime.rst:1266 +#: ../../library/datetime.rst:1270 msgid "" "If both comparands are aware, and have the same :attr:`!tzinfo` attribute, " "the :attr:`!tzinfo` and :attr:`~.datetime.fold` attributes are ignored and " @@ -1920,33 +1929,33 @@ msgid "" "implementation never overflows." msgstr "" -#: ../../library/datetime.rst:1273 +#: ../../library/datetime.rst:1277 msgid "" "Equality comparisons between aware and naive :class:`.datetime` instances " "don't raise :exc:`TypeError`." msgstr "" -#: ../../library/datetime.rst:1289 +#: ../../library/datetime.rst:1293 msgid "Return :class:`date` object with same year, month and day." msgstr "" -#: ../../library/datetime.rst:1294 +#: ../../library/datetime.rst:1298 msgid "" "Return :class:`.time` object with same hour, minute, second, microsecond and " "fold. :attr:`.tzinfo` is ``None``. See also method :meth:`timetz`." msgstr "" -#: ../../library/datetime.rst:1297 ../../library/datetime.rst:1306 +#: ../../library/datetime.rst:1301 ../../library/datetime.rst:1310 msgid "The fold value is copied to the returned :class:`.time` object." msgstr "" -#: ../../library/datetime.rst:1303 +#: ../../library/datetime.rst:1307 msgid "" "Return :class:`.time` object with same hour, minute, second, microsecond, " "fold, and tzinfo attributes. See also method :meth:`time`." msgstr "" -#: ../../library/datetime.rst:1314 +#: ../../library/datetime.rst:1318 msgid "" "Return a datetime with the same attributes, except for those attributes " "given new values by whichever keyword arguments are specified. Note that " @@ -1954,27 +1963,27 @@ msgid "" "datetime with no conversion of date and time data." msgstr "" -#: ../../library/datetime.rst:1319 +#: ../../library/datetime.rst:1323 msgid "" ":class:`.datetime` objects are also supported by generic function :func:" "`copy.replace`." msgstr "" -#: ../../library/datetime.rst:1328 +#: ../../library/datetime.rst:1332 msgid "" "Return a :class:`.datetime` object with new :attr:`.tzinfo` attribute *tz*, " "adjusting the date and time data so the result is the same UTC time as " "*self*, but in *tz*'s local time." msgstr "" -#: ../../library/datetime.rst:1332 +#: ../../library/datetime.rst:1336 msgid "" "If provided, *tz* must be an instance of a :class:`tzinfo` subclass, and " "its :meth:`utcoffset` and :meth:`dst` methods must not return ``None``. If " "*self* is naive, it is presumed to represent time in the system time zone." msgstr "" -#: ../../library/datetime.rst:1336 +#: ../../library/datetime.rst:1340 msgid "" "If called without arguments (or with ``tz=None``) the system local time zone " "is assumed for the target time zone. The ``.tzinfo`` attribute of the " @@ -1982,7 +1991,7 @@ msgid "" "with the zone name and offset obtained from the OS." msgstr "" -#: ../../library/datetime.rst:1341 +#: ../../library/datetime.rst:1345 msgid "" "If ``self.tzinfo`` is *tz*, ``self.astimezone(tz)`` is equal to *self*: no " "adjustment of date or time data is performed. Else the result is local time " @@ -1991,7 +2000,7 @@ msgid "" "date and time data as ``dt - dt.utcoffset()``." msgstr "" -#: ../../library/datetime.rst:1347 +#: ../../library/datetime.rst:1351 msgid "" "If you merely want to attach a :class:`timezone` object *tz* to a datetime " "*dt* without adjustment of date and time data, use ``dt." @@ -2000,14 +2009,14 @@ msgid "" "use ``dt.replace(tzinfo=None)``." msgstr "" -#: ../../library/datetime.rst:1352 +#: ../../library/datetime.rst:1356 msgid "" "Note that the default :meth:`tzinfo.fromutc` method can be overridden in a :" "class:`tzinfo` subclass to affect the result returned by :meth:`astimezone`. " "Ignoring error cases, :meth:`astimezone` acts like::" msgstr "" -#: ../../library/datetime.rst:1356 +#: ../../library/datetime.rst:1360 msgid "" "def astimezone(self, tz):\n" " if self.tzinfo is tz:\n" @@ -2018,49 +2027,49 @@ msgid "" " return tz.fromutc(utc)" msgstr "" -#: ../../library/datetime.rst:1364 +#: ../../library/datetime.rst:1368 msgid "*tz* now can be omitted." msgstr "" -#: ../../library/datetime.rst:1367 +#: ../../library/datetime.rst:1371 msgid "" "The :meth:`astimezone` method can now be called on naive instances that are " "presumed to represent system local time." msgstr "" -#: ../../library/datetime.rst:1374 +#: ../../library/datetime.rst:1378 msgid "" "If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." "utcoffset(self)``, and raises an exception if the latter doesn't return " "``None`` or a :class:`timedelta` object with magnitude less than one day." msgstr "" -#: ../../library/datetime.rst:1378 ../../library/datetime.rst:1973 -#: ../../library/datetime.rst:2080 ../../library/datetime.rst:2325 -#: ../../library/datetime.rst:2337 ../../library/datetime.rst:2649 +#: ../../library/datetime.rst:1382 ../../library/datetime.rst:1977 +#: ../../library/datetime.rst:2084 ../../library/datetime.rst:2329 +#: ../../library/datetime.rst:2341 ../../library/datetime.rst:2653 msgid "The UTC offset is not restricted to a whole number of minutes." msgstr "" -#: ../../library/datetime.rst:1384 +#: ../../library/datetime.rst:1388 msgid "" "If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." "dst(self)``, and raises an exception if the latter doesn't return ``None`` " "or a :class:`timedelta` object with magnitude less than one day." msgstr "" -#: ../../library/datetime.rst:1388 ../../library/datetime.rst:1983 -#: ../../library/datetime.rst:2134 +#: ../../library/datetime.rst:1392 ../../library/datetime.rst:1987 +#: ../../library/datetime.rst:2138 msgid "The DST offset is not restricted to a whole number of minutes." msgstr "" -#: ../../library/datetime.rst:1394 +#: ../../library/datetime.rst:1398 msgid "" "If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." "tzname(self)``, raises an exception if the latter doesn't return ``None`` or " "a string object," msgstr "" -#: ../../library/datetime.rst:1405 +#: ../../library/datetime.rst:1409 msgid "" "time.struct_time((d.year, d.month, d.day,\n" " d.hour, d.minute, d.second,\n" @@ -2070,7 +2079,7 @@ msgstr "" " d.hour, d.minute, d.second,\n" " d.weekday(), yday, dst))" -#: ../../library/datetime.rst:1409 +#: ../../library/datetime.rst:1413 msgid "" "where ``yday = d.toordinal() - date(d.year, 1, 1).toordinal() + 1`` is the " "day number within the current year starting with 1 for January 1st. The :" @@ -2081,24 +2090,24 @@ msgid "" "to 0." msgstr "" -#: ../../library/datetime.rst:1420 +#: ../../library/datetime.rst:1424 msgid "" -"If :class:`.datetime` instance *d* is naive, this is the same as ``d." +"If :class:`.datetime` instance ``d`` is naive, this is the same as ``d." "timetuple()`` except that :attr:`~.time.struct_time.tm_isdst` is forced to 0 " "regardless of what ``d.dst()`` returns. DST is never in effect for a UTC " "time." msgstr "" -#: ../../library/datetime.rst:1424 +#: ../../library/datetime.rst:1428 msgid "" -"If *d* is aware, *d* is normalized to UTC time, by subtracting ``d." +"If ``d`` is aware, ``d`` is normalized to UTC time, by subtracting ``d." "utcoffset()``, and a :class:`time.struct_time` for the normalized time is " "returned. :attr:`!tm_isdst` is forced to 0. Note that an :exc:" "`OverflowError` may be raised if ``d.year`` was ``MINYEAR`` or ``MAXYEAR`` " "and UTC adjustment spills over a year boundary." msgstr "" -#: ../../library/datetime.rst:1433 +#: ../../library/datetime.rst:1437 msgid "" "Because naive ``datetime`` objects are treated by many ``datetime`` methods " "as local times, it is preferred to use aware datetimes to represent times in " @@ -2108,20 +2117,20 @@ msgid "" "meth:`.datetime.timetuple`." msgstr "" -#: ../../library/datetime.rst:1442 +#: ../../library/datetime.rst:1446 msgid "" "Return the proleptic Gregorian ordinal of the date. The same as ``self." "date().toordinal()``." msgstr "" -#: ../../library/datetime.rst:1447 +#: ../../library/datetime.rst:1451 msgid "" "Return POSIX timestamp corresponding to the :class:`.datetime` instance. The " "return value is a :class:`float` similar to that returned by :func:`time." "time`." msgstr "" -#: ../../library/datetime.rst:1451 +#: ../../library/datetime.rst:1455 msgid "" "Naive :class:`.datetime` instances are assumed to represent local time and " "this method relies on the platform C :c:func:`mktime` function to perform " @@ -2131,22 +2140,22 @@ msgid "" "future." msgstr "" -#: ../../library/datetime.rst:1458 +#: ../../library/datetime.rst:1462 msgid "" "For aware :class:`.datetime` instances, the return value is computed as::" msgstr "" -#: ../../library/datetime.rst:1461 +#: ../../library/datetime.rst:1465 msgid "(dt - datetime(1970, 1, 1, tzinfo=timezone.utc)).total_seconds()" msgstr "(dt - datetime(1970, 1, 1, tzinfo=timezone.utc)).total_seconds()" -#: ../../library/datetime.rst:1465 +#: ../../library/datetime.rst:1469 msgid "" "The :meth:`timestamp` method uses the :attr:`.fold` attribute to " "disambiguate the times during a repeated interval." msgstr "" -#: ../../library/datetime.rst:1471 +#: ../../library/datetime.rst:1475 msgid "" "There is no method to obtain the POSIX timestamp directly from a naive :" "class:`.datetime` instance representing UTC time. If your application uses " @@ -2154,57 +2163,57 @@ msgid "" "the POSIX timestamp by supplying ``tzinfo=timezone.utc``::" msgstr "" -#: ../../library/datetime.rst:1477 +#: ../../library/datetime.rst:1481 msgid "timestamp = dt.replace(tzinfo=timezone.utc).timestamp()" msgstr "timestamp = dt.replace(tzinfo=timezone.utc).timestamp()" -#: ../../library/datetime.rst:1479 +#: ../../library/datetime.rst:1483 msgid "or by calculating the timestamp directly::" msgstr "" -#: ../../library/datetime.rst:1481 +#: ../../library/datetime.rst:1485 msgid "timestamp = (dt - datetime(1970, 1, 1)) / timedelta(seconds=1)" msgstr "timestamp = (dt - datetime(1970, 1, 1)) / timedelta(seconds=1)" -#: ../../library/datetime.rst:1485 +#: ../../library/datetime.rst:1489 msgid "" "Return the day of the week as an integer, where Monday is 0 and Sunday is 6. " "The same as ``self.date().weekday()``. See also :meth:`isoweekday`." msgstr "" -#: ../../library/datetime.rst:1491 +#: ../../library/datetime.rst:1495 msgid "" "Return the day of the week as an integer, where Monday is 1 and Sunday is 7. " "The same as ``self.date().isoweekday()``. See also :meth:`weekday`, :meth:" "`isocalendar`." msgstr "" -#: ../../library/datetime.rst:1498 +#: ../../library/datetime.rst:1502 msgid "" "Return a :term:`named tuple` with three components: ``year``, ``week`` and " "``weekday``. The same as ``self.date().isocalendar()``." msgstr "" -#: ../../library/datetime.rst:1504 +#: ../../library/datetime.rst:1508 msgid "Return a string representing the date and time in ISO 8601 format:" msgstr "" -#: ../../library/datetime.rst:1506 +#: ../../library/datetime.rst:1510 msgid "``YYYY-MM-DDTHH:MM:SS.ffffff``, if :attr:`microsecond` is not 0" msgstr "``YYYY-MM-DDTHH:MM:SS.ffffff``,如果 :attr:`microsecond` 不是 0" -#: ../../library/datetime.rst:1507 +#: ../../library/datetime.rst:1511 msgid "``YYYY-MM-DDTHH:MM:SS``, if :attr:`microsecond` is 0" msgstr "``YYYY-MM-DDTHH:MM:SS``,如果 :attr:`microsecond` 是 0" -#: ../../library/datetime.rst:1509 +#: ../../library/datetime.rst:1513 msgid "" "If :meth:`utcoffset` does not return ``None``, a string is appended, giving " "the UTC offset:" msgstr "" "如果 :meth:`utcoffset` 没有回傳 ``None``,則會附加一个字串,給出 UTC 偏移:" -#: ../../library/datetime.rst:1512 +#: ../../library/datetime.rst:1516 msgid "" "``YYYY-MM-DDTHH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` " "is not 0" @@ -2212,13 +2221,13 @@ msgstr "" "``YYYY-MM-DDTHH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``,如果 :attr:`microsecond` " "不是 0" -#: ../../library/datetime.rst:1514 +#: ../../library/datetime.rst:1518 msgid "" "``YYYY-MM-DDTHH:MM:SS+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` is 0" msgstr "" "``YYYY-MM-DDTHH:MM:SS+HH:MM[:SS[.ffffff]]``,如果 :attr:`microsecond` 是 0" -#: ../../library/datetime.rst:1518 +#: ../../library/datetime.rst:1522 msgid "" ">>> from datetime import datetime, timezone\n" ">>> datetime(2019, 5, 18, 15, 17, 8, 132263).isoformat()\n" @@ -2232,13 +2241,13 @@ msgstr "" ">>> datetime(2019, 5, 18, 15, 17, tzinfo=timezone.utc).isoformat()\n" "'2019-05-18T15:17:00+00:00'" -#: ../../library/datetime.rst:1524 +#: ../../library/datetime.rst:1528 msgid "" "The optional argument *sep* (default ``'T'``) is a one-character separator, " "placed between the date and time portions of the result. For example::" msgstr "" -#: ../../library/datetime.rst:1527 +#: ../../library/datetime.rst:1531 msgid "" ">>> from datetime import tzinfo, timedelta, datetime\n" ">>> class TZ(tzinfo):\n" @@ -2252,53 +2261,53 @@ msgid "" "'2009-11-27T00:00:00.000100-06:39'" msgstr "" -#: ../../library/datetime.rst:1538 ../../library/datetime.rst:1913 +#: ../../library/datetime.rst:1542 ../../library/datetime.rst:1917 msgid "" "The optional argument *timespec* specifies the number of additional " "components of the time to include (the default is ``'auto'``). It can be one " "of the following:" msgstr "" -#: ../../library/datetime.rst:1542 ../../library/datetime.rst:1917 +#: ../../library/datetime.rst:1546 ../../library/datetime.rst:1921 msgid "" "``'auto'``: Same as ``'seconds'`` if :attr:`microsecond` is 0, same as " "``'microseconds'`` otherwise." msgstr "" -#: ../../library/datetime.rst:1544 ../../library/datetime.rst:1919 +#: ../../library/datetime.rst:1548 ../../library/datetime.rst:1923 msgid "``'hours'``: Include the :attr:`hour` in the two-digit ``HH`` format." msgstr "" -#: ../../library/datetime.rst:1545 ../../library/datetime.rst:1920 +#: ../../library/datetime.rst:1549 ../../library/datetime.rst:1924 msgid "" "``'minutes'``: Include :attr:`hour` and :attr:`minute` in ``HH:MM`` format." msgstr "" -#: ../../library/datetime.rst:1546 ../../library/datetime.rst:1921 +#: ../../library/datetime.rst:1550 ../../library/datetime.rst:1925 msgid "" "``'seconds'``: Include :attr:`hour`, :attr:`minute`, and :attr:`second` in " "``HH:MM:SS`` format." msgstr "" -#: ../../library/datetime.rst:1548 ../../library/datetime.rst:1923 +#: ../../library/datetime.rst:1552 ../../library/datetime.rst:1927 msgid "" "``'milliseconds'``: Include full time, but truncate fractional second part " "to milliseconds. ``HH:MM:SS.sss`` format." msgstr "" -#: ../../library/datetime.rst:1550 ../../library/datetime.rst:1925 +#: ../../library/datetime.rst:1554 ../../library/datetime.rst:1929 msgid "``'microseconds'``: Include full time in ``HH:MM:SS.ffffff`` format." msgstr "" -#: ../../library/datetime.rst:1554 ../../library/datetime.rst:1929 +#: ../../library/datetime.rst:1558 ../../library/datetime.rst:1933 msgid "Excluded time components are truncated, not rounded." msgstr "" -#: ../../library/datetime.rst:1556 +#: ../../library/datetime.rst:1560 msgid ":exc:`ValueError` will be raised on an invalid *timespec* argument::" msgstr "" -#: ../../library/datetime.rst:1559 +#: ../../library/datetime.rst:1563 msgid "" ">>> from datetime import datetime\n" ">>> datetime.now().isoformat(timespec='minutes') \n" @@ -2314,21 +2323,21 @@ msgstr "" ">>> dt.isoformat(timespec='microseconds')\n" "'2015-01-01T12:30:59.000000'" -#: ../../library/datetime.rst:1566 ../../library/datetime.rst:1944 +#: ../../library/datetime.rst:1570 ../../library/datetime.rst:1948 msgid "Added the *timespec* parameter." msgstr "新增 *timespec* 參數。" -#: ../../library/datetime.rst:1572 +#: ../../library/datetime.rst:1576 msgid "" -"For a :class:`.datetime` instance *d*, ``str(d)`` is equivalent to ``d." +"For a :class:`.datetime` instance ``d``, ``str(d)`` is equivalent to ``d." "isoformat(' ')``." msgstr "" -#: ../../library/datetime.rst:1578 +#: ../../library/datetime.rst:1582 msgid "Return a string representing the date and time::" msgstr "" -#: ../../library/datetime.rst:1580 +#: ../../library/datetime.rst:1584 msgid "" ">>> from datetime import datetime\n" ">>> datetime(2002, 12, 4, 20, 30, 40).ctime()\n" @@ -2338,27 +2347,27 @@ msgstr "" ">>> datetime(2002, 12, 4, 20, 30, 40).ctime()\n" "'Wed Dec 4 20:30:40 2002'" -#: ../../library/datetime.rst:1584 +#: ../../library/datetime.rst:1588 msgid "" "The output string will *not* include time zone information, regardless of " "whether the input is aware or naive." msgstr "" -#: ../../library/datetime.rst:1591 +#: ../../library/datetime.rst:1595 msgid "" "on platforms where the native C :c:func:`ctime` function (which :func:`time." "ctime` invokes, but which :meth:`datetime.ctime` does not invoke) conforms " "to the C standard." msgstr "" -#: ../../library/datetime.rst:1598 +#: ../../library/datetime.rst:1602 msgid "" "Return a string representing the date and time, controlled by an explicit " "format string. See also :ref:`strftime-strptime-behavior` and :meth:" "`datetime.isoformat`." msgstr "" -#: ../../library/datetime.rst:1605 +#: ../../library/datetime.rst:1609 msgid "" "Same as :meth:`.datetime.strftime`. This makes it possible to specify a " "format string for a :class:`.datetime` object in :ref:`formatted string " @@ -2366,15 +2375,15 @@ msgid "" "`strftime-strptime-behavior` and :meth:`datetime.isoformat`." msgstr "" -#: ../../library/datetime.rst:1612 +#: ../../library/datetime.rst:1616 msgid "Examples of Usage: :class:`.datetime`" msgstr "用法範例::class:`.datetime`" -#: ../../library/datetime.rst:1614 +#: ../../library/datetime.rst:1618 msgid "Examples of working with :class:`.datetime` objects:" msgstr "更多 :class:`.datetime` 的用法範例:" -#: ../../library/datetime.rst:1616 +#: ../../library/datetime.rst:1620 msgid "" ">>> from datetime import datetime, date, time, timezone\n" "\n" @@ -2428,14 +2437,14 @@ msgid "" "'The day is 21, the month is November, the time is 04:30PM.'" msgstr "" -#: ../../library/datetime.rst:1667 +#: ../../library/datetime.rst:1671 msgid "" "The example below defines a :class:`tzinfo` subclass capturing time zone " "information for Kabul, Afghanistan, which used +4 UTC until 1945 and then " "+4:30 UTC thereafter::" msgstr "" -#: ../../library/datetime.rst:1671 +#: ../../library/datetime.rst:1675 msgid "" "from datetime import timedelta, datetime, tzinfo, timezone\n" "\n" @@ -2482,11 +2491,11 @@ msgid "" " return \"+04\"" msgstr "" -#: ../../library/datetime.rst:1714 +#: ../../library/datetime.rst:1718 msgid "Usage of ``KabulTz`` from above::" msgstr "" -#: ../../library/datetime.rst:1716 +#: ../../library/datetime.rst:1720 msgid "" ">>> tz1 = KabulTz()\n" "\n" @@ -2510,63 +2519,63 @@ msgid "" "True" msgstr "" -#: ../../library/datetime.rst:1740 +#: ../../library/datetime.rst:1744 msgid ":class:`.time` Objects" msgstr ":class:`.time` 物件" -#: ../../library/datetime.rst:1742 +#: ../../library/datetime.rst:1746 msgid "" "A :class:`.time` object represents a (local) time of day, independent of any " "particular day, and subject to adjustment via a :class:`tzinfo` object." msgstr "" -#: ../../library/datetime.rst:1747 +#: ../../library/datetime.rst:1751 msgid "" "All arguments are optional. *tzinfo* may be ``None``, or an instance of a :" "class:`tzinfo` subclass. The remaining arguments must be integers in the " "following ranges:" msgstr "" -#: ../../library/datetime.rst:1757 +#: ../../library/datetime.rst:1761 msgid "" "If an argument outside those ranges is given, :exc:`ValueError` is raised. " "All default to 0 except *tzinfo*, which defaults to ``None``." msgstr "" -#: ../../library/datetime.rst:1765 +#: ../../library/datetime.rst:1769 msgid "The earliest representable :class:`.time`, ``time(0, 0, 0, 0)``." msgstr "" -#: ../../library/datetime.rst:1770 +#: ../../library/datetime.rst:1774 msgid "The latest representable :class:`.time`, ``time(23, 59, 59, 999999)``." msgstr "" -#: ../../library/datetime.rst:1775 +#: ../../library/datetime.rst:1779 msgid "" "The smallest possible difference between non-equal :class:`.time` objects, " "``timedelta(microseconds=1)``, although note that arithmetic on :class:`." "time` objects is not supported." msgstr "" -#: ../../library/datetime.rst:1804 +#: ../../library/datetime.rst:1808 msgid "" "The object passed as the tzinfo argument to the :class:`.time` constructor, " "or ``None`` if none was passed." msgstr "" -#: ../../library/datetime.rst:1818 +#: ../../library/datetime.rst:1822 msgid "" -":class:`.time` objects support equality and order comparisons, where *a* is " -"considered less than *b* when *a* precedes *b* in time." +":class:`.time` objects support equality and order comparisons, where ``a`` " +"is considered less than ``b`` when ``a`` precedes ``b`` in time." msgstr "" -#: ../../library/datetime.rst:1821 +#: ../../library/datetime.rst:1825 msgid "" "Naive and aware :class:`!time` objects are never equal. Order comparison " "between naive and aware :class:`!time` objects raises :exc:`TypeError`." msgstr "" -#: ../../library/datetime.rst:1825 +#: ../../library/datetime.rst:1829 msgid "" "If both comparands are aware, and have the same :attr:`~.time.tzinfo` " "attribute, the :attr:`!tzinfo` and :attr:`!fold` attributes are ignored and " @@ -2575,18 +2584,18 @@ msgid "" "subtracting their UTC offsets (obtained from ``self.utcoffset()``)." msgstr "" -#: ../../library/datetime.rst:1831 +#: ../../library/datetime.rst:1835 msgid "" "Equality comparisons between aware and naive :class:`.time` instances don't " "raise :exc:`TypeError`." msgstr "" -#: ../../library/datetime.rst:1835 +#: ../../library/datetime.rst:1839 msgid "" "In Boolean contexts, a :class:`.time` object is always considered to be true." msgstr "" -#: ../../library/datetime.rst:1837 +#: ../../library/datetime.rst:1841 msgid "" "Before Python 3.5, a :class:`.time` object was considered to be false if it " "represented midnight in UTC. This behavior was considered obscure and error-" @@ -2594,33 +2603,33 @@ msgid "" "details." msgstr "" -#: ../../library/datetime.rst:1844 +#: ../../library/datetime.rst:1848 msgid "Other constructor:" msgstr "" -#: ../../library/datetime.rst:1848 +#: ../../library/datetime.rst:1852 msgid "" "Return a :class:`.time` corresponding to a *time_string* in any valid ISO " "8601 format, with the following exceptions:" msgstr "" -#: ../../library/datetime.rst:1852 +#: ../../library/datetime.rst:1856 msgid "" "The leading ``T``, normally required in cases where there may be ambiguity " "between a date and a time, is not required." msgstr "" -#: ../../library/datetime.rst:1854 +#: ../../library/datetime.rst:1858 msgid "" "Fractional seconds may have any number of digits (anything beyond 6 will be " "truncated)." msgstr "" -#: ../../library/datetime.rst:1858 +#: ../../library/datetime.rst:1862 msgid "Examples:" msgstr "範例: ::" -#: ../../library/datetime.rst:1860 +#: ../../library/datetime.rst:1864 msgid "" ">>> from datetime import time\n" ">>> time.fromisoformat('04:23:01')\n" @@ -2660,13 +2669,13 @@ msgstr "" ">>> time.fromisoformat('04:23:01+00:00')\n" "datetime.time(4, 23, 1, tzinfo=datetime.timezone.utc)" -#: ../../library/datetime.rst:1882 +#: ../../library/datetime.rst:1886 msgid "" "Previously, this method only supported formats that could be emitted by :" "meth:`time.isoformat`." msgstr "" -#: ../../library/datetime.rst:1892 +#: ../../library/datetime.rst:1896 msgid "" "Return a :class:`.time` with the same value, except for those attributes " "given new values by whichever keyword arguments are specified. Note that " @@ -2674,41 +2683,41 @@ msgid "" "aware :class:`.time`, without conversion of the time data." msgstr "" -#: ../../library/datetime.rst:1897 +#: ../../library/datetime.rst:1901 msgid "" ":class:`.time` objects are also supported by generic function :func:`copy." "replace`." msgstr "" -#: ../../library/datetime.rst:1906 +#: ../../library/datetime.rst:1910 msgid "Return a string representing the time in ISO 8601 format, one of:" msgstr "" -#: ../../library/datetime.rst:1908 +#: ../../library/datetime.rst:1912 msgid "``HH:MM:SS.ffffff``, if :attr:`microsecond` is not 0" msgstr "" -#: ../../library/datetime.rst:1909 +#: ../../library/datetime.rst:1913 msgid "``HH:MM:SS``, if :attr:`microsecond` is 0" msgstr "" -#: ../../library/datetime.rst:1910 +#: ../../library/datetime.rst:1914 msgid "" "``HH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``, if :meth:`utcoffset` does not " "return ``None``" msgstr "" -#: ../../library/datetime.rst:1911 +#: ../../library/datetime.rst:1915 msgid "" "``HH:MM:SS+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` is 0 and :meth:" "`utcoffset` does not return ``None``" msgstr "" -#: ../../library/datetime.rst:1931 +#: ../../library/datetime.rst:1935 msgid ":exc:`ValueError` will be raised on an invalid *timespec* argument." msgstr "" -#: ../../library/datetime.rst:1935 +#: ../../library/datetime.rst:1939 msgid "" ">>> from datetime import time\n" ">>> time(hour=12, minute=34, second=56, microsecond=123456)." @@ -2730,18 +2739,18 @@ msgstr "" ">>> dt.isoformat(timespec='auto')\n" "'12:34:56'" -#: ../../library/datetime.rst:1950 -msgid "For a time *t*, ``str(t)`` is equivalent to ``t.isoformat()``." +#: ../../library/datetime.rst:1954 +msgid "For a time ``t``, ``str(t)`` is equivalent to ``t.isoformat()``." msgstr "" -#: ../../library/datetime.rst:1955 +#: ../../library/datetime.rst:1959 msgid "" "Return a string representing the time, controlled by an explicit format " "string. See also :ref:`strftime-strptime-behavior` and :meth:`time." "isoformat`." msgstr "" -#: ../../library/datetime.rst:1961 +#: ../../library/datetime.rst:1965 msgid "" "Same as :meth:`.time.strftime`. This makes it possible to specify a format " "string for a :class:`.time` object in :ref:`formatted string literals >> from datetime import time, tzinfo, timedelta\n" ">>> class TZ1(tzinfo):\n" @@ -2830,18 +2839,18 @@ msgstr "" ">>> 'The {} is {:%H:%M}.'.format(\"time\", t)\n" "'The time is 12:10.'" -#: ../../library/datetime.rst:2026 +#: ../../library/datetime.rst:2030 msgid ":class:`tzinfo` Objects" msgstr ":class:`tzinfo` 物件" -#: ../../library/datetime.rst:2030 +#: ../../library/datetime.rst:2034 msgid "" "This is an abstract base class, meaning that this class should not be " "instantiated directly. Define a subclass of :class:`tzinfo` to capture " "information about a particular time zone." msgstr "" -#: ../../library/datetime.rst:2034 +#: ../../library/datetime.rst:2038 msgid "" "An instance of (a concrete subclass of) :class:`tzinfo` can be passed to the " "constructors for :class:`.datetime` and :class:`.time` objects. The latter " @@ -2851,7 +2860,7 @@ msgid "" "object passed to them." msgstr "" -#: ../../library/datetime.rst:2040 +#: ../../library/datetime.rst:2044 msgid "" "You need to derive a concrete subclass, and (at least) supply " "implementations of the standard :class:`tzinfo` methods needed by the :class:" @@ -2861,7 +2870,7 @@ msgid "" "American EST and EDT." msgstr "" -#: ../../library/datetime.rst:2047 +#: ../../library/datetime.rst:2051 msgid "" "Special requirement for pickling: A :class:`tzinfo` subclass must have an :" "meth:`~object.__init__` method that can be called with no arguments, " @@ -2869,20 +2878,20 @@ msgid "" "technical requirement that may be relaxed in the future." msgstr "" -#: ../../library/datetime.rst:2053 +#: ../../library/datetime.rst:2057 msgid "" "A concrete subclass of :class:`tzinfo` may need to implement the following " "methods. Exactly which methods are needed depends on the uses made of aware :" "mod:`!datetime` objects. If in doubt, simply implement all of them." msgstr "" -#: ../../library/datetime.rst:2060 +#: ../../library/datetime.rst:2064 msgid "" "Return offset of local time from UTC, as a :class:`timedelta` object that is " "positive east of UTC. If local time is west of UTC, this should be negative." msgstr "" -#: ../../library/datetime.rst:2063 +#: ../../library/datetime.rst:2067 msgid "" "This represents the *total* offset from UTC; for example, if a :class:" "`tzinfo` object represents both time zone and DST adjustments, :meth:" @@ -2893,31 +2902,31 @@ msgid "" "meth:`utcoffset` will probably look like one of these two::" msgstr "" -#: ../../library/datetime.rst:2071 +#: ../../library/datetime.rst:2075 msgid "" "return CONSTANT # fixed-offset class\n" "return CONSTANT + self.dst(dt) # daylight-aware class" msgstr "" -#: ../../library/datetime.rst:2074 +#: ../../library/datetime.rst:2078 msgid "" "If :meth:`utcoffset` does not return ``None``, :meth:`dst` should not return " "``None`` either." msgstr "" -#: ../../library/datetime.rst:2077 +#: ../../library/datetime.rst:2081 msgid "" "The default implementation of :meth:`utcoffset` raises :exc:" "`NotImplementedError`." msgstr "" -#: ../../library/datetime.rst:2086 +#: ../../library/datetime.rst:2090 msgid "" "Return the daylight saving time (DST) adjustment, as a :class:`timedelta` " "object or ``None`` if DST information isn't known." msgstr "" -#: ../../library/datetime.rst:2090 +#: ../../library/datetime.rst:2094 msgid "" "Return ``timedelta(0)`` if DST is not in effect. If DST is in effect, return " "the offset as a :class:`timedelta` object (see :meth:`utcoffset` for " @@ -2930,17 +2939,17 @@ msgid "" "to account for DST changes when crossing time zones." msgstr "" -#: ../../library/datetime.rst:2100 +#: ../../library/datetime.rst:2104 msgid "" "An instance *tz* of a :class:`tzinfo` subclass that models both standard and " "daylight times must be consistent in this sense:" msgstr "" -#: ../../library/datetime.rst:2103 +#: ../../library/datetime.rst:2107 msgid "``tz.utcoffset(dt) - tz.dst(dt)``" msgstr "``tz.utcoffset(dt) - tz.dst(dt)``" -#: ../../library/datetime.rst:2105 +#: ../../library/datetime.rst:2109 msgid "" "must return the same result for every :class:`.datetime` *dt* with ``dt." "tzinfo == tz``. For sane :class:`tzinfo` subclasses, this expression yields " @@ -2953,24 +2962,24 @@ msgid "" "astimezone` regardless." msgstr "" -#: ../../library/datetime.rst:2114 +#: ../../library/datetime.rst:2118 msgid "" "Most implementations of :meth:`dst` will probably look like one of these " "two::" msgstr "" -#: ../../library/datetime.rst:2116 +#: ../../library/datetime.rst:2120 msgid "" "def dst(self, dt):\n" " # a fixed-offset class: doesn't account for DST\n" " return timedelta(0)" msgstr "" -#: ../../library/datetime.rst:2120 +#: ../../library/datetime.rst:2124 msgid "or::" msgstr "或是: ::" -#: ../../library/datetime.rst:2122 +#: ../../library/datetime.rst:2126 msgid "" "def dst(self, dt):\n" " # Code to set dston and dstoff to the time zone's DST\n" @@ -2983,12 +2992,12 @@ msgid "" " return timedelta(0)" msgstr "" -#: ../../library/datetime.rst:2132 +#: ../../library/datetime.rst:2136 msgid "" "The default implementation of :meth:`dst` raises :exc:`NotImplementedError`." msgstr "" -#: ../../library/datetime.rst:2140 +#: ../../library/datetime.rst:2144 msgid "" "Return the time zone name corresponding to the :class:`.datetime` object " "*dt*, as a string. Nothing about string names is defined by the :mod:`!" @@ -3002,13 +3011,13 @@ msgid "" "accounting for daylight time." msgstr "" -#: ../../library/datetime.rst:2150 +#: ../../library/datetime.rst:2154 msgid "" "The default implementation of :meth:`tzname` raises :exc:" "`NotImplementedError`." msgstr "" -#: ../../library/datetime.rst:2153 +#: ../../library/datetime.rst:2157 msgid "" "These methods are called by a :class:`.datetime` or :class:`.time` object, " "in response to their methods of the same names. A :class:`.datetime` object " @@ -3018,7 +3027,7 @@ msgid "" "datetime`." msgstr "" -#: ../../library/datetime.rst:2159 +#: ../../library/datetime.rst:2163 msgid "" "When ``None`` is passed, it's up to the class designer to decide the best " "response. For example, returning ``None`` is appropriate if the class wishes " @@ -3027,7 +3036,7 @@ msgid "" "offset, as there is no other convention for discovering the standard offset." msgstr "" -#: ../../library/datetime.rst:2165 +#: ../../library/datetime.rst:2169 msgid "" "When a :class:`.datetime` object is passed in response to a :class:`." "datetime` method, ``dt.tzinfo`` is the same object as *self*. :class:" @@ -3037,13 +3046,13 @@ msgid "" "zones." msgstr "" -#: ../../library/datetime.rst:2171 +#: ../../library/datetime.rst:2175 msgid "" "There is one more :class:`tzinfo` method that a subclass may wish to " "override:" msgstr "" -#: ../../library/datetime.rst:2176 +#: ../../library/datetime.rst:2180 msgid "" "This is called from the default :meth:`datetime.astimezone` implementation. " "When called from that, ``dt.tzinfo`` is *self*, and *dt*'s date and time " @@ -3052,7 +3061,7 @@ msgid "" "datetime in *self*'s local time." msgstr "" -#: ../../library/datetime.rst:2182 +#: ../../library/datetime.rst:2186 msgid "" "Most :class:`tzinfo` subclasses should be able to inherit the default :meth:" "`fromutc` implementation without problems. It's strong enough to handle " @@ -3067,13 +3076,13 @@ msgid "" "offset changes." msgstr "" -#: ../../library/datetime.rst:2193 +#: ../../library/datetime.rst:2197 msgid "" "Skipping code for error cases, the default :meth:`fromutc` implementation " "acts like::" msgstr "" -#: ../../library/datetime.rst:2196 +#: ../../library/datetime.rst:2200 msgid "" "def fromutc(self, dt):\n" " # raise ValueError error if dt.tzinfo is not self\n" @@ -3091,13 +3100,13 @@ msgid "" " return dt" msgstr "" -#: ../../library/datetime.rst:2211 +#: ../../library/datetime.rst:2215 msgid "" "In the following :download:`tzinfo_examples.py <../includes/tzinfo_examples." "py>` file there are some examples of :class:`tzinfo` classes:" msgstr "" -#: ../../library/datetime.rst:2215 +#: ../../library/datetime.rst:2219 msgid "" "from datetime import tzinfo, timedelta, datetime\n" "\n" @@ -3277,7 +3286,7 @@ msgid "" "Pacific = USTimeZone(-8, \"Pacific\", \"PST\", \"PDT\")\n" msgstr "" -#: ../../library/datetime.rst:2217 +#: ../../library/datetime.rst:2221 msgid "" "Note that there are unavoidable subtleties twice per year in a :class:" "`tzinfo` subclass accounting for both standard and daylight time, at the DST " @@ -3286,7 +3295,7 @@ msgid "" "ends the minute after 1:59 (EDT) on the first Sunday in November::" msgstr "" -#: ../../library/datetime.rst:2223 +#: ../../library/datetime.rst:2227 msgid "" " UTC 3:MM 4:MM 5:MM 6:MM 7:MM 8:MM\n" " EST 22:MM 23:MM 0:MM 1:MM 2:MM 3:MM\n" @@ -3304,7 +3313,7 @@ msgstr "" "\n" " end 23:MM 0:MM 1:MM 1:MM 2:MM 3:MM" -#: ../../library/datetime.rst:2231 +#: ../../library/datetime.rst:2235 msgid "" "When DST starts (the \"start\" line), the local wall clock leaps from 1:59 " "to 3:00. A wall time of the form 2:MM doesn't really make sense on that day, " @@ -3313,7 +3322,7 @@ msgid "" "get::" msgstr "" -#: ../../library/datetime.rst:2236 +#: ../../library/datetime.rst:2240 msgid "" ">>> from datetime import datetime, timezone\n" ">>> from tzinfo_examples import HOUR, Eastern\n" @@ -3341,7 +3350,7 @@ msgstr "" "07:00:00 UTC = 03:00:00 EDT\n" "08:00:00 UTC = 04:00:00 EDT" -#: ../../library/datetime.rst:2250 +#: ../../library/datetime.rst:2254 msgid "" "When DST ends (the \"end\" line), there's a potentially worse problem: " "there's an hour that can't be spelled unambiguously in local wall time: the " @@ -3356,7 +3365,7 @@ msgid "" "Fall back transition of 2016, we get::" msgstr "" -#: ../../library/datetime.rst:2261 +#: ../../library/datetime.rst:2265 msgid "" ">>> u0 = datetime(2016, 11, 6, 4, tzinfo=timezone.utc)\n" ">>> for i in range(4):\n" @@ -3380,13 +3389,13 @@ msgstr "" "06:00:00 UTC = 01:00:00 EST 1\n" "07:00:00 UTC = 02:00:00 EST 0" -#: ../../library/datetime.rst:2272 +#: ../../library/datetime.rst:2276 msgid "" "Note that the :class:`.datetime` instances that differ only by the value of " "the :attr:`~.datetime.fold` attribute are considered equal in comparisons." msgstr "" -#: ../../library/datetime.rst:2275 +#: ../../library/datetime.rst:2279 msgid "" "Applications that can't bear wall-time ambiguities should explicitly check " "the value of the :attr:`~.datetime.fold` attribute or avoid using hybrid :" @@ -3396,28 +3405,28 @@ msgid "" "offset -4 hours))." msgstr "" -#: ../../library/datetime.rst:2283 +#: ../../library/datetime.rst:2287 msgid ":mod:`zoneinfo`" msgstr ":mod:`zoneinfo`" -#: ../../library/datetime.rst:2284 +#: ../../library/datetime.rst:2288 msgid "" "The :mod:`!datetime` module has a basic :class:`timezone` class (for " "handling arbitrary fixed offsets from UTC) and its :attr:`timezone.utc` " "attribute (a UTC :class:`!timezone` instance)." msgstr "" -#: ../../library/datetime.rst:2288 +#: ../../library/datetime.rst:2292 msgid "" "``zoneinfo`` brings the *IANA time zone database* (also known as the Olson " "database) to Python, and its usage is recommended." msgstr "" -#: ../../library/datetime.rst:2291 +#: ../../library/datetime.rst:2295 msgid "`IANA time zone database `_" msgstr "`IANA 時區資料庫 `_" -#: ../../library/datetime.rst:2292 +#: ../../library/datetime.rst:2296 msgid "" "The Time Zone Database (often called tz, tzdata or zoneinfo) contains code " "and data that represent the history of local time for many representative " @@ -3426,24 +3435,24 @@ msgid "" "saving rules." msgstr "" -#: ../../library/datetime.rst:2302 +#: ../../library/datetime.rst:2306 msgid ":class:`timezone` Objects" msgstr ":class:`timezone` 物件" -#: ../../library/datetime.rst:2304 +#: ../../library/datetime.rst:2308 msgid "" "The :class:`timezone` class is a subclass of :class:`tzinfo`, each instance " "of which represents a time zone defined by a fixed offset from UTC." msgstr "" -#: ../../library/datetime.rst:2308 +#: ../../library/datetime.rst:2312 msgid "" "Objects of this class cannot be used to represent time zone information in " "the locations where different offsets are used in different days of the year " "or where historical changes have been made to civil time." msgstr "" -#: ../../library/datetime.rst:2315 +#: ../../library/datetime.rst:2319 msgid "" "The *offset* argument must be specified as a :class:`timedelta` object " "representing the difference between the local time and UTC. It must be " @@ -3451,25 +3460,25 @@ msgid "" "otherwise :exc:`ValueError` is raised." msgstr "" -#: ../../library/datetime.rst:2320 +#: ../../library/datetime.rst:2324 msgid "" "The *name* argument is optional. If specified it must be a string that will " "be used as the value returned by the :meth:`datetime.tzname` method." msgstr "" -#: ../../library/datetime.rst:2331 ../../library/datetime.rst:2342 +#: ../../library/datetime.rst:2335 ../../library/datetime.rst:2346 msgid "" "Return the fixed value specified when the :class:`timezone` instance is " "constructed." msgstr "" -#: ../../library/datetime.rst:2334 +#: ../../library/datetime.rst:2338 msgid "" "The *dt* argument is ignored. The return value is a :class:`timedelta` " "instance equal to the difference between the local time and UTC." msgstr "" -#: ../../library/datetime.rst:2345 +#: ../../library/datetime.rst:2349 msgid "" "If *name* is not provided in the constructor, the name returned by " "``tzname(dt)`` is generated from the value of the ``offset`` as follows. If " @@ -3478,119 +3487,119 @@ msgid "" "are two digits of ``offset.hours`` and ``offset.minutes`` respectively." msgstr "" -#: ../../library/datetime.rst:2351 +#: ../../library/datetime.rst:2355 msgid "" "Name generated from ``offset=timedelta(0)`` is now plain ``'UTC'``, not " "``'UTC+00:00'``." msgstr "" -#: ../../library/datetime.rst:2358 +#: ../../library/datetime.rst:2362 msgid "Always returns ``None``." msgstr "總是回傳 ``None``。" -#: ../../library/datetime.rst:2362 +#: ../../library/datetime.rst:2366 msgid "" "Return ``dt + offset``. The *dt* argument must be an aware :class:`." "datetime` instance, with ``tzinfo`` set to ``self``." msgstr "" -#: ../../library/datetime.rst:2369 +#: ../../library/datetime.rst:2373 msgid "The UTC time zone, ``timezone(timedelta(0))``." msgstr "UTC 時區,``timezone(timedelta(0))``。" -#: ../../library/datetime.rst:2378 +#: ../../library/datetime.rst:2382 msgid ":meth:`~.datetime.strftime` and :meth:`~.datetime.strptime` Behavior" msgstr ":meth:`~.datetime.strftime` 與 :meth:`~.datetime.strptime` 的行為" -#: ../../library/datetime.rst:2380 +#: ../../library/datetime.rst:2384 msgid "" ":class:`date`, :class:`.datetime`, and :class:`.time` objects all support a " "``strftime(format)`` method, to create a string representing the time under " "the control of an explicit format string." msgstr "" -#: ../../library/datetime.rst:2384 +#: ../../library/datetime.rst:2388 msgid "" "Conversely, the :meth:`datetime.strptime` class method creates a :class:`." "datetime` object from a string representing a date and time and a " "corresponding format string." msgstr "" -#: ../../library/datetime.rst:2388 +#: ../../library/datetime.rst:2392 msgid "" "The table below provides a high-level comparison of :meth:`~.datetime." "strftime` versus :meth:`~.datetime.strptime`:" msgstr "" -#: ../../library/datetime.rst:2392 +#: ../../library/datetime.rst:2396 msgid "``strftime``" msgstr "``strftime``" -#: ../../library/datetime.rst:2392 +#: ../../library/datetime.rst:2396 msgid "``strptime``" msgstr "``strptime``" -#: ../../library/datetime.rst:2394 +#: ../../library/datetime.rst:2398 msgid "Usage" msgstr "用法" -#: ../../library/datetime.rst:2394 +#: ../../library/datetime.rst:2398 msgid "Convert object to a string according to a given format" msgstr "" -#: ../../library/datetime.rst:2394 +#: ../../library/datetime.rst:2398 msgid "" "Parse a string into a :class:`.datetime` object given a corresponding format" msgstr "" -#: ../../library/datetime.rst:2396 +#: ../../library/datetime.rst:2400 msgid "Type of method" msgstr "" -#: ../../library/datetime.rst:2396 +#: ../../library/datetime.rst:2400 msgid "Instance method" msgstr "實例方法" -#: ../../library/datetime.rst:2396 +#: ../../library/datetime.rst:2400 msgid "Class method" msgstr "類別方法" -#: ../../library/datetime.rst:2398 +#: ../../library/datetime.rst:2402 msgid "Method of" msgstr "" -#: ../../library/datetime.rst:2398 +#: ../../library/datetime.rst:2402 msgid ":class:`date`; :class:`.datetime`; :class:`.time`" msgstr ":class:`date`; :class:`.datetime`; :class:`.time`" -#: ../../library/datetime.rst:2398 +#: ../../library/datetime.rst:2402 msgid ":class:`.datetime`" msgstr ":class:`.datetime`" -#: ../../library/datetime.rst:2400 +#: ../../library/datetime.rst:2404 msgid "Signature" msgstr "" -#: ../../library/datetime.rst:2400 +#: ../../library/datetime.rst:2404 msgid "``strftime(format)``" msgstr "``strftime(format)``" -#: ../../library/datetime.rst:2400 +#: ../../library/datetime.rst:2404 msgid "``strptime(date_string, format)``" msgstr "``strptime(date_string, format)``" -#: ../../library/datetime.rst:2407 +#: ../../library/datetime.rst:2411 msgid "" ":meth:`~.datetime.strftime` and :meth:`~.datetime.strptime` Format Codes" msgstr ":meth:`~.datetime.strftime` 與 :meth:`~.datetime.strptime` 格式碼" -#: ../../library/datetime.rst:2409 +#: ../../library/datetime.rst:2413 msgid "" "These methods accept format codes that can be used to parse and format " "dates::" msgstr "" -#: ../../library/datetime.rst:2411 +#: ../../library/datetime.rst:2415 msgid "" ">>> datetime.strptime('31/01/22 23:59:59.999999',\n" "... '%d/%m/%y %H:%M:%S.%f')\n" @@ -3604,33 +3613,33 @@ msgstr "" ">>> _.strftime('%a %d %b %Y, %I:%M%p')\n" "'Mon 31 Jan 2022, 11:59PM'" -#: ../../library/datetime.rst:2417 +#: ../../library/datetime.rst:2421 msgid "" "The following is a list of all the format codes that the 1989 C standard " "requires, and these work on all platforms with a standard C implementation." msgstr "" -#: ../../library/datetime.rst:2421 ../../library/datetime.rst:2524 +#: ../../library/datetime.rst:2425 ../../library/datetime.rst:2528 msgid "Directive" msgstr "" -#: ../../library/datetime.rst:2421 ../../library/datetime.rst:2524 +#: ../../library/datetime.rst:2425 ../../library/datetime.rst:2528 msgid "Meaning" msgstr "含義" -#: ../../library/datetime.rst:2421 ../../library/datetime.rst:2524 +#: ../../library/datetime.rst:2425 ../../library/datetime.rst:2528 msgid "Example" msgstr "範例" -#: ../../library/datetime.rst:2421 ../../library/datetime.rst:2524 +#: ../../library/datetime.rst:2425 ../../library/datetime.rst:2528 msgid "Notes" msgstr "註解" -#: ../../library/datetime.rst:2423 +#: ../../library/datetime.rst:2427 msgid "``%a``" msgstr "``%a``" -#: ../../library/datetime.rst:2423 +#: ../../library/datetime.rst:2427 msgid "Weekday as locale's abbreviated name." msgstr "" @@ -3642,11 +3651,11 @@ msgstr "" msgid "So, Mo, ..., Sa (de_DE)" msgstr "" -#: ../../library/datetime.rst:2428 +#: ../../library/datetime.rst:2432 msgid "``%A``" msgstr "``%A``" -#: ../../library/datetime.rst:2428 +#: ../../library/datetime.rst:2432 msgid "Weekday as locale's full name." msgstr "" @@ -3658,42 +3667,42 @@ msgstr "" msgid "Sonntag, Montag, ..., Samstag (de_DE)" msgstr "" -#: ../../library/datetime.rst:2433 +#: ../../library/datetime.rst:2437 msgid "``%w``" msgstr "``%w``" -#: ../../library/datetime.rst:2433 +#: ../../library/datetime.rst:2437 msgid "Weekday as a decimal number, where 0 is Sunday and 6 is Saturday." msgstr "" -#: ../../library/datetime.rst:2433 +#: ../../library/datetime.rst:2437 msgid "0, 1, ..., 6" msgstr "0, 1, ..., 6" -#: ../../library/datetime.rst:2437 +#: ../../library/datetime.rst:2441 msgid "``%d``" msgstr "``%d``" -#: ../../library/datetime.rst:2437 +#: ../../library/datetime.rst:2441 msgid "Day of the month as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2437 +#: ../../library/datetime.rst:2441 msgid "01, 02, ..., 31" msgstr "01, 02, ..., 31" -#: ../../library/datetime.rst:2437 ../../library/datetime.rst:2450 -#: ../../library/datetime.rst:2453 ../../library/datetime.rst:2459 -#: ../../library/datetime.rst:2462 ../../library/datetime.rst:2468 -#: ../../library/datetime.rst:2486 +#: ../../library/datetime.rst:2441 ../../library/datetime.rst:2454 +#: ../../library/datetime.rst:2457 ../../library/datetime.rst:2463 +#: ../../library/datetime.rst:2466 ../../library/datetime.rst:2472 +#: ../../library/datetime.rst:2490 msgid "\\(9)" msgstr "\\(9)" -#: ../../library/datetime.rst:2440 +#: ../../library/datetime.rst:2444 msgid "``%b``" msgstr "``%b``" -#: ../../library/datetime.rst:2440 +#: ../../library/datetime.rst:2444 msgid "Month as locale's abbreviated name." msgstr "" @@ -3705,11 +3714,11 @@ msgstr "" msgid "Jan, Feb, ..., Dez (de_DE)" msgstr "" -#: ../../library/datetime.rst:2445 +#: ../../library/datetime.rst:2449 msgid "``%B``" msgstr "``%B``" -#: ../../library/datetime.rst:2445 +#: ../../library/datetime.rst:2449 msgid "Month as locale's full name." msgstr "" @@ -3721,67 +3730,67 @@ msgstr "" msgid "Januar, Februar, ..., Dezember (de_DE)" msgstr "" -#: ../../library/datetime.rst:2450 +#: ../../library/datetime.rst:2454 msgid "``%m``" msgstr "``%m``" -#: ../../library/datetime.rst:2450 +#: ../../library/datetime.rst:2454 msgid "Month as a zero-padded decimal number." msgstr "以零填充的並以十進位數字表示的月份。" -#: ../../library/datetime.rst:2450 ../../library/datetime.rst:2462 +#: ../../library/datetime.rst:2454 ../../library/datetime.rst:2466 msgid "01, 02, ..., 12" msgstr "01, 02, ..., 12" -#: ../../library/datetime.rst:2453 +#: ../../library/datetime.rst:2457 msgid "``%y``" msgstr "``%y``" -#: ../../library/datetime.rst:2453 +#: ../../library/datetime.rst:2457 msgid "Year without century as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2453 +#: ../../library/datetime.rst:2457 msgid "00, 01, ..., 99" msgstr "00, 01, ..., 99" -#: ../../library/datetime.rst:2456 +#: ../../library/datetime.rst:2460 msgid "``%Y``" msgstr "``%Y``" -#: ../../library/datetime.rst:2456 +#: ../../library/datetime.rst:2460 msgid "Year with century as a decimal number." msgstr "" -#: ../../library/datetime.rst:2456 ../../library/datetime.rst:2526 +#: ../../library/datetime.rst:2460 ../../library/datetime.rst:2530 msgid "0001, 0002, ..., 2013, 2014, ..., 9998, 9999" msgstr "0001, 0002, ..., 2013, 2014, ..., 9998, 9999" -#: ../../library/datetime.rst:2459 +#: ../../library/datetime.rst:2463 msgid "``%H``" msgstr "``%H``" -#: ../../library/datetime.rst:2459 +#: ../../library/datetime.rst:2463 msgid "Hour (24-hour clock) as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2459 +#: ../../library/datetime.rst:2463 msgid "00, 01, ..., 23" msgstr "00, 01, ..., 23" -#: ../../library/datetime.rst:2462 +#: ../../library/datetime.rst:2466 msgid "``%I``" msgstr "``%I``" -#: ../../library/datetime.rst:2462 +#: ../../library/datetime.rst:2466 msgid "Hour (12-hour clock) as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2465 +#: ../../library/datetime.rst:2469 msgid "``%p``" msgstr "``%p``" -#: ../../library/datetime.rst:2465 +#: ../../library/datetime.rst:2469 msgid "Locale's equivalent of either AM or PM." msgstr "" @@ -3793,128 +3802,128 @@ msgstr "AM, PM (en_US);" msgid "am, pm (de_DE)" msgstr "am, pm (de_DE)" -#: ../../library/datetime.rst:2465 +#: ../../library/datetime.rst:2469 msgid "\\(1), \\(3)" msgstr "\\(1), \\(3)" -#: ../../library/datetime.rst:2468 +#: ../../library/datetime.rst:2472 msgid "``%M``" msgstr "``%M``" -#: ../../library/datetime.rst:2468 +#: ../../library/datetime.rst:2472 msgid "Minute as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2468 ../../library/datetime.rst:2471 +#: ../../library/datetime.rst:2472 ../../library/datetime.rst:2475 msgid "00, 01, ..., 59" msgstr "00, 01, ..., 59" -#: ../../library/datetime.rst:2471 +#: ../../library/datetime.rst:2475 msgid "``%S``" msgstr "``%S``" -#: ../../library/datetime.rst:2471 +#: ../../library/datetime.rst:2475 msgid "Second as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2471 +#: ../../library/datetime.rst:2475 msgid "\\(4), \\(9)" msgstr "\\(4), \\(9)" -#: ../../library/datetime.rst:2474 +#: ../../library/datetime.rst:2478 msgid "``%f``" msgstr "``%f``" -#: ../../library/datetime.rst:2474 +#: ../../library/datetime.rst:2478 msgid "Microsecond as a decimal number, zero-padded to 6 digits." msgstr "" -#: ../../library/datetime.rst:2474 +#: ../../library/datetime.rst:2478 msgid "000000, 000001, ..., 999999" msgstr "000000, 000001, ..., 999999" -#: ../../library/datetime.rst:2474 +#: ../../library/datetime.rst:2478 msgid "\\(5)" msgstr "\\(5)" -#: ../../library/datetime.rst:2478 ../../library/datetime.rst:2637 +#: ../../library/datetime.rst:2482 ../../library/datetime.rst:2641 msgid "``%z``" msgstr "``%z``" -#: ../../library/datetime.rst:2478 +#: ../../library/datetime.rst:2482 msgid "" "UTC offset in the form ``±HHMM[SS[.ffffff]]`` (empty string if the object is " "naive)." msgstr "" -#: ../../library/datetime.rst:2478 +#: ../../library/datetime.rst:2482 msgid "(empty), +0000, -0400, +1030, +063415, -030712.345216" msgstr "" -#: ../../library/datetime.rst:2478 ../../library/datetime.rst:2483 -#: ../../library/datetime.rst:2540 +#: ../../library/datetime.rst:2482 ../../library/datetime.rst:2487 +#: ../../library/datetime.rst:2544 msgid "\\(6)" msgstr "\\(6)" -#: ../../library/datetime.rst:2483 ../../library/datetime.rst:2663 +#: ../../library/datetime.rst:2487 ../../library/datetime.rst:2667 msgid "``%Z``" msgstr "``%Z``" -#: ../../library/datetime.rst:2483 +#: ../../library/datetime.rst:2487 msgid "Time zone name (empty string if the object is naive)." msgstr "" -#: ../../library/datetime.rst:2483 +#: ../../library/datetime.rst:2487 msgid "(empty), UTC, GMT" msgstr "" -#: ../../library/datetime.rst:2486 +#: ../../library/datetime.rst:2490 msgid "``%j``" msgstr "``%j``" -#: ../../library/datetime.rst:2486 +#: ../../library/datetime.rst:2490 msgid "Day of the year as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2486 +#: ../../library/datetime.rst:2490 msgid "001, 002, ..., 366" msgstr "001, 002, ..., 366" -#: ../../library/datetime.rst:2489 +#: ../../library/datetime.rst:2493 msgid "``%U``" msgstr "``%U``" -#: ../../library/datetime.rst:2489 +#: ../../library/datetime.rst:2493 msgid "" "Week number of the year (Sunday as the first day of the week) as a zero-" "padded decimal number. All days in a new year preceding the first Sunday are " "considered to be in week 0." msgstr "" -#: ../../library/datetime.rst:2489 ../../library/datetime.rst:2497 +#: ../../library/datetime.rst:2493 ../../library/datetime.rst:2501 msgid "00, 01, ..., 53" msgstr "00, 01, ..., 53" -#: ../../library/datetime.rst:2489 ../../library/datetime.rst:2497 +#: ../../library/datetime.rst:2493 ../../library/datetime.rst:2501 msgid "\\(7), \\(9)" msgstr "\\(7), \\(9)" -#: ../../library/datetime.rst:2497 +#: ../../library/datetime.rst:2501 msgid "``%W``" msgstr "``%W``" -#: ../../library/datetime.rst:2497 +#: ../../library/datetime.rst:2501 msgid "" "Week number of the year (Monday as the first day of the week) as a zero-" "padded decimal number. All days in a new year preceding the first Monday are " "considered to be in week 0." msgstr "" -#: ../../library/datetime.rst:2505 +#: ../../library/datetime.rst:2509 msgid "``%c``" msgstr "``%c``" -#: ../../library/datetime.rst:2505 +#: ../../library/datetime.rst:2509 msgid "Locale's appropriate date and time representation." msgstr "" @@ -3926,11 +3935,11 @@ msgstr "" msgid "Di 16 Aug 21:30:00 1988 (de_DE)" msgstr "" -#: ../../library/datetime.rst:2510 +#: ../../library/datetime.rst:2514 msgid "``%x``" msgstr "``%x``" -#: ../../library/datetime.rst:2510 +#: ../../library/datetime.rst:2514 msgid "Locale's appropriate date representation." msgstr "" @@ -3946,11 +3955,11 @@ msgstr "" msgid "16.08.1988 (de_DE)" msgstr "" -#: ../../library/datetime.rst:2514 +#: ../../library/datetime.rst:2518 msgid "``%X``" msgstr "``%X``" -#: ../../library/datetime.rst:2514 +#: ../../library/datetime.rst:2518 msgid "Locale's appropriate time representation." msgstr "" @@ -3962,83 +3971,83 @@ msgstr "" msgid "21:30:00 (de_DE)" msgstr "" -#: ../../library/datetime.rst:2517 +#: ../../library/datetime.rst:2521 msgid "``%%``" msgstr "``%%``" -#: ../../library/datetime.rst:2517 +#: ../../library/datetime.rst:2521 msgid "A literal ``'%'`` character." msgstr "" -#: ../../library/datetime.rst:2517 +#: ../../library/datetime.rst:2521 msgid "%" msgstr "%" -#: ../../library/datetime.rst:2520 +#: ../../library/datetime.rst:2524 msgid "" "Several additional directives not required by the C89 standard are included " "for convenience. These parameters all correspond to ISO 8601 date values." msgstr "" -#: ../../library/datetime.rst:2526 +#: ../../library/datetime.rst:2530 msgid "``%G``" msgstr "``%G``" -#: ../../library/datetime.rst:2526 +#: ../../library/datetime.rst:2530 msgid "" "ISO 8601 year with century representing the year that contains the greater " "part of the ISO week (``%V``)." msgstr "" -#: ../../library/datetime.rst:2526 +#: ../../library/datetime.rst:2530 msgid "\\(8)" msgstr "\\(8)" -#: ../../library/datetime.rst:2531 +#: ../../library/datetime.rst:2535 msgid "``%u``" msgstr "``%u``" -#: ../../library/datetime.rst:2531 +#: ../../library/datetime.rst:2535 msgid "ISO 8601 weekday as a decimal number where 1 is Monday." msgstr "" -#: ../../library/datetime.rst:2531 +#: ../../library/datetime.rst:2535 msgid "1, 2, ..., 7" msgstr "1, 2, ..., 7" -#: ../../library/datetime.rst:2534 +#: ../../library/datetime.rst:2538 msgid "``%V``" msgstr "``%V``" -#: ../../library/datetime.rst:2534 +#: ../../library/datetime.rst:2538 msgid "" "ISO 8601 week as a decimal number with Monday as the first day of the week. " "Week 01 is the week containing Jan 4." msgstr "" -#: ../../library/datetime.rst:2534 +#: ../../library/datetime.rst:2538 msgid "01, 02, ..., 53" msgstr "01, 02, ..., 53" -#: ../../library/datetime.rst:2534 +#: ../../library/datetime.rst:2538 msgid "\\(8), \\(9)" msgstr "\\(8), \\(9)" -#: ../../library/datetime.rst:2540 ../../library/datetime.rst:2659 +#: ../../library/datetime.rst:2544 ../../library/datetime.rst:2663 msgid "``%:z``" msgstr "``%:z``" -#: ../../library/datetime.rst:2540 +#: ../../library/datetime.rst:2544 msgid "" "UTC offset in the form ``±HH:MM[:SS[.ffffff]]`` (empty string if the object " "is naive)." msgstr "" -#: ../../library/datetime.rst:2540 +#: ../../library/datetime.rst:2544 msgid "(empty), +00:00, -04:00, +10:30, +06:34:15, -03:07:12.345216" msgstr "" -#: ../../library/datetime.rst:2546 +#: ../../library/datetime.rst:2550 msgid "" "These may not be available on all platforms when used with the :meth:`~." "datetime.strftime` method. The ISO 8601 year and ISO 8601 week directives " @@ -4047,7 +4056,7 @@ msgid "" "directives will raise a :exc:`ValueError`." msgstr "" -#: ../../library/datetime.rst:2551 +#: ../../library/datetime.rst:2555 msgid "" "The full set of format codes supported varies across platforms, because " "Python calls the platform C library's :c:func:`strftime` function, and " @@ -4057,44 +4066,44 @@ msgid "" "unsupported format specifiers." msgstr "" -#: ../../library/datetime.rst:2557 +#: ../../library/datetime.rst:2561 msgid "``%G``, ``%u`` and ``%V`` were added." msgstr "新增 ``%G``、``%u`` 與 ``%V``。" -#: ../../library/datetime.rst:2560 +#: ../../library/datetime.rst:2564 msgid "``%:z`` was added." msgstr "新增 ``%:z``。" -#: ../../library/datetime.rst:2564 +#: ../../library/datetime.rst:2568 msgid "Technical Detail" msgstr "技術細節" -#: ../../library/datetime.rst:2566 +#: ../../library/datetime.rst:2570 msgid "" "Broadly speaking, ``d.strftime(fmt)`` acts like the :mod:`time` module's " "``time.strftime(fmt, d.timetuple())`` although not all objects support a :" "meth:`~date.timetuple` method." msgstr "" -#: ../../library/datetime.rst:2570 +#: ../../library/datetime.rst:2574 msgid "" "For the :meth:`.datetime.strptime` class method, the default value is " "``1900-01-01T00:00:00.000``: any components not specified in the format " "string will be pulled from the default value. [#]_" msgstr "" -#: ../../library/datetime.rst:2574 +#: ../../library/datetime.rst:2578 msgid "Using ``datetime.strptime(date_string, format)`` is equivalent to::" msgstr "" -#: ../../library/datetime.rst:2578 +#: ../../library/datetime.rst:2582 msgid "" "except when the format includes sub-second components or time zone offset " "information, which are supported in ``datetime.strptime`` but are discarded " "by ``time.strptime``." msgstr "" -#: ../../library/datetime.rst:2582 +#: ../../library/datetime.rst:2586 msgid "" "For :class:`.time` objects, the format codes for year, month, and day should " "not be used, as :class:`!time` objects have no such values. If they're used " @@ -4104,7 +4113,7 @@ msgstr "" "time` 物件並沒有這些值。如果使用這些格式碼,年份會以 1900 代替、月及日會以 1 " "代替。" -#: ../../library/datetime.rst:2586 +#: ../../library/datetime.rst:2590 msgid "" "For :class:`date` objects, the format codes for hours, minutes, seconds, and " "microseconds should not be used, as :class:`date` objects have no such " @@ -4113,7 +4122,7 @@ msgstr "" "對 :class:`.date` 物件來說,不應該使用時、分、秒、微秒的格式碼,因為 :class:" "`date` 物件並沒有這些值。如果使用這些格式碼,這些值都會以 0 代替。" -#: ../../library/datetime.rst:2590 +#: ../../library/datetime.rst:2594 msgid "" "For the same reason, handling of format strings containing Unicode code " "points that can't be represented in the charset of the current locale is " @@ -4122,7 +4131,7 @@ msgid "" "`UnicodeError` or return an empty string instead." msgstr "" -#: ../../library/datetime.rst:2599 +#: ../../library/datetime.rst:2603 msgid "" "Because the format depends on the current locale, care should be taken when " "making assumptions about the output value. Field orderings will vary (for " @@ -4130,38 +4139,38 @@ msgid "" "contain non-ASCII characters." msgstr "" -#: ../../library/datetime.rst:2605 +#: ../../library/datetime.rst:2609 msgid "" "The :meth:`~.datetime.strptime` method can parse years in the full [1, 9999] " "range, but years < 1000 must be zero-filled to 4-digit width." msgstr "" -#: ../../library/datetime.rst:2608 +#: ../../library/datetime.rst:2612 msgid "" "In previous versions, :meth:`~.datetime.strftime` method was restricted to " "years >= 1900." msgstr "" -#: ../../library/datetime.rst:2612 +#: ../../library/datetime.rst:2616 msgid "" "In version 3.2, :meth:`~.datetime.strftime` method was restricted to years " ">= 1000." msgstr "" -#: ../../library/datetime.rst:2617 +#: ../../library/datetime.rst:2621 msgid "" "When used with the :meth:`~.datetime.strptime` method, the ``%p`` directive " "only affects the output hour field if the ``%I`` directive is used to parse " "the hour." msgstr "" -#: ../../library/datetime.rst:2621 +#: ../../library/datetime.rst:2625 msgid "" "Unlike the :mod:`time` module, the :mod:`!datetime` module does not support " "leap seconds." msgstr "" -#: ../../library/datetime.rst:2625 +#: ../../library/datetime.rst:2629 msgid "" "When used with the :meth:`~.datetime.strptime` method, the ``%f`` directive " "accepts from one to six digits and zero pads on the right. ``%f`` is an " @@ -4169,17 +4178,17 @@ msgid "" "separately in datetime objects, and therefore always available)." msgstr "" -#: ../../library/datetime.rst:2632 +#: ../../library/datetime.rst:2636 msgid "" "For a naive object, the ``%z``, ``%:z`` and ``%Z`` format codes are replaced " "by empty strings." msgstr "" -#: ../../library/datetime.rst:2635 +#: ../../library/datetime.rst:2639 msgid "For an aware object:" msgstr "" -#: ../../library/datetime.rst:2638 +#: ../../library/datetime.rst:2642 msgid "" ":meth:`~.datetime.utcoffset` is transformed into a string of the form " "``±HHMM[SS[.ffffff]]``, where ``HH`` is a 2-digit string giving the number " @@ -4193,7 +4202,7 @@ msgid "" "replaced with the string ``'-0330'``." msgstr "" -#: ../../library/datetime.rst:2652 +#: ../../library/datetime.rst:2656 msgid "" "When the ``%z`` directive is provided to the :meth:`~.datetime.strptime` " "method, the UTC offsets can have a colon as a separator between hours, " @@ -4202,53 +4211,53 @@ msgid "" "``'+00:00'``." msgstr "" -#: ../../library/datetime.rst:2660 +#: ../../library/datetime.rst:2664 msgid "" "Behaves exactly as ``%z``, but has a colon separator added between hours, " "minutes and seconds." msgstr "" -#: ../../library/datetime.rst:2664 +#: ../../library/datetime.rst:2668 msgid "" "In :meth:`~.datetime.strftime`, ``%Z`` is replaced by an empty string if :" "meth:`~.datetime.tzname` returns ``None``; otherwise ``%Z`` is replaced by " "the returned value, which must be a string." msgstr "" -#: ../../library/datetime.rst:2668 +#: ../../library/datetime.rst:2672 msgid ":meth:`~.datetime.strptime` only accepts certain values for ``%Z``:" msgstr "" -#: ../../library/datetime.rst:2670 +#: ../../library/datetime.rst:2674 msgid "any value in ``time.tzname`` for your machine's locale" msgstr "" -#: ../../library/datetime.rst:2671 +#: ../../library/datetime.rst:2675 msgid "the hard-coded values ``UTC`` and ``GMT``" msgstr "" -#: ../../library/datetime.rst:2673 +#: ../../library/datetime.rst:2677 msgid "" "So someone living in Japan may have ``JST``, ``UTC``, and ``GMT`` as valid " "values, but probably not ``EST``. It will raise ``ValueError`` for invalid " "values." msgstr "" -#: ../../library/datetime.rst:2677 +#: ../../library/datetime.rst:2681 msgid "" "When the ``%z`` directive is provided to the :meth:`~.datetime.strptime` " "method, an aware :class:`.datetime` object will be produced. The ``tzinfo`` " "of the result will be set to a :class:`timezone` instance." msgstr "" -#: ../../library/datetime.rst:2683 +#: ../../library/datetime.rst:2687 msgid "" "When used with the :meth:`~.datetime.strptime` method, ``%U`` and ``%W`` are " "only used in calculations when the day of the week and the calendar year " "(``%Y``) are specified." msgstr "" -#: ../../library/datetime.rst:2688 +#: ../../library/datetime.rst:2692 msgid "" "Similar to ``%U`` and ``%W``, ``%V`` is only used in calculations when the " "day of the week and the ISO year (``%G``) are specified in a :meth:`~." @@ -4256,7 +4265,7 @@ msgid "" "interchangeable." msgstr "" -#: ../../library/datetime.rst:2694 +#: ../../library/datetime.rst:2698 msgid "" "When used with the :meth:`~.datetime.strptime` method, the leading zero is " "optional for formats ``%d``, ``%m``, ``%H``, ``%I``, ``%M``, ``%S``, " @@ -4264,7 +4273,7 @@ msgid "" "zero." msgstr "" -#: ../../library/datetime.rst:2699 +#: ../../library/datetime.rst:2703 msgid "" "When parsing a month and day using :meth:`~.datetime.strptime`, always " "include a year in the format. If the value you need to parse lacks a year, " @@ -4273,7 +4282,7 @@ msgid "" "parser is not a leap year. Users run into this bug every four years..." msgstr "" -#: ../../library/datetime.rst:2705 +#: ../../library/datetime.rst:2709 msgid "" ">>> month_day = \"02/29\"\n" ">>> datetime.strptime(f\"{month_day};1984\", \"%m/%d;%Y\") # No leap year " @@ -4281,7 +4290,7 @@ msgid "" "datetime.datetime(1984, 2, 29, 0, 0)" msgstr "" -#: ../../library/datetime.rst:2711 +#: ../../library/datetime.rst:2715 msgid "" ":meth:`~.datetime.strptime` calls using a format string containing a day of " "month without a year now emit a :exc:`DeprecationWarning`. In 3.15 or later " @@ -4289,15 +4298,15 @@ msgid "" "See :gh:`70647`." msgstr "" -#: ../../library/datetime.rst:2718 +#: ../../library/datetime.rst:2722 msgid "Footnotes" msgstr "註解" -#: ../../library/datetime.rst:2719 +#: ../../library/datetime.rst:2723 msgid "If, that is, we ignore the effects of Relativity" msgstr "也就是說,我們會忽略相對論的效應" -#: ../../library/datetime.rst:2721 +#: ../../library/datetime.rst:2725 msgid "" "This matches the definition of the \"proleptic Gregorian\" calendar in " "Dershowitz and Reingold's book *Calendrical Calculations*, where it's the " @@ -4306,23 +4315,23 @@ msgid "" "systems." msgstr "" -#: ../../library/datetime.rst:2727 +#: ../../library/datetime.rst:2731 msgid "" "See R. H. van Gent's `guide to the mathematics of the ISO 8601 calendar " "`_ for a good explanation." msgstr "" -#: ../../library/datetime.rst:2731 +#: ../../library/datetime.rst:2735 msgid "" "Passing ``datetime.strptime('Feb 29', '%b %d')`` will fail since 1900 is not " "a leap year." msgstr "" -#: ../../library/datetime.rst:2372 +#: ../../library/datetime.rst:2376 msgid "% (percent)" msgstr "% (百分號)" -#: ../../library/datetime.rst:2372 +#: ../../library/datetime.rst:2376 msgid "datetime format" msgstr "datetime format(日期時間格式)" diff --git a/library/dbm.po b/library/dbm.po index d8cdda7b2e..a3a5e9c26d 100644 --- a/library/dbm.po +++ b/library/dbm.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-11 00:13+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-" @@ -251,9 +251,9 @@ msgid "" "including the SQLite CLI." msgstr "" -#: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not WASI." -msgstr ":ref:`適用 `:非 WASI。" +#: ../../includes/wasm-mobile-notavail.rst:3 ../../includes/wasm-notavail.rst:3 +msgid "Availability" +msgstr "" #: ../../includes/wasm-notavail.rst:5 msgid "" @@ -301,10 +301,6 @@ msgid "" "incompatible and can not be used interchangeably." msgstr "" -#: ../../includes/wasm-mobile-notavail.rst:3 -msgid ":ref:`Availability `: not Android, not iOS, not WASI." -msgstr ":ref:`適用 `:非 Android、非 iOS、非 WASI。" - #: ../../includes/wasm-mobile-notavail.rst:5 msgid "" "This module is not supported on :ref:`mobile platforms \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -721,8 +721,8 @@ msgstr "" msgid "Implements ``STACK[-1] = not STACK[-1]``." msgstr "" -#: ../../library/dis.rst:618 ../../library/dis.rst:1313 -#: ../../library/dis.rst:1329 +#: ../../library/dis.rst:618 ../../library/dis.rst:1314 +#: ../../library/dis.rst:1330 msgid "This instruction now requires an exact :class:`bool` operand." msgstr "" @@ -782,9 +782,9 @@ msgstr "" #: ../../library/dis.rst:690 ../../library/dis.rst:698 #: ../../library/dis.rst:710 ../../library/dis.rst:798 #: ../../library/dis.rst:808 ../../library/dis.rst:818 -#: ../../library/dis.rst:1041 ../../library/dis.rst:1052 -#: ../../library/dis.rst:1156 ../../library/dis.rst:1168 -#: ../../library/dis.rst:1180 +#: ../../library/dis.rst:1042 ../../library/dis.rst:1053 +#: ../../library/dis.rst:1157 ../../library/dis.rst:1169 +#: ../../library/dis.rst:1181 msgid "Implements::" msgstr "" @@ -1090,10 +1090,12 @@ msgid "" msgstr "" #: ../../library/dis.rst:960 -msgid "Perform ``STACK.append(len(STACK[-1]))``." +msgid "" +"Perform ``STACK.append(len(STACK[-1]))``. Used in :keyword:`match` " +"statements where comparison with structure of pattern is needed." msgstr "" -#: ../../library/dis.rst:967 +#: ../../library/dis.rst:968 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 " @@ -1101,7 +1103,7 @@ msgid "" "Otherwise, push ``False``." msgstr "" -#: ../../library/dis.rst:977 +#: ../../library/dis.rst:978 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, " @@ -1110,20 +1112,20 @@ msgid "" "Otherwise, push ``False``." msgstr "" -#: ../../library/dis.rst:987 +#: ../../library/dis.rst:988 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:993 ../../library/dis.rst:1664 +#: ../../library/dis.rst:994 ../../library/dis.rst:1665 msgid "" "Previously, this instruction also pushed a boolean value indicating success " "(``True``) or failure (``False``)." msgstr "" -#: ../../library/dis.rst:1000 +#: ../../library/dis.rst:1001 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:1013 +#: ../../library/dis.rst:1014 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:1016 +#: ../../library/dis.rst:1017 msgid "" "assert(len(STACK[-1]) == count)\n" "STACK.extend(STACK.pop()[:-count-1:-1])" @@ -1151,7 +1153,7 @@ msgstr "" "assert(len(STACK[-1]) == count)\n" "STACK.extend(STACK.pop()[:-count-1:-1])" -#: ../../library/dis.rst:1022 +#: ../../library/dis.rst:1023 msgid "" "Implements assignment with a starred target: Unpacks an iterable in " "``STACK[-1]`` into individual values, where the total number of values can " @@ -1159,11 +1161,11 @@ msgid "" "will be a list of all leftover items." msgstr "" -#: ../../library/dis.rst:1027 +#: ../../library/dis.rst:1028 msgid "The number of values before and after the list value is limited to 255." msgstr "" -#: ../../library/dis.rst:1029 +#: ../../library/dis.rst:1030 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 " @@ -1172,13 +1174,13 @@ msgid "" "list value, the high byte of *counts* the number of values after it." msgstr "" -#: ../../library/dis.rst:1035 +#: ../../library/dis.rst:1036 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:1043 +#: ../../library/dis.rst:1044 msgid "" "obj = STACK.pop()\n" "value = STACK.pop()\n" @@ -1188,13 +1190,13 @@ msgstr "" "value = STACK.pop()\n" "obj.name = value" -#: ../../library/dis.rst:1047 +#: ../../library/dis.rst:1048 msgid "" "where *namei* is the index of name in :attr:`~codeobject.co_names` of the :" "ref:`code object `." msgstr "" -#: ../../library/dis.rst:1054 +#: ../../library/dis.rst:1055 msgid "" "obj = STACK.pop()\n" "del obj.name" @@ -1202,38 +1204,38 @@ msgstr "" "obj = STACK.pop()\n" "del obj.name" -#: ../../library/dis.rst:1057 +#: ../../library/dis.rst:1058 msgid "" "where *namei* is the index of name into :attr:`~codeobject.co_names` of the :" "ref:`code object `." msgstr "" -#: ../../library/dis.rst:1063 +#: ../../library/dis.rst:1064 msgid "Works as :opcode:`STORE_NAME`, but stores the name as a global." msgstr "" -#: ../../library/dis.rst:1068 +#: ../../library/dis.rst:1069 msgid "Works as :opcode:`DELETE_NAME`, but deletes a global name." msgstr "" -#: ../../library/dis.rst:1073 +#: ../../library/dis.rst:1074 msgid "Pushes ``co_consts[consti]`` onto the stack." msgstr "" -#: ../../library/dis.rst:1078 +#: ../../library/dis.rst:1079 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:1084 +#: ../../library/dis.rst:1085 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:1093 +#: ../../library/dis.rst:1094 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 " @@ -1242,13 +1244,13 @@ msgid "" "bodies." msgstr "" -#: ../../library/dis.rst:1104 +#: ../../library/dis.rst:1105 msgid "" "Creates a tuple consuming *count* items from the stack, and pushes the " "resulting tuple onto the stack::" msgstr "" -#: ../../library/dis.rst:1107 +#: ../../library/dis.rst:1108 msgid "" "if count == 0:\n" " value = ()\n" @@ -1266,41 +1268,41 @@ msgstr "" "\n" "STACK.append(value)" -#: ../../library/dis.rst:1118 +#: ../../library/dis.rst:1119 msgid "Works as :opcode:`BUILD_TUPLE`, but creates a list." msgstr "" -#: ../../library/dis.rst:1123 +#: ../../library/dis.rst:1124 msgid "Works as :opcode:`BUILD_TUPLE`, but creates a set." msgstr "" -#: ../../library/dis.rst:1128 +#: ../../library/dis.rst:1129 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:1132 +#: ../../library/dis.rst:1133 msgid "" "The dictionary is created from stack items instead of creating an empty " "dictionary pre-sized to hold *count* items." msgstr "" -#: ../../library/dis.rst:1139 +#: ../../library/dis.rst:1140 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:1148 +#: ../../library/dis.rst:1149 msgid "" "Concatenates *count* strings from the stack and pushes the resulting string " "onto the stack." msgstr "" -#: ../../library/dis.rst:1158 +#: ../../library/dis.rst:1159 msgid "" "seq = STACK.pop()\n" "list.extend(STACK[-i], seq)" @@ -1308,11 +1310,11 @@ msgstr "" "seq = STACK.pop()\n" "list.extend(STACK[-i], seq)" -#: ../../library/dis.rst:1161 +#: ../../library/dis.rst:1162 msgid "Used to build lists." msgstr "" -#: ../../library/dis.rst:1170 +#: ../../library/dis.rst:1171 msgid "" "seq = STACK.pop()\n" "set.update(STACK[-i], seq)" @@ -1320,11 +1322,11 @@ msgstr "" "seq = STACK.pop()\n" "set.update(STACK[-i], seq)" -#: ../../library/dis.rst:1173 +#: ../../library/dis.rst:1174 msgid "Used to build sets." msgstr "" -#: ../../library/dis.rst:1182 +#: ../../library/dis.rst:1183 msgid "" "map = STACK.pop()\n" "dict.update(STACK[-i], map)" @@ -1332,21 +1334,21 @@ msgstr "" "map = STACK.pop()\n" "dict.update(STACK[-i], map)" -#: ../../library/dis.rst:1185 +#: ../../library/dis.rst:1186 msgid "Used to build dicts." msgstr "" -#: ../../library/dis.rst:1192 +#: ../../library/dis.rst:1193 msgid "Like :opcode:`DICT_UPDATE` but raises an exception for duplicate keys." msgstr "" -#: ../../library/dis.rst:1199 +#: ../../library/dis.rst:1200 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:1202 +#: ../../library/dis.rst:1203 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 " @@ -1358,76 +1360,76 @@ msgid "" "pushed." msgstr "" -#: ../../library/dis.rst:1211 +#: ../../library/dis.rst:1212 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:1218 +#: ../../library/dis.rst:1219 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:1222 +#: ../../library/dis.rst:1223 msgid "It pops three values from the stack (from top of stack down):" msgstr "" -#: ../../library/dis.rst:1224 +#: ../../library/dis.rst:1225 msgid "``self``: the first argument to the current method" msgstr "" -#: ../../library/dis.rst:1225 +#: ../../library/dis.rst:1226 msgid "``cls``: the class within which the current method was defined" msgstr "" -#: ../../library/dis.rst:1226 +#: ../../library/dis.rst:1227 msgid "the global ``super``" msgstr "" -#: ../../library/dis.rst:1228 +#: ../../library/dis.rst:1229 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:1231 +#: ../../library/dis.rst:1232 msgid "" "The low bit of ``namei`` signals to attempt a method load, as with :opcode:" "`LOAD_ATTR`, which results in pushing ``NULL`` and the loaded method. When " "it is unset a single value is pushed to the stack." msgstr "" -#: ../../library/dis.rst:1235 +#: ../../library/dis.rst:1236 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:1243 +#: ../../library/dis.rst:1244 msgid "" "Performs a Boolean operation. The operation name can be found in " "``cmp_op[opname >> 5]``. If the fifth-lowest bit of ``opname`` is set " "(``opname & 16``), the result should be coerced to ``bool``." msgstr "" -#: ../../library/dis.rst:1247 +#: ../../library/dis.rst:1248 msgid "" "The fifth-lowest bit of the oparg now indicates a forced conversion to :" "class:`bool`." msgstr "" -#: ../../library/dis.rst:1254 +#: ../../library/dis.rst:1255 msgid "Performs ``is`` comparison, or ``is not`` if ``invert`` is 1." msgstr "" -#: ../../library/dis.rst:1261 +#: ../../library/dis.rst:1262 msgid "Performs ``in`` comparison, or ``not in`` if ``invert`` is 1." msgstr "" -#: ../../library/dis.rst:1268 +#: ../../library/dis.rst:1269 msgid "" "Imports the module ``co_names[namei]``. ``STACK[-1]`` and ``STACK[-2]`` are " "popped and provide the *fromlist* and *level* arguments of :func:" @@ -1436,68 +1438,68 @@ msgid "" "opcode:`STORE_FAST` instruction modifies the namespace." msgstr "" -#: ../../library/dis.rst:1276 +#: ../../library/dis.rst:1277 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:1283 +#: ../../library/dis.rst:1284 msgid "Increments bytecode counter by *delta*." msgstr "" -#: ../../library/dis.rst:1288 +#: ../../library/dis.rst:1289 msgid "Decrements bytecode counter by *delta*. Checks for interrupts." msgstr "" -#: ../../library/dis.rst:1295 +#: ../../library/dis.rst:1296 msgid "Decrements bytecode counter by *delta*. Does not check for interrupts." msgstr "" -#: ../../library/dis.rst:1302 +#: ../../library/dis.rst:1303 msgid "" "If ``STACK[-1]`` is true, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1305 ../../library/dis.rst:1321 +#: ../../library/dis.rst:1306 ../../library/dis.rst:1322 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:1310 ../../library/dis.rst:1326 -#: ../../library/dis.rst:1342 ../../library/dis.rst:1356 +#: ../../library/dis.rst:1311 ../../library/dis.rst:1327 +#: ../../library/dis.rst:1343 ../../library/dis.rst:1357 msgid "This is no longer a pseudo-instruction." msgstr "" -#: ../../library/dis.rst:1318 +#: ../../library/dis.rst:1319 msgid "" "If ``STACK[-1]`` is false, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1334 +#: ../../library/dis.rst:1335 msgid "" "If ``STACK[-1]`` is not ``None``, increments the bytecode counter by " "*delta*. ``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1337 ../../library/dis.rst:1351 +#: ../../library/dis.rst:1338 ../../library/dis.rst:1352 msgid "" "This opcode is a pseudo-instruction, replaced in final bytecode by the " "directed versions (forward/backward)." msgstr "" -#: ../../library/dis.rst:1348 +#: ../../library/dis.rst:1349 msgid "" "If ``STACK[-1]`` is ``None``, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1361 +#: ../../library/dis.rst:1362 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 " @@ -1505,186 +1507,188 @@ msgid "" "code counter is incremented by *delta*." msgstr "" -#: ../../library/dis.rst:1366 +#: ../../library/dis.rst:1367 msgid "Up until 3.11 the iterator was popped when it was exhausted." msgstr "" -#: ../../library/dis.rst:1371 +#: ../../library/dis.rst:1372 msgid "Loads the global named ``co_names[namei>>1]`` onto the stack." msgstr "" -#: ../../library/dis.rst:1373 +#: ../../library/dis.rst:1374 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:1379 +#: ../../library/dis.rst:1380 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack." msgstr "" -#: ../../library/dis.rst:1381 +#: ../../library/dis.rst:1382 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:1387 +#: ../../library/dis.rst:1388 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:1395 +#: ../../library/dis.rst:1396 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:1403 +#: ../../library/dis.rst:1404 msgid "Stores ``STACK.pop()`` into the local ``co_varnames[var_num]``." msgstr "" -#: ../../library/dis.rst:1408 +#: ../../library/dis.rst:1409 msgid "Deletes local ``co_varnames[var_num]``." msgstr "" -#: ../../library/dis.rst:1413 +#: ../../library/dis.rst:1414 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:1421 +#: ../../library/dis.rst:1422 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:1424 ../../library/dis.rst:1446 -#: ../../library/dis.rst:1457 +#: ../../library/dis.rst:1425 ../../library/dis.rst:1447 +#: ../../library/dis.rst:1458 msgid "" "``i`` is no longer offset by the length of :attr:`~codeobject.co_varnames`." msgstr "" -#: ../../library/dis.rst:1430 +#: ../../library/dis.rst:1431 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 " "found there, loads it from the cell contained in slot ``i``, similar to :" -"opcode:`LOAD_DEREF`. This is used for loading free variables in class bodies " -"(which previously used :opcode:`!LOAD_CLASSDEREF`) and in :ref:`annotation " -"scopes ` within class bodies." +"opcode:`LOAD_DEREF`. This is used for loading :term:`closure variables " +"` in class bodies (which previously used :opcode:`!" +"LOAD_CLASSDEREF`) and in :ref:`annotation scopes ` within " +"class bodies." msgstr "" -#: ../../library/dis.rst:1443 +#: ../../library/dis.rst:1444 msgid "" "Stores ``STACK.pop()`` into the cell contained in slot ``i`` of the \"fast " "locals\" storage." msgstr "" -#: ../../library/dis.rst:1452 +#: ../../library/dis.rst:1453 msgid "" "Empties the cell contained in slot ``i`` of the \"fast locals\" storage. " "Used by the :keyword:`del` statement." msgstr "" -#: ../../library/dis.rst:1463 +#: ../../library/dis.rst:1464 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." +"Copies the ``n`` :term:`free (closure) 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:1472 +#: ../../library/dis.rst:1473 msgid "" "Raises an exception using one of the 3 forms of the ``raise`` statement, " "depending on the value of *argc*:" msgstr "" -#: ../../library/dis.rst:1475 +#: ../../library/dis.rst:1476 msgid "0: ``raise`` (re-raise previous exception)" msgstr "" -#: ../../library/dis.rst:1476 +#: ../../library/dis.rst:1477 msgid "" "1: ``raise STACK[-1]`` (raise exception instance or type at ``STACK[-1]``)" msgstr "" -#: ../../library/dis.rst:1477 +#: ../../library/dis.rst:1478 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:1483 +#: ../../library/dis.rst:1484 msgid "" "Calls a callable object with the number of arguments specified by ``argc``. " "On the stack are (in ascending order):" msgstr "" -#: ../../library/dis.rst:1486 ../../library/dis.rst:1510 +#: ../../library/dis.rst:1487 ../../library/dis.rst:1511 msgid "The callable" msgstr "" -#: ../../library/dis.rst:1487 ../../library/dis.rst:1511 +#: ../../library/dis.rst:1488 ../../library/dis.rst:1512 msgid "``self`` or ``NULL``" msgstr "" -#: ../../library/dis.rst:1488 ../../library/dis.rst:1512 +#: ../../library/dis.rst:1489 ../../library/dis.rst:1513 msgid "The remaining positional arguments" msgstr "" -#: ../../library/dis.rst:1490 +#: ../../library/dis.rst:1491 msgid "``argc`` is the total of the positional arguments, excluding ``self``." msgstr "" -#: ../../library/dis.rst:1492 +#: ../../library/dis.rst:1493 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:1498 +#: ../../library/dis.rst:1499 msgid "The callable now always appears at the same position on the stack." msgstr "" -#: ../../library/dis.rst:1501 +#: ../../library/dis.rst:1502 msgid "Calls with keyword arguments are now handled by :opcode:`CALL_KW`." msgstr "" -#: ../../library/dis.rst:1507 +#: ../../library/dis.rst:1508 msgid "" "Calls a callable object with the number of arguments specified by ``argc``, " "including one or more named arguments. On the stack are (in ascending order):" msgstr "" -#: ../../library/dis.rst:1513 +#: ../../library/dis.rst:1514 msgid "The named arguments" msgstr "" -#: ../../library/dis.rst:1514 +#: ../../library/dis.rst:1515 msgid "A :class:`tuple` of keyword argument names" msgstr "" -#: ../../library/dis.rst:1516 +#: ../../library/dis.rst:1517 msgid "" "``argc`` is the total of the positional and named arguments, excluding " "``self``. The length of the tuple of keyword argument names is the number of " "named arguments." msgstr "" -#: ../../library/dis.rst:1519 +#: ../../library/dis.rst:1520 msgid "" "``CALL_KW`` pops all arguments, the keyword names, 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:1528 +#: ../../library/dis.rst:1529 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 " @@ -1696,33 +1700,33 @@ msgid "" "arguments, and pushes the return value returned by the callable object." msgstr "" -#: ../../library/dis.rst:1543 +#: ../../library/dis.rst:1544 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:1552 +#: ../../library/dis.rst:1553 msgid "" "Pushes a new function object on the stack built from the code object at " "``STACK[1]``." msgstr "" -#: ../../library/dis.rst:1554 +#: ../../library/dis.rst:1555 msgid "Flag value ``0x04`` is a tuple of strings instead of dictionary" msgstr "" -#: ../../library/dis.rst:1557 +#: ../../library/dis.rst:1558 msgid "Qualified name at ``STACK[-1]`` was removed." msgstr "" -#: ../../library/dis.rst:1560 +#: ../../library/dis.rst:1561 msgid "" "Extra function attributes on the stack, signaled by oparg flags, were " "removed. They now use :opcode:`SET_FUNCTION_ATTRIBUTE`." msgstr "" -#: ../../library/dis.rst:1567 +#: ../../library/dis.rst:1568 msgid "" "Sets an attribute on a function object. Expects the function at " "``STACK[-1]`` and the attribute value to set at ``STACK[-2]``; consumes both " @@ -1730,42 +1734,42 @@ msgid "" "attribute to set:" msgstr "" -#: ../../library/dis.rst:1571 +#: ../../library/dis.rst:1572 msgid "" "``0x01`` a tuple of default values for positional-only and positional-or-" "keyword parameters in positional order" msgstr "" -#: ../../library/dis.rst:1573 +#: ../../library/dis.rst:1574 msgid "``0x02`` a dictionary of keyword-only parameters' default values" msgstr "" -#: ../../library/dis.rst:1574 +#: ../../library/dis.rst:1575 msgid "``0x04`` a tuple of strings containing parameters' annotations" msgstr "" -#: ../../library/dis.rst:1575 +#: ../../library/dis.rst:1576 msgid "``0x08`` a tuple containing cells for free variables, making a closure" msgstr "" -#: ../../library/dis.rst:1584 +#: ../../library/dis.rst:1585 msgid "" "Pushes a slice object on the stack. *argc* must be 2 or 3. If it is 2, " "implements::" msgstr "" -#: ../../library/dis.rst:1586 +#: ../../library/dis.rst:1587 msgid "" "end = STACK.pop()\n" "start = STACK.pop()\n" "STACK.append(slice(start, end))" msgstr "" -#: ../../library/dis.rst:1590 +#: ../../library/dis.rst:1591 msgid "if it is 3, implements::" msgstr "" -#: ../../library/dis.rst:1592 +#: ../../library/dis.rst:1593 msgid "" "step = STACK.pop()\n" "end = STACK.pop()\n" @@ -1777,11 +1781,11 @@ msgstr "" "start = STACK.pop()\n" "STACK.append(slice(start, end, step))" -#: ../../library/dis.rst:1597 +#: ../../library/dis.rst:1598 msgid "See the :func:`slice` built-in function for more information." msgstr "" -#: ../../library/dis.rst:1602 +#: ../../library/dis.rst:1603 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 " @@ -1789,11 +1793,11 @@ msgid "" "allowed, forming an argument from two-byte to four-byte." msgstr "" -#: ../../library/dis.rst:1610 +#: ../../library/dis.rst:1611 msgid "Convert value to a string, depending on ``oparg``::" msgstr "" -#: ../../library/dis.rst:1612 +#: ../../library/dis.rst:1613 msgid "" "value = STACK.pop()\n" "result = func(value)\n" @@ -1803,28 +1807,28 @@ msgstr "" "result = func(value)\n" "STACK.append(result)" -#: ../../library/dis.rst:1616 +#: ../../library/dis.rst:1617 msgid "``oparg == 1``: call :func:`str` on *value*" msgstr "" -#: ../../library/dis.rst:1617 +#: ../../library/dis.rst:1618 msgid "``oparg == 2``: call :func:`repr` on *value*" msgstr "" -#: ../../library/dis.rst:1618 +#: ../../library/dis.rst:1619 msgid "``oparg == 3``: call :func:`ascii` on *value*" msgstr "" -#: ../../library/dis.rst:1620 ../../library/dis.rst:1633 -#: ../../library/dis.rst:1646 +#: ../../library/dis.rst:1621 ../../library/dis.rst:1634 +#: ../../library/dis.rst:1647 msgid "Used for implementing formatted literal strings (f-strings)." msgstr "" -#: ../../library/dis.rst:1627 +#: ../../library/dis.rst:1628 msgid "Formats the value on top of stack::" msgstr "" -#: ../../library/dis.rst:1629 +#: ../../library/dis.rst:1630 msgid "" "value = STACK.pop()\n" "result = value.__format__(\"\")\n" @@ -1834,11 +1838,11 @@ msgstr "" "result = value.__format__(\"\")\n" "STACK.append(result)" -#: ../../library/dis.rst:1639 +#: ../../library/dis.rst:1640 msgid "Formats the given value with the given format spec::" msgstr "" -#: ../../library/dis.rst:1641 +#: ../../library/dis.rst:1642 msgid "" "spec = STACK.pop()\n" "value = STACK.pop()\n" @@ -1850,14 +1854,14 @@ msgstr "" "result = value.__format__(spec)\n" "STACK.append(result)" -#: ../../library/dis.rst:1653 +#: ../../library/dis.rst:1654 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:1657 +#: ../../library/dis.rst:1658 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 " @@ -1865,219 +1869,219 @@ msgid "" "Otherwise, push ``None``." msgstr "" -#: ../../library/dis.rst:1671 +#: ../../library/dis.rst:1672 msgid "A no-op. Performs internal tracing, debugging and optimization checks." msgstr "" -#: ../../library/dis.rst:1673 +#: ../../library/dis.rst:1674 msgid "" "The ``context`` oparand consists of two parts. The lowest two bits indicate " "where the ``RESUME`` occurs:" msgstr "" -#: ../../library/dis.rst:1676 +#: ../../library/dis.rst:1677 msgid "" "``0`` The start of a function, which is neither a generator, coroutine nor " "an async generator" msgstr "" -#: ../../library/dis.rst:1678 +#: ../../library/dis.rst:1679 msgid "``1`` After a ``yield`` expression" msgstr "" -#: ../../library/dis.rst:1679 +#: ../../library/dis.rst:1680 msgid "``2`` After a ``yield from`` expression" msgstr "" -#: ../../library/dis.rst:1680 +#: ../../library/dis.rst:1681 msgid "``3`` After an ``await`` expression" msgstr "" -#: ../../library/dis.rst:1682 +#: ../../library/dis.rst:1683 msgid "" "The next bit is ``1`` if the RESUME is at except-depth ``1``, and ``0`` " "otherwise." msgstr "" -#: ../../library/dis.rst:1687 +#: ../../library/dis.rst:1688 msgid "The oparg value changed to include information about except-depth" msgstr "" -#: ../../library/dis.rst:1693 +#: ../../library/dis.rst:1694 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:1702 +#: ../../library/dis.rst:1703 msgid "" "Equivalent to ``STACK[-1] = STACK[-2].send(STACK[-1])``. Used in ``yield " "from`` and ``await`` statements." msgstr "" -#: ../../library/dis.rst:1705 +#: ../../library/dis.rst:1706 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:1714 +#: ../../library/dis.rst:1715 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:1718 +#: ../../library/dis.rst:1719 msgid "" "If your application uses pseudo instructions or specialized instructions, " "use the :data:`hasarg` collection instead." msgstr "" -#: ../../library/dis.rst:1721 +#: ../../library/dis.rst:1722 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:1725 +#: ../../library/dis.rst:1726 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:1730 +#: ../../library/dis.rst:1731 msgid "Use :data:`hasarg` instead." msgstr "" -#: ../../library/dis.rst:1735 +#: ../../library/dis.rst:1736 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:1739 ../../library/dis.rst:1793 +#: ../../library/dis.rst:1740 ../../library/dis.rst:1794 msgid "The operand determines which intrinsic function is called:" msgstr "" -#: ../../library/dis.rst:1742 ../../library/dis.rst:1796 +#: ../../library/dis.rst:1743 ../../library/dis.rst:1797 msgid "Operand" msgstr "" -#: ../../library/dis.rst:1742 ../../library/dis.rst:1796 +#: ../../library/dis.rst:1743 ../../library/dis.rst:1797 msgid "Description" msgstr "" -#: ../../library/dis.rst:1744 +#: ../../library/dis.rst:1745 msgid "``INTRINSIC_1_INVALID``" msgstr "``INTRINSIC_1_INVALID``" -#: ../../library/dis.rst:1744 ../../library/dis.rst:1798 +#: ../../library/dis.rst:1745 ../../library/dis.rst:1799 msgid "Not valid" msgstr "" -#: ../../library/dis.rst:1746 +#: ../../library/dis.rst:1747 msgid "``INTRINSIC_PRINT``" msgstr "``INTRINSIC_PRINT``" -#: ../../library/dis.rst:1746 +#: ../../library/dis.rst:1747 msgid "Prints the argument to standard out. Used in the REPL." msgstr "" -#: ../../library/dis.rst:1749 +#: ../../library/dis.rst:1750 msgid "``INTRINSIC_IMPORT_STAR``" msgstr "``INTRINSIC_IMPORT_STAR``" -#: ../../library/dis.rst:1749 +#: ../../library/dis.rst:1750 msgid "Performs ``import *`` for the named module." msgstr "" -#: ../../library/dis.rst:1752 +#: ../../library/dis.rst:1753 msgid "``INTRINSIC_STOPITERATION_ERROR``" msgstr "``INTRINSIC_STOPITERATION_ERROR``" -#: ../../library/dis.rst:1752 +#: ../../library/dis.rst:1753 msgid "Extracts the return value from a ``StopIteration`` exception." msgstr "" -#: ../../library/dis.rst:1755 +#: ../../library/dis.rst:1756 msgid "``INTRINSIC_ASYNC_GEN_WRAP``" msgstr "``INTRINSIC_ASYNC_GEN_WRAP``" -#: ../../library/dis.rst:1755 +#: ../../library/dis.rst:1756 msgid "Wraps an async generator value" msgstr "" -#: ../../library/dis.rst:1757 +#: ../../library/dis.rst:1758 msgid "``INTRINSIC_UNARY_POSITIVE``" msgstr "``INTRINSIC_UNARY_POSITIVE``" -#: ../../library/dis.rst:1757 +#: ../../library/dis.rst:1758 msgid "Performs the unary ``+`` operation" msgstr "" -#: ../../library/dis.rst:1760 +#: ../../library/dis.rst:1761 msgid "``INTRINSIC_LIST_TO_TUPLE``" msgstr "``INTRINSIC_LIST_TO_TUPLE``" -#: ../../library/dis.rst:1760 +#: ../../library/dis.rst:1761 msgid "Converts a list to a tuple" msgstr "" -#: ../../library/dis.rst:1762 +#: ../../library/dis.rst:1763 msgid "``INTRINSIC_TYPEVAR``" msgstr "``INTRINSIC_TYPEVAR``" -#: ../../library/dis.rst:1762 +#: ../../library/dis.rst:1763 msgid "Creates a :class:`typing.TypeVar`" msgstr "" -#: ../../library/dis.rst:1764 +#: ../../library/dis.rst:1765 msgid "``INTRINSIC_PARAMSPEC``" msgstr "``INTRINSIC_PARAMSPEC``" -#: ../../library/dis.rst:1764 +#: ../../library/dis.rst:1765 msgid "Creates a :class:`typing.ParamSpec`" msgstr "" -#: ../../library/dis.rst:1767 +#: ../../library/dis.rst:1768 msgid "``INTRINSIC_TYPEVARTUPLE``" msgstr "``INTRINSIC_TYPEVARTUPLE``" -#: ../../library/dis.rst:1767 +#: ../../library/dis.rst:1768 msgid "Creates a :class:`typing.TypeVarTuple`" msgstr "" -#: ../../library/dis.rst:1770 +#: ../../library/dis.rst:1771 msgid "``INTRINSIC_SUBSCRIPT_GENERIC``" msgstr "``INTRINSIC_SUBSCRIPT_GENERIC``" -#: ../../library/dis.rst:1770 +#: ../../library/dis.rst:1771 msgid "Returns :class:`typing.Generic` subscripted with the argument" msgstr "" -#: ../../library/dis.rst:1773 +#: ../../library/dis.rst:1774 msgid "``INTRINSIC_TYPEALIAS``" msgstr "``INTRINSIC_TYPEALIAS``" -#: ../../library/dis.rst:1773 +#: ../../library/dis.rst:1774 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:1785 +#: ../../library/dis.rst:1786 msgid "" "Calls an intrinsic function with two arguments. Used to implement " "functionality that is not performance critical::" msgstr "" -#: ../../library/dis.rst:1788 +#: ../../library/dis.rst:1789 msgid "" "arg2 = STACK.pop()\n" "arg1 = STACK.pop()\n" @@ -2089,61 +2093,61 @@ msgstr "" "result = intrinsic2(arg1, arg2)\n" "STACK.append(result)" -#: ../../library/dis.rst:1798 +#: ../../library/dis.rst:1799 msgid "``INTRINSIC_2_INVALID``" msgstr "``INTRINSIC_2_INVALID``" -#: ../../library/dis.rst:1800 +#: ../../library/dis.rst:1801 msgid "``INTRINSIC_PREP_RERAISE_STAR``" msgstr "``INTRINSIC_PREP_RERAISE_STAR``" -#: ../../library/dis.rst:1800 +#: ../../library/dis.rst:1801 msgid "Calculates the :exc:`ExceptionGroup` to raise from a ``try-except*``." msgstr "" -#: ../../library/dis.rst:1804 +#: ../../library/dis.rst:1805 msgid "``INTRINSIC_TYPEVAR_WITH_BOUND``" msgstr "``INTRINSIC_TYPEVAR_WITH_BOUND``" -#: ../../library/dis.rst:1804 +#: ../../library/dis.rst:1805 msgid "Creates a :class:`typing.TypeVar` with a bound." msgstr "" -#: ../../library/dis.rst:1807 +#: ../../library/dis.rst:1808 msgid "``INTRINSIC_TYPEVAR_WITH_CONSTRAINTS``" msgstr "``INTRINSIC_TYPEVAR_WITH_CONSTRAINTS``" -#: ../../library/dis.rst:1807 +#: ../../library/dis.rst:1808 msgid "Creates a :class:`typing.TypeVar` with constraints." msgstr "" -#: ../../library/dis.rst:1811 +#: ../../library/dis.rst:1812 msgid "``INTRINSIC_SET_FUNCTION_TYPE_PARAMS``" msgstr "``INTRINSIC_SET_FUNCTION_TYPE_PARAMS``" -#: ../../library/dis.rst:1811 +#: ../../library/dis.rst:1812 msgid "Sets the ``__type_params__`` attribute of a function." msgstr "" -#: ../../library/dis.rst:1818 +#: ../../library/dis.rst:1819 msgid "**Pseudo-instructions**" msgstr "" -#: ../../library/dis.rst:1820 +#: ../../library/dis.rst:1821 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:1825 +#: ../../library/dis.rst:1826 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:1832 +#: ../../library/dis.rst:1833 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 " @@ -2152,139 +2156,140 @@ msgid "" "exception handler at ``target``." msgstr "" -#: ../../library/dis.rst:1841 +#: ../../library/dis.rst:1842 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:1845 +#: ../../library/dis.rst:1846 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:1852 +#: ../../library/dis.rst:1853 msgid "" "Marks the end of the code block associated with the last ``SETUP_FINALLY``, " "``SETUP_CLEANUP`` or ``SETUP_WITH``." msgstr "" -#: ../../library/dis.rst:1858 +#: ../../library/dis.rst:1859 msgid "" "Undirected relative jump instructions which are replaced by their directed " "(forward/backward) counterparts by the assembler." msgstr "" -#: ../../library/dis.rst:1863 +#: ../../library/dis.rst:1864 msgid "" "Pushes a reference to the cell contained in slot ``i`` of the \"fast " "locals\" storage." msgstr "" -#: ../../library/dis.rst:1866 +#: ../../library/dis.rst:1867 msgid "" "Note that ``LOAD_CLOSURE`` is replaced with ``LOAD_FAST`` in the assembler." msgstr "" -#: ../../library/dis.rst:1868 +#: ../../library/dis.rst:1869 msgid "This opcode is now a pseudo-instruction." msgstr "" -#: ../../library/dis.rst:1874 +#: ../../library/dis.rst:1875 msgid "" "Optimized unbound method lookup. Emitted as a ``LOAD_ATTR`` opcode with a " "flag set in the arg." msgstr "" -#: ../../library/dis.rst:1881 +#: ../../library/dis.rst:1882 msgid "Opcode collections" msgstr "" -#: ../../library/dis.rst:1883 +#: ../../library/dis.rst:1884 msgid "" "These collections are provided for automatic introspection of bytecode " "instructions:" msgstr "" -#: ../../library/dis.rst:1886 +#: ../../library/dis.rst:1887 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:1893 +#: ../../library/dis.rst:1894 msgid "Sequence of operation names, indexable using the bytecode." msgstr "" -#: ../../library/dis.rst:1898 +#: ../../library/dis.rst:1899 msgid "Dictionary mapping operation names to bytecodes." msgstr "" -#: ../../library/dis.rst:1903 +#: ../../library/dis.rst:1904 msgid "Sequence of all compare operation names." msgstr "" -#: ../../library/dis.rst:1908 +#: ../../library/dis.rst:1909 msgid "Sequence of bytecodes that use their argument." msgstr "" -#: ../../library/dis.rst:1915 +#: ../../library/dis.rst:1916 msgid "Sequence of bytecodes that access a constant." msgstr "" -#: ../../library/dis.rst:1920 +#: ../../library/dis.rst:1921 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 " -"names in outer scopes that are referenced from this scope. It does *not* " -"include references to global or builtin scopes." +"Sequence of bytecodes that access a :term:`free (closure) variable `. 'free' in this context refers to names in the current scope that " +"are referenced by inner scopes or names in outer scopes that are referenced " +"from this scope. It does *not* include references to global or builtin " +"scopes." msgstr "" -#: ../../library/dis.rst:1928 +#: ../../library/dis.rst:1929 msgid "Sequence of bytecodes that access an attribute by name." msgstr "" -#: ../../library/dis.rst:1933 +#: ../../library/dis.rst:1934 msgid "Sequence of bytecodes that have a jump target. All jumps are relative." msgstr "" -#: ../../library/dis.rst:1940 +#: ../../library/dis.rst:1941 msgid "Sequence of bytecodes that access a local variable." msgstr "" -#: ../../library/dis.rst:1945 +#: ../../library/dis.rst:1946 msgid "Sequence of bytecodes of Boolean operations." msgstr "" -#: ../../library/dis.rst:1949 +#: ../../library/dis.rst:1950 msgid "Sequence of bytecodes that set an exception handler." msgstr "" -#: ../../library/dis.rst:1956 +#: ../../library/dis.rst:1957 msgid "Sequence of bytecodes that have a relative jump target." msgstr "" -#: ../../library/dis.rst:1958 +#: ../../library/dis.rst:1959 msgid "All jumps are now relative. Use :data:`hasjump`." msgstr "" -#: ../../library/dis.rst:1964 +#: ../../library/dis.rst:1965 msgid "Sequence of bytecodes that have an absolute jump target." msgstr "" -#: ../../library/dis.rst:1966 +#: ../../library/dis.rst:1967 msgid "All jumps are now relative. This list is empty." msgstr "" -#: ../../library/dis.rst:1582 +#: ../../library/dis.rst:1583 msgid "built-in function" msgstr "built-in function(內建函式)" -#: ../../library/dis.rst:1582 +#: ../../library/dis.rst:1583 msgid "slice" msgstr "slice(切片)" diff --git a/library/ensurepip.po b/library/ensurepip.po index 0c3867c9a3..ada8cd86dc 100644 --- a/library/ensurepip.po +++ b/library/ensurepip.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-11 00:13+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-" @@ -76,8 +76,8 @@ msgid "The original rationale and specification for this module." msgstr "此模組的最初設計理念與規範。" #: ../../includes/wasm-mobile-notavail.rst:3 -msgid ":ref:`Availability `: not Android, not iOS, not WASI." -msgstr ":ref:`適用 `:非 Android、非 iOS、非 WASI。" +msgid "Availability" +msgstr "" #: ../../includes/wasm-mobile-notavail.rst:5 msgid "" @@ -270,13 +270,3 @@ msgstr "" "初始建置的過程也許會安裝 ``pip`` 所需要的額外的模組,但其他軟體不應該假設這些" "相依 (dependency) 總是預設存在(因為這些相依很可能會在未來版本的 ``pip`` 中被" "移除)。" - -#, fuzzy -#~ msgid "" -#~ "This module does not work or is not available on WebAssembly platforms, " -#~ "or on iOS. See :ref:`wasm-availability` for more information on WASM " -#~ "availability; see :ref:`iOS-availability` for more information on iOS " -#~ "availability." -#~ msgstr "" -#~ "此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法" -#~ "作用或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" diff --git a/library/errno.po b/library/errno.po index 8a2c10f4e4..0d41f0a9c6 100644 --- a/library/errno.po +++ b/library/errno.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-09 00:03+0000\n" +"POT-Creation-Date: 2024-10-11 00:13+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -588,8 +588,8 @@ msgid "" msgstr "" #: ../../library/errno.rst:673 -msgid ":ref:`Availability `: WASI, FreeBSD" -msgstr ":ref:`適用 `:WASI, FreeBSD" +msgid "Availability" +msgstr "" #: ../../library/errno.rst:680 msgid "Operation canceled" diff --git a/library/fcntl.po b/library/fcntl.po index 4a43c0463f..a806871acf 100644 --- a/library/fcntl.po +++ b/library/fcntl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-11 00:13+0000\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -31,9 +31,8 @@ msgid "" msgstr "" #: ../../library/fcntl.rst:21 -#, fuzzy -msgid ":ref:`Availability `: Unix, not WASI." -msgstr ":ref:`適用 `:Unix、非 Emscripten、非 WASI。" +msgid "Availability" +msgstr "" #: ../../library/fcntl.rst:23 msgid "" @@ -380,11 +379,3 @@ msgstr "file control(檔案控制)" #: ../../library/fcntl.rst:10 msgid "I/O control" msgstr "I/O control(I/O 控制)" - -#~ msgid "" -#~ "This module does not work or is not available on WebAssembly platforms " -#~ "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` " -#~ "for more information." -#~ msgstr "" -#~ "此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法" -#~ "作用或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" diff --git a/library/ftplib.po b/library/ftplib.po index 5f1ac72eb1..15641cfa55 100644 --- a/library/ftplib.po +++ b/library/ftplib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-11 00:13+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-" @@ -46,8 +46,8 @@ msgid "The default encoding is UTF-8, following :rfc:`2640`." msgstr "預設編碼是 UTF-8,遵循 :rfc:`2640`。" #: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not WASI." -msgstr ":ref:`Availability `:非 WASI。" +msgid "Availability" +msgstr "" #: ../../includes/wasm-notavail.rst:5 msgid "" diff --git a/library/functions.po b/library/functions.po index 0703f10a5b..59b35e4bb2 100644 --- a/library/functions.po +++ b/library/functions.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-27 00:14+0000\n" +"POT-Creation-Date: 2024-10-12 00:13+0000\n" "PO-Revision-Date: 2024-05-06 17:06+0800\n" "Last-Translator: KNChiu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -514,8 +514,8 @@ msgid "" "ways." msgstr "如果不一定需要 \"0b\" 前綴,還可以使用如下的方法。" -#: ../../library/functions.rst:141 ../../library/functions.rst:931 -#: ../../library/functions.rst:1311 +#: ../../library/functions.rst:141 ../../library/functions.rst:932 +#: ../../library/functions.rst:1312 msgid "See also :func:`format` for more information." msgstr "可參考 :func:`format` 獲取更多資訊。" @@ -534,7 +534,7 @@ msgstr "" "(參見 :ref:`typesnumeric`),其他 class 不能繼承自它。它只有 ``False`` 和 " "``True`` 兩個實例(參見 :ref:`typebool`)。" -#: ../../library/functions.rst:156 ../../library/functions.rst:796 +#: ../../library/functions.rst:156 ../../library/functions.rst:797 msgid "The parameter is now positional-only." msgstr "現在為僅限位置參數。" @@ -932,8 +932,8 @@ msgid "" "number from real and imaginary parts." msgstr "" -#: ../../library/functions.rst:384 ../../library/functions.rst:741 -#: ../../library/functions.rst:987 +#: ../../library/functions.rst:384 ../../library/functions.rst:742 +#: ../../library/functions.rst:988 msgid "Examples:" msgstr "例如: ::" @@ -1022,8 +1022,8 @@ msgstr "" msgid "The complex type is described in :ref:`typesnumeric`." msgstr "複數型別在 :ref:`typesnumeric` 中有相關描述。" -#: ../../library/functions.rst:447 ../../library/functions.rst:793 -#: ../../library/functions.rst:1036 +#: ../../library/functions.rst:447 ../../library/functions.rst:794 +#: ../../library/functions.rst:1037 msgid "Grouping digits with underscores as in code literals is allowed." msgstr "可以使用底線將程式碼文字中的數字進行分組。" @@ -1299,7 +1299,7 @@ msgstr "" "串。" #: ../../library/functions.rst:629 ../../library/functions.rst:631 -#: ../../library/functions.rst:685 ../../library/functions.rst:687 +#: ../../library/functions.rst:686 ../../library/functions.rst:688 msgid "" "Raises an :ref:`auditing event ` ``exec`` with the code object as " "the argument. Code compilation events may also be raised." @@ -1307,11 +1307,11 @@ msgstr "" "引發一個附帶程式碼物件為引數的\\ :ref:`稽核事件 ` ``exec``。也可能" "會引發程式碼編譯事件。" -#: ../../library/functions.rst:636 ../../library/functions.rst:707 +#: ../../library/functions.rst:636 ../../library/functions.rst:708 msgid "The *globals* and *locals* arguments can now be passed as keywords." msgstr "" -#: ../../library/functions.rst:640 ../../library/functions.rst:711 +#: ../../library/functions.rst:640 ../../library/functions.rst:712 msgid "" "The semantics of the default *locals* namespace have been adjusted as " "described for the :func:`locals` builtin." @@ -1378,15 +1378,16 @@ msgstr "" #: ../../library/functions.rst:680 msgid "" "The *closure* argument specifies a closure--a tuple of cellvars. It's only " -"valid when the *object* is a code object containing free variables. The " -"length of the tuple must exactly match the number of free variables " -"referenced by the code object." +"valid when the *object* is a code object containing :term:`free (closure) " +"variables `. The length of the tuple must exactly match " +"the length of the code object's :attr:`~codeobject.co_freevars` attribute." msgstr "" "*closure* 引數會指定一個閉包 (closure) — 它是一個 cellvar(格變數)的 tuple。" -"只有在 *object* 是一個含有自由變數 (free variable) 的程式碼物件時,它才有效。" -"Tuple 的長度必須與程式碼物件所引用的自由變數數量完全匹配。" +"只有在 *object* 是一個含有\\ :term:`自由(閉包)變數 (free (closure) " +"variables) ` 的程式碼物件時,它才有效。Tuple 的長度必須與程" +"式碼物件的 :attr:`~codeobject.co_freevars` 屬性完全匹配。" -#: ../../library/functions.rst:692 +#: ../../library/functions.rst:693 msgid "" "The built-in functions :func:`globals` and :func:`locals` return the current " "global and local namespace, respectively, which may be useful to pass around " @@ -1395,7 +1396,7 @@ msgstr "" "內建 :func:`globals` 和 :func:`locals` 函式各自回傳當前的全域和區域命名空間," "因此可以將它們傳遞給 :func:`exec` 的第二個和第三個引數以供後續使用。" -#: ../../library/functions.rst:698 +#: ../../library/functions.rst:699 msgid "" "The default *locals* act as described for function :func:`locals` below. " "Pass an explicit *locals* dictionary if you need to see effects of the code " @@ -1405,11 +1406,11 @@ msgstr "" "func:`exec` 函式回傳時知道程式碼對 *locals* 的變動,請明確地傳遞 *locals* " "dictionary 。" -#: ../../library/functions.rst:702 +#: ../../library/functions.rst:703 msgid "Added the *closure* parameter." msgstr "增加了 *closure* 參數。" -#: ../../library/functions.rst:717 +#: ../../library/functions.rst:718 msgid "" "Construct an iterator from those elements of *iterable* for which *function* " "is true. *iterable* may be either a sequence, a container which supports " @@ -1421,7 +1422,7 @@ msgstr "" "*function* 是 ``None``,則會假設它是一個識別性函式,即 *iterable* 中所有假值" "元素會被移除。" -#: ../../library/functions.rst:723 +#: ../../library/functions.rst:724 msgid "" "Note that ``filter(function, iterable)`` is equivalent to the generator " "expression ``(item for item in iterable if function(item))`` if function is " @@ -1432,7 +1433,7 @@ msgstr "" "是 ``None`` 的時候為 ``(item for item in iterable if function(item))``;" "function 是 ``None`` 的時候為 ``(item for item in iterable if item)``。" -#: ../../library/functions.rst:728 +#: ../../library/functions.rst:729 msgid "" "See :func:`itertools.filterfalse` for the complementary function that " "returns elements of *iterable* for which *function* is false." @@ -1440,11 +1441,11 @@ msgstr "" "請參閱 :func:`itertools.filterfalse`,只有 *function* 為 false 時才選取 " "*iterable* 中元素的互補函式。" -#: ../../library/functions.rst:739 +#: ../../library/functions.rst:740 msgid "Return a floating-point number constructed from a number or a string." msgstr "回傳從數字或字串生成的浮點數。" -#: ../../library/functions.rst:743 +#: ../../library/functions.rst:744 msgid "" ">>> float('+1.23')\n" "1.23\n" @@ -1468,7 +1469,7 @@ msgstr "" ">>> float('-Infinity')\n" "-inf" -#: ../../library/functions.rst:756 +#: ../../library/functions.rst:757 msgid "" "If the argument is a string, it should contain a decimal number, optionally " "preceded by a sign, and optionally embedded in whitespace. The optional " @@ -1483,7 +1484,7 @@ msgstr "" "數也可以是 NaN(非數字)或正負無窮大的字串。確切地說,除去首尾的空格後,輸入" "必須遵循以下語法中 :token:`~float:floatvalue` 的生成規則:" -#: ../../library/functions.rst:777 +#: ../../library/functions.rst:778 msgid "" "Case is not significant, so, for example, \"inf\", \"Inf\", \"INFINITY\", " "and \"iNfINity\" are all acceptable spellings for positive infinity." @@ -1491,7 +1492,7 @@ msgstr "" "字母大小寫不影響,例如,\"inf\"、\"Inf\"、\"INFINITY\"、\"iNfINity\" 都可以表" "示正無窮大。" -#: ../../library/functions.rst:780 +#: ../../library/functions.rst:781 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 " @@ -1501,7 +1502,7 @@ msgstr "" "否則,如果引數是整數或浮點數,則回傳具有相同值(在 Python 浮點精度範圍內)的" "浮點數。如果引數在 Python 浮點精度範圍外,則會引發 :exc:`OverflowError`。" -#: ../../library/functions.rst:785 +#: ../../library/functions.rst:786 msgid "" "For a general Python object ``x``, ``float(x)`` delegates to ``x." "__float__()``. If :meth:`~object.__float__` is not defined then it falls " @@ -1510,22 +1511,22 @@ msgstr "" "對於一般的 Python 物件 ``x``,``float(x)`` 會委派給 ``x.__float__()``。如果未" "定義 :meth:`~object.__float__` 則會回退到 :meth:`~object.__index__`。" -#: ../../library/functions.rst:789 +#: ../../library/functions.rst:790 msgid "If no argument is given, ``0.0`` is returned." msgstr "如果沒有引數,則回傳 ``0.0``。" -#: ../../library/functions.rst:791 +#: ../../library/functions.rst:792 msgid "The float type is described in :ref:`typesnumeric`." msgstr ":ref:`typesnumeric` 描述了浮點數型別。" -#: ../../library/functions.rst:799 +#: ../../library/functions.rst:800 msgid "" "Falls back to :meth:`~object.__index__` if :meth:`~object.__float__` is not " "defined." msgstr "" "如果 :meth:`~object.__float__` 未定義,則會回退到 :meth:`~object.__index__`。" -#: ../../library/functions.rst:809 +#: ../../library/functions.rst:810 msgid "" "Convert a *value* to a \"formatted\" representation, as controlled by " "*format_spec*. The interpretation of *format_spec* will depend on the type " @@ -1536,7 +1537,7 @@ msgstr "" "取決於 *value* 引數的型別,但是大多數內建型別使用標準格式化語法::ref:" "`formatspec`。" -#: ../../library/functions.rst:814 +#: ../../library/functions.rst:815 msgid "" "The default *format_spec* is an empty string which usually gives the same " "effect as calling :func:`str(value) `." @@ -1544,7 +1545,7 @@ msgstr "" "預設的 *format_spec* 是一個空字串,它通常和呼叫 :func:`str(value) ` 的效" "果相同。" -#: ../../library/functions.rst:817 +#: ../../library/functions.rst:818 msgid "" "A call to ``format(value, format_spec)`` is translated to ``type(value)." "__format__(value, format_spec)`` which bypasses the instance dictionary when " @@ -1558,7 +1559,7 @@ msgstr "" "實例中的字典。如果搜尋到 :mod:`object` 這個 method 但 *format_spec* 不為空," "或是 *format_spec* 或回傳值不是字串,則會引發 :exc:`TypeError`。" -#: ../../library/functions.rst:824 +#: ../../library/functions.rst:825 msgid "" "``object().__format__(format_spec)`` raises :exc:`TypeError` if " "*format_spec* is not an empty string." @@ -1566,7 +1567,7 @@ msgstr "" "當 *format_spec* 不是空字串時,``object().__format__(format_spec)`` 會引發 :" "exc:`TypeError`。" -#: ../../library/functions.rst:833 +#: ../../library/functions.rst:834 msgid "" "Return a new :class:`frozenset` object, optionally with elements taken from " "*iterable*. ``frozenset`` is a built-in class. See :class:`frozenset` and :" @@ -1576,7 +1577,7 @@ msgstr "" "``frozenset`` 是一個內建的 class。有關此 class 的文件,請參閱 :class:" "`frozenset` 和 :ref:`types-set`。" -#: ../../library/functions.rst:837 +#: ../../library/functions.rst:838 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." @@ -1584,7 +1585,7 @@ msgstr "" "請參閱內建的 :class:`set`、:class:`list`、:class:`tuple` 和 :class:`dict` " "class,以及 :mod:`collections` module 來了解其它的容器。" -#: ../../library/functions.rst:845 +#: ../../library/functions.rst:846 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 " @@ -1599,7 +1600,7 @@ msgstr "" "`AttributeError`。*name* 不必是個 Python 識別符 (identifier)(請見 :func:" "`setattr`)。" -#: ../../library/functions.rst:854 +#: ../../library/functions.rst:855 msgid "" "Since :ref:`private name mangling ` happens at " "compilation time, one must manually mangle a private attribute's (attributes " @@ -1610,7 +1611,7 @@ msgstr "" "發生在編譯期,因此你必須手動改編私有屬性(有兩個前導底線的屬性)的名稱,才能" "使用 :func:`getattr` 來取得它。" -#: ../../library/functions.rst:862 +#: ../../library/functions.rst:863 msgid "" "Return the dictionary implementing the current module namespace. For code " "within functions, this is set when the function is defined and remains the " @@ -1619,7 +1620,7 @@ msgstr "" "回傳代表當前 module 命名空間的 dictionary。對於在函式中的程式碼來說,這在定義" "函式時設定且不論該函式是在何處呼叫都會保持相同。" -#: ../../library/functions.rst:869 +#: ../../library/functions.rst:870 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. " @@ -1630,7 +1631,7 @@ msgstr "" "則回傳 ``False``。(此功能是透過呼叫 ``getattr(object, name)`` 並檢查是否引" "發 :exc:`AttributeError` 來實作的。)" -#: ../../library/functions.rst:877 +#: ../../library/functions.rst:878 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 " @@ -1641,7 +1642,7 @@ msgstr "" "時用來快速比較 dictionary 的鍵。相同大小的數字數值有相同的雜湊值(即使它們型" "別不同,如 1 和 1.0)。" -#: ../../library/functions.rst:884 +#: ../../library/functions.rst:885 msgid "" "For objects with custom :meth:`~object.__hash__` methods, note that :func:" "`hash` truncates the return value based on the bit width of the host machine." @@ -1649,7 +1650,7 @@ msgstr "" "請注意,如果物件帶有自訂的 :meth:`~object.__hash__` 方法,:func:`hash` 將根據" "運行機器的位元長度來截斷回傳值。" -#: ../../library/functions.rst:891 +#: ../../library/functions.rst:892 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 " @@ -1663,7 +1664,7 @@ msgstr "" "關鍵字或說明文件主題中搜索該字串,並在控制台上列印幫助資訊。如果引數是其他任" "意物件,則會生成該物件的幫助頁。" -#: ../../library/functions.rst:898 +#: ../../library/functions.rst:899 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 " @@ -1674,12 +1675,12 @@ msgstr "" "前面的參數是僅限位置 (positional-only) 參數。有關更多資訊,請參閱\\ :ref:`常" "見問答集中的僅限位置參數條目 `。" -#: ../../library/functions.rst:903 +#: ../../library/functions.rst:904 msgid "" "This function is added to the built-in namespace by the :mod:`site` module." msgstr "此函式會被 :mod:`site` module 加入到內建命名空間。" -#: ../../library/functions.rst:905 +#: ../../library/functions.rst:906 msgid "" "Changes to :mod:`pydoc` and :mod:`inspect` mean that the reported signatures " "for callables are now more comprehensive and consistent." @@ -1687,7 +1688,7 @@ msgstr "" "對於 :mod:`pydoc` 和 :mod:`inspect` 的變更,使得可呼叫物件回報的的簽名 " "(signature) 更加全面和一致。" -#: ../../library/functions.rst:912 +#: ../../library/functions.rst:913 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 :" @@ -1697,7 +1698,7 @@ msgstr "" "class:`int` 物件,則必須定義一個 :meth:`~object.__index__` method 並且回傳一" "個整數。舉例來說:" -#: ../../library/functions.rst:921 +#: ../../library/functions.rst:922 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 " @@ -1706,20 +1707,20 @@ msgstr "" "如果要將整數轉換為大寫或小寫的十六進位制字串,並可選擇有無 \"0x\" 前綴,則可" "以使用如下方法:" -#: ../../library/functions.rst:933 +#: ../../library/functions.rst:934 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:938 +#: ../../library/functions.rst:939 msgid "" "To obtain a hexadecimal string representation for a float, use the :meth:" "`float.hex` method." msgstr "" "如果要獲取浮點數的十六進位制字串形式,請使用 :meth:`float.hex` method。" -#: ../../library/functions.rst:944 +#: ../../library/functions.rst:945 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. " @@ -1729,18 +1730,18 @@ msgstr "" "回傳物件的 \"識別性\" 。該值是一個整數,在此物件的生命週期中保證是唯一且恆定" "的。兩個生命期不重疊的物件可能具有相同的 :func:`id` 值。" -#: ../../library/functions.rst:949 +#: ../../library/functions.rst:950 msgid "This is the address of the object in memory." msgstr "這是該物件在記憶體中的位址。" -#: ../../library/functions.rst:951 +#: ../../library/functions.rst:952 msgid "" "Raises an :ref:`auditing event ` ``builtins.id`` with argument " "``id``." msgstr "" "引發一個附帶引數 ``id`` 的\\ :ref:`稽核事件 ` ``builtins.id``。" -#: ../../library/functions.rst:957 +#: ../../library/functions.rst:958 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, " @@ -1751,7 +1752,7 @@ msgstr "" "從輸入中讀取一行,將其轉換為字串(去除末尾的換行符)並回傳。當讀取到 EOF 時," "則引發 :exc:`EOFError`。例如: ::" -#: ../../library/functions.rst:962 +#: ../../library/functions.rst:963 msgid "" ">>> s = input('--> ') \n" "--> Monty Python's Flying Circus\n" @@ -1763,7 +1764,7 @@ msgstr "" ">>> s \n" "\"Monty Python's Flying Circus\"" -#: ../../library/functions.rst:967 +#: ../../library/functions.rst:968 msgid "" "If the :mod:`readline` module was loaded, then :func:`input` will use it to " "provide elaborate line editing and history features." @@ -1771,7 +1772,7 @@ msgstr "" "如果載入了 :mod:`readline` module,:func:`input` 將使用它來提供複雜的行編輯和" "歷史記錄功能。" -#: ../../library/functions.rst:970 ../../library/functions.rst:972 +#: ../../library/functions.rst:971 ../../library/functions.rst:973 msgid "" "Raises an :ref:`auditing event ` ``builtins.input`` with argument " "``prompt`` before reading input" @@ -1779,7 +1780,7 @@ msgstr "" "引發一個附帶讀取輸入前的引數 ``prompt`` 的\\ :ref:`稽核事件 ` " "``builtins.input``。" -#: ../../library/functions.rst:975 ../../library/functions.rst:977 +#: ../../library/functions.rst:976 ../../library/functions.rst:978 msgid "" "Raises an :ref:`auditing event ` ``builtins.input/result`` with " "the result after successfully reading input." @@ -1787,13 +1788,13 @@ msgstr "" "引發一個附帶成功讀取結果的\\ :ref:`稽核事件 ` ``builtins.input/" "result``。" -#: ../../library/functions.rst:984 +#: ../../library/functions.rst:985 msgid "" "Return an integer object constructed from a number or a string, or return " "``0`` if no arguments are given." msgstr "" -#: ../../library/functions.rst:989 +#: ../../library/functions.rst:990 msgid "" ">>> int(123.45)\n" "123\n" @@ -1821,7 +1822,7 @@ msgstr "" ">>> int('01110011', base=2)\n" "115" -#: ../../library/functions.rst:1004 +#: ../../library/functions.rst:1005 msgid "" "If the argument defines :meth:`~object.__int__`, ``int(x)`` returns ``x." "__int__()``. If the argument defines :meth:`~object.__index__`, it returns " @@ -1834,7 +1835,7 @@ msgstr "" "義了 :meth:`~object.__trunc__` 則回傳 ``x.__trunc__()``。對於浮點數,則會向零" "的方向無條件捨去。" -#: ../../library/functions.rst:1010 +#: ../../library/functions.rst:1011 msgid "" "If the argument is not a number or if *base* is given, then it must be a " "string, :class:`bytes`, or :class:`bytearray` instance representing an " @@ -1847,7 +1848,7 @@ msgstr "" "以有 ``+`` 或 ``-``\\ (中間沒有空格)、可有個前導的零、也可被空格包圍、或在" "數字間有單一底線。" -#: ../../library/functions.rst:1016 +#: ../../library/functions.rst:1017 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 " @@ -1869,11 +1870,11 @@ msgstr "" "進制中的一個,所以 ``int('010', 0)`` 是非法的,但 ``int('010')`` 和 " "``int('010', 8)`` 是有效的。" -#: ../../library/functions.rst:1027 +#: ../../library/functions.rst:1028 msgid "The integer type is described in :ref:`typesnumeric`." msgstr "整數型別定義請參閱\\ :ref:`typesnumeric`。" -#: ../../library/functions.rst:1029 +#: ../../library/functions.rst:1030 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 " @@ -1885,22 +1886,22 @@ msgstr "" "的版本使用 :meth:`base.__int__ ` 而不是 :meth:`base." "__index__ `。" -#: ../../library/functions.rst:1039 +#: ../../library/functions.rst:1040 msgid "The first parameter is now positional-only." msgstr "第一個參數為僅限位置參數。" -#: ../../library/functions.rst:1042 +#: ../../library/functions.rst:1043 msgid "" "Falls back to :meth:`~object.__index__` if :meth:`~object.__int__` is not " "defined." msgstr "" "如果未定義 :meth:`~object.__int__` 則會回退到 :meth:`~object.__index__`。" -#: ../../library/functions.rst:1045 +#: ../../library/functions.rst:1046 msgid "The delegation to :meth:`~object.__trunc__` is deprecated." msgstr "對 :meth:`~object.__trunc__` 的委派已棄用。" -#: ../../library/functions.rst:1048 +#: ../../library/functions.rst:1049 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 " @@ -1914,7 +1915,7 @@ msgstr "" "`int` 轉換為字串時將會超出限制時,會引發 :exc:`ValueError`。請參閱\\ :ref:`整" "數字串轉換的長度限制 `\\ 說明文件。" -#: ../../library/functions.rst:1058 +#: ../../library/functions.rst:1059 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 " @@ -1954,7 +1955,7 @@ msgstr "" "是 *classinfo* 中任一元素的 subclass 時則回傳 ``True``。其他情況,會引發 :" "exc:`TypeError`。" -#: ../../library/functions.rst:1090 +#: ../../library/functions.rst:1091 msgid "" "Return an :term:`iterator` object. The first argument is interpreted very " "differently depending on the presence of the second argument. Without a " @@ -1978,11 +1979,11 @@ msgstr "" "__next__` 時會不帶引數地呼叫 *object*;如果回傳的結果是 *sentinel* 則引發 :" "exc:`StopIteration`,否則回傳呼叫結果。" -#: ../../library/functions.rst:1104 +#: ../../library/functions.rst:1105 msgid "See also :ref:`typeiter`." msgstr "另請參閱 :ref:`typeiter`。" -#: ../../library/functions.rst:1106 +#: ../../library/functions.rst:1107 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 " @@ -1991,7 +1992,7 @@ msgstr "" ":func:`iter` 的第二種形式有一個好用的應用,是能夠建立一個區塊閱讀器 (block-" "reader)。例如,從二進位資料庫檔案中讀取固定寬度的區塊,直到檔案的結尾: ::" -#: ../../library/functions.rst:1110 +#: ../../library/functions.rst:1111 msgid "" "from functools import partial\n" "with open('mydata.db', 'rb') as f:\n" @@ -2003,7 +2004,7 @@ msgstr "" " for block in iter(partial(f.read, 64), b''):\n" " process_block(block)" -#: ../../library/functions.rst:1118 +#: ../../library/functions.rst:1119 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 " @@ -2012,7 +2013,7 @@ msgstr "" "回傳物件的長度(元素個數)。引數可以是序列(如 string、bytes、tuple、list 或 " "range)或集合(如 dictionary、set 或 frozen set)。" -#: ../../library/functions.rst:1124 +#: ../../library/functions.rst:1125 msgid "" "``len`` raises :exc:`OverflowError` on lengths larger than :data:`sys." "maxsize`, such as :class:`range(2 ** 100) `." @@ -2020,7 +2021,7 @@ msgstr "" "如果物件長度大於 :data:`sys.maxsize`,像是 :class:`range(2 ** 100) `," "則 ``len`` 會引發 :exc:`OverflowError`。" -#: ../../library/functions.rst:1133 +#: ../../library/functions.rst:1134 msgid "" "Rather than being a function, :class:`list` is actually a mutable sequence " "type, as documented in :ref:`typesseq-list` and :ref:`typesseq`." @@ -2028,33 +2029,33 @@ msgstr "" "除了是函式,:class:`list` 也是可變序列型別,詳情請參閱 :ref:`typesseq-list` " "和 :ref:`typesseq`。" -#: ../../library/functions.rst:1139 +#: ../../library/functions.rst:1140 msgid "" "Return a mapping object representing the current local symbol table, with " "variable names as the keys, and their currently bound references as the " "values." msgstr "" -#: ../../library/functions.rst:1143 +#: ../../library/functions.rst:1144 msgid "" "At module scope, as well as when using :func:`exec` or :func:`eval` with a " "single namespace, this function returns the same namespace as :func:" "`globals`." msgstr "" -#: ../../library/functions.rst:1147 +#: ../../library/functions.rst:1148 msgid "" "At class scope, it returns the namespace that will be passed to the " "metaclass constructor." msgstr "" -#: ../../library/functions.rst:1150 +#: ../../library/functions.rst:1151 msgid "" "When using ``exec()`` or ``eval()`` with separate local and global " "arguments, it returns the local namespace passed in to the function call." msgstr "" -#: ../../library/functions.rst:1153 +#: ../../library/functions.rst:1154 msgid "" "In all of the above cases, each call to ``locals()`` in a given frame of " "execution will return the *same* mapping object. Changes made through the " @@ -2064,7 +2065,7 @@ msgid "" "returned mapping object." msgstr "" -#: ../../library/functions.rst:1160 +#: ../../library/functions.rst:1161 msgid "" "In an :term:`optimized scope` (including functions, generators, and " "coroutines), each call to ``locals()`` instead returns a fresh dictionary " @@ -2076,7 +2077,7 @@ msgid "" "previously returned dictionaries." msgstr "" -#: ../../library/functions.rst:1169 +#: ../../library/functions.rst:1170 msgid "" "Calling ``locals()`` as part of a comprehension in a function, generator, or " "coroutine is equivalent to calling it in the containing scope, except that " @@ -2085,19 +2086,19 @@ msgid "" "function." msgstr "" -#: ../../library/functions.rst:1175 +#: ../../library/functions.rst:1176 msgid "" "Calling ``locals()`` as part of a generator expression is equivalent to " "calling it in a nested generator function." msgstr "" -#: ../../library/functions.rst:1178 +#: ../../library/functions.rst:1179 msgid "" "The behaviour of ``locals()`` in a comprehension has been updated as " "described in :pep:`709`." msgstr "" -#: ../../library/functions.rst:1182 +#: ../../library/functions.rst:1183 msgid "" "As part of :pep:`667`, the semantics of mutating the mapping objects " "returned from this function are now defined. The behavior in :term:" @@ -2106,7 +2107,7 @@ msgid "" "versions." msgstr "" -#: ../../library/functions.rst:1192 +#: ../../library/functions.rst:1193 msgid "" "Return an iterator that applies *function* to every item of *iterable*, " "yielding the results. If additional *iterables* arguments are passed, " @@ -2121,13 +2122,13 @@ msgstr "" "iteratable 耗盡時 iterator 也會結束。如果函式的輸入已經被編排為引數的 tuple," "請參閱 :func:`itertools.starmap`。" -#: ../../library/functions.rst:1204 +#: ../../library/functions.rst:1205 msgid "" "Return the largest item in an iterable or the largest of two or more " "arguments." msgstr "回傳 iterable 中最大的元素,或者回傳兩個以上的引數中最大的。" -#: ../../library/functions.rst:1207 +#: ../../library/functions.rst:1208 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 " @@ -2136,7 +2137,7 @@ msgstr "" "如果只提供了一個位置引數,它必須是個 :term:`iterable`,iterable 中最大的元素" "會被回傳。如果提供了兩個或以上的位置引數,則回傳最大的位置引數。" -#: ../../library/functions.rst:1212 ../../library/functions.rst:1250 +#: ../../library/functions.rst:1213 ../../library/functions.rst:1251 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 " @@ -2149,7 +2150,7 @@ msgstr "" "的物件。如果 iterable 為空,並且沒有提供 *default*,則會引發 :exc:" "`ValueError`。" -#: ../../library/functions.rst:1218 +#: ../../library/functions.rst:1219 msgid "" "If multiple items are maximal, the function returns the first one " "encountered. This is consistent with other sort-stability preserving tools " @@ -2160,15 +2161,15 @@ msgstr "" "``sorted(iterable, key=keyfunc, reverse=True)[0]`` 和 ``heapq.nlargest(1, " "iterable, key=keyfunc)`` 一致。" -#: ../../library/functions.rst:1223 ../../library/functions.rst:1261 +#: ../../library/functions.rst:1224 ../../library/functions.rst:1262 msgid "Added the *default* keyword-only parameter." msgstr "新增 *default* 僅限關鍵字參數。" -#: ../../library/functions.rst:1226 ../../library/functions.rst:1264 +#: ../../library/functions.rst:1227 ../../library/functions.rst:1265 msgid "The *key* can be ``None``." msgstr "*key* 可以為 ``None``。" -#: ../../library/functions.rst:1234 +#: ../../library/functions.rst:1235 msgid "" "Return a \"memory view\" object created from the given argument. See :ref:" "`typememoryview` for more information." @@ -2176,13 +2177,13 @@ msgstr "" "回傳由給定的引數所建立之「memory view(記憶體檢視)」物件。有關詳細資訊,請參" "閱\\ :ref:`typememoryview`。" -#: ../../library/functions.rst:1242 +#: ../../library/functions.rst:1243 msgid "" "Return the smallest item in an iterable or the smallest of two or more " "arguments." msgstr "回傳 iterable 中最小的元素,或者回傳兩個以上的引數中最小的。" -#: ../../library/functions.rst:1245 +#: ../../library/functions.rst:1246 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 " @@ -2191,7 +2192,7 @@ msgstr "" "如果只提供了一個位置引數,它必須是 :term:`iterable`,iterable 中最小的元素會" "被回傳。如果提供了兩個以上的位置引數,則回傳最小的位置引數。" -#: ../../library/functions.rst:1256 +#: ../../library/functions.rst:1257 msgid "" "If multiple items are minimal, the function returns the first one " "encountered. This is consistent with other sort-stability preserving tools " @@ -2202,7 +2203,7 @@ msgstr "" "``sorted(iterable, key=keyfunc)[0]`` 和 ``heapq.nsmallest(1, iterable, " "key=keyfunc)`` 一致。" -#: ../../library/functions.rst:1271 +#: ../../library/functions.rst:1272 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 " @@ -2212,7 +2213,7 @@ msgstr "" "素。如果 iterator 耗盡,則回傳給定的預設值 *default*,如果沒有預設值則引發 :" "exc:`StopIteration`。" -#: ../../library/functions.rst:1278 +#: ../../library/functions.rst:1279 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 " @@ -2221,7 +2222,7 @@ msgstr "" "回傳一個沒有特徵的新物件。:class:`object` 是所有 class 的基礎,它具有所有 " "Python class 實例的通用 method。這個函式不接受任何引數。" -#: ../../library/functions.rst:1284 +#: ../../library/functions.rst:1285 msgid "" ":class:`object` instances do *not* have :attr:`~object.__dict__` attributes, " "so you can't assign arbitrary attributes to an instance of :class:`object`." @@ -2229,7 +2230,7 @@ msgstr "" "由於 :class:`object` 實例\\ *沒有* :attr:`~object.__dict__` 屬性,因此無法將" "任意屬性賦給 :class:`object` 的實例。" -#: ../../library/functions.rst:1291 +#: ../../library/functions.rst:1292 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` " @@ -2240,7 +2241,7 @@ msgstr "" "Python 運算式。如果 *x* 不是 Python 的 :class:`int` 物件,那它需要定義 :meth:" "`~object.__index__` method 回傳一個整數。舉例來說:" -#: ../../library/functions.rst:1301 +#: ../../library/functions.rst:1302 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." @@ -2248,7 +2249,7 @@ msgstr "" "如果要將整數轉換為八進位制字串,不論是否具備 \"0o\" 前綴,都可以使用下面的方" "法。" -#: ../../library/functions.rst:1318 +#: ../../library/functions.rst:1319 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 " @@ -2258,7 +2259,7 @@ msgstr "" "啟,則引發 :exc:`OSError`。關於使用此函式的更多方法,請參閱\\ :ref:`tut-" "files`。" -#: ../../library/functions.rst:1322 +#: ../../library/functions.rst:1323 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 " @@ -2271,7 +2272,7 @@ msgstr "" "器 (file descriptor)。(如果有給定檔案描述器,它會隨著回傳的 I/O 物件關閉而關" "閉,除非 *closefd* 被設為 ``False``。)" -#: ../../library/functions.rst:1328 +#: ../../library/functions.rst:1329 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. " @@ -2292,71 +2293,71 @@ msgstr "" "getencoding` 來獲取當前的本地編碼。(要讀取和寫入原始 bytes,請使用二進位制模" "式且不要指定 *encoding*。)可用的模式有:" -#: ../../library/functions.rst:1345 +#: ../../library/functions.rst:1346 msgid "Character" msgstr "字元" -#: ../../library/functions.rst:1345 +#: ../../library/functions.rst:1346 msgid "Meaning" msgstr "意義" -#: ../../library/functions.rst:1347 +#: ../../library/functions.rst:1348 msgid "``'r'``" msgstr "``'r'``" -#: ../../library/functions.rst:1347 +#: ../../library/functions.rst:1348 msgid "open for reading (default)" msgstr "讀取(預設)" -#: ../../library/functions.rst:1348 +#: ../../library/functions.rst:1349 msgid "``'w'``" msgstr "``'w'``" -#: ../../library/functions.rst:1348 +#: ../../library/functions.rst:1349 msgid "open for writing, truncating the file first" msgstr "寫入,會先清除檔案內容" -#: ../../library/functions.rst:1349 +#: ../../library/functions.rst:1350 msgid "``'x'``" msgstr "``'x'``" -#: ../../library/functions.rst:1349 +#: ../../library/functions.rst:1350 msgid "open for exclusive creation, failing if the file already exists" msgstr "唯一性建立,如果文件已存在則會失敗" -#: ../../library/functions.rst:1350 +#: ../../library/functions.rst:1351 msgid "``'a'``" msgstr "``'a'``" -#: ../../library/functions.rst:1350 +#: ../../library/functions.rst:1351 msgid "open for writing, appending to the end of file if it exists" msgstr "寫入,如果檔案存在則在其末端附加內容" -#: ../../library/functions.rst:1351 +#: ../../library/functions.rst:1352 msgid "``'b'``" msgstr "``'b'``" -#: ../../library/functions.rst:1351 ../../library/functions.rst:1495 +#: ../../library/functions.rst:1352 ../../library/functions.rst:1496 msgid "binary mode" msgstr "二進制模式" -#: ../../library/functions.rst:1352 +#: ../../library/functions.rst:1353 msgid "``'t'``" msgstr "``'t'``" -#: ../../library/functions.rst:1352 +#: ../../library/functions.rst:1353 msgid "text mode (default)" msgstr "文字模式(預設)" -#: ../../library/functions.rst:1353 +#: ../../library/functions.rst:1354 msgid "``'+'``" msgstr "``'+'``" -#: ../../library/functions.rst:1353 +#: ../../library/functions.rst:1354 msgid "open for updating (reading and writing)" msgstr "更新(讀取並寫入)" -#: ../../library/functions.rst:1356 +#: ../../library/functions.rst:1357 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 " @@ -2366,7 +2367,7 @@ msgstr "" "``'w+b'`` 模式會開啟並清除檔案。``'r+'`` 和 ``'r+b'`` 模式會開啟且保留檔案內" "容。" -#: ../../library/functions.rst:1360 +#: ../../library/functions.rst:1361 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* " @@ -2382,7 +2383,7 @@ msgstr "" "``'t'``),檔案的內容會以 :class:`str` 回傳,其位元組已經先被解碼,使用的是取" "決於平台的編碼系統或是給定的 *encoding*。" -#: ../../library/functions.rst:1370 +#: ../../library/functions.rst:1371 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 " @@ -2391,7 +2392,7 @@ msgstr "" "Python 不會使用底層作業系統對於文字檔案的操作概念;所有的處理都是由 Python 獨" "自完成的,因此能獨立於不同平台。" -#: ../../library/functions.rst:1374 +#: ../../library/functions.rst:1375 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 " @@ -2412,7 +2413,7 @@ msgstr "" "``write_through`` 旗標。若未給定 *buffering* 引數,則預設的緩衝策略會運作如" "下:" -#: ../../library/functions.rst:1384 +#: ../../library/functions.rst:1385 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 " @@ -2424,7 +2425,7 @@ msgstr "" "DEFAULT_BUFFER_SIZE`。在許多系統上,緩衝區的長度通常為 4096 或 8192 個位元" "組。" -#: ../../library/functions.rst:1389 +#: ../../library/functions.rst:1390 msgid "" "\"Interactive\" text files (files for which :meth:`~io.IOBase.isatty` " "returns ``True``) use line buffering. Other text files use the policy " @@ -2433,7 +2434,7 @@ msgstr "" "「互動式」文字檔(:meth:`~io.IOBase.isatty` 回傳 ``True`` 的檔案)會使用列緩" "衝。其他文字檔則使用上述的二進制檔案緩衝策略。" -#: ../../library/functions.rst:1393 +#: ../../library/functions.rst:1394 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 " @@ -2446,7 +2447,7 @@ msgstr "" "Python 支援的任何 :term:`text encoding`\\ (文字編碼)都是可以使用的。關於支" "援的編碼系統清單,請參閱 :mod:`codecs` module。" -#: ../../library/functions.rst:1399 +#: ../../library/functions.rst:1400 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 " @@ -2459,7 +2460,7 @@ msgstr "" "handlers`\\ 有列出清單),不過任何已註冊到 :func:`codecs.register_error` 的錯" "誤處理程式名稱也都是有效的。標準的名稱包括:" -#: ../../library/functions.rst:1407 +#: ../../library/functions.rst:1408 msgid "" "``'strict'`` to raise a :exc:`ValueError` exception if there is an encoding " "error. The default value of ``None`` has the same effect." @@ -2467,20 +2468,20 @@ msgstr "" "``'strict'`` 如果發生編碼錯誤,則引發 :exc:`ValueError` 例外。預設值 " "``None`` 也有相同的效果。" -#: ../../library/functions.rst:1411 +#: ../../library/functions.rst:1412 msgid "" "``'ignore'`` ignores errors. Note that ignoring encoding errors can lead to " "data loss." msgstr "``'ignore'`` 忽略錯誤。請注意,忽略編碼錯誤可能導致資料遺失。" -#: ../../library/functions.rst:1414 +#: ../../library/functions.rst:1415 msgid "" "``'replace'`` causes a replacement marker (such as ``'?'``) to be inserted " "where there is malformed data." msgstr "" "``'replace'`` 會在格式不正確的資料位置插入一個替換標誌(像是 ``'?'``)。" -#: ../../library/functions.rst:1417 +#: ../../library/functions.rst:1418 msgid "" "``'surrogateescape'`` will represent any incorrect bytes as low surrogate " "code units ranging from U+DC80 to U+DCFF. These surrogate code units will " @@ -2493,7 +2494,7 @@ msgstr "" "被還原回 ``surrogateescape`` 錯誤處理程式當時所處理的那些相同位元組。這對於處" "理未知編碼方式的檔案會很好用。" -#: ../../library/functions.rst:1424 +#: ../../library/functions.rst:1425 msgid "" "``'xmlcharrefreplace'`` is only supported when writing to a file. Characters " "not supported by the encoding are replaced with the appropriate XML " @@ -2502,7 +2503,7 @@ msgstr "" "``'xmlcharrefreplace'`` 僅在寫入檔案時可支援。編碼系統不支援的字元會被替換為" "適當的 XML 字元參考 (character reference) ``&#nnn;``。" -#: ../../library/functions.rst:1428 +#: ../../library/functions.rst:1429 msgid "" "``'backslashreplace'`` replaces malformed data by Python's backslashed " "escape sequences." @@ -2510,7 +2511,7 @@ msgstr "" "``'backslashreplace'`` 會用 Python 的反斜線跳脫序列 (backslashed escape " "sequence) 替換格式不正確的資料。" -#: ../../library/functions.rst:1431 +#: ../../library/functions.rst:1432 msgid "" "``'namereplace'`` (also only supported when writing) replaces unsupported " "characters with ``\\N{...}`` escape sequences." @@ -2518,7 +2519,7 @@ msgstr "" "``'namereplace'``\\ (也僅在寫入時支援)會將不支援的字元替換為 ``\\N{...}`` " "跳脫序列。" -#: ../../library/functions.rst:1439 +#: ../../library/functions.rst:1440 msgid "" "*newline* determines how to parse newline characters from the stream. It can " "be ``None``, ``''``, ``'\\n'``, ``'\\r'``, and ``'\\r\\n'``. It works as " @@ -2527,7 +2528,7 @@ msgstr "" "*newline* 會決定如何剖析資料串流 (stream) 中的換行字元。它可以是 ``None``、" "``''``、``'\\n'``、``'\\r'`` 或 ``'\\r\\n'``。它的運作規則如下:" -#: ../../library/functions.rst:1443 +#: ../../library/functions.rst:1444 msgid "" "When reading input from the stream, if *newline* is ``None``, universal " "newlines mode is enabled. Lines in the input can end in ``'\\n'``, " @@ -2543,7 +2544,7 @@ msgstr "" "傳給呼叫方時,行尾符號不會被轉換。如果它是任何其他有效的值,則輸入資料的行只" "會由給定的字串做結尾,且在回傳給呼叫方時,行尾符號不會被轉換。" -#: ../../library/functions.rst:1451 +#: ../../library/functions.rst:1452 msgid "" "When writing output to the stream, if *newline* is ``None``, any ``'\\n'`` " "characters written are translated to the system default line separator, :" @@ -2556,7 +2557,7 @@ msgstr "" "``''`` 或 ``'\\n'``,則不做任何轉換。如果 *newline* 是任何其他有效的值,則寫" "入的任何 ``'\\n'`` 字元都將轉換為給定的字串。" -#: ../../library/functions.rst:1457 +#: ../../library/functions.rst:1458 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 " @@ -2567,7 +2568,7 @@ msgstr "" "則當檔案關閉時,底層的檔案描述器會保持開啟狀態。如果有給定一個檔名,則 " "*closefd* 必須是 ``True``\\ (預設值);否則將引發錯誤。" -#: ../../library/functions.rst:1462 +#: ../../library/functions.rst:1463 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 " @@ -2580,11 +2581,11 @@ msgstr "" "必須回傳一個開啟的檔案描述器(將 :mod:`os.open` 作為 *opener* 傳入,在功能上" "的結果會相當於傳入 ``None``)。" -#: ../../library/functions.rst:1468 +#: ../../library/functions.rst:1469 msgid "The newly created file is :ref:`non-inheritable `." msgstr "新建立的檔案是\\ :ref:`不可繼承的 `。" -#: ../../library/functions.rst:1470 +#: ../../library/functions.rst:1471 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::" @@ -2592,7 +2593,7 @@ msgstr "" "下面的範例使用 :func:`os.open` 函式回傳值當作 :ref:`dir_fd ` 的參數," "從給定的目錄中用相對路徑開啟檔案: ::" -#: ../../library/functions.rst:1473 +#: ../../library/functions.rst:1474 msgid "" ">>> import os\n" ">>> dir_fd = os.open('somedir', os.O_RDONLY)\n" @@ -2605,7 +2606,7 @@ msgid "" ">>> os.close(dir_fd) # don't leak a file descriptor" msgstr "" -#: ../../library/functions.rst:1483 +#: ../../library/functions.rst:1484 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 " @@ -2629,7 +2630,7 @@ msgstr "" "BufferedRandom`。當緩衝被停用時,會回傳原始資料串流 :class:`io.FileIO`,它" "是 :class:`io.RawIOBase` 的一個 subclass。" -#: ../../library/functions.rst:1504 +#: ../../library/functions.rst:1505 msgid "" "See also the file handling modules, such as :mod:`fileinput`, :mod:`io` " "(where :func:`open` is declared), :mod:`os`, :mod:`os.path`, :mod:" @@ -2639,7 +2640,7 @@ msgstr "" "`open` 的 module )、:mod:`os`、:mod:`os.path`、:mod:`tempfile` 以及 :mod:" "`shutil`。" -#: ../../library/functions.rst:1508 +#: ../../library/functions.rst:1509 msgid "" "Raises an :ref:`auditing event ` ``open`` with arguments ``path``, " "``mode``, ``flags``." @@ -2647,25 +2648,25 @@ msgstr "" "引發一個附帶引數 ``path``、``mode``、``flags`` 的\\ :ref:`稽核事件 " "` ``open``。" -#: ../../library/functions.rst:1510 +#: ../../library/functions.rst:1511 msgid "" "The ``mode`` and ``flags`` arguments may have been modified or inferred from " "the original call." msgstr "``mode`` 和 ``flags`` 引數可能會被原始的呼叫所修改或推論 (infer)。" -#: ../../library/functions.rst:1515 +#: ../../library/functions.rst:1516 msgid "The *opener* parameter was added." msgstr "增加了 *opener* 參數。" -#: ../../library/functions.rst:1516 +#: ../../library/functions.rst:1517 msgid "The ``'x'`` mode was added." msgstr "增加了 ``'x'`` 模式。" -#: ../../library/functions.rst:1517 +#: ../../library/functions.rst:1518 msgid ":exc:`IOError` used to be raised, it is now an alias of :exc:`OSError`." msgstr "過去引發的 :exc:`IOError`,現在是 :exc:`OSError` 的別名。" -#: ../../library/functions.rst:1518 +#: ../../library/functions.rst:1519 msgid "" ":exc:`FileExistsError` is now raised if the file opened in exclusive " "creation mode (``'x'``) already exists." @@ -2673,11 +2674,11 @@ msgstr "" "如果檔案已存在但使用了唯一性建立模式 (``'x'``),現在會引發 :exc:" "`FileExistsError`。" -#: ../../library/functions.rst:1523 +#: ../../library/functions.rst:1524 msgid "The file is now non-inheritable." msgstr "檔案在此版本開始是不可繼承的。" -#: ../../library/functions.rst:1527 +#: ../../library/functions.rst:1528 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 :" @@ -2686,15 +2687,15 @@ msgstr "" "如果系統呼叫被中斷,但訊號處理程式沒有引發例外,此函式現在會重試系統呼叫,而" "不是引發 :exc:`InterruptedError` 例外(原因詳見 :pep:`475`)。" -#: ../../library/functions.rst:1530 +#: ../../library/functions.rst:1531 msgid "The ``'namereplace'`` error handler was added." msgstr "增加了 ``'namereplace'`` 錯誤處理程式。" -#: ../../library/functions.rst:1534 +#: ../../library/functions.rst:1535 msgid "Support added to accept objects implementing :class:`os.PathLike`." msgstr "增加對於實作 :class:`os.PathLike` 物件的支援。" -#: ../../library/functions.rst:1535 +#: ../../library/functions.rst:1536 msgid "" "On Windows, opening a console buffer may return a subclass of :class:`io." "RawIOBase` other than :class:`io.FileIO`." @@ -2702,11 +2703,11 @@ msgstr "" "在 Windows 上,開啟一個控制臺緩衝區可能會回傳 :class:`io.RawIOBase` 的 " "subclass,而不是 :class:`io.FileIO`。" -#: ../../library/functions.rst:1538 +#: ../../library/functions.rst:1539 msgid "The ``'U'`` mode has been removed." msgstr "``'U'`` 模式被移除。" -#: ../../library/functions.rst:1543 +#: ../../library/functions.rst:1544 msgid "" "Given a string representing one Unicode character, return an integer " "representing the Unicode code point of that character. For example, " @@ -2717,7 +2718,7 @@ msgstr "" "``ord('a')`` 回傳整數 ``97``、``ord('€')``\\ (歐元符號)回傳 ``8364``。這" "是 :func:`chr` 的逆函式。" -#: ../../library/functions.rst:1551 +#: ../../library/functions.rst:1552 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) % " @@ -2728,7 +2729,7 @@ msgstr "" "*mod* 取餘數(比直接呼叫 ``pow(base, exp) % mod`` 計算更高效)。兩個引數形式" "的 ``pow(exp, exp)`` 等價於次方運算子:``base**exp``。" -#: ../../library/functions.rst:1556 +#: ../../library/functions.rst:1557 msgid "" "The arguments must have numeric types. With mixed operand types, the " "coercion rules for binary arithmetic operators apply. For :class:`int` " @@ -2752,7 +2753,7 @@ msgstr "" "`float` 的負數且指數為整數,則會得到一個浮點數的結果,例如 ``pow(-9, 2.0)`` " "會回傳 ``81.0``。" -#: ../../library/functions.rst:1568 +#: ../../library/functions.rst:1569 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 " @@ -2765,11 +2766,11 @@ msgstr "" "與 *mod* 互質。在這種情況下,會回傳 ``pow(inv_base, -exp, mod)``,其中 " "*inv_base* 是 *base* 對 *mod* 的模倒數 (inverse modulo)。" -#: ../../library/functions.rst:1574 +#: ../../library/functions.rst:1575 msgid "Here's an example of computing an inverse for ``38`` modulo ``97``::" msgstr "以下是一個計算 ``38`` 對 ``97`` 取模倒數的範例: ::" -#: ../../library/functions.rst:1576 +#: ../../library/functions.rst:1577 msgid "" ">>> pow(38, -1, mod=97)\n" "23\n" @@ -2781,7 +2782,7 @@ msgstr "" ">>> 23 * 38 % 97 == 1\n" "True" -#: ../../library/functions.rst:1581 +#: ../../library/functions.rst:1582 msgid "" "For :class:`int` operands, the three-argument form of ``pow`` now allows the " "second argument to be negative, permitting computation of modular inverses." @@ -2789,12 +2790,12 @@ msgstr "" "對於 :class:`int` 運算元,現在 ``pow`` 的三引數形式允許第二個引數為負數,也容" "許模倒數的計算。" -#: ../../library/functions.rst:1586 +#: ../../library/functions.rst:1587 msgid "" "Allow keyword arguments. Formerly, only positional arguments were supported." msgstr "允許關鍵字引數。在此之前只支援位置引數。" -#: ../../library/functions.rst:1593 +#: ../../library/functions.rst:1594 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 " @@ -2803,7 +2804,7 @@ msgstr "" "將 *objects* 列印到文字資料串流 *file*,用 *sep* 分隔並以 *end* 結尾。如果有" "給定 *sep*、*end*、*file* 和 *flush*,那麼它們必須是關鍵字引數的形式。" -#: ../../library/functions.rst:1597 +#: ../../library/functions.rst:1598 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* " @@ -2816,7 +2817,7 @@ msgstr "" "以是 ``None``,這表示使用預設值。如果沒有給定 *objects*,:func:`print` 就只會" "寫入 *end*。" -#: ../../library/functions.rst:1603 +#: ../../library/functions.rst:1604 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 " @@ -2828,7 +2829,7 @@ msgstr "" "串,所以 :func:`print` 不能用於二進位模式的檔案物件。對於此類物件,請改用 " "``file.write(...)``。" -#: ../../library/functions.rst:1608 +#: ../../library/functions.rst:1609 msgid "" "Output buffering is usually determined by *file*. However, if *flush* is " "true, the stream is forcibly flushed." @@ -2836,15 +2837,15 @@ msgstr "" "輸出緩衝通常會由 *file* 決定。但是如果 *flush* 為 true,則資料串流會被強制清" "除。" -#: ../../library/functions.rst:1612 +#: ../../library/functions.rst:1613 msgid "Added the *flush* keyword argument." msgstr "增加了 *flush* 關鍵字引數。" -#: ../../library/functions.rst:1618 +#: ../../library/functions.rst:1619 msgid "Return a property attribute." msgstr "回傳 property 屬性。" -#: ../../library/functions.rst:1620 +#: ../../library/functions.rst:1621 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 " @@ -2853,11 +2854,11 @@ msgstr "" "*fget* 是一個用於取得屬性值的函式,*fset* 是一個用於設定屬性值的函式,*fdel* " "是一個用於刪除屬性值的函式,而 *doc* 會為該屬性建立一個說明字串。" -#: ../../library/functions.rst:1624 +#: ../../library/functions.rst:1625 msgid "A typical use is to define a managed attribute ``x``::" msgstr "一個典型的用途是定義一個受管理的屬性 ``x``: ::" -#: ../../library/functions.rst:1626 +#: ../../library/functions.rst:1627 msgid "" "class C:\n" " def __init__(self):\n" @@ -2889,7 +2890,7 @@ msgstr "" "\n" " x = property(getx, setx, delx, \"I'm the 'x' property.\")" -#: ../../library/functions.rst:1641 +#: ../../library/functions.rst:1642 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." @@ -2897,7 +2898,7 @@ msgstr "" "如果 *c* 是 *C* 的一個實例,則 ``c.x`` 將會呼叫取得器 (getter),``c.x = " "value`` 會呼叫設定器 (setter),而 ``del c.x`` 會呼叫刪除器 (deleter)。" -#: ../../library/functions.rst:1644 +#: ../../library/functions.rst:1645 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 " @@ -2908,7 +2909,7 @@ msgstr "" "*fget* 的說明字串(如果它存在的話)。這樣一來,就能夠輕鬆地使用 :func:" "`property` 作為\\ :term:`裝飾器 `\\ 來建立唯讀屬性: ::" -#: ../../library/functions.rst:1648 +#: ../../library/functions.rst:1649 msgid "" "class Parrot:\n" " def __init__(self):\n" @@ -2920,14 +2921,14 @@ msgid "" " return self._voltage" msgstr "" -#: ../../library/functions.rst:1657 +#: ../../library/functions.rst:1658 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:1665 +#: ../../library/functions.rst:1666 msgid "" "A property object has ``getter``, ``setter``, and ``deleter`` methods usable " "as decorators that create a copy of the property with the corresponding " @@ -2935,7 +2936,7 @@ msgid "" "with an example:" msgstr "" -#: ../../library/functions.rst:1670 +#: ../../library/functions.rst:1671 msgid "" "class C:\n" " def __init__(self):\n" @@ -2971,36 +2972,36 @@ msgstr "" " def x(self):\n" " del self._x" -#: ../../library/functions.rst:1689 +#: ../../library/functions.rst:1690 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:1693 +#: ../../library/functions.rst:1694 msgid "" "The returned property object also has the attributes ``fget``, ``fset``, and " "``fdel`` corresponding to the constructor arguments." msgstr "" -#: ../../library/functions.rst:1696 +#: ../../library/functions.rst:1697 msgid "The docstrings of property objects are now writeable." msgstr "" -#: ../../library/functions.rst:1701 +#: ../../library/functions.rst:1702 msgid "" "Attribute holding the name of the property. The name of the property can be " "changed at runtime." msgstr "" -#: ../../library/functions.rst:1712 +#: ../../library/functions.rst:1713 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:1718 +#: ../../library/functions.rst:1719 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 " @@ -3013,11 +3014,11 @@ msgid "" "raise :exc:`RuntimeError`." msgstr "" -#: ../../library/functions.rst:1729 +#: ../../library/functions.rst:1730 msgid "This class has a custom representation that can be evaluated::" msgstr "" -#: ../../library/functions.rst:1731 +#: ../../library/functions.rst:1732 msgid "" "class Person:\n" " def __init__(self, name, age):\n" @@ -3035,7 +3036,7 @@ msgstr "" " def __repr__(self):\n" " return f\"Person('{self.name}', {self.age})\"" -#: ../../library/functions.rst:1742 +#: ../../library/functions.rst:1743 msgid "" "Return a reverse :term:`iterator`. *seq* must be an object which has a :" "meth:`~object.__reversed__` method or supports the sequence protocol (the :" @@ -3043,14 +3044,14 @@ msgid "" "with integer arguments starting at ``0``)." msgstr "" -#: ../../library/functions.rst:1750 +#: ../../library/functions.rst:1751 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:1754 +#: ../../library/functions.rst:1755 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 " @@ -3061,13 +3062,13 @@ msgid "" "``None``. Otherwise, the return value has the same type as *number*." msgstr "" -#: ../../library/functions.rst:1763 +#: ../../library/functions.rst:1764 msgid "" "For a general Python object ``number``, ``round`` delegates to ``number." "__round__``." msgstr "" -#: ../../library/functions.rst:1768 +#: ../../library/functions.rst:1769 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 " @@ -3076,21 +3077,21 @@ msgid "" "information." msgstr "" -#: ../../library/functions.rst:1780 +#: ../../library/functions.rst:1781 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:1784 +#: ../../library/functions.rst:1785 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:1791 +#: ../../library/functions.rst:1792 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 " @@ -3099,7 +3100,7 @@ msgid "" "is equivalent to ``x.foobar = 123``." msgstr "" -#: ../../library/functions.rst:1797 +#: ../../library/functions.rst:1798 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:" @@ -3108,21 +3109,21 @@ msgid "" "notation, but is accessible through :func:`getattr` etc.." msgstr "" -#: ../../library/functions.rst:1805 +#: ../../library/functions.rst:1806 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:1814 +#: ../../library/functions.rst:1815 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:1822 +#: ../../library/functions.rst:1823 msgid "" "Slice objects have read-only data attributes :attr:`!start`, :attr:`!stop`, " "and :attr:`!step` which merely return the argument values (or their " @@ -3130,48 +3131,48 @@ msgid "" "by NumPy and other third-party packages." msgstr "" -#: ../../library/functions.rst:1827 +#: ../../library/functions.rst:1828 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:1832 +#: ../../library/functions.rst:1833 msgid "" "Slice objects are now :term:`hashable` (provided :attr:`~slice.start`, :attr:" "`~slice.stop`, and :attr:`~slice.step` are hashable)." msgstr "" -#: ../../library/functions.rst:1838 +#: ../../library/functions.rst:1839 msgid "Return a new sorted list from the items in *iterable*." msgstr "" -#: ../../library/functions.rst:1840 +#: ../../library/functions.rst:1841 msgid "" "Has two optional arguments which must be specified as keyword arguments." msgstr "有兩個選擇性引數,只能使用關鍵字引數來指定。" -#: ../../library/functions.rst:1842 +#: ../../library/functions.rst:1843 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:1846 +#: ../../library/functions.rst:1847 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:1849 +#: ../../library/functions.rst:1850 msgid "" "Use :func:`functools.cmp_to_key` to convert an old-style *cmp* function to a " "*key* function." msgstr "" -#: ../../library/functions.rst:1852 +#: ../../library/functions.rst:1853 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 " @@ -3179,7 +3180,7 @@ msgid "" "example, sort by department, then by salary grade)." msgstr "" -#: ../../library/functions.rst:1857 +#: ../../library/functions.rst:1858 msgid "" "The sort algorithm uses only ``<`` comparisons between items. While " "defining an :meth:`~object.__lt__` method will suffice for sorting, :PEP:`8` " @@ -3191,22 +3192,22 @@ msgid "" "method." msgstr "" -#: ../../library/functions.rst:1866 +#: ../../library/functions.rst:1867 msgid "" "For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`." msgstr "" -#: ../../library/functions.rst:1870 +#: ../../library/functions.rst:1871 msgid "Transform a method into a static method." msgstr "" -#: ../../library/functions.rst:1872 +#: ../../library/functions.rst:1873 msgid "" "A static method does not receive an implicit first argument. To declare a " "static method, use this idiom::" msgstr "" -#: ../../library/functions.rst:1875 +#: ../../library/functions.rst:1876 msgid "" "class C:\n" " @staticmethod\n" @@ -3216,7 +3217,7 @@ msgstr "" " @staticmethod\n" " def f(arg1, arg2, argN): ..." -#: ../../library/functions.rst:1879 +#: ../../library/functions.rst:1880 msgid "" "The ``@staticmethod`` form is a function :term:`decorator` -- see :ref:" "`function` for details." @@ -3224,7 +3225,7 @@ msgstr "" "``@staticmethod`` 語法是一個函式 :term:`decorator` - 參見 :ref:`function` 中" "的詳細介紹。" -#: ../../library/functions.rst:1882 +#: ../../library/functions.rst:1883 msgid "" "A static method can be called either on the class (such as ``C.f()``) or on " "an instance (such as ``C().f()``). Moreover, the static method :term:" @@ -3232,14 +3233,14 @@ msgid "" "(such as ``f()``)." msgstr "" -#: ../../library/functions.rst:1887 +#: ../../library/functions.rst:1888 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:1891 +#: ../../library/functions.rst:1892 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 " @@ -3248,7 +3249,7 @@ msgid "" "cases, use this idiom::" msgstr "" -#: ../../library/functions.rst:1897 +#: ../../library/functions.rst:1898 msgid "" "def regular_function():\n" " ...\n" @@ -3262,11 +3263,11 @@ msgstr "" "class C:\n" " method = staticmethod(regular_function)" -#: ../../library/functions.rst:1903 +#: ../../library/functions.rst:1904 msgid "For more information on static methods, see :ref:`types`." msgstr "關於 static method 的更多資訊,請參考 :ref:`types`。" -#: ../../library/functions.rst:1905 +#: ../../library/functions.rst:1906 msgid "" "Static methods now inherit the method attributes (:attr:`~function." "__module__`, :attr:`~function.__name__`, :attr:`~function.__qualname__`, :" @@ -3278,25 +3279,25 @@ msgstr "" "__doc__` 和 :attr:`~function.__annotations__`),並擁有一個新的 " "``__wrapped__`` 屬性,且為如一般函式的可呼叫物件。" -#: ../../library/functions.rst:1921 +#: ../../library/functions.rst:1922 msgid "" "Return a :class:`str` version of *object*. See :func:`str` for details." msgstr "" -#: ../../library/functions.rst:1923 +#: ../../library/functions.rst:1924 msgid "" "``str`` is the built-in string :term:`class`. For general information about " "strings, see :ref:`textseq`." msgstr "" -#: ../../library/functions.rst:1929 +#: ../../library/functions.rst:1930 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:1933 +#: ../../library/functions.rst:1934 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 ``''." @@ -3305,37 +3306,37 @@ msgid "" "using :func:`itertools.chain`." msgstr "" -#: ../../library/functions.rst:1939 +#: ../../library/functions.rst:1940 msgid "The *start* parameter can be specified as a keyword argument." msgstr "*start* 參數可被指定為關鍵字引數。" -#: ../../library/functions.rst:1942 +#: ../../library/functions.rst:1943 msgid "" "Summation of floats switched to an algorithm that gives higher accuracy and " "better commutativity on most builds." msgstr "" -#: ../../library/functions.rst:1949 +#: ../../library/functions.rst:1950 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:1953 +#: ../../library/functions.rst:1954 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:1957 +#: ../../library/functions.rst:1958 msgid "" "For example, if :attr:`~type.__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:1961 +#: ../../library/functions.rst:1962 msgid "" "The :attr:`~type.__mro__` attribute of the class corresponding to " "*object_or_type* lists the method resolution search order used by both :func:" @@ -3343,7 +3344,7 @@ msgid "" "whenever the inheritance hierarchy is updated." msgstr "" -#: ../../library/functions.rst:1966 +#: ../../library/functions.rst:1967 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. " @@ -3351,7 +3352,7 @@ msgid "" "(this is useful for classmethods)." msgstr "" -#: ../../library/functions.rst:1971 +#: ../../library/functions.rst:1972 msgid "" "When called directly within an ordinary method of a class, both arguments " "may be omitted (\"zero-argument :func:`!super`\"). In this case, *type* will " @@ -3361,7 +3362,7 @@ msgid "" "including generator expressions, which implicitly create nested functions.)" msgstr "" -#: ../../library/functions.rst:1978 +#: ../../library/functions.rst:1979 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 " @@ -3369,7 +3370,7 @@ msgid "" "closely parallels the use of *super* in other programming languages." msgstr "" -#: ../../library/functions.rst:1983 +#: ../../library/functions.rst:1984 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 " @@ -3382,11 +3383,11 @@ msgid "" "classes that are unknown prior to runtime)." msgstr "" -#: ../../library/functions.rst:1993 +#: ../../library/functions.rst:1994 msgid "For both use cases, a typical superclass call looks like this::" msgstr "" -#: ../../library/functions.rst:1995 +#: ../../library/functions.rst:1996 msgid "" "class C(B):\n" " def method(self, arg):\n" @@ -3394,14 +3395,14 @@ msgid "" " # super(C, self).method(arg)" msgstr "" -#: ../../library/functions.rst:2000 +#: ../../library/functions.rst:2001 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:2004 +#: ../../library/functions.rst:2005 msgid "" "Note that :func:`super` is implemented as part of the binding process for " "explicit dotted attribute lookups such as ``super().__getitem__(name)``. It " @@ -3411,7 +3412,7 @@ msgid "" "using statements or operators such as ``super()[name]``." msgstr "" -#: ../../library/functions.rst:2012 +#: ../../library/functions.rst:2013 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 " @@ -3421,33 +3422,33 @@ msgid "" "accessing the current instance for ordinary methods." msgstr "" -#: ../../library/functions.rst:2019 +#: ../../library/functions.rst:2020 msgid "" "For practical suggestions on how to design cooperative classes using :func:" "`super`, see `guide to using super() `_." msgstr "" -#: ../../library/functions.rst:2029 +#: ../../library/functions.rst:2030 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:2038 +#: ../../library/functions.rst:2039 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:2042 +#: ../../library/functions.rst:2043 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:2045 +#: ../../library/functions.rst:2046 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 " @@ -3460,21 +3461,21 @@ msgid "" "type` objects:" msgstr "" -#: ../../library/functions.rst:2060 +#: ../../library/functions.rst:2061 msgid "See also:" msgstr "" -#: ../../library/functions.rst:2062 +#: ../../library/functions.rst:2063 msgid "" ":ref:`Documentation on attributes and methods on classes `." msgstr "" -#: ../../library/functions.rst:2063 +#: ../../library/functions.rst:2064 msgid ":ref:`bltin-type-objects`" msgstr ":ref:`bltin-type-objects`" -#: ../../library/functions.rst:2065 +#: ../../library/functions.rst:2066 msgid "" "Keyword arguments provided to the three argument form are passed to the " "appropriate metaclass machinery (usually :meth:`~object.__init_subclass__`) " @@ -3482,23 +3483,23 @@ msgid "" "would." msgstr "" -#: ../../library/functions.rst:2070 +#: ../../library/functions.rst:2071 msgid "See also :ref:`class-customization`." msgstr "另請參閱 :ref:`class-customization`。" -#: ../../library/functions.rst:2072 +#: ../../library/functions.rst:2073 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:2079 +#: ../../library/functions.rst:2080 msgid "" "Return the :attr:`~object.__dict__` attribute for a module, class, instance, " "or any other object with a :attr:`!__dict__` attribute." msgstr "" -#: ../../library/functions.rst:2082 +#: ../../library/functions.rst:2083 msgid "" "Objects such as modules and instances have an updateable :attr:`~object." "__dict__` attribute; however, other objects may have write restrictions on " @@ -3506,34 +3507,34 @@ msgid "" "MappingProxyType` to prevent direct dictionary updates)." msgstr "" -#: ../../library/functions.rst:2087 +#: ../../library/functions.rst:2088 msgid "Without an argument, :func:`vars` acts like :func:`locals`." msgstr "" -#: ../../library/functions.rst:2089 +#: ../../library/functions.rst:2090 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:2095 +#: ../../library/functions.rst:2096 msgid "" "The result of calling this function without an argument has been updated as " "described for the :func:`locals` builtin." msgstr "" -#: ../../library/functions.rst:2101 +#: ../../library/functions.rst:2102 msgid "" "Iterate over several iterables in parallel, producing tuples with an item " "from each one." msgstr "" -#: ../../library/functions.rst:2104 +#: ../../library/functions.rst:2105 msgid "Example::" msgstr "例如: ::" -#: ../../library/functions.rst:2106 +#: ../../library/functions.rst:2107 msgid "" ">>> for item in zip([1, 2, 3], ['sugar', 'spice', 'everything nice']):\n" "... print(item)\n" @@ -3549,27 +3550,27 @@ msgstr "" "(2, 'spice')\n" "(3, 'everything nice')" -#: ../../library/functions.rst:2113 +#: ../../library/functions.rst:2114 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:2116 +#: ../../library/functions.rst:2117 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:2120 +#: ../../library/functions.rst:2121 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:2124 +#: ../../library/functions.rst:2125 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 " @@ -3577,14 +3578,14 @@ msgid "" "approaches to dealing with this issue:" msgstr "" -#: ../../library/functions.rst:2129 +#: ../../library/functions.rst:2130 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:2133 +#: ../../library/functions.rst:2134 msgid "" ">>> list(zip(range(3), ['fee', 'fi', 'fo', 'fum']))\n" "[(0, 'fee'), (1, 'fi'), (2, 'fo')]" @@ -3592,14 +3593,14 @@ msgstr "" ">>> list(zip(range(3), ['fee', 'fi', 'fo', 'fum']))\n" "[(0, 'fee'), (1, 'fi'), (2, 'fo')]" -#: ../../library/functions.rst:2136 +#: ../../library/functions.rst:2137 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:2140 +#: ../../library/functions.rst:2141 msgid "" ">>> list(zip(('a', 'b', 'c'), (1, 2, 3), strict=True))\n" "[('a', 1), ('b', 2), ('c', 3)]" @@ -3607,37 +3608,37 @@ msgstr "" ">>> list(zip(('a', 'b', 'c'), (1, 2, 3), strict=True))\n" "[('a', 1), ('b', 2), ('c', 3)]" -#: ../../library/functions.rst:2143 +#: ../../library/functions.rst:2144 msgid "" "Unlike the default behavior, it raises a :exc:`ValueError` if one iterable " "is exhausted before the others:" msgstr "" -#: ../../library/functions.rst:2161 +#: ../../library/functions.rst:2162 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:2165 +#: ../../library/functions.rst:2166 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:2169 +#: ../../library/functions.rst:2170 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:2172 +#: ../../library/functions.rst:2173 msgid "Tips and tricks:" msgstr "" -#: ../../library/functions.rst:2174 +#: ../../library/functions.rst:2175 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 " @@ -3646,13 +3647,13 @@ msgid "" "iterator. This has the effect of dividing the input into n-length chunks." msgstr "" -#: ../../library/functions.rst:2180 +#: ../../library/functions.rst:2181 msgid "" ":func:`zip` in conjunction with the ``*`` operator can be used to unzip a " "list::" msgstr "" -#: ../../library/functions.rst:2183 +#: ../../library/functions.rst:2184 msgid "" ">>> x = [1, 2, 3]\n" ">>> y = [4, 5, 6]\n" @@ -3670,17 +3671,17 @@ msgstr "" ">>> x == list(x2) and y == list(y2)\n" "True" -#: ../../library/functions.rst:2191 +#: ../../library/functions.rst:2192 msgid "Added the ``strict`` argument." msgstr "增加了 ``strict`` 引數。" -#: ../../library/functions.rst:2203 +#: ../../library/functions.rst:2204 msgid "" "This is an advanced function that is not needed in everyday Python " "programming, unlike :func:`importlib.import_module`." msgstr "" -#: ../../library/functions.rst:2206 +#: ../../library/functions.rst:2207 msgid "" "This function is invoked by the :keyword:`import` statement. It can be " "replaced (by importing the :mod:`builtins` module and assigning to " @@ -3692,7 +3693,7 @@ msgid "" "discouraged in favor of :func:`importlib.import_module`." msgstr "" -#: ../../library/functions.rst:2215 +#: ../../library/functions.rst:2216 msgid "" "The function imports the module *name*, potentially using the given " "*globals* and *locals* to determine how to interpret the name in a package " @@ -3702,7 +3703,7 @@ msgid "" "determine the package context of the :keyword:`import` statement." msgstr "" -#: ../../library/functions.rst:2222 +#: ../../library/functions.rst:2223 msgid "" "*level* specifies whether to use absolute or relative imports. ``0`` (the " "default) means only perform absolute imports. Positive values for *level* " @@ -3711,7 +3712,7 @@ msgid "" "details)." msgstr "" -#: ../../library/functions.rst:2228 +#: ../../library/functions.rst:2229 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 " @@ -3719,37 +3720,37 @@ msgid "" "given, the module named by *name* is returned." msgstr "" -#: ../../library/functions.rst:2233 +#: ../../library/functions.rst:2234 msgid "" "For example, the statement ``import spam`` results in bytecode resembling " "the following code::" msgstr "" -#: ../../library/functions.rst:2236 +#: ../../library/functions.rst:2237 msgid "spam = __import__('spam', globals(), locals(), [], 0)" msgstr "spam = __import__('spam', globals(), locals(), [], 0)" -#: ../../library/functions.rst:2238 +#: ../../library/functions.rst:2239 msgid "The statement ``import spam.ham`` results in this call::" msgstr "" -#: ../../library/functions.rst:2240 +#: ../../library/functions.rst:2241 msgid "spam = __import__('spam.ham', globals(), locals(), [], 0)" msgstr "spam = __import__('spam.ham', globals(), locals(), [], 0)" -#: ../../library/functions.rst:2242 +#: ../../library/functions.rst:2243 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:2245 +#: ../../library/functions.rst:2246 msgid "" "On the other hand, the statement ``from spam.ham import eggs, sausage as " "saus`` results in ::" msgstr "" -#: ../../library/functions.rst:2248 +#: ../../library/functions.rst:2249 msgid "" "_temp = __import__('spam.ham', globals(), locals(), ['eggs', 'sausage'], 0)\n" "eggs = _temp.eggs\n" @@ -3759,36 +3760,36 @@ msgstr "" "eggs = _temp.eggs\n" "saus = _temp.sausage" -#: ../../library/functions.rst:2252 +#: ../../library/functions.rst:2253 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:2256 +#: ../../library/functions.rst:2257 msgid "" "If you simply want to import a module (potentially within a package) by " "name, use :func:`importlib.import_module`." msgstr "" -#: ../../library/functions.rst:2259 +#: ../../library/functions.rst:2260 msgid "" "Negative values for *level* are no longer supported (which also changes the " "default value to 0)." msgstr "" -#: ../../library/functions.rst:2263 +#: ../../library/functions.rst:2264 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:2268 +#: ../../library/functions.rst:2269 msgid "Footnotes" msgstr "註解" -#: ../../library/functions.rst:2269 +#: ../../library/functions.rst:2270 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 " @@ -3801,7 +3802,7 @@ msgstr "" msgid "Boolean" msgstr "Boolean(布林值)" -#: ../../library/functions.rst:154 ../../library/functions.rst:2036 +#: ../../library/functions.rst:154 ../../library/functions.rst:2037 msgid "type" msgstr "type(型別)" @@ -3813,95 +3814,95 @@ msgstr "built-in function(內建函式)" msgid "exec" msgstr "exec" -#: ../../library/functions.rst:735 +#: ../../library/functions.rst:736 msgid "NaN" msgstr "NaN" -#: ../../library/functions.rst:735 +#: ../../library/functions.rst:736 msgid "Infinity" msgstr "Infinity(無窮)" -#: ../../library/functions.rst:803 +#: ../../library/functions.rst:804 msgid "__format__" msgstr "__format__" -#: ../../library/functions.rst:803 ../../library/functions.rst:1913 +#: ../../library/functions.rst:804 ../../library/functions.rst:1914 msgid "string" msgstr "string(字串)" -#: ../../library/functions.rst:803 +#: ../../library/functions.rst:804 msgid "format() (built-in function)" msgstr "format()(內建函式)" -#: ../../library/functions.rst:1313 +#: ../../library/functions.rst:1314 msgid "file object" msgstr "file object(檔案物件)" -#: ../../library/functions.rst:1313 ../../library/functions.rst:1434 +#: ../../library/functions.rst:1314 ../../library/functions.rst:1435 msgid "open() built-in function" msgstr "open() 內建函式" -#: ../../library/functions.rst:1341 +#: ../../library/functions.rst:1342 msgid "file" msgstr "file(檔案)" -#: ../../library/functions.rst:1341 +#: ../../library/functions.rst:1342 msgid "modes" msgstr "modes(模式)" -#: ../../library/functions.rst:1434 +#: ../../library/functions.rst:1435 msgid "universal newlines" msgstr "universal newlines" -#: ../../library/functions.rst:1495 +#: ../../library/functions.rst:1496 msgid "line-buffered I/O" msgstr "line-buffered I/O(行緩衝 I/O)" -#: ../../library/functions.rst:1495 +#: ../../library/functions.rst:1496 msgid "unbuffered I/O" msgstr "unbuffered I/O(非緩衝 I/O)" -#: ../../library/functions.rst:1495 +#: ../../library/functions.rst:1496 msgid "buffer size, I/O" msgstr "buffer size, I/O(緩衝區大小、I/O)" -#: ../../library/functions.rst:1495 +#: ../../library/functions.rst:1496 msgid "I/O control" msgstr "I/O control(I/O 控制)" -#: ../../library/functions.rst:1495 +#: ../../library/functions.rst:1496 msgid "buffering" msgstr "buffering(緩衝)" -#: ../../library/functions.rst:1495 +#: ../../library/functions.rst:1496 msgid "text mode" msgstr "text mode(文字模式)" -#: ../../library/functions.rst:1495 ../../library/functions.rst:2197 +#: ../../library/functions.rst:1496 ../../library/functions.rst:2198 msgid "module" msgstr "module(模組)" -#: ../../library/functions.rst:1495 +#: ../../library/functions.rst:1496 msgid "sys" msgstr "sys" -#: ../../library/functions.rst:1913 +#: ../../library/functions.rst:1914 msgid "str() (built-in function)" msgstr "str() (內建函式)" -#: ../../library/functions.rst:2036 +#: ../../library/functions.rst:2037 msgid "object" msgstr "object(物件)" -#: ../../library/functions.rst:2197 +#: ../../library/functions.rst:2198 msgid "statement" msgstr "statement(陳述式)" -#: ../../library/functions.rst:2197 +#: ../../library/functions.rst:2198 msgid "import" msgstr "import(引入)" -#: ../../library/functions.rst:2197 +#: ../../library/functions.rst:2198 msgid "builtins" msgstr "builtins(內建)" diff --git a/library/getpass.po b/library/getpass.po index c1301e9377..afd4253883 100644 --- a/library/getpass.po +++ b/library/getpass.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-11 00:13+0000\n" "PO-Revision-Date: 2022-02-11 12:04+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -28,8 +28,8 @@ msgid "**Source code:** :source:`Lib/getpass.py`" msgstr "**原始碼:**\\ :source:`Lib/getpass.py`" #: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not WASI." -msgstr ":ref:`Availability `:非 WASI。" +msgid "Availability" +msgstr "" #: ../../includes/wasm-notavail.rst:5 msgid "" diff --git a/library/grp.po b/library/grp.po index 15b9d95405..77bef2e980 100644 --- a/library/grp.po +++ b/library/grp.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-11 00:13+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-" @@ -29,9 +29,8 @@ msgid "" msgstr "" #: ../../library/grp.rst:13 -msgid "" -":ref:`Availability `: Unix, not WASI, not Android, not iOS." -msgstr ":ref:`適用 `:Unix、非 WASI、非 Android、非 iOS。" +msgid "Availability" +msgstr "" #: ../../library/grp.rst:15 msgid "" @@ -143,14 +142,3 @@ msgstr ":mod:`pwd` 模組" #: ../../library/grp.rst:65 msgid "An interface to the user database, similar to this." msgstr "" - -#~ msgid "Module :mod:`spwd`" -#~ msgstr ":mod:`spwd` 模組" - -#~ msgid "" -#~ "This module does not work or is not available on WebAssembly platforms " -#~ "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` " -#~ "for more information." -#~ msgstr "" -#~ "此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法" -#~ "作用或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" diff --git a/library/http.client.po b/library/http.client.po index e9a367037e..e8becdcaee 100644 --- a/library/http.client.po +++ b/library/http.client.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-11 00:13+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-" @@ -45,8 +45,8 @@ msgid "" msgstr "" #: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not WASI." -msgstr ":ref:`Availability `:非 WASI。" +msgid "Availability" +msgstr "" #: ../../includes/wasm-notavail.rst:5 msgid "" diff --git a/library/http.server.po b/library/http.server.po index 16bc06d5f9..e9346abbd1 100644 --- a/library/http.server.po +++ b/library/http.server.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-11 00:13+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-" @@ -36,8 +36,8 @@ msgid "" msgstr "" #: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not WASI." -msgstr ":ref:`適用 `:非 WASI。" +msgid "Availability" +msgstr "" #: ../../includes/wasm-notavail.rst:5 msgid "" diff --git a/library/imaplib.po b/library/imaplib.po index e78b7739b0..353026d0e6 100644 --- a/library/imaplib.po +++ b/library/imaplib.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-11 00:13+0000\n" "PO-Revision-Date: 2018-05-23 16:04+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -35,8 +35,8 @@ msgid "" msgstr "" #: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not WASI." -msgstr ":ref:`適用 `:非 WASI。" +msgid "Availability" +msgstr "" #: ../../includes/wasm-notavail.rst:5 msgid "" diff --git a/library/importlib.metadata.po b/library/importlib.metadata.po index 02d7d7e1c8..c84bdc92dd 100644 --- a/library/importlib.metadata.po +++ b/library/importlib.metadata.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-08 03:35+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-" @@ -161,43 +161,81 @@ msgid "" "`requirements`." msgstr "" -#: ../../library/importlib.metadata.rst:104 +#: ../../library/importlib.metadata.rst:105 +msgid "" +"Subclass of :class:`ModuleNotFoundError` raised by several functions in this " +"module when queried for a distribution package which is not installed in the " +"current Python environment." +msgstr "" + +#: ../../library/importlib.metadata.rst:111 msgid "Functional API" msgstr "" -#: ../../library/importlib.metadata.rst:106 +#: ../../library/importlib.metadata.rst:113 msgid "This package provides the following functionality via its public API." msgstr "" -#: ../../library/importlib.metadata.rst:112 +#: ../../library/importlib.metadata.rst:119 msgid "Entry points" msgstr "" -#: ../../library/importlib.metadata.rst:114 +#: ../../library/importlib.metadata.rst:123 +msgid "" +"Returns a :class:`EntryPoints` instance describing entry points for the " +"current environment. Any given keyword parameters are passed to the :meth:`!" +"select` method for comparison to the attributes of the individual entry " +"point definitions." +msgstr "" + +#: ../../library/importlib.metadata.rst:128 +msgid "" +"Note: it is not currently possible to query for entry points based on their :" +"attr:`!EntryPoint.dist` attribute (as different :class:`!Distribution` " +"instances do not currently compare equal, even if they have the same " +"attributes)" +msgstr "" + +#: ../../library/importlib.metadata.rst:134 +msgid "Details of a collection of installed entry points." +msgstr "" + +#: ../../library/importlib.metadata.rst:136 +msgid "" +"Also provides a ``.groups`` attribute that reports all identifed entry point " +"groups, and a ``.names`` attribute that reports all identified entry point " +"names." +msgstr "" + +#: ../../library/importlib.metadata.rst:142 +msgid "Details of an installed entry point." +msgstr "" + +#: ../../library/importlib.metadata.rst:144 msgid "" -"The ``entry_points()`` function returns a collection of entry points. Entry " -"points are represented by ``EntryPoint`` instances; each ``EntryPoint`` has " -"a ``.name``, ``.group``, and ``.value`` attributes and a ``.load()`` method " -"to resolve the value. There are also ``.module``, ``.attr``, and ``." -"extras`` attributes for getting the components of the ``.value`` attribute." +"Each :class:`!EntryPoint` instance has ``.name``, ``.group``, and ``.value`` " +"attributes and a ``.load()`` method to resolve the value. There are also ``." +"module``, ``.attr``, and ``.extras`` attributes for getting the components " +"of the ``.value`` attribute, and ``.dist`` for obtaining information " +"regarding the distribution package that provides the entry point." msgstr "" -#: ../../library/importlib.metadata.rst:121 +#: ../../library/importlib.metadata.rst:150 msgid "Query all entry points::" msgstr "" -#: ../../library/importlib.metadata.rst:123 +#: ../../library/importlib.metadata.rst:152 msgid ">>> eps = entry_points() " msgstr ">>> eps = entry_points() " -#: ../../library/importlib.metadata.rst:125 +#: ../../library/importlib.metadata.rst:154 msgid "" -"The ``entry_points()`` function returns an ``EntryPoints`` object, a " -"collection of all ``EntryPoint`` objects with ``names`` and ``groups`` " +"The :func:`!entry_points` function returns a :class:`!EntryPoints` object, a " +"collection of all :class:`!EntryPoint` objects with ``names`` and ``groups`` " "attributes for convenience::" msgstr "" -#: ../../library/importlib.metadata.rst:129 +#: ../../library/importlib.metadata.rst:158 msgid "" ">>> sorted(eps.groups) \n" "['console_scripts', 'distutils.commands', 'distutils.setup_keywords', " @@ -207,32 +245,33 @@ msgstr "" "['console_scripts', 'distutils.commands', 'distutils.setup_keywords', " "'egg_info.writers', 'setuptools.installation']" -#: ../../library/importlib.metadata.rst:132 +#: ../../library/importlib.metadata.rst:161 msgid "" -"``EntryPoints`` has a ``select`` method to select entry points matching " -"specific properties. Select entry points in the ``console_scripts`` group::" +":class:`!EntryPoints` has a :meth:`!select` method to select entry points " +"matching specific properties. Select entry points in the ``console_scripts`` " +"group::" msgstr "" -#: ../../library/importlib.metadata.rst:136 +#: ../../library/importlib.metadata.rst:165 msgid ">>> scripts = eps.select(group='console_scripts') " msgstr ">>> scripts = eps.select(group='console_scripts') " -#: ../../library/importlib.metadata.rst:138 +#: ../../library/importlib.metadata.rst:167 msgid "" -"Equivalently, since ``entry_points`` passes keyword arguments through to " -"select::" +"Equivalently, since :func:`!entry_points` passes keyword arguments through " +"to select::" msgstr "" -#: ../../library/importlib.metadata.rst:141 +#: ../../library/importlib.metadata.rst:170 msgid ">>> scripts = entry_points(group='console_scripts') " msgstr ">>> scripts = entry_points(group='console_scripts') " -#: ../../library/importlib.metadata.rst:143 +#: ../../library/importlib.metadata.rst:172 msgid "" "Pick out a specific script named \"wheel\" (found in the wheel project)::" msgstr "" -#: ../../library/importlib.metadata.rst:145 +#: ../../library/importlib.metadata.rst:174 msgid "" ">>> 'wheel' in scripts.names \n" "True\n" @@ -242,11 +281,11 @@ msgstr "" "True\n" ">>> wheel = scripts['wheel'] " -#: ../../library/importlib.metadata.rst:149 +#: ../../library/importlib.metadata.rst:178 msgid "Equivalently, query for that entry point during selection::" msgstr "" -#: ../../library/importlib.metadata.rst:151 +#: ../../library/importlib.metadata.rst:180 msgid "" ">>> (wheel,) = entry_points(group='console_scripts', name='wheel') \n" ">>> (wheel,) = entry_points().select(group='console_scripts', name='wheel') " @@ -254,11 +293,11 @@ msgstr "" ">>> (wheel,) = entry_points(group='console_scripts', name='wheel') \n" ">>> (wheel,) = entry_points().select(group='console_scripts', name='wheel') " -#: ../../library/importlib.metadata.rst:154 +#: ../../library/importlib.metadata.rst:183 msgid "Inspect the resolved entry point::" msgstr "" -#: ../../library/importlib.metadata.rst:156 +#: ../../library/importlib.metadata.rst:185 msgid "" ">>> wheel \n" "EntryPoint(name='wheel', value='wheel.cli:main', group='console_scripts')\n" @@ -284,7 +323,7 @@ msgstr "" ">>> main \n" "" -#: ../../library/importlib.metadata.rst:168 +#: ../../library/importlib.metadata.rst:197 msgid "" "The ``group`` and ``name`` are arbitrary values defined by the package " "author and usually a client will wish to resolve all entry points for a " @@ -293,7 +332,7 @@ msgid "" "their definition, and usage." msgstr "" -#: ../../library/importlib.metadata.rst:174 +#: ../../library/importlib.metadata.rst:203 msgid "" "The \"selectable\" entry points were introduced in ``importlib_metadata`` " "3.6 and Python 3.10. Prior to those changes, ``entry_points`` accepted no " @@ -303,35 +342,66 @@ msgid "" "entry_points_selectable` for compatibility options." msgstr "" -#: ../../library/importlib.metadata.rst:183 +#: ../../library/importlib.metadata.rst:212 msgid "" "``EntryPoint`` objects no longer present a tuple-like interface (:meth:" "`~object.__getitem__`)." msgstr "" -#: ../../library/importlib.metadata.rst:190 +#: ../../library/importlib.metadata.rst:219 msgid "Distribution metadata" msgstr "" -#: ../../library/importlib.metadata.rst:192 +#: ../../library/importlib.metadata.rst:223 +msgid "" +"Return the distribution metadata corresponding to the named distribution " +"package as a :class:`PackageMetadata` instance." +msgstr "" + +#: ../../library/importlib.metadata.rst:226 +#: ../../library/importlib.metadata.rst:274 +#: ../../library/importlib.metadata.rst:295 +#: ../../library/importlib.metadata.rst:358 +#: ../../library/importlib.metadata.rst:409 +msgid "" +"Raises :exc:`PackageNotFoundError` if the named distribution package is not " +"installed in the current Python environment." +msgstr "" + +#: ../../library/importlib.metadata.rst:231 +msgid "A concrete implementation of the" +msgstr "" + +#: ../../library/importlib.metadata.rst:232 +msgid "" +"`PackageMetadata protocol `_." +msgstr "" + +#: ../../library/importlib.metadata.rst:234 +msgid "" +"In addition to providing the defined protocol methods and attributes, " +"subscripting the instance is equivalent to calling the :meth:`!get` method." +msgstr "" + +#: ../../library/importlib.metadata.rst:237 msgid "" "Every `Distribution Package `_ includes some metadata, which you can extract " -"using the ``metadata()`` function::" +"using the :func:`!metadata` function::" msgstr "" -#: ../../library/importlib.metadata.rst:196 +#: ../../library/importlib.metadata.rst:240 msgid ">>> wheel_metadata = metadata('wheel') " msgstr ">>> wheel_metadata = metadata('wheel') " -#: ../../library/importlib.metadata.rst:198 +#: ../../library/importlib.metadata.rst:242 msgid "" -"The keys of the returned data structure, a ``PackageMetadata``, name the " -"metadata keywords, and the values are returned unparsed from the " -"distribution metadata::" +"The keys of the returned data structure name the metadata keywords, and the " +"values are returned unparsed from the distribution metadata::" msgstr "" -#: ../../library/importlib.metadata.rst:202 +#: ../../library/importlib.metadata.rst:245 msgid "" ">>> wheel_metadata['Requires-Python'] \n" "'>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*'" @@ -339,13 +409,13 @@ msgstr "" ">>> wheel_metadata['Requires-Python'] \n" "'>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*'" -#: ../../library/importlib.metadata.rst:205 +#: ../../library/importlib.metadata.rst:248 msgid "" -"``PackageMetadata`` also presents a ``json`` attribute that returns all the " -"metadata in a JSON-compatible form per :PEP:`566`::" +":class:`PackageMetadata` also presents a :attr:`!json` attribute that " +"returns all the metadata in a JSON-compatible form per :PEP:`566`::" msgstr "" -#: ../../library/importlib.metadata.rst:208 +#: ../../library/importlib.metadata.rst:251 msgid "" ">>> wheel_metadata.json['requires_python']\n" "'>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*'" @@ -353,36 +423,42 @@ msgstr "" ">>> wheel_metadata.json['requires_python']\n" "'>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*'" -#: ../../library/importlib.metadata.rst:213 +#: ../../library/importlib.metadata.rst:254 +#: ../../library/importlib.metadata.rst:452 msgid "" -"The actual type of the object returned by ``metadata()`` is an " -"implementation detail and should be accessed only through the interface " -"described by the `PackageMetadata protocol `_." +"The full set of available metadata is not described here. See the PyPA `Core " +"metadata specification `_ for additional details." msgstr "" -#: ../../library/importlib.metadata.rst:218 +#: ../../library/importlib.metadata.rst:257 msgid "" "The ``Description`` is now included in the metadata when presented through " "the payload. Line continuation characters have been removed." msgstr "" -#: ../../library/importlib.metadata.rst:222 +#: ../../library/importlib.metadata.rst:261 msgid "The ``json`` attribute was added." msgstr "新增 ``json`` 屬性。" -#: ../../library/importlib.metadata.rst:228 +#: ../../library/importlib.metadata.rst:267 msgid "Distribution versions" msgstr "" -#: ../../library/importlib.metadata.rst:230 +#: ../../library/importlib.metadata.rst:271 msgid "" -"The ``version()`` function is the quickest way to get a `Distribution " +"Return the installed distribution package version for the named distribution " +"package." +msgstr "" + +#: ../../library/importlib.metadata.rst:277 +msgid "" +"The :func:`!version` function is the quickest way to get a `Distribution " "Package `_'s version number, as a string::" msgstr "" -#: ../../library/importlib.metadata.rst:234 +#: ../../library/importlib.metadata.rst:281 msgid "" ">>> version('wheel') \n" "'0.32.3'" @@ -390,22 +466,38 @@ msgstr "" ">>> version('wheel') \n" "'0.32.3'" -#: ../../library/importlib.metadata.rst:241 +#: ../../library/importlib.metadata.rst:288 msgid "Distribution files" msgstr "" -#: ../../library/importlib.metadata.rst:243 +#: ../../library/importlib.metadata.rst:292 msgid "" -"You can also get the full set of files contained within a distribution. The " -"``files()`` function takes a `Distribution Package `_ name and returns all of " -"the files installed by this distribution. Each file object returned is a " -"``PackagePath``, a :class:`pathlib.PurePath` derived object with additional " -"``dist``, ``size``, and ``hash`` properties as indicated by the metadata. " -"For example::" +"Return the full set of files contained within the named distribution package." msgstr "" -#: ../../library/importlib.metadata.rst:250 +#: ../../library/importlib.metadata.rst:298 +msgid "" +"Returns :const:`None` if the distribution is found but the installation " +"database records reporting the files associated with the distribuion package " +"are missing." +msgstr "" + +#: ../../library/importlib.metadata.rst:304 +msgid "" +"A :class:`pathlib.PurePath` derived object with additional ``dist``, " +"``size``, and ``hash`` properties corresponding to the distribution " +"package's installation metadata for that file." +msgstr "" + +#: ../../library/importlib.metadata.rst:308 +msgid "" +"The :func:`!files` function takes a `Distribution Package `_ name and returns " +"all of the files installed by this distribution. Each file is reported as a :" +"class:`PackagePath` instance. For example::" +msgstr "" + +#: ../../library/importlib.metadata.rst:313 msgid "" ">>> util = [p for p in files('wheel') if 'util.py' in str(p)][0] \n" ">>> util \n" @@ -427,11 +519,11 @@ msgstr "" ">>> util.hash \n" "" -#: ../../library/importlib.metadata.rst:260 +#: ../../library/importlib.metadata.rst:323 msgid "Once you have the file, you can also read its contents::" msgstr "" -#: ../../library/importlib.metadata.rst:262 +#: ../../library/importlib.metadata.rst:325 msgid "" ">>> print(util.read_text()) \n" "import base64\n" @@ -451,13 +543,13 @@ msgstr "" " return s.encode('utf-8')\n" " return s" -#: ../../library/importlib.metadata.rst:271 +#: ../../library/importlib.metadata.rst:334 msgid "" -"You can also use the ``locate`` method to get a the absolute path to the " +"You can also use the :meth:`!locate` method to get the absolute path to the " "file::" msgstr "" -#: ../../library/importlib.metadata.rst:274 +#: ../../library/importlib.metadata.rst:337 msgid "" ">>> util.locate() \n" "PosixPath('/home/gustav/example/lib/site-packages/wheel/util.py')" @@ -465,28 +557,33 @@ msgstr "" ">>> util.locate() \n" "PosixPath('/home/gustav/example/lib/site-packages/wheel/util.py')" -#: ../../library/importlib.metadata.rst:277 +#: ../../library/importlib.metadata.rst:340 msgid "" -"In the case where the metadata file listing files (RECORD or SOURCES.txt) is " -"missing, ``files()`` will return ``None``. The caller may wish to wrap calls " -"to ``files()`` in `always_iterable `_ or otherwise guard against " -"this condition if the target distribution is not known to have the metadata " -"present." +"In the case where the metadata file listing files (``RECORD`` or ``SOURCES." +"txt``) is missing, :func:`!files` will return :const:`None`. The caller may " +"wish to wrap calls to :func:`!files` in `always_iterable `_ or otherwise guard against this condition if the target " +"distribution is not known to have the metadata present." msgstr "" -#: ../../library/importlib.metadata.rst:288 +#: ../../library/importlib.metadata.rst:351 msgid "Distribution requirements" msgstr "" -#: ../../library/importlib.metadata.rst:290 +#: ../../library/importlib.metadata.rst:355 +msgid "" +"Return the declared dependency specifiers for the named distribution package." +msgstr "" + +#: ../../library/importlib.metadata.rst:361 msgid "" "To get the full set of requirements for a `Distribution Package `_, use " -"the ``requires()`` function::" +"the :func:`!requires` function::" msgstr "" -#: ../../library/importlib.metadata.rst:294 +#: ../../library/importlib.metadata.rst:365 msgid "" ">>> requires('wheel') \n" "[\"pytest (>=3.0.0) ; extra == 'test'\", \"pytest-cov ; extra == 'test'\"]" @@ -494,11 +591,25 @@ msgstr "" ">>> requires('wheel') \n" "[\"pytest (>=3.0.0) ; extra == 'test'\", \"pytest-cov ; extra == 'test'\"]" -#: ../../library/importlib.metadata.rst:302 +#: ../../library/importlib.metadata.rst:373 msgid "Mapping import to distribution packages" msgstr "" -#: ../../library/importlib.metadata.rst:304 +#: ../../library/importlib.metadata.rst:377 +msgid "" +"Return a mapping from the top level module and import package names found " +"via :attr:`sys.meta_path` to the names of the distribution packages (if any) " +"that provide the corresponding files." +msgstr "" + +#: ../../library/importlib.metadata.rst:381 +msgid "" +"To allow for namespace packages (which may have members provided by multiple " +"distribution packages), each top level import name maps to a list of " +"distribution names rather than mapping directly to a single name." +msgstr "" + +#: ../../library/importlib.metadata.rst:385 msgid "" "A convenience method to resolve the `Distribution Package `_ name (or names, " @@ -507,7 +618,7 @@ msgid "" "glossary/#term-Import-Package>`_::" msgstr "" -#: ../../library/importlib.metadata.rst:309 +#: ../../library/importlib.metadata.rst:390 msgid "" ">>> packages_distributions()\n" "{'importlib_metadata': ['importlib-metadata'], 'yaml': ['PyYAML'], 'jaraco': " @@ -517,41 +628,64 @@ msgstr "" "{'importlib_metadata': ['importlib-metadata'], 'yaml': ['PyYAML'], 'jaraco': " "['jaraco.classes', 'jaraco.functools'], ...}" -#: ../../library/importlib.metadata.rst:312 +#: ../../library/importlib.metadata.rst:393 msgid "" "Some editable installs, `do not supply top-level names `_, and thus this function is not " "reliable with such installs." msgstr "" -#: ../../library/importlib.metadata.rst:321 +#: ../../library/importlib.metadata.rst:402 msgid "Distributions" msgstr "" -#: ../../library/importlib.metadata.rst:323 +#: ../../library/importlib.metadata.rst:406 msgid "" -"While the above API is the most common and convenient usage, you can get all " -"of that information from the ``Distribution`` class. A ``Distribution`` is " -"an abstract object that represents the metadata for a Python `Distribution " -"Package `_. You can get the ``Distribution`` instance::" +"Return a :class:`Distribution` instance describing the named distribution " +"package." msgstr "" -#: ../../library/importlib.metadata.rst:329 +#: ../../library/importlib.metadata.rst:414 +msgid "Details of an installed distribution package." +msgstr "" + +#: ../../library/importlib.metadata.rst:416 +msgid "" +"Note: different :class:`!Distribution` instances do not currently compare " +"equal, even if they relate to the same installed distribution and " +"accordingly have the same attributes." +msgstr "" + +#: ../../library/importlib.metadata.rst:420 +msgid "" +"While the module level API described above is the most common and convenient " +"usage, you can get all of that information from the :class:`!Distribution` " +"class. :class:`!Distribution` is an abstract object that represents the " +"metadata for a Python `Distribution Package `_. You can get the concreate :" +"class:`!Distribution` subclass instance for an installed distribution " +"package by calling the :func:`distribution` function::" +msgstr "" + +#: ../../library/importlib.metadata.rst:427 msgid "" ">>> from importlib.metadata import distribution \n" -">>> dist = distribution('wheel') " +">>> dist = distribution('wheel') \n" +">>> type(dist) \n" +"" msgstr "" ">>> from importlib.metadata import distribution \n" -">>> dist = distribution('wheel') " +">>> dist = distribution('wheel') \n" +">>> type(dist) \n" +"" -#: ../../library/importlib.metadata.rst:332 +#: ../../library/importlib.metadata.rst:432 msgid "" -"Thus, an alternative way to get the version number is through the " -"``Distribution`` instance::" +"Thus, an alternative way to get the version number is through the :class:`!" +"Distribution` instance::" msgstr "" -#: ../../library/importlib.metadata.rst:335 +#: ../../library/importlib.metadata.rst:435 msgid "" ">>> dist.version \n" "'0.32.3'" @@ -559,13 +693,13 @@ msgstr "" ">>> dist.version \n" "'0.32.3'" -#: ../../library/importlib.metadata.rst:338 +#: ../../library/importlib.metadata.rst:438 msgid "" -"There are all kinds of additional metadata available on the ``Distribution`` " -"instance::" +"There are all kinds of additional metadata available on :class:`!" +"Distribution` instances::" msgstr "" -#: ../../library/importlib.metadata.rst:341 +#: ../../library/importlib.metadata.rst:441 msgid "" ">>> dist.metadata['Requires-Python'] \n" "'>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*'\n" @@ -577,35 +711,27 @@ msgstr "" ">>> dist.metadata['License'] \n" "'MIT'" -#: ../../library/importlib.metadata.rst:346 +#: ../../library/importlib.metadata.rst:446 msgid "" "For editable packages, an ``origin`` property may present :pep:`610` " "metadata::" msgstr "" -#: ../../library/importlib.metadata.rst:349 +#: ../../library/importlib.metadata.rst:449 msgid "" ">>> dist.origin.url\n" "'file:///path/to/wheel-0.32.3.editable-py3-none-any.whl'" msgstr "" -#: ../../library/importlib.metadata.rst:352 -msgid "" -"The full set of available metadata is not described here. See the `Core " -"metadata specifications `_ for additional details." -msgstr "" - -#: ../../library/importlib.metadata.rst:355 -#, fuzzy +#: ../../library/importlib.metadata.rst:455 msgid "The ``.origin`` property was added." -msgstr "新增 ``json`` 屬性。" +msgstr "新增 ``.origin`` 屬性 (property)。" -#: ../../library/importlib.metadata.rst:359 +#: ../../library/importlib.metadata.rst:459 msgid "Distribution Discovery" msgstr "" -#: ../../library/importlib.metadata.rst:361 +#: ../../library/importlib.metadata.rst:461 msgid "" "By default, this package provides built-in support for discovery of metadata " "for file system and zip file `Distribution Package `_ metadata is not available through :" @@ -640,14 +766,14 @@ msgid "" "on :data:`sys.meta_path`." msgstr "" -#: ../../library/importlib.metadata.rst:380 +#: ../../library/importlib.metadata.rst:480 msgid "" "By default ``importlib.metadata`` installs a finder for distribution " "packages found on the file system. This finder doesn't actually find any " "*distributions*, but it can find their metadata." msgstr "" -#: ../../library/importlib.metadata.rst:385 +#: ../../library/importlib.metadata.rst:485 msgid "" "The abstract class :py:class:`importlib.abc.MetaPathFinder` defines the " "interface expected of finders by Python's import system. ``importlib." @@ -657,7 +783,7 @@ msgid "" "base class, which defines this abstract method::" msgstr "" -#: ../../library/importlib.metadata.rst:393 +#: ../../library/importlib.metadata.rst:493 msgid "" "@abc.abstractmethod\n" "def find_distributions(context=DistributionFinder.Context()):\n" @@ -666,14 +792,14 @@ msgid "" " \"\"\"" msgstr "" -#: ../../library/importlib.metadata.rst:399 +#: ../../library/importlib.metadata.rst:499 msgid "" "The ``DistributionFinder.Context`` object provides ``.path`` and ``.name`` " "properties indicating the path to search and name to match and may supply " "other relevant context." msgstr "" -#: ../../library/importlib.metadata.rst:403 +#: ../../library/importlib.metadata.rst:503 msgid "" "What this means in practice is that to support finding distribution package " "metadata in locations other than the file system, subclass ``Distribution`` " @@ -682,17 +808,17 @@ msgid "" "method." msgstr "" -#: ../../library/importlib.metadata.rst:410 +#: ../../library/importlib.metadata.rst:510 msgid "Example" msgstr "" -#: ../../library/importlib.metadata.rst:412 +#: ../../library/importlib.metadata.rst:512 msgid "" "Consider for example a custom finder that loads Python modules from a " "database::" msgstr "" -#: ../../library/importlib.metadata.rst:415 +#: ../../library/importlib.metadata.rst:515 msgid "" "class DatabaseImporter(importlib.abc.MetaPathFinder):\n" " def __init__(self, db):\n" @@ -704,14 +830,14 @@ msgid "" "sys.meta_path.append(DatabaseImporter(connect_db(...)))" msgstr "" -#: ../../library/importlib.metadata.rst:424 +#: ../../library/importlib.metadata.rst:524 msgid "" "That importer now presumably provides importable modules from a database, " "but it provides no metadata or entry points. For this custom importer to " "provide metadata, it would also need to implement ``DistributionFinder``::" msgstr "" -#: ../../library/importlib.metadata.rst:429 +#: ../../library/importlib.metadata.rst:529 msgid "" "from importlib.metadata import DistributionFinder\n" "\n" @@ -724,7 +850,7 @@ msgid "" " yield DatabaseDistribution(dist_record)" msgstr "" -#: ../../library/importlib.metadata.rst:439 +#: ../../library/importlib.metadata.rst:539 msgid "" "In this way, ``query_distributions`` would return records for each " "distribution served by the database matching the query. For example, if " @@ -733,7 +859,7 @@ msgid "" "``Context(name=None)``." msgstr "" -#: ../../library/importlib.metadata.rst:445 +#: ../../library/importlib.metadata.rst:545 msgid "" "For the sake of simplicity, this example ignores ``context.path``\\. The " "``path`` attribute defaults to ``sys.path`` and is the set of import paths " @@ -746,11 +872,11 @@ msgid "" "``context.path`` and only yield ``Distribution``\\ s pertinent to that path." msgstr "" -#: ../../library/importlib.metadata.rst:456 +#: ../../library/importlib.metadata.rst:556 msgid "``DatabaseDistribution``, then, would look something like::" msgstr "" -#: ../../library/importlib.metadata.rst:458 +#: ../../library/importlib.metadata.rst:558 msgid "" "class DatabaseDistribution(importlib.metadata.Distributon):\n" " def __init__(self, record):\n" @@ -773,14 +899,14 @@ msgid "" " raise RuntimeError(\"This distribution has no file system\")" msgstr "" -#: ../../library/importlib.metadata.rst:478 +#: ../../library/importlib.metadata.rst:578 msgid "" "This basic implementation should provide metadata and entry points for " "packages served by the ``DatabaseImporter``, assuming that the ``record`` " "supplies suitable ``.name``, ``.version``, and ``.entry_points`` attributes." msgstr "" -#: ../../library/importlib.metadata.rst:483 +#: ../../library/importlib.metadata.rst:583 msgid "" "The ``DatabaseDistribution`` may also provide other metadata files, like " "``RECORD`` (required for ``Distribution.files``) or override the " diff --git a/library/importlib.po b/library/importlib.po index 9946fd1bea..abe935981e 100644 --- a/library/importlib.po +++ b/library/importlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-28 00:13+0000\n" +"POT-Creation-Date: 2024-10-11 00:13+0000\n" "PO-Revision-Date: 2018-05-23 16:04+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -422,11 +422,11 @@ msgid "" "An abstract method for finding a :term:`spec ` for the " "specified module. If this is a top-level import, *path* will be ``None``. " "Otherwise, this is a search for a subpackage or module and *path* will be " -"the value of :attr:`__path__` from the parent package. If a spec cannot be " -"found, ``None`` is returned. When passed in, ``target`` is a module object " -"that the finder may use to make a more educated guess about what spec to " -"return. :func:`importlib.util.spec_from_loader` may be useful for " -"implementing concrete ``MetaPathFinders``." +"the value of :attr:`~module.__path__` from the parent package. If a spec " +"cannot be found, ``None`` is returned. When passed in, ``target`` is a " +"module object that the finder may use to make a more educated guess about " +"what spec to return. :func:`importlib.util.spec_from_loader` may be useful " +"for implementing concrete ``MetaPathFinders``." msgstr "" #: ../../library/importlib.rst:263 @@ -530,81 +530,42 @@ msgid "" msgstr "" #: ../../library/importlib.rst:358 -msgid ":attr:`__name__`" -msgstr ":attr:`__name__`" +msgid ":attr:`module.__name__`" +msgstr ":attr:`module.__name__`" #: ../../library/importlib.rst:359 -msgid "" -"The module's fully qualified name. It is ``'__main__'`` for an executed " -"module." -msgstr "" - -#: ../../library/importlib.rst:362 -msgid ":attr:`__file__`" -msgstr ":attr:`__file__`" - -#: ../../library/importlib.rst:363 -msgid "" -"The location the :term:`loader` used to load the module. For example, for " -"modules loaded from a .py file this is the filename. It is not set on all " -"modules (e.g. built-in modules)." -msgstr "" +msgid ":attr:`module.__file__`" +msgstr ":attr:`module.__file__`" -#: ../../library/importlib.rst:367 -msgid ":attr:`__cached__`" -msgstr ":attr:`__cached__`" +#: ../../library/importlib.rst:360 +msgid ":attr:`module.__cached__` *(deprecated)*" +msgstr ":attr:`module.__cached__` *(已棄用)*" -#: ../../library/importlib.rst:368 -msgid "" -"The filename of a compiled version of the module's code. It is not set on " -"all modules (e.g. built-in modules)." -msgstr "" +#: ../../library/importlib.rst:361 +msgid ":attr:`module.__path__`" +msgstr ":attr:`module.__path__`" -#: ../../library/importlib.rst:371 -msgid ":attr:`__path__`" -msgstr ":attr:`__path__`" - -#: ../../library/importlib.rst:372 -msgid "" -"The list of locations where the package's submodules will be found. Most of " -"the time this is a single directory. The import system passes this attribute " -"to ``__import__()`` and to finders in the same way as :data:`sys.path` but " -"just for the package. It is not set on non-package modules so it can be used " -"as an indicator that the module is a package." -msgstr "" - -#: ../../library/importlib.rst:379 -msgid ":attr:`__package__`" -msgstr ":attr:`__package__`" - -#: ../../library/importlib.rst:380 -msgid "" -"The fully qualified name of the package the module is in (or the empty " -"string for a top-level module). If the module is a package then this is the " -"same as :attr:`__name__`." -msgstr "" - -#: ../../library/importlib.rst:384 -msgid ":attr:`__loader__`" -msgstr ":attr:`__loader__`" +#: ../../library/importlib.rst:362 +msgid ":attr:`module.__package__` *(deprecated)*" +msgstr ":attr:`module.__package__` *(已棄用)*" -#: ../../library/importlib.rst:385 -msgid "The :term:`loader` used to load the module." -msgstr "" +#: ../../library/importlib.rst:363 +msgid ":attr:`module.__loader__` *(deprecated)*" +msgstr ":attr:`module.__loader__` *(已棄用)*" -#: ../../library/importlib.rst:387 +#: ../../library/importlib.rst:365 msgid "" "When :meth:`exec_module` is available then backwards-compatible " "functionality is provided." msgstr "" -#: ../../library/importlib.rst:390 +#: ../../library/importlib.rst:368 msgid "" "Raise :exc:`ImportError` when called instead of :exc:`NotImplementedError`. " "Functionality provided when :meth:`exec_module` is available." msgstr "" -#: ../../library/importlib.rst:395 +#: ../../library/importlib.rst:373 msgid "" "The recommended API for loading a module is :meth:`exec_module` (and :meth:" "`create_module`). Loaders should implement it instead of :meth:" @@ -613,56 +574,56 @@ msgid "" "implemented." msgstr "" -#: ../../library/importlib.rst:405 +#: ../../library/importlib.rst:383 msgid "" "An abstract base class for a :term:`loader` which implements the optional :" "pep:`302` protocol for loading arbitrary resources from the storage back-end." msgstr "" -#: ../../library/importlib.rst:409 +#: ../../library/importlib.rst:387 msgid "" "This ABC is deprecated in favour of supporting resource loading through :" "class:`importlib.resources.abc.ResourceReader`." msgstr "" -#: ../../library/importlib.rst:415 +#: ../../library/importlib.rst:393 msgid "" "An abstract method to return the bytes for the data located at *path*. " "Loaders that have a file-like storage back-end that allows storing arbitrary " "data can implement this abstract method to give direct access to the data " "stored. :exc:`OSError` is to be raised if the *path* cannot be found. The " -"*path* is expected to be constructed using a module's :attr:`__file__` " -"attribute or an item from a package's :attr:`__path__`." +"*path* is expected to be constructed using a module's :attr:`~module." +"__file__` attribute or an item from a package's :attr:`~module.__path__`." msgstr "" -#: ../../library/importlib.rst:423 +#: ../../library/importlib.rst:402 msgid "Raises :exc:`OSError` instead of :exc:`NotImplementedError`." msgstr "" -#: ../../library/importlib.rst:429 +#: ../../library/importlib.rst:408 msgid "" "An abstract base class for a :term:`loader` which implements the optional :" "pep:`302` protocol for loaders that inspect modules." msgstr "" -#: ../../library/importlib.rst:434 +#: ../../library/importlib.rst:413 msgid "" "Return the code object for a module, or ``None`` if the module does not have " "a code object (as would be the case, for example, for a built-in module). " "Raise an :exc:`ImportError` if loader cannot find the requested module." msgstr "" -#: ../../library/importlib.rst:440 +#: ../../library/importlib.rst:419 msgid "" "While the method has a default implementation, it is suggested that it be " "overridden if possible for performance." msgstr "" -#: ../../library/importlib.rst:446 +#: ../../library/importlib.rst:425 msgid "No longer abstract and a concrete implementation is provided." msgstr "" -#: ../../library/importlib.rst:451 +#: ../../library/importlib.rst:430 msgid "" "An abstract method to return the source of a module. It is returned as a " "text string using :term:`universal newlines`, translating all recognized " @@ -671,23 +632,23 @@ msgid "" "cannot find the module specified." msgstr "" -#: ../../library/importlib.rst:457 ../../library/importlib.rst:466 -#: ../../library/importlib.rst:516 +#: ../../library/importlib.rst:436 ../../library/importlib.rst:445 +#: ../../library/importlib.rst:495 msgid "Raises :exc:`ImportError` instead of :exc:`NotImplementedError`." msgstr "" -#: ../../library/importlib.rst:462 +#: ../../library/importlib.rst:441 msgid "" "An optional method to return a true value if the module is a package, a " "false value otherwise. :exc:`ImportError` is raised if the :term:`loader` " "cannot find the module." msgstr "" -#: ../../library/importlib.rst:471 +#: ../../library/importlib.rst:450 msgid "Create a code object from Python source." msgstr "" -#: ../../library/importlib.rst:473 +#: ../../library/importlib.rst:452 msgid "" "The *data* argument can be whatever the :func:`compile` function supports (i." "e. string or bytes). The *path* argument should be the \"path\" to where the " @@ -695,106 +656,107 @@ msgid "" "in a zip file)." msgstr "" -#: ../../library/importlib.rst:478 +#: ../../library/importlib.rst:457 msgid "" "With the subsequent code object one can execute it in a module by running " "``exec(code, module.__dict__)``." msgstr "" -#: ../../library/importlib.rst:483 +#: ../../library/importlib.rst:462 msgid "Made the method static." msgstr "" -#: ../../library/importlib.rst:488 +#: ../../library/importlib.rst:467 msgid "Implementation of :meth:`Loader.exec_module`." msgstr ":meth:`Loader.exec_module` 的實作。" -#: ../../library/importlib.rst:494 +#: ../../library/importlib.rst:473 msgid "Implementation of :meth:`Loader.load_module`." msgstr ":meth:`Loader.load_module` 的實作。" -#: ../../library/importlib.rst:496 +#: ../../library/importlib.rst:475 msgid "use :meth:`exec_module` instead." msgstr "請改用 :meth:`exec_module`。" -#: ../../library/importlib.rst:502 +#: ../../library/importlib.rst:481 msgid "" "An abstract base class which inherits from :class:`InspectLoader` that, when " "implemented, helps a module to be executed as a script. The ABC represents " "an optional :pep:`302` protocol." msgstr "" -#: ../../library/importlib.rst:508 +#: ../../library/importlib.rst:487 msgid "" -"An abstract method that is to return the value of :attr:`__file__` for the " -"specified module. If no path is available, :exc:`ImportError` is raised." +"An abstract method that is to return the value of :attr:`~module.__file__` " +"for the specified module. If no path is available, :exc:`ImportError` is " +"raised." msgstr "" -#: ../../library/importlib.rst:512 +#: ../../library/importlib.rst:491 msgid "" "If source code is available, then the method should return the path to the " "source file, regardless of whether a bytecode was used to load the module." msgstr "" -#: ../../library/importlib.rst:522 +#: ../../library/importlib.rst:501 msgid "" "An abstract base class which inherits from :class:`ResourceLoader` and :" "class:`ExecutionLoader`, providing concrete implementations of :meth:" "`ResourceLoader.get_data` and :meth:`ExecutionLoader.get_filename`." msgstr "" -#: ../../library/importlib.rst:526 +#: ../../library/importlib.rst:505 msgid "" "The *fullname* argument is a fully resolved name of the module the loader is " "to handle. The *path* argument is the path to the file for the module." msgstr "" -#: ../../library/importlib.rst:533 +#: ../../library/importlib.rst:512 msgid "The name of the module the loader can handle." msgstr "" -#: ../../library/importlib.rst:537 +#: ../../library/importlib.rst:516 msgid "Path to the file of the module." msgstr "" -#: ../../library/importlib.rst:541 +#: ../../library/importlib.rst:520 msgid "Calls super's ``load_module()``." msgstr "" -#: ../../library/importlib.rst:543 +#: ../../library/importlib.rst:522 msgid "Use :meth:`Loader.exec_module` instead." msgstr "" -#: ../../library/importlib.rst:548 ../../library/importlib.rst:1143 +#: ../../library/importlib.rst:527 ../../library/importlib.rst:1122 msgid "Returns :attr:`path`." msgstr "" -#: ../../library/importlib.rst:552 +#: ../../library/importlib.rst:531 msgid "Reads *path* as a binary file and returns the bytes from it." msgstr "" -#: ../../library/importlib.rst:557 +#: ../../library/importlib.rst:536 msgid "" "An abstract base class for implementing source (and optionally bytecode) " "file loading. The class inherits from both :class:`ResourceLoader` and :" "class:`ExecutionLoader`, requiring the implementation of:" msgstr "" -#: ../../library/importlib.rst:561 +#: ../../library/importlib.rst:540 msgid ":meth:`ResourceLoader.get_data`" msgstr ":meth:`ResourceLoader.get_data`" -#: ../../library/importlib.rst:562 +#: ../../library/importlib.rst:541 msgid ":meth:`ExecutionLoader.get_filename`" msgstr ":meth:`ExecutionLoader.get_filename`" -#: ../../library/importlib.rst:563 +#: ../../library/importlib.rst:542 msgid "" "Should only return the path to the source file; sourceless loading is not " "supported." msgstr "" -#: ../../library/importlib.rst:566 +#: ../../library/importlib.rst:545 msgid "" "The abstract methods defined by this class are to add optional bytecode file " "support. Not implementing these optional methods (or causing them to raise :" @@ -806,83 +768,83 @@ msgid "" "bytecode-specific API is exposed." msgstr "" -#: ../../library/importlib.rst:577 +#: ../../library/importlib.rst:556 msgid "" "Optional abstract method which returns a :class:`dict` containing metadata " "about the specified path. Supported dictionary keys are:" msgstr "" -#: ../../library/importlib.rst:580 +#: ../../library/importlib.rst:559 msgid "" "``'mtime'`` (mandatory): an integer or floating-point number representing " "the modification time of the source code;" msgstr "" -#: ../../library/importlib.rst:582 +#: ../../library/importlib.rst:561 msgid "``'size'`` (optional): the size in bytes of the source code." msgstr "" -#: ../../library/importlib.rst:584 +#: ../../library/importlib.rst:563 msgid "" "Any other keys in the dictionary are ignored, to allow for future " "extensions. If the path cannot be handled, :exc:`OSError` is raised." msgstr "" -#: ../../library/importlib.rst:589 ../../library/importlib.rst:602 +#: ../../library/importlib.rst:568 ../../library/importlib.rst:581 msgid "Raise :exc:`OSError` instead of :exc:`NotImplementedError`." msgstr "" -#: ../../library/importlib.rst:594 +#: ../../library/importlib.rst:573 msgid "" "Optional abstract method which returns the modification time for the " "specified path." msgstr "" -#: ../../library/importlib.rst:597 +#: ../../library/importlib.rst:576 msgid "" "This method is deprecated in favour of :meth:`path_stats`. You don't have " "to implement it, but it is still available for compatibility purposes. " "Raise :exc:`OSError` if the path cannot be handled." msgstr "" -#: ../../library/importlib.rst:607 +#: ../../library/importlib.rst:586 msgid "" "Optional abstract method which writes the specified bytes to a file path. " "Any intermediate directories which do not exist are to be created " "automatically." msgstr "" -#: ../../library/importlib.rst:611 +#: ../../library/importlib.rst:590 msgid "" "When writing to the path fails because the path is read-only (:const:`errno." "EACCES`/:exc:`PermissionError`), do not propagate the exception." msgstr "" -#: ../../library/importlib.rst:615 +#: ../../library/importlib.rst:594 msgid "No longer raises :exc:`NotImplementedError` when called." msgstr "" -#: ../../library/importlib.rst:620 +#: ../../library/importlib.rst:599 msgid "Concrete implementation of :meth:`InspectLoader.get_code`." msgstr "" -#: ../../library/importlib.rst:624 +#: ../../library/importlib.rst:603 msgid "Concrete implementation of :meth:`Loader.exec_module`." msgstr "" -#: ../../library/importlib.rst:630 +#: ../../library/importlib.rst:609 msgid "Concrete implementation of :meth:`Loader.load_module`." msgstr "" -#: ../../library/importlib.rst:632 +#: ../../library/importlib.rst:611 msgid "Use :meth:`exec_module` instead." msgstr "" -#: ../../library/importlib.rst:637 +#: ../../library/importlib.rst:616 msgid "Concrete implementation of :meth:`InspectLoader.get_source`." msgstr "" -#: ../../library/importlib.rst:641 +#: ../../library/importlib.rst:620 msgid "" "Concrete implementation of :meth:`InspectLoader.is_package`. A module is " "determined to be a package if its file path (as provided by :meth:" @@ -891,16 +853,16 @@ msgid "" "``__init__``." msgstr "" -#: ../../library/importlib.rst:650 +#: ../../library/importlib.rst:629 msgid "*Superseded by TraversableResources*" msgstr "" -#: ../../library/importlib.rst:652 +#: ../../library/importlib.rst:631 msgid "" "An :term:`abstract base class` to provide the ability to read *resources*." msgstr "" -#: ../../library/importlib.rst:655 +#: ../../library/importlib.rst:634 msgid "" "From the perspective of this ABC, a *resource* is a binary artifact that is " "shipped within a package. Typically this is something like a data file that " @@ -910,7 +872,7 @@ msgid "" "file versus on the file system." msgstr "" -#: ../../library/importlib.rst:663 +#: ../../library/importlib.rst:642 msgid "" "For any of methods of this class, a *resource* argument is expected to be a :" "term:`path-like object` which represents conceptually just a file name. This " @@ -922,7 +884,7 @@ msgid "" "potentially representing multiple packages or a module)." msgstr "" -#: ../../library/importlib.rst:674 +#: ../../library/importlib.rst:653 msgid "" "Loaders that wish to support resource reading are expected to provide a " "method called ``get_resource_reader(fullname)`` which returns an object " @@ -931,37 +893,37 @@ msgid "" "with this ABC should only be returned when the specified module is a package." msgstr "" -#: ../../library/importlib.rst:683 ../../library/importlib.rst:793 +#: ../../library/importlib.rst:662 ../../library/importlib.rst:772 msgid "Use :class:`importlib.resources.abc.TraversableResources` instead." msgstr "" -#: ../../library/importlib.rst:688 +#: ../../library/importlib.rst:667 msgid "" "Returns an opened, :term:`file-like object` for binary reading of the " "*resource*." msgstr "" -#: ../../library/importlib.rst:691 +#: ../../library/importlib.rst:670 msgid "If the resource cannot be found, :exc:`FileNotFoundError` is raised." msgstr "" -#: ../../library/importlib.rst:696 +#: ../../library/importlib.rst:675 msgid "Returns the file system path to the *resource*." msgstr "" -#: ../../library/importlib.rst:698 +#: ../../library/importlib.rst:677 msgid "" "If the resource does not concretely exist on the file system, raise :exc:" "`FileNotFoundError`." msgstr "" -#: ../../library/importlib.rst:703 +#: ../../library/importlib.rst:682 msgid "" "Returns ``True`` if the named *name* is considered a resource. :exc:" "`FileNotFoundError` is raised if *name* does not exist." msgstr "" -#: ../../library/importlib.rst:708 +#: ../../library/importlib.rst:687 msgid "" "Returns an :term:`iterable` of strings over the contents of the package. Do " "note that it is not required that all names returned by the iterator be " @@ -969,7 +931,7 @@ msgid "" "`is_resource` would be false." msgstr "" -#: ../../library/importlib.rst:714 +#: ../../library/importlib.rst:693 msgid "" "Allowing non-resource names to be returned is to allow for situations where " "how a package and its resources are stored are known a priori and the non-" @@ -978,71 +940,71 @@ msgid "" "stored on the file system then those subdirectory names can be used directly." msgstr "" -#: ../../library/importlib.rst:722 +#: ../../library/importlib.rst:701 msgid "The abstract method returns an iterable of no items." msgstr "" -#: ../../library/importlib.rst:727 +#: ../../library/importlib.rst:706 msgid "" "An object with a subset of :class:`pathlib.Path` methods suitable for " "traversing directories and opening files." msgstr "" -#: ../../library/importlib.rst:730 +#: ../../library/importlib.rst:709 msgid "" "For a representation of the object on the file-system, use :meth:`importlib." "resources.as_file`." msgstr "" -#: ../../library/importlib.rst:735 +#: ../../library/importlib.rst:714 msgid "Use :class:`importlib.resources.abc.Traversable` instead." msgstr "" -#: ../../library/importlib.rst:740 +#: ../../library/importlib.rst:719 msgid "Abstract. The base name of this object without any parent references." msgstr "" -#: ../../library/importlib.rst:744 +#: ../../library/importlib.rst:723 msgid "Yield ``Traversable`` objects in ``self``." msgstr "" -#: ../../library/importlib.rst:748 +#: ../../library/importlib.rst:727 msgid "Return ``True`` if ``self`` is a directory." msgstr "" -#: ../../library/importlib.rst:752 +#: ../../library/importlib.rst:731 msgid "Return ``True`` if ``self`` is a file." msgstr "" -#: ../../library/importlib.rst:756 +#: ../../library/importlib.rst:735 msgid "Return Traversable child in ``self``." msgstr "" -#: ../../library/importlib.rst:760 +#: ../../library/importlib.rst:739 msgid "Return ``Traversable`` child in ``self``." msgstr "" -#: ../../library/importlib.rst:764 +#: ../../library/importlib.rst:743 msgid "" "*mode* may be 'r' or 'rb' to open as text or binary. Return a handle " "suitable for reading (same as :attr:`pathlib.Path.open`)." msgstr "" -#: ../../library/importlib.rst:767 +#: ../../library/importlib.rst:746 msgid "" "When opening as text, accepts encoding parameters such as those accepted by :" "attr:`io.TextIOWrapper`." msgstr "" -#: ../../library/importlib.rst:772 +#: ../../library/importlib.rst:751 msgid "Read contents of ``self`` as bytes." msgstr "" -#: ../../library/importlib.rst:776 +#: ../../library/importlib.rst:755 msgid "Read contents of ``self`` as text." msgstr "" -#: ../../library/importlib.rst:781 +#: ../../library/importlib.rst:760 msgid "" "An abstract base class for resource readers capable of serving the :meth:" "`importlib.resources.files` interface. Subclasses :class:`importlib." @@ -1052,71 +1014,71 @@ msgid "" "also supplies ResourceReader." msgstr "" -#: ../../library/importlib.rst:788 +#: ../../library/importlib.rst:767 msgid "" "Loaders that wish to support resource reading are expected to implement this " "interface." msgstr "" -#: ../../library/importlib.rst:798 +#: ../../library/importlib.rst:777 msgid "" "Returns a :class:`importlib.resources.abc.Traversable` object for the loaded " "package." msgstr "" -#: ../../library/importlib.rst:804 +#: ../../library/importlib.rst:783 msgid ":mod:`importlib.machinery` -- Importers and path hooks" msgstr "" -#: ../../library/importlib.rst:809 +#: ../../library/importlib.rst:788 msgid "**Source code:** :source:`Lib/importlib/machinery.py`" msgstr "**原始碼:**\\ :source:`Lib/importlib/machinery.py`" -#: ../../library/importlib.rst:813 +#: ../../library/importlib.rst:792 msgid "" "This module contains the various objects that help :keyword:`import` find " "and load modules." msgstr "" -#: ../../library/importlib.rst:818 +#: ../../library/importlib.rst:797 msgid "" "A list of strings representing the recognized file suffixes for source " "modules." msgstr "" -#: ../../library/importlib.rst:825 +#: ../../library/importlib.rst:804 msgid "" "A list of strings representing the file suffixes for non-optimized bytecode " "modules." msgstr "" -#: ../../library/importlib.rst:830 ../../library/importlib.rst:840 +#: ../../library/importlib.rst:809 ../../library/importlib.rst:819 msgid "Use :attr:`BYTECODE_SUFFIXES` instead." msgstr "" -#: ../../library/importlib.rst:835 +#: ../../library/importlib.rst:814 msgid "" "A list of strings representing the file suffixes for optimized bytecode " "modules." msgstr "" -#: ../../library/importlib.rst:845 +#: ../../library/importlib.rst:824 msgid "" "A list of strings representing the recognized file suffixes for bytecode " "modules (including the leading dot)." msgstr "" -#: ../../library/importlib.rst:850 +#: ../../library/importlib.rst:829 msgid "The value is no longer dependent on ``__debug__``." msgstr "" -#: ../../library/importlib.rst:855 +#: ../../library/importlib.rst:834 msgid "" "A list of strings representing the recognized file suffixes for extension " "modules." msgstr "" -#: ../../library/importlib.rst:862 +#: ../../library/importlib.rst:841 msgid "" "Returns a combined list of strings representing all file suffixes for " "modules recognized by the standard import machinery. This is a helper for " @@ -1125,57 +1087,57 @@ msgid "" "`inspect.getmodulename`)." msgstr "" -#: ../../library/importlib.rst:873 +#: ../../library/importlib.rst:852 msgid "" "An :term:`importer` for built-in modules. All known built-in modules are " "listed in :data:`sys.builtin_module_names`. This class implements the :class:" "`importlib.abc.MetaPathFinder` and :class:`importlib.abc.InspectLoader` ABCs." msgstr "" -#: ../../library/importlib.rst:878 ../../library/importlib.rst:892 -#: ../../library/importlib.rst:905 ../../library/importlib.rst:920 +#: ../../library/importlib.rst:857 ../../library/importlib.rst:871 +#: ../../library/importlib.rst:884 ../../library/importlib.rst:899 msgid "" "Only class methods are defined by this class to alleviate the need for " "instantiation." msgstr "" -#: ../../library/importlib.rst:881 +#: ../../library/importlib.rst:860 msgid "" "As part of :pep:`489`, the builtin importer now implements :meth:`Loader." "create_module` and :meth:`Loader.exec_module`" msgstr "" -#: ../../library/importlib.rst:888 +#: ../../library/importlib.rst:867 msgid "" "An :term:`importer` for frozen modules. This class implements the :class:" "`importlib.abc.MetaPathFinder` and :class:`importlib.abc.InspectLoader` ABCs." msgstr "" -#: ../../library/importlib.rst:895 +#: ../../library/importlib.rst:874 msgid "" "Gained :meth:`~Loader.create_module` and :meth:`~Loader.exec_module` methods." msgstr "" -#: ../../library/importlib.rst:902 +#: ../../library/importlib.rst:881 msgid "" ":term:`Finder ` for modules declared in the Windows registry. This " "class implements the :class:`importlib.abc.MetaPathFinder` ABC." msgstr "" -#: ../../library/importlib.rst:910 +#: ../../library/importlib.rst:889 msgid "" "Use :mod:`site` configuration instead. Future versions of Python may not " "enable this finder by default." msgstr "" -#: ../../library/importlib.rst:917 +#: ../../library/importlib.rst:896 msgid "" "A :term:`Finder ` for :data:`sys.path` and package ``__path__`` " "attributes. This class implements the :class:`importlib.abc.MetaPathFinder` " "ABC." msgstr "" -#: ../../library/importlib.rst:925 +#: ../../library/importlib.rst:904 msgid "" "Class method that attempts to find a :term:`spec ` for the " "module specified by *fullname* on :data:`sys.path` or, if defined, on " @@ -1189,43 +1151,43 @@ msgid "" "cache and returned." msgstr "" -#: ../../library/importlib.rst:939 +#: ../../library/importlib.rst:918 msgid "" "If the current working directory -- represented by an empty string -- is no " "longer valid then ``None`` is returned but no value is cached in :data:`sys." "path_importer_cache`." msgstr "" -#: ../../library/importlib.rst:946 +#: ../../library/importlib.rst:925 msgid "" "Calls :meth:`importlib.abc.PathEntryFinder.invalidate_caches` on all finders " "stored in :data:`sys.path_importer_cache` that define the method. Otherwise " "entries in :data:`sys.path_importer_cache` set to ``None`` are deleted." msgstr "" -#: ../../library/importlib.rst:951 +#: ../../library/importlib.rst:930 msgid "Entries of ``None`` in :data:`sys.path_importer_cache` are deleted." msgstr "" -#: ../../library/importlib.rst:954 +#: ../../library/importlib.rst:933 msgid "" "Calls objects in :data:`sys.path_hooks` with the current working directory " "for ``''`` (i.e. the empty string)." msgstr "" -#: ../../library/importlib.rst:961 +#: ../../library/importlib.rst:940 msgid "" "A concrete implementation of :class:`importlib.abc.PathEntryFinder` which " "caches results from the file system." msgstr "" -#: ../../library/importlib.rst:964 +#: ../../library/importlib.rst:943 msgid "" "The *path* argument is the directory for which the finder is in charge of " "searching." msgstr "" -#: ../../library/importlib.rst:967 +#: ../../library/importlib.rst:946 msgid "" "The *loader_details* argument is a variable number of 2-item tuples each " "containing a loader and a sequence of file suffixes the loader recognizes. " @@ -1233,7 +1195,7 @@ msgid "" "module's name and the path to the file found." msgstr "" -#: ../../library/importlib.rst:972 +#: ../../library/importlib.rst:951 msgid "" "The finder will cache the directory contents as necessary, making stat calls " "for each module search to verify the cache is not outdated. Because cache " @@ -1246,166 +1208,166 @@ msgid "" "to call :func:`importlib.invalidate_caches`." msgstr "" -#: ../../library/importlib.rst:986 +#: ../../library/importlib.rst:965 msgid "The path the finder will search in." msgstr "" -#: ../../library/importlib.rst:990 +#: ../../library/importlib.rst:969 msgid "Attempt to find the spec to handle *fullname* within :attr:`path`." msgstr "" -#: ../../library/importlib.rst:996 +#: ../../library/importlib.rst:975 msgid "Clear out the internal cache." msgstr "" -#: ../../library/importlib.rst:1000 +#: ../../library/importlib.rst:979 msgid "" "A class method which returns a closure for use on :data:`sys.path_hooks`. An " "instance of :class:`FileFinder` is returned by the closure using the path " "argument given to the closure directly and *loader_details* indirectly." msgstr "" -#: ../../library/importlib.rst:1005 +#: ../../library/importlib.rst:984 msgid "" "If the argument to the closure is not an existing directory, :exc:" "`ImportError` is raised." msgstr "" -#: ../../library/importlib.rst:1011 +#: ../../library/importlib.rst:990 msgid "" "A concrete implementation of :class:`importlib.abc.SourceLoader` by " "subclassing :class:`importlib.abc.FileLoader` and providing some concrete " "implementations of other methods." msgstr "" -#: ../../library/importlib.rst:1019 +#: ../../library/importlib.rst:998 msgid "The name of the module that this loader will handle." msgstr "" -#: ../../library/importlib.rst:1023 +#: ../../library/importlib.rst:1002 msgid "The path to the source file." msgstr "" -#: ../../library/importlib.rst:1027 +#: ../../library/importlib.rst:1006 msgid "Return ``True`` if :attr:`path` appears to be for a package." msgstr "" -#: ../../library/importlib.rst:1031 +#: ../../library/importlib.rst:1010 msgid "" "Concrete implementation of :meth:`importlib.abc.SourceLoader.path_stats`." msgstr "" -#: ../../library/importlib.rst:1035 +#: ../../library/importlib.rst:1014 msgid "Concrete implementation of :meth:`importlib.abc.SourceLoader.set_data`." msgstr "" -#: ../../library/importlib.rst:1039 ../../library/importlib.rst:1082 +#: ../../library/importlib.rst:1018 ../../library/importlib.rst:1061 msgid "" "Concrete implementation of :meth:`importlib.abc.Loader.load_module` where " "specifying the name of the module to load is optional." msgstr "" -#: ../../library/importlib.rst:1044 ../../library/importlib.rst:1087 +#: ../../library/importlib.rst:1023 ../../library/importlib.rst:1066 msgid "Use :meth:`importlib.abc.Loader.exec_module` instead." msgstr "" -#: ../../library/importlib.rst:1049 +#: ../../library/importlib.rst:1028 msgid "" "A concrete implementation of :class:`importlib.abc.FileLoader` which can " "import bytecode files (i.e. no source code files exist)." msgstr "" -#: ../../library/importlib.rst:1052 +#: ../../library/importlib.rst:1031 msgid "" "Please note that direct use of bytecode files (and thus not source code " "files) inhibits your modules from being usable by all Python implementations " "or new versions of Python which change the bytecode format." msgstr "" -#: ../../library/importlib.rst:1061 +#: ../../library/importlib.rst:1040 msgid "The name of the module the loader will handle." msgstr "" -#: ../../library/importlib.rst:1065 +#: ../../library/importlib.rst:1044 msgid "The path to the bytecode file." msgstr "" -#: ../../library/importlib.rst:1069 +#: ../../library/importlib.rst:1048 msgid "Determines if the module is a package based on :attr:`path`." msgstr "" -#: ../../library/importlib.rst:1073 +#: ../../library/importlib.rst:1052 msgid "Returns the code object for :attr:`name` created from :attr:`path`." msgstr "" -#: ../../library/importlib.rst:1077 +#: ../../library/importlib.rst:1056 msgid "" "Returns ``None`` as bytecode files have no source when this loader is used." msgstr "" -#: ../../library/importlib.rst:1092 +#: ../../library/importlib.rst:1071 msgid "" "A concrete implementation of :class:`importlib.abc.ExecutionLoader` for " "extension modules." msgstr "" -#: ../../library/importlib.rst:1095 +#: ../../library/importlib.rst:1074 msgid "" "The *fullname* argument specifies the name of the module the loader is to " "support. The *path* argument is the path to the extension module's file." msgstr "" -#: ../../library/importlib.rst:1098 +#: ../../library/importlib.rst:1077 msgid "" "Note that, by default, importing an extension module will fail in " "subinterpreters if it doesn't implement multi-phase init (see :pep:`489`), " "even if it would otherwise import successfully." msgstr "" -#: ../../library/importlib.rst:1104 +#: ../../library/importlib.rst:1083 msgid "Multi-phase init is now required for use in subinterpreters." msgstr "" -#: ../../library/importlib.rst:1109 ../../library/importlib.rst:1293 +#: ../../library/importlib.rst:1088 ../../library/importlib.rst:1274 msgid "Name of the module the loader supports." msgstr "" -#: ../../library/importlib.rst:1113 +#: ../../library/importlib.rst:1092 msgid "Path to the extension module." msgstr "" -#: ../../library/importlib.rst:1117 +#: ../../library/importlib.rst:1096 msgid "" "Creates the module object from the given specification in accordance with :" "pep:`489`." msgstr "" -#: ../../library/importlib.rst:1124 +#: ../../library/importlib.rst:1103 msgid "Initializes the given module object in accordance with :pep:`489`." msgstr "" -#: ../../library/importlib.rst:1130 +#: ../../library/importlib.rst:1109 msgid "" "Returns ``True`` if the file path points to a package's ``__init__`` module " "based on :attr:`EXTENSION_SUFFIXES`." msgstr "" -#: ../../library/importlib.rst:1135 +#: ../../library/importlib.rst:1114 msgid "Returns ``None`` as extension modules lack a code object." msgstr "" -#: ../../library/importlib.rst:1139 +#: ../../library/importlib.rst:1118 msgid "Returns ``None`` as extension modules do not have source code." msgstr "" -#: ../../library/importlib.rst:1150 +#: ../../library/importlib.rst:1129 msgid "" "A concrete implementation of :class:`importlib.abc.InspectLoader` for " "namespace packages. This is an alias for a private class and is only made " "public for introspecting the ``__loader__`` attribute on namespace packages::" msgstr "" -#: ../../library/importlib.rst:1155 +#: ../../library/importlib.rst:1134 msgid "" ">>> from importlib.machinery import NamespaceLoader\n" ">>> import my_namespace\n" @@ -1423,88 +1385,90 @@ msgstr "" ">>> isinstance(my_namespace.__loader__, importlib.abc.Loader)\n" "True" -#: ../../library/importlib.rst:1168 +#: ../../library/importlib.rst:1147 msgid "" "A specification for a module's import-system-related state. This is " -"typically exposed as the module's :attr:`__spec__` attribute. Many of these " -"attributes are also available directly on a module: for example, ``module." -"__spec__.origin == module.__file__``. Note, however, that while the " -"*values* are usually equivalent, they can differ since there is no " +"typically exposed as the module's :attr:`~module.__spec__` attribute. Many " +"of these attributes are also available directly on a module: for example, " +"``module.__spec__.origin == module.__file__``. Note, however, that while " +"the *values* are usually equivalent, they can differ since there is no " "synchronization between the two objects. For example, it is possible to " -"update the module's :attr:`__file__` at runtime and this will not be " -"automatically reflected in the module's :attr:`__spec__.origin`, and vice " -"versa." +"update the module's :attr:`~module.__file__` at runtime and this will not be " +"automatically reflected in the module's :attr:`__spec__.origin `, and vice versa." msgstr "" -#: ../../library/importlib.rst:1181 +#: ../../library/importlib.rst:1161 msgid "" -"The module's fully qualified name (see :attr:`__name__` attributes on " -"modules). The :term:`finder` should always set this attribute to a non-empty " -"string." +"The module's fully qualified name (see :attr:`module.__name__`). The :term:" +"`finder` should always set this attribute to a non-empty string." msgstr "" -#: ../../library/importlib.rst:1187 +#: ../../library/importlib.rst:1166 msgid "" -"The :term:`loader` used to load the module (see :attr:`__loader__` " -"attributes on modules). The :term:`finder` should always set this attribute." +"The :term:`loader` used to load the module (see :attr:`module.__loader__`). " +"The :term:`finder` should always set this attribute." msgstr "" -#: ../../library/importlib.rst:1193 +#: ../../library/importlib.rst:1171 msgid "" "The location the :term:`loader` should use to load the module (see :attr:" -"`__file__` attributes on modules). For example, for modules loaded from a ." -"py file this is the filename. The :term:`finder` should always set this " -"attribute to a meaningful value for the :term:`loader` to use. In the " -"uncommon case that there is not one (like for namespace packages), it should " -"be set to ``None``." +"`module.__file__`). For example, for modules loaded from a ``.py`` file this " +"is the filename. The :term:`finder` should always set this attribute to a " +"meaningful value for the :term:`loader` to use. In the uncommon case that " +"there is not one (like for namespace packages), it should be set to ``None``." msgstr "" -#: ../../library/importlib.rst:1202 +#: ../../library/importlib.rst:1180 msgid "" -"The list of locations where the package's submodules will be found (see :" -"attr:`__path__` attributes on modules). Most of the time this is a single " -"directory. The :term:`finder` should set this attribute to a list, even an " -"empty one, to indicate to the import system that the module is a package. " -"It should be set to ``None`` for non-package modules. It is set " -"automatically later to a special object for namespace packages." +"A (possibly empty) :term:`sequence` of strings enumerating the locations in " +"which a package's submodules will be found (see :attr:`module.__path__`). " +"Most of the time there will only be a single directory in this list." msgstr "" -#: ../../library/importlib.rst:1212 +#: ../../library/importlib.rst:1185 +msgid "" +"The :term:`finder` should set this attribute to a sequence, even an empty " +"one, to indicate to the import system that the module is a package. It " +"should be set to ``None`` for non-package modules. It is set automatically " +"later to a special object for namespace packages." +msgstr "" + +#: ../../library/importlib.rst:1193 msgid "" "The :term:`finder` may set this attribute to an object containing " "additional, module-specific data to use when loading the module. Otherwise " "it should be set to ``None``." msgstr "" -#: ../../library/importlib.rst:1218 +#: ../../library/importlib.rst:1199 msgid "" -"The filename of a compiled version of the module's code (see :attr:" -"`__cached__` attributes on modules). The :term:`finder` should always set " -"this attribute but it may be ``None`` for modules that do not need compiled " -"code stored." +"The filename of a compiled version of the module's code (see :attr:`module." +"__cached__`). The :term:`finder` should always set this attribute but it may " +"be ``None`` for modules that do not need compiled code stored." msgstr "" -#: ../../library/importlib.rst:1225 +#: ../../library/importlib.rst:1206 msgid "" "(Read-only) The fully qualified name of the package the module is in (or the " -"empty string for a top-level module). See :attr:`__package__` attributes on " -"modules. If the module is a package then this is the same as :attr:`name`." +"empty string for a top-level module). See :attr:`module.__package__`. If the " +"module is a package then this is the same as :attr:`name`." msgstr "" -#: ../../library/importlib.rst:1232 +#: ../../library/importlib.rst:1213 msgid "" "``True`` if the spec's :attr:`origin` refers to a loadable location, " -"``False`` otherwise. This value impacts how :attr:`origin` is interpreted " -"and how the module's :attr:`__file__` is populated." +"``False`` otherwise. This value impacts how :attr:`!origin` is interpreted " +"and how the module's :attr:`~module.__file__` is populated." msgstr "" -#: ../../library/importlib.rst:1239 +#: ../../library/importlib.rst:1220 msgid "" "A specialization of :class:`importlib.machinery.ExtensionFileLoader` that is " "able to load extension modules in Framework format." msgstr "" -#: ../../library/importlib.rst:1242 +#: ../../library/importlib.rst:1223 msgid "" "For compatibility with the iOS App Store, *all* binary modules in an iOS app " "must be dynamic libraries, contained in a framework with appropriate " @@ -1513,7 +1477,7 @@ msgid "" "material outside the Frameworks folder." msgstr "" -#: ../../library/importlib.rst:1248 +#: ../../library/importlib.rst:1229 msgid "" "To accommodate this requirement, when running on iOS, extension module " "binaries are *not* packaged as ``.so`` files on ``sys.path``, but as " @@ -1527,7 +1491,7 @@ msgid "" "fwork`` file, relative to the app bundle." msgstr "" -#: ../../library/importlib.rst:1259 +#: ../../library/importlib.rst:1240 msgid "" "For example, consider the case of an import ``from foo.bar import _whiz``, " "where ``_whiz`` is implemented with the binary module ``sources/foo/bar/" @@ -1543,7 +1507,7 @@ msgid "" "_whiz.origin``, containing the path to the ``.fwork`` file." msgstr "" -#: ../../library/importlib.rst:1273 +#: ../../library/importlib.rst:1254 msgid "" "When a module is loaded with this loader, the ``__file__`` for the module " "will report as the location of the ``.fwork`` file. This allows code to use " @@ -1552,7 +1516,7 @@ msgid "" "in the ``.framework`` folder." msgstr "" -#: ../../library/importlib.rst:1279 +#: ../../library/importlib.rst:1260 msgid "" "The Xcode project building the app is responsible for converting any ``.so`` " "files from wherever they exist in the ``PYTHONPATH`` into frameworks in the " @@ -1563,35 +1527,35 @@ msgid "" "details on how to construct this build step." msgstr "" -#: ../../library/importlib.rst:1289 -msgid ":ref:`Availability `: iOS." +#: ../../library/importlib.rst:1270 +msgid "Availability" msgstr "" -#: ../../library/importlib.rst:1297 +#: ../../library/importlib.rst:1278 msgid "Path to the ``.fwork`` file for the extension module." msgstr "" -#: ../../library/importlib.rst:1301 +#: ../../library/importlib.rst:1282 msgid ":mod:`importlib.util` -- Utility code for importers" msgstr "" -#: ../../library/importlib.rst:1307 +#: ../../library/importlib.rst:1288 msgid "**Source code:** :source:`Lib/importlib/util.py`" msgstr "**原始碼:**\\ :source:`Lib/importlib/util.py`" -#: ../../library/importlib.rst:1311 +#: ../../library/importlib.rst:1292 msgid "" "This module contains the various objects that help in the construction of " "an :term:`importer`." msgstr "" -#: ../../library/importlib.rst:1316 +#: ../../library/importlib.rst:1297 msgid "" "The bytes which represent the bytecode version number. If you need help with " "loading/writing bytecode then consider :class:`importlib.abc.SourceLoader`." msgstr "" -#: ../../library/importlib.rst:1323 +#: ../../library/importlib.rst:1304 msgid "" "Return the :pep:`3147`/:pep:`488` path to the byte-compiled file associated " "with the source *path*. For example, if *path* is ``/foo/bar/baz.py`` the " @@ -1601,7 +1565,7 @@ msgid "" "`NotImplementedError` will be raised)." msgstr "" -#: ../../library/importlib.rst:1330 +#: ../../library/importlib.rst:1311 msgid "" "The *optimization* parameter is used to specify the optimization level of " "the bytecode file. An empty string represents no optimization, so ``/foo/bar/" @@ -1614,7 +1578,7 @@ msgid "" "be alphanumeric, else :exc:`ValueError` is raised." msgstr "" -#: ../../library/importlib.rst:1340 +#: ../../library/importlib.rst:1321 msgid "" "The *debug_override* parameter is deprecated and can be used to override the " "system's value for ``__debug__``. A ``True`` value is the equivalent of " @@ -1623,18 +1587,18 @@ msgid "" "are not ``None`` then :exc:`TypeError` is raised." msgstr "" -#: ../../library/importlib.rst:1348 +#: ../../library/importlib.rst:1329 msgid "" "The *optimization* parameter was added and the *debug_override* parameter " "was deprecated." msgstr "" -#: ../../library/importlib.rst:1352 ../../library/importlib.rst:1368 -#: ../../library/importlib.rst:1457 +#: ../../library/importlib.rst:1333 ../../library/importlib.rst:1349 +#: ../../library/importlib.rst:1438 msgid "Accepts a :term:`path-like object`." msgstr "" -#: ../../library/importlib.rst:1358 +#: ../../library/importlib.rst:1339 msgid "" "Given the *path* to a :pep:`3147` file name, return the associated source " "code file path. For example, if *path* is ``/foo/bar/__pycache__/baz." @@ -1644,25 +1608,25 @@ msgid "" "cache_tag` is not defined, :exc:`NotImplementedError` is raised." msgstr "" -#: ../../library/importlib.rst:1373 +#: ../../library/importlib.rst:1354 msgid "" "Decode the given bytes representing source code and return it as a string " "with universal newlines (as required by :meth:`importlib.abc.InspectLoader." "get_source`)." msgstr "" -#: ../../library/importlib.rst:1381 +#: ../../library/importlib.rst:1362 msgid "Resolve a relative module name to an absolute one." msgstr "" -#: ../../library/importlib.rst:1383 +#: ../../library/importlib.rst:1364 msgid "" "If **name** has no leading dots, then **name** is simply returned. This " "allows for usage such as ``importlib.util.resolve_name('sys', __spec__." "parent)`` without doing a check to see if the **package** argument is needed." msgstr "" -#: ../../library/importlib.rst:1388 +#: ../../library/importlib.rst:1369 msgid "" ":exc:`ImportError` is raised if **name** is a relative module name but " "**package** is a false value (e.g. ``None`` or the empty string). :exc:" @@ -1670,13 +1634,13 @@ msgid "" "package (e.g. requesting ``..bacon`` from within the ``spam`` package)." msgstr "" -#: ../../library/importlib.rst:1396 +#: ../../library/importlib.rst:1377 msgid "" "To improve consistency with import statements, raise :exc:`ImportError` " "instead of :exc:`ValueError` for invalid relative import attempts." msgstr "" -#: ../../library/importlib.rst:1403 +#: ../../library/importlib.rst:1384 msgid "" "Find the :term:`spec ` for a module, optionally relative to the " "specified **package** name. If the module is in :data:`sys.modules`, then " @@ -1686,30 +1650,30 @@ msgid "" "if no spec is found." msgstr "" -#: ../../library/importlib.rst:1410 +#: ../../library/importlib.rst:1391 msgid "" "If **name** is for a submodule (contains a dot), the parent module is " "automatically imported." msgstr "" -#: ../../library/importlib.rst:1413 +#: ../../library/importlib.rst:1394 msgid "**name** and **package** work the same as for :func:`import_module`." msgstr "" -#: ../../library/importlib.rst:1417 +#: ../../library/importlib.rst:1398 msgid "" "Raises :exc:`ModuleNotFoundError` instead of :exc:`AttributeError` if " -"**package** is in fact not a package (i.e. lacks a :attr:`__path__` " +"**package** is in fact not a package (i.e. lacks a :attr:`~module.__path__` " "attribute)." msgstr "" -#: ../../library/importlib.rst:1424 +#: ../../library/importlib.rst:1405 msgid "" "Create a new module based on **spec** and :meth:`spec.loader.create_module " "`." msgstr "" -#: ../../library/importlib.rst:1427 +#: ../../library/importlib.rst:1408 msgid "" "If :meth:`spec.loader.create_module ` " "does not return ``None``, then any pre-existing attributes will not be " @@ -1717,14 +1681,14 @@ msgid "" "accessing **spec** or setting an attribute on the module." msgstr "" -#: ../../library/importlib.rst:1432 +#: ../../library/importlib.rst:1413 msgid "" "This function is preferred over using :class:`types.ModuleType` to create a " "new module as **spec** is used to set as many import-controlled attributes " "on the module as possible." msgstr "" -#: ../../library/importlib.rst:1440 +#: ../../library/importlib.rst:1421 msgid "" "A factory function for creating a :class:`~importlib.machinery.ModuleSpec` " "instance based on a loader. The parameters have the same meaning as they do " @@ -1733,7 +1697,7 @@ msgid "" "spec." msgstr "" -#: ../../library/importlib.rst:1450 +#: ../../library/importlib.rst:1431 msgid "" "A factory function for creating a :class:`~importlib.machinery.ModuleSpec` " "instance based on the path to a file. Missing information will be filled in " @@ -1741,14 +1705,14 @@ msgid "" "module will be file-based." msgstr "" -#: ../../library/importlib.rst:1462 +#: ../../library/importlib.rst:1443 msgid "" "Return the hash of *source_bytes* as bytes. A hash-based ``.pyc`` file " "embeds the :func:`source_hash` of the corresponding source file's contents " "in its header." msgstr "" -#: ../../library/importlib.rst:1470 +#: ../../library/importlib.rst:1451 msgid "" "A context manager that can temporarily skip the compatibility check for " "extension modules. By default the check is enabled and will fail when a " @@ -1757,33 +1721,33 @@ msgid "" "interpreter GIL, when imported in an interpreter with its own GIL." msgstr "" -#: ../../library/importlib.rst:1477 +#: ../../library/importlib.rst:1458 msgid "" "Note that this function is meant to accommodate an unusual case; one which " "is likely to eventually go away. There's is a pretty good chance this is " "not what you were looking for." msgstr "" -#: ../../library/importlib.rst:1481 +#: ../../library/importlib.rst:1462 msgid "" "You can get the same effect as this function by implementing the basic " "interface of multi-phase init (:pep:`489`) and lying about support for " "multiple interpreters (or per-interpreter GIL)." msgstr "" -#: ../../library/importlib.rst:1486 +#: ../../library/importlib.rst:1467 msgid "" "Using this function to disable the check can lead to unexpected behavior and " "even crashes. It should only be used during extension module development." msgstr "" -#: ../../library/importlib.rst:1494 +#: ../../library/importlib.rst:1475 msgid "" "A class which postpones the execution of the loader of a module until the " "module has an attribute accessed." msgstr "" -#: ../../library/importlib.rst:1497 +#: ../../library/importlib.rst:1478 msgid "" "This class **only** works with loaders that define :meth:`~importlib.abc." "Loader.exec_module` as control over what module type is used for the module " @@ -1796,7 +1760,7 @@ msgid "" "raised if such a substitution is detected." msgstr "" -#: ../../library/importlib.rst:1508 +#: ../../library/importlib.rst:1489 msgid "" "For projects where startup time is critical, this class allows for " "potentially minimizing the cost of loading a module if it is never used. For " @@ -1805,21 +1769,21 @@ msgid "" "postponed and thus occurring out of context." msgstr "" -#: ../../library/importlib.rst:1516 +#: ../../library/importlib.rst:1497 msgid "" "Began calling :meth:`~importlib.abc.Loader.create_module`, removing the " "compatibility warning for :class:`importlib.machinery.BuiltinImporter` and :" "class:`importlib.machinery.ExtensionFileLoader`." msgstr "" -#: ../../library/importlib.rst:1523 +#: ../../library/importlib.rst:1504 msgid "" "A class method which returns a callable that creates a lazy loader. This is " "meant to be used in situations where the loader is passed by class instead " "of by instance. ::" msgstr "" -#: ../../library/importlib.rst:1528 +#: ../../library/importlib.rst:1509 msgid "" "suffixes = importlib.machinery.SOURCE_SUFFIXES\n" "loader = importlib.machinery.SourceFileLoader\n" @@ -1831,20 +1795,20 @@ msgstr "" "lazy_loader = importlib.util.LazyLoader.factory(loader)\n" "finder = importlib.machinery.FileFinder(path, (lazy_loader, suffixes))" -#: ../../library/importlib.rst:1536 +#: ../../library/importlib.rst:1517 msgid "Examples" msgstr "範例" -#: ../../library/importlib.rst:1539 +#: ../../library/importlib.rst:1520 msgid "Importing programmatically" msgstr "" -#: ../../library/importlib.rst:1541 +#: ../../library/importlib.rst:1522 msgid "" "To programmatically import a module, use :func:`importlib.import_module`. ::" msgstr "" -#: ../../library/importlib.rst:1544 +#: ../../library/importlib.rst:1525 msgid "" "import importlib\n" "\n" @@ -1854,23 +1818,23 @@ msgstr "" "\n" "itertools = importlib.import_module('itertools')" -#: ../../library/importlib.rst:1550 +#: ../../library/importlib.rst:1531 msgid "Checking if a module can be imported" msgstr "" -#: ../../library/importlib.rst:1552 +#: ../../library/importlib.rst:1533 msgid "" "If you need to find out if a module can be imported without actually doing " "the import, then you should use :func:`importlib.util.find_spec`." msgstr "" -#: ../../library/importlib.rst:1555 +#: ../../library/importlib.rst:1536 msgid "" "Note that if ``name`` is a submodule (contains a dot), :func:`importlib.util." "find_spec` will import the parent module. ::" msgstr "" -#: ../../library/importlib.rst:1559 +#: ../../library/importlib.rst:1540 msgid "" "import importlib.util\n" "import sys\n" @@ -1890,11 +1854,11 @@ msgid "" " print(f\"can't find the {name!r} module\")" msgstr "" -#: ../../library/importlib.rst:1578 +#: ../../library/importlib.rst:1559 msgid "Importing a source file directly" msgstr "" -#: ../../library/importlib.rst:1580 +#: ../../library/importlib.rst:1561 msgid "" "This recipe should be used with caution: it is an approximation of an import " "statement where the file path is specified directly, rather than :data:`sys." @@ -1904,13 +1868,13 @@ msgid "" "file is appropriate." msgstr "" -#: ../../library/importlib.rst:1587 +#: ../../library/importlib.rst:1568 msgid "" "To import a Python source file directly from a path, use the following " "recipe::" msgstr "" -#: ../../library/importlib.rst:1589 +#: ../../library/importlib.rst:1570 msgid "" "import importlib.util\n" "import sys\n" @@ -1933,15 +1897,15 @@ msgid "" "json = import_from_path(module_name, file_path)" msgstr "" -#: ../../library/importlib.rst:1611 +#: ../../library/importlib.rst:1592 msgid "Implementing lazy imports" msgstr "" -#: ../../library/importlib.rst:1613 +#: ../../library/importlib.rst:1594 msgid "The example below shows how to implement lazy imports::" msgstr "" -#: ../../library/importlib.rst:1615 +#: ../../library/importlib.rst:1596 msgid "" ">>> import importlib.util\n" ">>> import sys\n" @@ -1961,11 +1925,11 @@ msgid "" "False" msgstr "" -#: ../../library/importlib.rst:1634 +#: ../../library/importlib.rst:1615 msgid "Setting up an importer" msgstr "" -#: ../../library/importlib.rst:1636 +#: ../../library/importlib.rst:1617 msgid "" "For deep customizations of import, you typically want to implement an :term:" "`importer`. This means managing both the :term:`finder` and :term:`loader` " @@ -1979,7 +1943,7 @@ msgid "" "for the appropriate classes defined within this package)::" msgstr "" -#: ../../library/importlib.rst:1647 +#: ../../library/importlib.rst:1628 msgid "" "import importlib.machinery\n" "import sys\n" @@ -2003,11 +1967,11 @@ msgid "" "sys.path_hooks.append(SpamPathEntryFinder.path_hook(loader_details))" msgstr "" -#: ../../library/importlib.rst:1668 +#: ../../library/importlib.rst:1649 msgid "Approximating :func:`importlib.import_module`" msgstr "" -#: ../../library/importlib.rst:1670 +#: ../../library/importlib.rst:1651 msgid "" "Import itself is implemented in Python code, making it possible to expose " "most of the import machinery through importlib. The following helps " @@ -2015,7 +1979,7 @@ msgid "" "approximate implementation of :func:`importlib.import_module`::" msgstr "" -#: ../../library/importlib.rst:1676 +#: ../../library/importlib.rst:1657 msgid "" "import importlib.util\n" "import sys\n" @@ -2048,28 +2012,28 @@ msgid "" " return module" msgstr "" -#: ../../library/importlib.rst:443 +#: ../../library/importlib.rst:422 msgid "universal newlines" msgstr "universal newlines" -#: ../../library/importlib.rst:443 +#: ../../library/importlib.rst:422 msgid "importlib.abc.InspectLoader.get_source method" msgstr "importlib.abc.InspectLoader.get_source 方法" +#~ msgid ":attr:`__cached__`" +#~ msgstr ":attr:`__cached__`" + +#~ msgid ":attr:`__package__`" +#~ msgstr ":attr:`__package__`" + +#~ msgid ":attr:`__loader__`" +#~ msgstr ":attr:`__loader__`" + #~ msgid "(:attr:`__name__`)" #~ msgstr "(:attr:`__name__`)" -#~ msgid "(:attr:`__loader__`)" -#~ msgstr "(:attr:`__loader__`)" - #~ msgid "(:attr:`__file__`)" #~ msgstr "(:attr:`__file__`)" #~ msgid "(:attr:`__path__`)" #~ msgstr "(:attr:`__path__`)" - -#~ msgid "(:attr:`__cached__`)" -#~ msgstr "(:attr:`__cached__`)" - -#~ msgid "(:attr:`__package__`)" -#~ msgstr "(:attr:`__package__`)" diff --git a/library/itertools.po b/library/itertools.po index cd3e78c8ca..b02809e1e2 100644 --- a/library/itertools.po +++ b/library/itertools.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-09 00:13+0000\n" "PO-Revision-Date: 2024-08-16 15:01+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -259,6 +259,10 @@ msgstr "iterable[, key]" msgid "sub-iterators grouped by value of key(v)" msgstr "根據 key(v) 的值分組的子疊代器" +#: ../../library/itertools.rst:61 +msgid "``groupby(['A','B','DEF'], len) → (1, A B) (3, DEF)``" +msgstr "``groupby(['A','B','DEF'], len) → (1, A B) (3, DEF)``" + #: ../../library/itertools.rst:62 msgid ":func:`islice`" msgstr ":func:`islice`" @@ -429,12 +433,12 @@ msgstr "Itertool 函式" #: ../../library/itertools.rst:96 msgid "" -"The following module functions all construct and return iterators. Some " -"provide streams of infinite length, so they should only be accessed by " -"functions or loops that truncate the stream." +"The following functions all construct and return iterators. Some provide " +"streams of infinite length, so they should only be accessed by functions or " +"loops that truncate the stream." msgstr "" -"以下的模組函式都會建構並回傳疊代器。一些函式提供無限長度的串流 (stream),因此" -"應僅由截斷串流的函式或迴圈來存取它們。" +"以下的函式都會建構並回傳疊代器。一些函式提供無限長度的串流 (stream),因此應僅" +"由截斷串流的函式或迴圈來存取它們。" #: ../../library/itertools.rst:103 msgid "" @@ -458,11 +462,11 @@ msgstr "" "如果提供了 *initial* 值,則累積將從該值開始,並且輸出的元素數將比輸入的可疊代" "物件多一個。" -#: ../../library/itertools.rst:113 ../../library/itertools.rst:185 -#: ../../library/itertools.rst:244 ../../library/itertools.rst:287 -#: ../../library/itertools.rst:484 ../../library/itertools.rst:515 -#: ../../library/itertools.rst:550 ../../library/itertools.rst:623 -#: ../../library/itertools.rst:684 ../../library/itertools.rst:726 +#: ../../library/itertools.rst:113 ../../library/itertools.rst:186 +#: ../../library/itertools.rst:245 ../../library/itertools.rst:288 +#: ../../library/itertools.rst:489 ../../library/itertools.rst:524 +#: ../../library/itertools.rst:561 ../../library/itertools.rst:637 +#: ../../library/itertools.rst:698 ../../library/itertools.rst:779 msgid "Roughly equivalent to::" msgstr "大致等價於: ::" @@ -490,18 +494,18 @@ msgstr "" #: ../../library/itertools.rst:134 msgid "" -"The *function* argument can be set to :func:`min` for a running minimum, :" -"func:`max` for a running maximum, or :func:`operator.mul` for a running " -"product. `Amortization tables `_ can be built by accumulating interest and applying " -"payments:" +"To compute a running minimum, set *function* to :func:`min`. For a running " +"maximum, set *function* to :func:`max`. Or for a running product, set " +"*function* to :func:`operator.mul`. To build an `amortization table `_, accumulate the " +"interest and apply payments:" msgstr "" "*function* 引數可以被設定為 :func:`min` 以得到連續的最小值,設定為 :func:" "`max` 以得到連續的最大值,或者設定為 :func:`operator.mul` 以得到連續的乘積。" "也可以透過累積利息和付款來建立\\ `攤銷表 (Amortization tables) `_ :" -#: ../../library/itertools.rst:140 +#: ../../library/itertools.rst:141 msgid "" ">>> data = [3, 4, 6, 2, 1, 9, 0, 7, 5, 8]\n" ">>> list(accumulate(data, max)) # running maximum\n" @@ -515,35 +519,35 @@ msgid "" "[1000, 960, 918, 874, 828, 779, 728, 674, 618, 559, 497]" msgstr "" -#: ../../library/itertools.rst:153 +#: ../../library/itertools.rst:154 msgid "" "See :func:`functools.reduce` for a similar function that returns only the " "final accumulated value." msgstr "" "可參見 :func:`functools.reduce`,其是個類似的函式,但僅回傳最終的累積值。" -#: ../../library/itertools.rst:158 +#: ../../library/itertools.rst:159 msgid "Added the optional *function* parameter." msgstr "新增可選的 *function* 參數。" -#: ../../library/itertools.rst:161 +#: ../../library/itertools.rst:162 msgid "Added the optional *initial* parameter." msgstr "新增可選的 *initial* 參數。" -#: ../../library/itertools.rst:167 +#: ../../library/itertools.rst:168 msgid "" "Batch data from the *iterable* into tuples of length *n*. The last batch may " "be shorter than *n*." msgstr "" "將來自 *iterable* 的資料分批為長度為 *n* 的元組。最後一個批次可能比 *n* 短。" -#: ../../library/itertools.rst:170 +#: ../../library/itertools.rst:171 msgid "" "If *strict* is true, will raise a :exc:`ValueError` if the final batch is " "shorter than *n*." msgstr "" -#: ../../library/itertools.rst:173 +#: ../../library/itertools.rst:174 msgid "" "Loops over the input iterable and accumulates data into tuples up to size " "*n*. The input is consumed lazily, just enough to fill a batch. The result " @@ -554,7 +558,7 @@ msgstr "" "消耗 (consumed lazily) 的,會剛好足夠填充一批的資料。一旦批次填滿或輸入的可疊" "代物件耗盡,就會 yield 出結果:" -#: ../../library/itertools.rst:178 +#: ../../library/itertools.rst:179 msgid "" ">>> flattened_data = ['roses', 'red', 'violets', 'blue', 'sugar', 'sweet']\n" ">>> unflattened = list(batched(flattened_data, 2))\n" @@ -566,8 +570,7 @@ msgstr "" ">>> unflattened\n" "[('roses', 'red'), ('violets', 'blue'), ('sugar', 'sweet')]" -#: ../../library/itertools.rst:187 -#, fuzzy +#: ../../library/itertools.rst:188 msgid "" "def batched(iterable, n, *, strict=False):\n" " # batched('ABCDEFG', 3) → ABC DEF G\n" @@ -579,30 +582,32 @@ msgid "" " raise ValueError('batched(): incomplete batch')\n" " yield batch" msgstr "" -"def batched(iterable, n):\n" +"def batched(iterable, n, *, strict=False):\n" " # batched('ABCDEFG', 3) → ABC DEF G\n" " if n < 1:\n" " raise ValueError('n must be at least one')\n" " iterator = iter(iterable)\n" " while batch := tuple(islice(iterator, n)):\n" +" if strict and len(batch) != n:\n" +" raise ValueError('batched(): incomplete batch')\n" " yield batch" -#: ../../library/itertools.rst:199 +#: ../../library/itertools.rst:200 msgid "Added the *strict* option." -msgstr "" +msgstr "新增 *strict* 選項。" -#: ../../library/itertools.rst:205 +#: ../../library/itertools.rst:206 msgid "" "Make an iterator that returns elements from the first iterable until it is " "exhausted, then proceeds to the next iterable, until all of the iterables " -"are exhausted. Used for treating consecutive sequences as a single " -"sequence. Roughly equivalent to::" +"are exhausted. This combines multiple data sources into a single iterator. " +"Roughly equivalent to::" msgstr "" "建立一個疊代器,從第一個可疊代物件回傳元素直到其耗盡,然後繼續處理下一個可疊" -"代物件,直到所有可疊代物件都耗盡。用於將連續的序列做為單一序列處理。大致等價" -"於: ::" +"代物件,直到所有可疊代物件都耗盡。這將多個資料來源結合為單一個疊代器。大致等" +"價於: ::" -#: ../../library/itertools.rst:210 +#: ../../library/itertools.rst:211 msgid "" "def chain(*iterables):\n" " # chain('ABC', 'DEF') → A B C D E F\n" @@ -610,7 +615,7 @@ msgid "" " yield from iterable" msgstr "" -#: ../../library/itertools.rst:218 +#: ../../library/itertools.rst:219 msgid "" "Alternate constructor for :func:`chain`. Gets chained inputs from a single " "iterable argument that is evaluated lazily. Roughly equivalent to::" @@ -618,7 +623,7 @@ msgstr "" ":func:`chain` 的另一個建構函式。從單個可疊代的引數中得到鏈接的輸入,該引數是" "惰性計算的。大致等價於:" -#: ../../library/itertools.rst:221 +#: ../../library/itertools.rst:222 msgid "" "def from_iterable(iterables):\n" " # chain.from_iterable(['ABC', 'DEF']) → A B C D E F\n" @@ -630,11 +635,11 @@ msgstr "" " for iterable in iterables:\n" " yield from iterable" -#: ../../library/itertools.rst:229 +#: ../../library/itertools.rst:230 msgid "Return *r* length subsequences of elements from the input *iterable*." msgstr "從輸入 *iterable* 中回傳長度為 *r* 的元素的子序列。" -#: ../../library/itertools.rst:231 +#: ../../library/itertools.rst:232 msgid "" "The output is a subsequence of :func:`product` keeping only entries that are " "subsequences of the *iterable*. The length of the output is given by :func:" @@ -645,7 +650,7 @@ msgstr "" "度由 :func:`math.comb` 給定,當 ``0 ≤ r ≤ n`` 時,長度為 ``n! / r! / (n - r)!" "``,當 ``r > n`` 時為零。" -#: ../../library/itertools.rst:236 +#: ../../library/itertools.rst:237 msgid "" "The combination tuples are emitted in lexicographic order according to the " "order of the input *iterable*. If the input *iterable* is sorted, the output " @@ -654,7 +659,7 @@ msgstr "" "根據輸入值 *iterable* 的順序,組合的元組會按照字典順序輸出。如果輸入的 " "*iterable* 已經排序,則輸出的元組也將按排序的順序產生。" -#: ../../library/itertools.rst:240 +#: ../../library/itertools.rst:241 msgid "" "Elements are treated as unique based on their position, not on their value. " "If the input elements are unique, there will be no repeated values within " @@ -663,7 +668,7 @@ msgstr "" "元素是根據它們的位置(而非值)來決定其唯一性。如果輸入的元素都是獨特的,則每" "個組合內將不會有重複的值。" -#: ../../library/itertools.rst:246 +#: ../../library/itertools.rst:247 msgid "" "def combinations(iterable, r):\n" " # combinations('ABCD', 2) → AB AC AD BC BD CD\n" @@ -688,14 +693,14 @@ msgid "" " yield tuple(pool[i] for i in indices)" msgstr "" -#: ../../library/itertools.rst:271 +#: ../../library/itertools.rst:272 msgid "" "Return *r* length subsequences of elements from the input *iterable* " "allowing individual elements to be repeated more than once." msgstr "" "回傳來自輸入 *iterable* 的長度為 *r* 的子序列,且允許個別元素重複多次。" -#: ../../library/itertools.rst:274 +#: ../../library/itertools.rst:275 msgid "" "The output is a subsequence of :func:`product` that keeps only entries that " "are subsequences (with possible repeated elements) of the *iterable*. The " @@ -706,7 +711,7 @@ msgstr "" "複元素)的條目。當 ``n > 0`` 時,回傳的子序列數量為 ``(n + r - 1)! / r! / (n " "- 1)!``。" -#: ../../library/itertools.rst:279 +#: ../../library/itertools.rst:280 msgid "" "The combination tuples are emitted in lexicographic order according to the " "order of the input *iterable*. if the input *iterable* is sorted, the output " @@ -715,7 +720,7 @@ msgstr "" "根據輸入值 *iterable* 的順序,組合的元組會按照字典順序輸出。如果輸入的 " "*iterable* 已經排序,則輸出的元組也將按排序的順序產生。" -#: ../../library/itertools.rst:283 +#: ../../library/itertools.rst:284 msgid "" "Elements are treated as unique based on their position, not on their value. " "If the input elements are unique, the generated combinations will also be " @@ -724,7 +729,7 @@ msgstr "" "元素是根據它們的位置(而非值)來決定其唯一性。如果輸入的元素都是獨特的,生成" "的組合也將是獨特的。" -#: ../../library/itertools.rst:289 +#: ../../library/itertools.rst:290 msgid "" "def combinations_with_replacement(iterable, r):\n" " # combinations_with_replacement('ABC', 2) → AA AB AC BB BC CC\n" @@ -746,7 +751,7 @@ msgid "" " yield tuple(pool[i] for i in indices)" msgstr "" -#: ../../library/itertools.rst:313 +#: ../../library/itertools.rst:314 msgid "" "Make an iterator that returns elements from *data* where the corresponding " "element in *selectors* is true. Stops when either the *data* or *selectors* " @@ -755,14 +760,14 @@ msgstr "" "建立一個疊代器,回傳 *data* 中對應 *selectors* 的元素為 true 的元素。當 " "*data* 或 *selectors* 可疊代物件耗盡時停止。大致等價於: ::" -#: ../../library/itertools.rst:318 +#: ../../library/itertools.rst:319 msgid "" "def compress(data, selectors):\n" " # compress('ABCDEF', [1,0,1,0,1,1]) → A C E F\n" " return (datum for datum, selector in zip(data, selectors) if selector)" msgstr "" -#: ../../library/itertools.rst:327 +#: ../../library/itertools.rst:328 msgid "" "Make an iterator that returns evenly spaced values beginning with *start*. " "Can be used with :func:`map` to generate consecutive data points or with :" @@ -771,7 +776,7 @@ msgstr "" "建立一個疊代器,回傳從 *start* 開始的等差的值。可以與 :func:`map` 一起使用來" "產生連續的資料點,或與 :func:`zip` 一起使用來增加序列號。大致等價於: ::" -#: ../../library/itertools.rst:332 +#: ../../library/itertools.rst:333 msgid "" "def count(start=0, step=1):\n" " # count(10) → 10 11 12 13 14 ...\n" @@ -789,7 +794,7 @@ msgstr "" " yield n\n" " n += step" -#: ../../library/itertools.rst:340 +#: ../../library/itertools.rst:341 msgid "" "When counting with floating-point numbers, better accuracy can sometimes be " "achieved by substituting multiplicative code such as: ``(start + step * i " @@ -798,11 +803,11 @@ msgstr "" "當用浮點數計數時,將上述程式碼替換為乘法有時可以獲得更好的精確度,例如:" "``(start + step * i for i in count())``。" -#: ../../library/itertools.rst:344 +#: ../../library/itertools.rst:345 msgid "Added *step* argument and allowed non-integer arguments." msgstr "新增 *step* 引數並允許非整數引數。" -#: ../../library/itertools.rst:350 +#: ../../library/itertools.rst:351 msgid "" "Make an iterator returning elements from the *iterable* and saving a copy of " "each. When the iterable is exhausted, return elements from the saved copy. " @@ -811,35 +816,39 @@ msgstr "" "建立一個疊代器,回傳 *iterable* 中的元素並保存每個元素的副本。當可疊代物件耗" "盡時,從保存的副本中回傳元素。會無限次的重複。大致等價於: ::" -#: ../../library/itertools.rst:354 +#: ../../library/itertools.rst:355 msgid "" "def cycle(iterable):\n" " # cycle('ABCD') → A B C D A B C D A B C D ...\n" +"\n" " saved = []\n" " for element in iterable:\n" " yield element\n" " saved.append(element)\n" +"\n" " while saved:\n" " for element in saved:\n" " yield element" msgstr "" "def cycle(iterable):\n" " # cycle('ABCD') → A B C D A B C D A B C D ...\n" +"\n" " saved = []\n" " for element in iterable:\n" " yield element\n" " saved.append(element)\n" +"\n" " while saved:\n" " for element in saved:\n" " yield element" -#: ../../library/itertools.rst:364 +#: ../../library/itertools.rst:367 msgid "" "This itertool may require significant auxiliary storage (depending on the " "length of the iterable)." msgstr "此 itertool 可能需要大量的輔助儲存空間(取決於可疊代物件的長度)。" -#: ../../library/itertools.rst:370 +#: ../../library/itertools.rst:373 msgid "" "Make an iterator that drops elements from the *iterable* while the " "*predicate* is true and afterwards returns every element. Roughly " @@ -848,7 +857,7 @@ msgstr "" "建立一個疊代器,在 *predicate* 為 true 時丟棄 *iterable* 中的元素,之後回傳每" "個元素。大致等價於:" -#: ../../library/itertools.rst:374 +#: ../../library/itertools.rst:377 msgid "" "def dropwhile(predicate, iterable):\n" " # dropwhile(lambda x: x<5, [1,4,6,3,8]) → 6 3 8\n" @@ -874,7 +883,7 @@ msgstr "" " for x in iterator:\n" " yield x" -#: ../../library/itertools.rst:386 +#: ../../library/itertools.rst:389 msgid "" "Note this does not produce *any* output until the predicate first becomes " "false, so this itertool may have a lengthy start-up time." @@ -882,7 +891,7 @@ msgstr "" "注意,在 predicate 首次變為 False 之前,這不會產生\\ *任何*\\ 輸出,所以此 " "itertool 可能會有較長的啟動時間。" -#: ../../library/itertools.rst:392 +#: ../../library/itertools.rst:395 msgid "" "Make an iterator that filters elements from the *iterable* returning only " "those for which the *predicate* returns a false value. If *predicate* is " @@ -891,25 +900,29 @@ msgstr "" "建立一個疊代器,過濾 *iterable* 中的元素,僅回傳 *predicate* 為 False 值的元" "素。如果 *predicate* 是 ``None``,則回傳為 False 的項目。大致等價於: ::" -#: ../../library/itertools.rst:397 +#: ../../library/itertools.rst:400 msgid "" "def filterfalse(predicate, iterable):\n" " # filterfalse(lambda x: x<5, [1,4,6,3,8]) → 6 8\n" +"\n" " if predicate is None:\n" " predicate = bool\n" +"\n" " for x in iterable:\n" " if not predicate(x):\n" " yield x" msgstr "" "def filterfalse(predicate, iterable):\n" " # filterfalse(lambda x: x<5, [1,4,6,3,8]) → 6 8\n" +"\n" " if predicate is None:\n" " predicate = bool\n" +"\n" " for x in iterable:\n" " if not predicate(x):\n" " yield x" -#: ../../library/itertools.rst:408 +#: ../../library/itertools.rst:413 msgid "" "Make an iterator that returns consecutive keys and groups from the " "*iterable*. The *key* is a function computing a key value for each element. " @@ -922,7 +935,7 @@ msgstr "" "(identity function),並回傳未被更改的元素。一般來說,可疊代物件需要已經用相同" "的鍵函式進行排序。" -#: ../../library/itertools.rst:414 +#: ../../library/itertools.rst:419 msgid "" "The operation of :func:`groupby` is similar to the ``uniq`` filter in Unix. " "It generates a break or new group every time the value of the key function " @@ -935,7 +948,7 @@ msgstr "" "料進行排序)。這種行為不同於 SQL 的 GROUP BY,其無論輸入順序如何都會聚合相同" "的元素。" -#: ../../library/itertools.rst:420 +#: ../../library/itertools.rst:425 msgid "" "The returned group is itself an iterator that shares the underlying iterable " "with :func:`groupby`. Because the source is shared, when the :func:" @@ -946,7 +959,7 @@ msgstr "" "共享的,當 :func:`groupby` 物件前進時,前一個群組將不再可見。因此,如果之後需" "要該資料,應將其儲存為串列: ::" -#: ../../library/itertools.rst:425 +#: ../../library/itertools.rst:430 msgid "" "groups = []\n" "uniquekeys = []\n" @@ -956,11 +969,11 @@ msgid "" " uniquekeys.append(k)" msgstr "" -#: ../../library/itertools.rst:432 +#: ../../library/itertools.rst:437 msgid ":func:`groupby` is roughly equivalent to::" msgstr ":func:`groupby` 大致等價於: ::" -#: ../../library/itertools.rst:434 +#: ../../library/itertools.rst:439 msgid "" "def groupby(iterable, key=None):\n" " # [k for k, g in groupby('AAAABBBCCDAABBB')] → A B C D A B\n" @@ -1026,7 +1039,7 @@ msgstr "" " for _ in curr_group:\n" " pass" -#: ../../library/itertools.rst:470 +#: ../../library/itertools.rst:475 msgid "" "Make an iterator that returns selected elements from the iterable. Works " "like sequence slicing but does not support negative values for *start*, " @@ -1035,7 +1048,7 @@ msgstr "" "建立一個疊代器,回傳從 iterable 中選取的元素。其作用類似於序列切片 (sequence " "slicing),但不支援負數的 *start*、*stop* 或 *step* 的值。" -#: ../../library/itertools.rst:474 +#: ../../library/itertools.rst:479 msgid "" "If *start* is zero or ``None``, iteration starts at zero. Otherwise, " "elements from the iterable are skipped until *start* is reached." @@ -1043,15 +1056,15 @@ msgstr "" "如果 *start* 為零或 ``None``,則從零開始疊代。否則在達到 *start* 之前,會跳" "過 iterable 中的元素。" -#: ../../library/itertools.rst:477 +#: ../../library/itertools.rst:482 msgid "" -"If *stop* is ``None``, iteration continues until the iterator is exhausted, " -"if at all. Otherwise, it stops at the specified position." +"If *stop* is ``None``, iteration continues until the input is exhausted, if " +"at all. Otherwise, it stops at the specified position." msgstr "" -"如果 *stop* 為 ``None``,則疊代將繼續前進直到疊代器耗盡。如果指定了 *stop*," -"則在達到指定位置時停止。" +"如果 *stop* 為 ``None``,則疊代將繼續前進直到輸入耗盡。如果指定了 *stop*,則" +"在達到指定位置時停止。" -#: ../../library/itertools.rst:480 +#: ../../library/itertools.rst:485 msgid "" "If *step* is ``None``, the step defaults to one. Elements are returned " "consecutively unless *step* is set higher than one which results in items " @@ -1060,7 +1073,7 @@ msgstr "" "如果 *step* 為 ``None``,則步長 (step) 預設為一。元素會連續回傳,除非將 " "*step* 設定為大於一,這會導致一些項目被跳過。" -#: ../../library/itertools.rst:486 +#: ../../library/itertools.rst:491 msgid "" "def islice(iterable, *args):\n" " # islice('ABCDEFG', 2) → A B\n" @@ -1102,11 +1115,17 @@ msgstr "" " yield element\n" " next_i += step" -#: ../../library/itertools.rst:509 +#: ../../library/itertools.rst:511 +msgid "" +"If the input is an iterator, then fully consuming the *islice* advances the " +"input iterator by ``max(start, stop)`` steps regardless of the *step* value." +msgstr "" + +#: ../../library/itertools.rst:518 msgid "Return successive overlapping pairs taken from the input *iterable*." msgstr "回傳從輸入的 *iterable* 中提取的連續重疊對。" -#: ../../library/itertools.rst:511 +#: ../../library/itertools.rst:520 msgid "" "The number of 2-tuples in the output iterator will be one fewer than the " "number of inputs. It will be empty if the input iterable has fewer than two " @@ -1115,25 +1134,29 @@ msgstr "" "輸出疊代器中的 2 元組數量將比輸入少一個。如果輸入的可疊代物件中的值少於兩個," "則輸出將為空值。" -#: ../../library/itertools.rst:517 +#: ../../library/itertools.rst:526 msgid "" "def pairwise(iterable):\n" " # pairwise('ABCDEFG') → AB BC CD DE EF FG\n" +"\n" " iterator = iter(iterable)\n" " a = next(iterator, None)\n" +"\n" " for b in iterator:\n" " yield a, b\n" " a = b" msgstr "" "def pairwise(iterable):\n" " # pairwise('ABCDEFG') → AB BC CD DE EF FG\n" +"\n" " iterator = iter(iterable)\n" " a = next(iterator, None)\n" +"\n" " for b in iterator:\n" " yield a, b\n" " a = b" -#: ../../library/itertools.rst:530 +#: ../../library/itertools.rst:541 msgid "" "Return successive *r* length `permutations of elements `_ from the *iterable*." @@ -1141,7 +1164,7 @@ msgstr "" "回傳 *iterable* 中連續且長度為 *r* 的\\ `元素排列 `_ 。" -#: ../../library/itertools.rst:533 +#: ../../library/itertools.rst:544 msgid "" "If *r* is not specified or is ``None``, then *r* defaults to the length of " "the *iterable* and all possible full-length permutations are generated." @@ -1149,7 +1172,7 @@ msgstr "" "如果未指定 *r* 或其值為 ``None``,則 *r* 預設為 *iterable* 的長度,並產生所有" "可能的完整長度的排列。" -#: ../../library/itertools.rst:537 +#: ../../library/itertools.rst:548 msgid "" "The output is a subsequence of :func:`product` where entries with repeated " "elements have been filtered out. The length of the output is given by :func:" @@ -1160,7 +1183,7 @@ msgstr "" "func:`math.perm` 給定,當 ``0 ≤ r ≤ n`` 時,長度為 ``n! / (n - r)!``,當 ``r " "> n`` 時為零。" -#: ../../library/itertools.rst:542 +#: ../../library/itertools.rst:553 msgid "" "The permutation tuples are emitted in lexicographic order according to the " "order of the input *iterable*. If the input *iterable* is sorted, the " @@ -1169,7 +1192,7 @@ msgstr "" "根據輸入值 *iterable* 的順序,排列的元組會按照字典順序輸出。如果輸入的 " "*iterable* 已排序,則輸出的元組也將按排序的順序產生。" -#: ../../library/itertools.rst:546 +#: ../../library/itertools.rst:557 msgid "" "Elements are treated as unique based on their position, not on their value. " "If the input elements are unique, there will be no repeated values within a " @@ -1178,7 +1201,7 @@ msgstr "" "元素是根據它們的位置(而非值)來決定其唯一性。如果輸入的元素都是獨特的,則排" "列中將不會有重複的值。" -#: ../../library/itertools.rst:552 +#: ../../library/itertools.rst:563 msgid "" "def permutations(iterable, r=None):\n" " # permutations('ABCD', 2) → AB AC AD BA BC BD CA CB CD DA DB DC\n" @@ -1236,11 +1259,13 @@ msgstr "" " else:\n" " return" -#: ../../library/itertools.rst:583 -msgid "Cartesian product of input iterables." -msgstr "輸入的 iterables 的笛卡爾乘積。" +#: ../../library/itertools.rst:594 +msgid "" +"`Cartesian product `_ of " +"the input iterables." +msgstr "" -#: ../../library/itertools.rst:585 +#: ../../library/itertools.rst:597 msgid "" "Roughly equivalent to nested for-loops in a generator expression. For " "example, ``product(A, B)`` returns the same as ``((x,y) for x in A for y in " @@ -1249,7 +1274,7 @@ msgstr "" "大致等價於產生器運算式中的巢狀 for 迴圈。例如,``product(A, B)`` 的回傳結果" "與 ``((x,y) for x in A for y in B)`` 相同。" -#: ../../library/itertools.rst:588 +#: ../../library/itertools.rst:600 msgid "" "The nested loops cycle like an odometer with the rightmost element advancing " "on every iteration. This pattern creates a lexicographic ordering so that " @@ -1259,7 +1284,7 @@ msgstr "" "巢狀迴圈的循環類似於里程表,最右邊的元素在每次疊代時前進。這種模式會建立字典" "順序,因此如果輸入的 iterables 已排序,則輸出的乘積元組也將按排序的順序產生。" -#: ../../library/itertools.rst:593 +#: ../../library/itertools.rst:605 msgid "" "To compute the product of an iterable with itself, specify the number of " "repetitions with the optional *repeat* keyword argument. For example, " @@ -1268,7 +1293,7 @@ msgstr "" "要計算可疊代物件自身的乘積,可以使用可選的 *repeat* 關鍵字引數來指定重複次" "數。例如,``product(A, repeat=4)`` 與 ``product(A, A, A, A)`` 相同。" -#: ../../library/itertools.rst:597 +#: ../../library/itertools.rst:609 msgid "" "This function is roughly equivalent to the following code, except that the " "actual implementation does not build up intermediate results in memory::" @@ -1276,12 +1301,14 @@ msgstr "" "此函式大致等價於以下的程式碼,不同之處在於真正的實作不會在記憶體中建立中間結" "果: ::" -#: ../../library/itertools.rst:600 +#: ../../library/itertools.rst:612 msgid "" "def product(*iterables, repeat=1):\n" " # product('ABCD', 'xy') → Ax Ay Bx By Cx Cy Dx Dy\n" " # product(range(2), repeat=3) → 000 001 010 011 100 101 110 111\n" "\n" +" if repeat < 0:\n" +" raise ValueError('repeat argument cannot be negative')\n" " pools = [tuple(pool) for pool in iterables] * repeat\n" "\n" " result = [[]]\n" @@ -1295,6 +1322,8 @@ msgstr "" " # product('ABCD', 'xy') → Ax Ay Bx By Cx Cy Dx Dy\n" " # product(range(2), repeat=3) → 000 001 010 011 100 101 110 111\n" "\n" +" if repeat < 0:\n" +" raise ValueError('repeat argument cannot be negative')\n" " pools = [tuple(pool) for pool in iterables] * repeat\n" "\n" " result = [[]]\n" @@ -1304,7 +1333,7 @@ msgstr "" " for prod in result:\n" " yield tuple(prod)" -#: ../../library/itertools.rst:613 +#: ../../library/itertools.rst:627 msgid "" "Before :func:`product` runs, it completely consumes the input iterables, " "keeping pools of values in memory to generate the products. Accordingly, it " @@ -1313,7 +1342,7 @@ msgstr "" "在 :func:`product` 執行之前,它會完全消耗輸入的 iterables,並將值的池 (pools " "of values) 保存在記憶體中以產生乘積。因此,它僅對有限的輸入有用。" -#: ../../library/itertools.rst:620 +#: ../../library/itertools.rst:634 msgid "" "Make an iterator that returns *object* over and over again. Runs " "indefinitely unless the *times* argument is specified." @@ -1321,7 +1350,7 @@ msgstr "" "建立一個疊代器,反覆回傳 *object*。除非指定了 *times* 引數,否則會執行無限" "次。" -#: ../../library/itertools.rst:625 +#: ../../library/itertools.rst:639 msgid "" "def repeat(object, times=None):\n" " # repeat(10, 3) → 10 10 10\n" @@ -1341,13 +1370,13 @@ msgstr "" " for i in range(times):\n" " yield object" -#: ../../library/itertools.rst:634 +#: ../../library/itertools.rst:648 msgid "" "A common use for *repeat* is to supply a stream of constant values to *map* " "or *zip*:" msgstr "*repeat* 的常見用途是為 *map* 或 *zip* 提供定值的串流:" -#: ../../library/itertools.rst:637 +#: ../../library/itertools.rst:651 msgid "" ">>> list(map(pow, range(10), repeat(2)))\n" "[0, 1, 4, 9, 16, 25, 36, 49, 64, 81]" @@ -1355,7 +1384,7 @@ msgstr "" ">>> list(map(pow, range(10), repeat(2)))\n" "[0, 1, 4, 9, 16, 25, 36, 49, 64, 81]" -#: ../../library/itertools.rst:645 +#: ../../library/itertools.rst:659 msgid "" "Make an iterator that computes the *function* using arguments obtained from " "the *iterable*. Used instead of :func:`map` when argument parameters have " @@ -1364,7 +1393,7 @@ msgstr "" "建立一個疊代器,使用從 *iterable* 獲取的引數計算 *function* 。當引數參數已經" "被「預先壓縮 (pre-zipped)」成元組時,使用此方法代替 :func:`map`。" -#: ../../library/itertools.rst:649 +#: ../../library/itertools.rst:663 msgid "" "The difference between :func:`map` and :func:`starmap` parallels the " "distinction between ``function(a,b)`` and ``function(*c)``. Roughly " @@ -1373,7 +1402,7 @@ msgstr "" ":func:`map` 和 :func:`starmap` 之間的區別類似於 ``function(a,b)`` 和 " "``function(*c)`` 之間的區別。大致等價於:" -#: ../../library/itertools.rst:653 +#: ../../library/itertools.rst:667 msgid "" "def starmap(function, iterable):\n" " # starmap(pow, [(2,5), (3,2), (10,3)]) → 32 9 1000\n" @@ -1385,7 +1414,7 @@ msgstr "" " for args in iterable:\n" " yield function(*args)" -#: ../../library/itertools.rst:661 +#: ../../library/itertools.rst:675 msgid "" "Make an iterator that returns elements from the *iterable* as long as the " "*predicate* is true. Roughly equivalent to::" @@ -1393,7 +1422,7 @@ msgstr "" "建立一個疊代器,只在 *predicate* 為 true 時回傳 *iterable* 中的元素。大致等價" "於:" -#: ../../library/itertools.rst:664 +#: ../../library/itertools.rst:678 msgid "" "def takewhile(predicate, iterable):\n" " # takewhile(lambda x: x<5, [1,4,6,3,8]) → 1 4\n" @@ -1409,7 +1438,7 @@ msgstr "" " break\n" " yield x" -#: ../../library/itertools.rst:671 +#: ../../library/itertools.rst:685 msgid "" "Note, the element that first fails the predicate condition is consumed from " "the input iterator and there is no way to access it. This could be an issue " @@ -1424,54 +1453,80 @@ msgstr "" "more-itertools.readthedocs.io/en/stable/api.html#more_itertools." "before_and_after>`_ 作為替代。" -#: ../../library/itertools.rst:682 +#: ../../library/itertools.rst:696 msgid "Return *n* independent iterators from a single iterable." msgstr "從一個 iterable 中回傳 *n* 個獨立的疊代器。" -#: ../../library/itertools.rst:686 +#: ../../library/itertools.rst:700 msgid "" "def tee(iterable, n=2):\n" -" iterator = iter(iterable)\n" -" shared_link = [None, None]\n" -" return tuple(_tee(iterator, shared_link) for _ in range(n))\n" +" if n < 0:\n" +" raise ValueError\n" +" if n == 0:\n" +" return ()\n" +" iterator = _tee(iterable)\n" +" result = [iterator]\n" +" for _ in range(n - 1):\n" +" result.append(_tee(iterator))\n" +" return tuple(result)\n" +"\n" +"class _tee:\n" +"\n" +" def __init__(self, iterable):\n" +" it = iter(iterable)\n" +" if isinstance(it, _tee):\n" +" self.iterator = it.iterator\n" +" self.link = it.link\n" +" else:\n" +" self.iterator = it\n" +" self.link = [None, None]\n" "\n" -"def _tee(iterator, link):\n" -" try:\n" -" while True:\n" -" if link[1] is None:\n" -" link[0] = next(iterator)\n" -" link[1] = [None, None]\n" -" value, link = link\n" -" yield value\n" -" except StopIteration:\n" -" return" -msgstr "" -"def tee(iterable, n=2):\n" -" iterator = iter(iterable)\n" -" shared_link = [None, None]\n" -" return tuple(_tee(iterator, shared_link) for _ in range(n))\n" +" def __iter__(self):\n" +" return self\n" "\n" -"def _tee(iterator, link):\n" -" try:\n" -" while True:\n" -" if link[1] is None:\n" -" link[0] = next(iterator)\n" -" link[1] = [None, None]\n" -" value, link = link\n" -" yield value\n" -" except StopIteration:\n" -" return" +" def __next__(self):\n" +" link = self.link\n" +" if link[1] is None:\n" +" link[0] = next(self.iterator)\n" +" link[1] = [None, None]\n" +" value, self.link = link\n" +" return value" +msgstr "" -#: ../../library/itertools.rst:702 +#: ../../library/itertools.rst:733 msgid "" -"Once a :func:`tee` has been created, the original *iterable* should not be " -"used anywhere else; otherwise, the *iterable* could get advanced without the " -"tee objects being informed." +"When the input *iterable* is already a tee iterator object, all members of " +"the return tuple are constructed as if they had been produced by the " +"upstream :func:`tee` call. This \"flattening step\" allows nested :func:" +"`tee` calls to share the same underlying data chain and to have a single " +"update step rather than a chain of calls." +msgstr "" + +#: ../../library/itertools.rst:739 +msgid "The flattening property makes tee iterators efficiently peekable:" msgstr "" -"一旦建立了 :func:`tee`,原始的 *iterable* 不應在其他地方使用;否則," -"*iterable* 可能會在 tee 物件未被通知的情況下前進。" -#: ../../library/itertools.rst:706 +#: ../../library/itertools.rst:741 +msgid "" +"def lookahead(tee_iterator):\n" +" \"Return the next value without moving the input forward\"\n" +" [forked_iterator] = tee(tee_iterator, 1)\n" +" return next(forked_iterator)" +msgstr "" + +#: ../../library/itertools.rst:748 +msgid "" +">>> iterator = iter('abcdef')\n" +">>> [iterator] = tee(iterator, 1) # Make the input peekable\n" +">>> next(iterator) # Move the iterator forward\n" +"'a'\n" +">>> lookahead(iterator) # Check next value\n" +"'b'\n" +">>> next(iterator) # Continue moving forward\n" +"'b'" +msgstr "" + +#: ../../library/itertools.rst:759 msgid "" "``tee`` iterators are not threadsafe. A :exc:`RuntimeError` may be raised " "when simultaneously using iterators returned by the same :func:`tee` call, " @@ -1481,7 +1536,7 @@ msgstr "" "呼叫所回傳的疊代器時,即使原始的 *iterable* 是執行緒安全的,也可能引發 :exc:" "`RuntimeError`。" -#: ../../library/itertools.rst:710 +#: ../../library/itertools.rst:763 msgid "" "This itertool may require significant auxiliary storage (depending on how " "much temporary data needs to be stored). In general, if one iterator uses " @@ -1492,11 +1547,11 @@ msgstr "" "果一個疊代器在另一個疊代器開始之前使用了大部分或全部的資料,使用 :func:" "`list` 會比 :func:`tee` 更快。" -#: ../../library/itertools.rst:718 +#: ../../library/itertools.rst:771 msgid "Make an iterator that aggregates elements from each of the *iterables*." msgstr "建立一個疊代器,聚合來自每個 *iterables* 中的元素。" -#: ../../library/itertools.rst:721 +#: ../../library/itertools.rst:774 msgid "" "If the iterables are of uneven length, missing values are filled-in with " "*fillvalue*. If not specified, *fillvalue* defaults to ``None``." @@ -1504,11 +1559,11 @@ msgstr "" "如果 iterables 的長度不一,則使用 *fillvalue* 填充缺少的值。如果未指定," "*fillvalue* 會預設為 ``None``。" -#: ../../library/itertools.rst:724 +#: ../../library/itertools.rst:777 msgid "Iteration continues until the longest iterable is exhausted." msgstr "疊代將持續直到最長的可疊代物件耗盡為止。" -#: ../../library/itertools.rst:728 +#: ../../library/itertools.rst:781 msgid "" "def zip_longest(*iterables, fillvalue=None):\n" " # zip_longest('ABCD', 'xy', fillvalue='-') → Ax By C- D-\n" @@ -1554,7 +1609,7 @@ msgstr "" " values.append(value)\n" " yield tuple(values)" -#: ../../library/itertools.rst:750 +#: ../../library/itertools.rst:803 msgid "" "If one of the iterables is potentially infinite, then the :func:" "`zip_longest` function should be wrapped with something that limits the " @@ -1563,18 +1618,18 @@ msgstr "" "如果其中一個 iterables 可能是無限的,那麼應該用別的可以限制呼叫次數的方法來包" "裝 :func:`zip_longest` 函式(例如 :func:`islice` 或 :func:`takewhile`)。" -#: ../../library/itertools.rst:758 +#: ../../library/itertools.rst:811 msgid "Itertools Recipes" msgstr "Itertools 應用技巧" -#: ../../library/itertools.rst:760 +#: ../../library/itertools.rst:813 msgid "" "This section shows recipes for creating an extended toolset using the " "existing itertools as building blocks." msgstr "" "此段落展示了使用現有的 itertools 作為構建塊來建立擴展工具集的應用技巧。" -#: ../../library/itertools.rst:763 +#: ../../library/itertools.rst:816 msgid "" "The primary purpose of the itertools recipes is educational. The recipes " "show various ways of thinking about individual tools — for example, that " @@ -1592,7 +1647,7 @@ msgstr "" "`collections` 模組一同使用以及與內建 itertools(如 ``map()``、``filter()``、" "``reversed()`` 和 ``enumerate()``)一同使用的模式。" -#: ../../library/itertools.rst:772 +#: ../../library/itertools.rst:825 msgid "" "A secondary purpose of the recipes is to serve as an incubator. The " "``accumulate()``, ``compress()``, and ``pairwise()`` itertools started out " @@ -1604,7 +1659,7 @@ msgstr "" "``sliding_window()``、``iter_index()`` 和 ``sieve()`` 的應用技巧正在被測試," "以確定它們是否有價值被收錄到內建的 itertools 中。" -#: ../../library/itertools.rst:777 +#: ../../library/itertools.rst:830 msgid "" "Substantially all of these recipes and many, many others can be installed " "from the :pypi:`more-itertools` project found on the Python Package Index::" @@ -1612,11 +1667,11 @@ msgstr "" "幾乎所有這些應用技巧以及許多其他應用技巧都可以從 Python Package Index 上的 :" "pypi:`more-itertools` 專案中安裝: ::" -#: ../../library/itertools.rst:781 +#: ../../library/itertools.rst:834 msgid "python -m pip install more-itertools" msgstr "python -m pip install more-itertools" -#: ../../library/itertools.rst:783 +#: ../../library/itertools.rst:836 msgid "" "Many of the recipes offer the same high performance as the underlying " "toolset. Superior memory performance is kept by processing elements one at a " @@ -1634,7 +1689,7 @@ msgstr "" "用「向量化 (vectorized)」的構建塊而不是使用會造成直譯器負擔的 for 迴圈和\\ :" "term:`產生器 `,則能保持高速度。" -#: ../../library/itertools.rst:791 +#: ../../library/itertools.rst:844 msgid "" "import collections\n" "import contextlib\n" @@ -1770,16 +1825,6 @@ msgid "" " iterators = cycle(islice(iterators, num_active))\n" " yield from map(next, iterators)\n" "\n" -"def partition(predicate, iterable):\n" -" \"\"\"Partition entries into false entries and true entries.\n" -"\n" -" If *predicate* is slow, consider wrapping it with functools." -"lru_cache().\n" -" \"\"\"\n" -" # partition(is_odd, range(10)) → 0 2 4 6 8 and 1 3 5 7 9\n" -" t1, t2 = tee(iterable)\n" -" return filterfalse(predicate, t1), filter(predicate, t2)\n" -"\n" "def subslices(seq):\n" " \"Return all contiguous non-empty subslices of a sequence.\"\n" " # subslices('ABCD') → A AB ABC ABCD B BC BCD C CD D\n" @@ -1813,11 +1858,11 @@ msgid "" " yield func()" msgstr "" -#: ../../library/itertools.rst:964 +#: ../../library/itertools.rst:1008 msgid "The following recipes have a more mathematical flavor:" msgstr "以下的應用技巧具有更多的數學風格:" -#: ../../library/itertools.rst:966 +#: ../../library/itertools.rst:1010 msgid "" "def powerset(iterable):\n" " \"powerset([1,2,3]) → () (1,) (2,) (3,) (1,2) (1,3) (2,3) (1,2,3)\"\n" diff --git a/library/locale.po b/library/locale.po index 2cb4e18ddf..c36cbfaff7 100644 --- a/library/locale.po +++ b/library/locale.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-11 00:13+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-" @@ -331,110 +331,111 @@ msgstr "" #: ../../library/locale.rst:161 msgid "" -"Return some locale-specific information as a string. This function is not " -"available on all systems, and the set of possible options might also vary " -"across platforms. The possible argument values are numbers, for which " -"symbolic constants are available in the locale module." +"Return some locale-specific information as a string (or a tuple for " +"``ALT_DIGITS``). This function is not available on all systems, and the set " +"of possible options might also vary across platforms. The possible argument " +"values are numbers, for which symbolic constants are available in the locale " +"module." msgstr "" -#: ../../library/locale.rst:166 +#: ../../library/locale.rst:167 msgid "" "The :func:`nl_langinfo` function accepts one of the following keys. Most " "descriptions are taken from the corresponding description in the GNU C " "library." msgstr "" -#: ../../library/locale.rst:172 +#: ../../library/locale.rst:173 msgid "" "Get a string with the name of the character encoding used in the selected " "locale." msgstr "" -#: ../../library/locale.rst:177 +#: ../../library/locale.rst:178 msgid "" "Get a string that can be used as a format string for :func:`time.strftime` " "to represent date and time in a locale-specific way." msgstr "" -#: ../../library/locale.rst:182 +#: ../../library/locale.rst:183 msgid "" "Get a string that can be used as a format string for :func:`time.strftime` " "to represent a date in a locale-specific way." msgstr "" -#: ../../library/locale.rst:187 +#: ../../library/locale.rst:188 msgid "" "Get a string that can be used as a format string for :func:`time.strftime` " "to represent a time in a locale-specific way." msgstr "" -#: ../../library/locale.rst:192 +#: ../../library/locale.rst:193 msgid "" "Get a format string for :func:`time.strftime` to represent time in the am/pm " "format." msgstr "" -#: ../../library/locale.rst:203 +#: ../../library/locale.rst:204 msgid "Get the name of the n-th day of the week." msgstr "" -#: ../../library/locale.rst:207 +#: ../../library/locale.rst:208 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:219 +#: ../../library/locale.rst:220 msgid "Get the abbreviated name of the n-th day of the week." msgstr "" -#: ../../library/locale.rst:234 +#: ../../library/locale.rst:235 msgid "Get the name of the n-th month." msgstr "" -#: ../../library/locale.rst:249 +#: ../../library/locale.rst:250 msgid "Get the abbreviated name of the n-th month." msgstr "" -#: ../../library/locale.rst:253 +#: ../../library/locale.rst:254 msgid "Get the radix character (decimal dot, decimal comma, etc.)." msgstr "" -#: ../../library/locale.rst:257 +#: ../../library/locale.rst:258 msgid "Get the separator character for thousands (groups of three digits)." msgstr "" -#: ../../library/locale.rst:261 +#: ../../library/locale.rst:262 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:266 +#: ../../library/locale.rst:267 msgid "" "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:271 +#: ../../library/locale.rst:272 msgid "" "The regular expressions for :const:`YESEXPR` and :const:`NOEXPR` use syntax " "suitable for the ``regex`` function from the C library, which might differ " "from the syntax used in :mod:`re`." msgstr "" -#: ../../library/locale.rst:278 +#: ../../library/locale.rst:279 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:284 +#: ../../library/locale.rst:285 msgid "Get a string that represents the era used in the current locale." msgstr "" -#: ../../library/locale.rst:286 +#: ../../library/locale.rst:287 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 " @@ -442,7 +443,7 @@ msgid "" "then-emperor's reign." msgstr "" -#: ../../library/locale.rst:291 +#: ../../library/locale.rst:292 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` " @@ -451,28 +452,26 @@ msgid "" "systems." msgstr "" -#: ../../library/locale.rst:299 +#: ../../library/locale.rst:300 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:304 +#: ../../library/locale.rst:305 msgid "" "Get a format string for :func:`time.strftime` to represent a date in a " "locale-specific era-based way." msgstr "" -#: ../../library/locale.rst:309 +#: ../../library/locale.rst:310 msgid "" "Get a format string for :func:`time.strftime` to represent a time in a " "locale-specific era-based way." msgstr "" -#: ../../library/locale.rst:314 -msgid "" -"Get a representation of up to 100 values used to represent the values 0 to " -"99." +#: ../../library/locale.rst:315 +msgid "Get a tuple of up to 100 strings used to represent the values 0 to 99." msgstr "" #: ../../library/locale.rst:320 diff --git a/library/logging.config.po b/library/logging.config.po index 018f87b9aa..bac0b9d580 100644 --- a/library/logging.config.po +++ b/library/logging.config.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-09 00:13+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-" @@ -1085,59 +1085,59 @@ msgstr "" #: ../../library/logging.config.rst:756 msgid "" -"An object implementing the :class:`queue.Queue` public API. For instance, " -"this may be an actual instance of :class:`queue.Queue` or a subclass " -"thereof, or a proxy obtained by :meth:`multiprocessing.managers.SyncManager." -"Queue`." +"An object implementing the :meth:`Queue.put_nowait ` " +"and :meth:`Queue.get ` public API. For instance, this may " +"be an actual instance of :class:`queue.Queue` or a subclass thereof, or a " +"proxy obtained by :meth:`multiprocessing.managers.SyncManager.Queue`." msgstr "" -#: ../../library/logging.config.rst:760 +#: ../../library/logging.config.rst:761 msgid "" "This is of course only possible if you are constructing or modifying the " "configuration dictionary in code." msgstr "" -#: ../../library/logging.config.rst:763 +#: ../../library/logging.config.rst:764 msgid "" "A string that resolves to a callable which, when called with no arguments, " -"returns the :class:`queue.Queue` instance to use. That callable could be a :" -"class:`queue.Queue` subclass or a function which returns a suitable queue " -"instance, such as ``my.module.queue_factory()``." +"returns the queue instance to use. That callable could be a :class:`queue." +"Queue` subclass or a function which returns a suitable queue instance, such " +"as ``my.module.queue_factory()``." msgstr "" -#: ../../library/logging.config.rst:768 +#: ../../library/logging.config.rst:769 msgid "" "A dict with a ``'()'`` key which is constructed in the usual way as " "discussed in :ref:`logging-config-dict-userdef`. The result of this " "construction should be a :class:`queue.Queue` instance." msgstr "" -#: ../../library/logging.config.rst:772 +#: ../../library/logging.config.rst:773 msgid "" "If the ``queue`` key is absent, a standard unbounded :class:`queue.Queue` " "instance is created and used." msgstr "" -#: ../../library/logging.config.rst:775 +#: ../../library/logging.config.rst:776 msgid "" "If the ``listener`` key is present, the corresponding value can be one of " "the following:" msgstr "" -#: ../../library/logging.config.rst:777 +#: ../../library/logging.config.rst:778 msgid "" "A subclass of :class:`logging.handlers.QueueListener`. This is of course " "only possible if you are constructing or modifying the configuration " "dictionary in code." msgstr "" -#: ../../library/logging.config.rst:781 +#: ../../library/logging.config.rst:782 msgid "" "A string which resolves to a class which is a subclass of ``QueueListener``, " "such as ``'my.package.CustomListener'``." msgstr "" -#: ../../library/logging.config.rst:784 +#: ../../library/logging.config.rst:785 msgid "" "A dict with a ``'()'`` key which is constructed in the usual way as " "discussed in :ref:`logging-config-dict-userdef`. The result of this " @@ -1145,31 +1145,31 @@ msgid "" "``QueueListener`` initializer." msgstr "" -#: ../../library/logging.config.rst:788 +#: ../../library/logging.config.rst:789 msgid "" "If the ``listener`` key is absent, :class:`logging.handlers.QueueListener` " "is used." msgstr "" -#: ../../library/logging.config.rst:790 +#: ../../library/logging.config.rst:791 msgid "" "The values under the ``handlers`` key are the names of other handlers in the " "configuration (not shown in the above snippet) which will be passed to the " "queue listener." msgstr "" -#: ../../library/logging.config.rst:794 +#: ../../library/logging.config.rst:795 msgid "" "Any custom queue handler and listener classes will need to be defined with " "the same initialization signatures as :class:`~logging.handlers." "QueueHandler` and :class:`~logging.handlers.QueueListener`." msgstr "" -#: ../../library/logging.config.rst:803 +#: ../../library/logging.config.rst:804 msgid "Configuration file format" msgstr "" -#: ../../library/logging.config.rst:805 +#: ../../library/logging.config.rst:806 msgid "" "The configuration file format understood by :func:`fileConfig` is based on :" "mod:`configparser` functionality. The file must contain sections called " @@ -1186,7 +1186,7 @@ msgid "" "specified in a section called ``[logger_root]``." msgstr "" -#: ../../library/logging.config.rst:820 +#: ../../library/logging.config.rst:821 msgid "" "The :func:`fileConfig` API is older than the :func:`dictConfig` API and does " "not provide functionality to cover certain aspects of logging. For example, " @@ -1199,11 +1199,11 @@ msgid "" "when it's convenient to do so." msgstr "" -#: ../../library/logging.config.rst:830 +#: ../../library/logging.config.rst:831 msgid "Examples of these sections in the file are given below." msgstr "" -#: ../../library/logging.config.rst:832 +#: ../../library/logging.config.rst:833 msgid "" "[loggers]\n" "keys=root,log02,log03,log04,log05,log06,log07\n" @@ -1223,13 +1223,13 @@ msgstr "" "[formatters]\n" "keys=form01,form02,form03,form04,form05,form06,form07,form08,form09" -#: ../../library/logging.config.rst:843 +#: ../../library/logging.config.rst:844 msgid "" "The root logger must specify a level and a list of handlers. An example of a " "root logger section is given below." msgstr "" -#: ../../library/logging.config.rst:846 +#: ../../library/logging.config.rst:847 msgid "" "[logger_root]\n" "level=NOTSET\n" @@ -1239,7 +1239,7 @@ msgstr "" "level=NOTSET\n" "handlers=hand01" -#: ../../library/logging.config.rst:852 +#: ../../library/logging.config.rst:853 msgid "" "The ``level`` entry can be one of ``DEBUG, INFO, WARNING, ERROR, CRITICAL`` " "or ``NOTSET``. For the root logger only, ``NOTSET`` means that all messages " @@ -1247,7 +1247,7 @@ msgid "" "of the ``logging`` package's namespace." msgstr "" -#: ../../library/logging.config.rst:857 +#: ../../library/logging.config.rst:858 msgid "" "The ``handlers`` entry is a comma-separated list of handler names, which " "must appear in the ``[handlers]`` section. These names must appear in the " @@ -1255,13 +1255,13 @@ msgid "" "file." msgstr "" -#: ../../library/logging.config.rst:862 +#: ../../library/logging.config.rst:863 msgid "" "For loggers other than the root logger, some additional information is " "required. This is illustrated by the following example." msgstr "" -#: ../../library/logging.config.rst:865 +#: ../../library/logging.config.rst:866 msgid "" "[logger_parser]\n" "level=DEBUG\n" @@ -1275,7 +1275,7 @@ msgstr "" "propagate=1\n" "qualname=compiler.parser" -#: ../../library/logging.config.rst:873 +#: ../../library/logging.config.rst:874 msgid "" "The ``level`` and ``handlers`` entries are interpreted as for the root " "logger, except that if a non-root logger's level is specified as ``NOTSET``, " @@ -1288,13 +1288,13 @@ msgid "" "application to get the logger." msgstr "" -#: ../../library/logging.config.rst:882 +#: ../../library/logging.config.rst:883 msgid "" "Sections which specify handler configuration are exemplified by the " "following." msgstr "" -#: ../../library/logging.config.rst:884 +#: ../../library/logging.config.rst:885 msgid "" "[handler_hand01]\n" "class=StreamHandler\n" @@ -1308,14 +1308,14 @@ msgstr "" "formatter=form01\n" "args=(sys.stdout,)" -#: ../../library/logging.config.rst:892 +#: ../../library/logging.config.rst:893 msgid "" "The ``class`` entry indicates the handler's class (as determined by :func:" "`eval` in the ``logging`` package's namespace). The ``level`` is interpreted " "as for loggers, and ``NOTSET`` is taken to mean 'log everything'." msgstr "" -#: ../../library/logging.config.rst:896 +#: ../../library/logging.config.rst:897 msgid "" "The ``formatter`` entry indicates the key name of the formatter for this " "handler. If blank, a default formatter (``logging._defaultFormatter``) is " @@ -1323,7 +1323,7 @@ msgid "" "and have a corresponding section in the configuration file." msgstr "" -#: ../../library/logging.config.rst:901 +#: ../../library/logging.config.rst:902 msgid "" "The ``args`` entry, when :ref:`evaluated ` in the context of the " "``logging`` package's namespace, is the list of arguments to the constructor " @@ -1332,7 +1332,7 @@ msgid "" "provided, it defaults to ``()``." msgstr "" -#: ../../library/logging.config.rst:907 +#: ../../library/logging.config.rst:908 msgid "" "The optional ``kwargs`` entry, when :ref:`evaluated ` in the " "context of the ``logging`` package's namespace, is the keyword argument dict " @@ -1340,7 +1340,7 @@ msgid "" "``{}``." msgstr "" -#: ../../library/logging.config.rst:911 +#: ../../library/logging.config.rst:912 msgid "" "[handler_hand02]\n" "class=FileHandler\n" @@ -1448,12 +1448,12 @@ msgstr "" "args=('localhost:9022', '/log', 'GET')\n" "kwargs={'secure': True}" -#: ../../library/logging.config.rst:964 +#: ../../library/logging.config.rst:965 msgid "" "Sections which specify formatter configuration are typified by the following." msgstr "" -#: ../../library/logging.config.rst:966 +#: ../../library/logging.config.rst:967 msgid "" "[formatter_form01]\n" "format=F1 %(asctime)s %(levelname)s %(message)s %(customfield)s\n" @@ -1471,21 +1471,21 @@ msgstr "" "defaults={'customfield': 'defaultvalue'}\n" "class=logging.Formatter" -#: ../../library/logging.config.rst:976 +#: ../../library/logging.config.rst:977 msgid "" "The arguments for the formatter configuration are the same as the keys in " "the dictionary schema :ref:`formatters section `." msgstr "" -#: ../../library/logging.config.rst:980 +#: ../../library/logging.config.rst:981 msgid "" "The ``defaults`` entry, when :ref:`evaluated ` in the context of " "the ``logging`` package's namespace, is a dictionary of default values for " "custom formatting fields. If not provided, it defaults to ``None``." msgstr "" -#: ../../library/logging.config.rst:987 +#: ../../library/logging.config.rst:988 msgid "" "Due to the use of :func:`eval` as described above, there are potential " "security risks which result from using the :func:`listen` to send and " @@ -1494,18 +1494,18 @@ msgid "" "`listen` documentation for more information." msgstr "" -#: ../../library/logging.config.rst:995 +#: ../../library/logging.config.rst:996 msgid "Module :mod:`logging`" msgstr ":mod:`logging` 模組" -#: ../../library/logging.config.rst:996 +#: ../../library/logging.config.rst:997 msgid "API reference for the logging module." msgstr "" -#: ../../library/logging.config.rst:998 +#: ../../library/logging.config.rst:999 msgid "Module :mod:`logging.handlers`" msgstr ":mod:`logging.handlers` 模組" -#: ../../library/logging.config.rst:999 +#: ../../library/logging.config.rst:1000 msgid "Useful handlers included with the logging module." msgstr "" diff --git a/library/mimetypes.po b/library/mimetypes.po index 9b5715f5c0..fe246b5824 100644 --- a/library/mimetypes.po +++ b/library/mimetypes.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-11 00:13+0000\n" "PO-Revision-Date: 2016-11-19 00:32+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -353,8 +353,8 @@ msgid "Load MIME type information from the Windows registry." msgstr "" #: ../../library/mimetypes.rst:292 -msgid ":ref:`Availability `: Windows." -msgstr ":ref:`適用 `:Windows。" +msgid "Availability" +msgstr "" #: ../../library/mimetypes.rst:11 ../../library/mimetypes.rst:31 #: ../../library/mimetypes.rst:64 diff --git a/library/mmap.po b/library/mmap.po index 2d33ddb42b..91eea5513a 100644 --- a/library/mmap.po +++ b/library/mmap.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-11 00:13+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-" @@ -22,8 +22,8 @@ msgid ":mod:`!mmap` --- Memory-mapped file support" msgstr ":mod:`!mmap` --- 記憶體對映檔案的支援" #: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not WASI." -msgstr ":ref:`適用 `:非 WASI。" +msgid "Availability" +msgstr "" #: ../../includes/wasm-notavail.rst:5 msgid "" @@ -458,7 +458,7 @@ msgstr "" #: ../../library/mmap.rst:348 msgid "MADV_* Constants" -msgstr "" +msgstr "MADV_* 常數" #: ../../library/mmap.rst:375 msgid "" @@ -491,9 +491,8 @@ msgid "Added :data:`MAP_STACK` constant." msgstr "新增 :data:`MAP_STACK` 常數。" #: ../../library/mmap.rst:419 -#, fuzzy msgid "Added :data:`MAP_ALIGNED_SUPER` and :data:`MAP_CONCEAL` constants." -msgstr "新增 :data:`MAP_ALIGNED_SUPER` 常數。新增 :data:`MAP_CONCEAL` 常數。" +msgstr "新增 :data:`MAP_ALIGNED_SUPER` 和 :data:`MAP_CONCEAL` 常數。" #: ../../library/mmap.rst:422 msgid "" diff --git a/library/multiprocessing.po b/library/multiprocessing.po index c428df62b4..da2a98eeaa 100644 --- a/library/multiprocessing.po +++ b/library/multiprocessing.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-11 00:13+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-" @@ -26,8 +26,8 @@ msgid "**Source code:** :source:`Lib/multiprocessing/`" msgstr "**原始碼:**\\ :source:`Lib/multiprocessing/`" #: ../../includes/wasm-mobile-notavail.rst:3 -msgid ":ref:`Availability `: not Android, not iOS, not WASI." -msgstr ":ref:`適用 `:非 Android、非 iOS、非 WASI。" +msgid "Availability" +msgstr "" #: ../../includes/wasm-mobile-notavail.rst:5 msgid "" @@ -1577,7 +1577,7 @@ msgstr "" #: ../../library/multiprocessing.rst:1019 msgid ":func:`os.cpu_count` :func:`os.process_cpu_count`" -msgstr "" +msgstr ":func:`os.cpu_count` :func:`os.process_cpu_count`" #: ../../library/multiprocessing.rst:1024 msgid "" @@ -4879,16 +4879,3 @@ msgid "" " freeze_support()\n" " test()\n" msgstr "" - -#, fuzzy -#~ msgid "" -#~ "This module does not work or is not available on WebAssembly platforms, " -#~ "or on iOS. See :ref:`wasm-availability` for more information on WASM " -#~ "availability; see :ref:`iOS-availability` for more information on iOS " -#~ "availability." -#~ msgstr "" -#~ "此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法" -#~ "作用或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" - -#~ msgid ":func:`os.cpu_count`" -#~ msgstr ":func:`os.cpu_count`" diff --git a/library/os.path.po b/library/os.path.po index 7480d8c542..2019487b8c 100644 --- a/library/os.path.po +++ b/library/os.path.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-11 00:13+0000\n" "PO-Revision-Date: 2023-07-13 14:06+0800\n" "Last-Translator: Po-Chuan Chen \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -456,8 +456,8 @@ msgid "" msgstr "" #: ../../library/os.path.rst:348 -msgid ":ref:`Availability `: Windows." -msgstr ":ref:`適用 `:Windows。" +msgid "Availability" +msgstr "" #: ../../library/os.path.rst:355 msgid "" diff --git a/library/os.po b/library/os.po index e840cd0740..08a42cda4c 100644 --- a/library/os.po +++ b/library/os.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-27 00:14+0000\n" +"POT-Creation-Date: 2024-10-11 00:13+0000\n" "PO-Revision-Date: 2024-04-29 15:24+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -305,20 +305,62 @@ msgid "" "Return the filename corresponding to the controlling terminal of the process." msgstr "" -#: ../../library/os.rst:181 ../../library/os.rst:358 ../../library/os.rst:367 -#: ../../library/os.rst:389 ../../library/os.rst:398 ../../library/os.rst:434 -#: ../../library/os.rst:442 ../../library/os.rst:480 ../../library/os.rst:491 -#: ../../library/os.rst:512 ../../library/os.rst:522 ../../library/os.rst:602 +#: ../../library/os.rst:181 ../../library/os.rst:322 ../../library/os.rst:337 +#: ../../library/os.rst:358 ../../library/os.rst:367 ../../library/os.rst:376 +#: ../../library/os.rst:389 ../../library/os.rst:398 ../../library/os.rst:426 +#: ../../library/os.rst:434 ../../library/os.rst:442 ../../library/os.rst:462 +#: ../../library/os.rst:480 ../../library/os.rst:491 ../../library/os.rst:503 +#: ../../library/os.rst:512 ../../library/os.rst:522 ../../library/os.rst:533 +#: ../../library/os.rst:545 ../../library/os.rst:579 ../../library/os.rst:586 +#: ../../library/os.rst:593 ../../library/os.rst:602 ../../library/os.rst:639 #: ../../library/os.rst:652 ../../library/os.rst:661 ../../library/os.rst:678 -#: ../../library/os.rst:719 ../../library/os.rst:726 ../../library/os.rst:1139 -#: ../../library/os.rst:1183 ../../library/os.rst:1367 -#: ../../library/os.rst:1393 ../../library/os.rst:1463 -#: ../../library/os.rst:1535 ../../library/os.rst:1662 -#: ../../library/os.rst:1682 ../../library/os.rst:1691 +#: ../../library/os.rst:687 ../../library/os.rst:694 ../../library/os.rst:703 +#: ../../library/os.rst:712 ../../library/os.rst:719 ../../library/os.rst:726 +#: ../../library/os.rst:735 ../../library/os.rst:792 ../../library/os.rst:831 +#: ../../library/os.rst:953 ../../library/os.rst:979 ../../library/os.rst:992 +#: ../../library/os.rst:1009 ../../library/os.rst:1027 +#: ../../library/os.rst:1038 ../../library/os.rst:1061 +#: ../../library/os.rst:1082 ../../library/os.rst:1094 +#: ../../library/os.rst:1105 ../../library/os.rst:1118 +#: ../../library/os.rst:1139 ../../library/os.rst:1160 +#: ../../library/os.rst:1172 ../../library/os.rst:1183 +#: ../../library/os.rst:1244 ../../library/os.rst:1367 +#: ../../library/os.rst:1379 ../../library/os.rst:1393 +#: ../../library/os.rst:1403 ../../library/os.rst:1418 +#: ../../library/os.rst:1433 ../../library/os.rst:1446 +#: ../../library/os.rst:1463 ../../library/os.rst:1489 +#: ../../library/os.rst:1506 ../../library/os.rst:1520 +#: ../../library/os.rst:1535 ../../library/os.rst:1547 +#: ../../library/os.rst:1574 ../../library/os.rst:1586 +#: ../../library/os.rst:1596 ../../library/os.rst:1610 +#: ../../library/os.rst:1662 ../../library/os.rst:1682 +#: ../../library/os.rst:1691 ../../library/os.rst:1703 +#: ../../library/os.rst:1738 ../../library/os.rst:1762 #: ../../library/os.rst:1772 ../../library/os.rst:1780 -#: ../../library/os.rst:1800 ../../library/os.rst:2087 -#: ../../library/os.rst:2221 ../../library/os.rst:2514 -#: ../../library/os.rst:2536 ../../library/os.rst:4330 +#: ../../library/os.rst:1789 ../../library/os.rst:1800 +#: ../../library/os.rst:1837 ../../library/os.rst:1864 +#: ../../library/os.rst:1915 ../../library/os.rst:1921 +#: ../../library/os.rst:2087 ../../library/os.rst:2164 +#: ../../library/os.rst:2181 ../../library/os.rst:2195 +#: ../../library/os.rst:2221 ../../library/os.rst:2239 +#: ../../library/os.rst:2255 ../../library/os.rst:2271 +#: ../../library/os.rst:2334 ../../library/os.rst:2358 +#: ../../library/os.rst:2378 ../../library/os.rst:2514 +#: ../../library/os.rst:2536 ../../library/os.rst:2580 +#: ../../library/os.rst:2592 ../../library/os.rst:2614 +#: ../../library/os.rst:3322 ../../library/os.rst:3456 +#: ../../library/os.rst:3479 ../../library/os.rst:3493 +#: ../../library/os.rst:3712 ../../library/os.rst:3737 +#: ../../library/os.rst:3762 ../../library/os.rst:3816 +#: ../../library/os.rst:3825 ../../library/os.rst:3834 +#: ../../library/os.rst:3842 ../../library/os.rst:3851 +#: ../../library/os.rst:3860 ../../library/os.rst:3932 +#: ../../library/os.rst:3995 ../../library/os.rst:4005 +#: ../../library/os.rst:4023 ../../library/os.rst:4032 +#: ../../library/os.rst:4042 ../../library/os.rst:4052 +#: ../../library/os.rst:4062 ../../library/os.rst:4073 +#: ../../library/os.rst:4218 ../../library/os.rst:4287 +#: ../../library/os.rst:4322 ../../library/os.rst:4330 #: ../../library/os.rst:4337 ../../library/os.rst:4344 #: ../../library/os.rst:4351 ../../library/os.rst:4358 #: ../../library/os.rst:4365 ../../library/os.rst:4372 @@ -326,9 +368,32 @@ msgstr "" #: ../../library/os.rst:4395 ../../library/os.rst:4402 #: ../../library/os.rst:4411 ../../library/os.rst:4419 #: ../../library/os.rst:4427 ../../library/os.rst:4434 -#: ../../library/os.rst:4441 ../../library/os.rst:4564 -msgid ":ref:`Availability `: Unix, not WASI." -msgstr ":ref:`適用 `:Unix、非 WASI。" +#: ../../library/os.rst:4441 ../../library/os.rst:4490 +#: ../../library/os.rst:4517 ../../library/os.rst:4541 +#: ../../library/os.rst:4557 ../../library/os.rst:4564 +#: ../../library/os.rst:4575 ../../library/os.rst:4585 +#: ../../library/os.rst:4594 ../../library/os.rst:4626 +#: ../../library/os.rst:4734 ../../library/os.rst:4750 +#: ../../library/os.rst:4783 ../../library/os.rst:4852 +#: ../../library/os.rst:4871 ../../library/os.rst:4882 +#: ../../library/os.rst:4894 ../../library/os.rst:4939 +#: ../../library/os.rst:4976 ../../library/os.rst:4999 +#: ../../library/os.rst:5020 ../../library/os.rst:5054 +#: ../../library/os.rst:5095 ../../library/os.rst:5115 +#: ../../library/os.rst:5129 ../../library/os.rst:5146 +#: ../../library/os.rst:5161 ../../library/os.rst:5172 +#: ../../library/os.rst:5184 ../../library/os.rst:5197 +#: ../../library/os.rst:5206 ../../library/os.rst:5216 +#: ../../library/os.rst:5229 ../../library/os.rst:5264 +#: ../../library/os.rst:5280 ../../library/os.rst:5291 +#: ../../library/os.rst:5303 ../../library/os.rst:5310 +#: ../../library/os.rst:5319 ../../library/os.rst:5328 +#: ../../library/os.rst:5337 ../../library/os.rst:5346 +#: ../../library/os.rst:5496 ../../library/os.rst:5505 +#: ../../library/os.rst:5529 ../../library/os.rst:5556 +#: ../../library/os.rst:5565 ../../library/os.rst:5688 +msgid "Availability" +msgstr "" #: ../../library/os.rst:186 msgid "" @@ -481,17 +546,6 @@ msgid "" "like to use a different encoding." msgstr "" -#: ../../library/os.rst:322 ../../library/os.rst:1009 ../../library/os.rst:1094 -#: ../../library/os.rst:1105 ../../library/os.rst:1118 -#: ../../library/os.rst:1379 ../../library/os.rst:1703 -#: ../../library/os.rst:1864 ../../library/os.rst:2271 -#: ../../library/os.rst:2614 ../../library/os.rst:3456 -#: ../../library/os.rst:3493 ../../library/os.rst:4322 -#: ../../library/os.rst:4871 ../../library/os.rst:4882 -#: ../../library/os.rst:4999 -msgid ":ref:`Availability `: Unix, Windows." -msgstr ":ref:`適用 `:Unix、Windows。" - #: ../../library/os.rst:327 msgid "" "Return the value of the environment variable *key* as bytes if it exists, or " @@ -507,24 +561,6 @@ msgid "" "``True``." msgstr "" -#: ../../library/os.rst:337 ../../library/os.rst:376 ../../library/os.rst:533 -#: ../../library/os.rst:792 ../../library/os.rst:1027 ../../library/os.rst:1038 -#: ../../library/os.rst:1061 ../../library/os.rst:1082 -#: ../../library/os.rst:1160 ../../library/os.rst:1172 -#: ../../library/os.rst:1403 ../../library/os.rst:1418 -#: ../../library/os.rst:1433 ../../library/os.rst:1446 -#: ../../library/os.rst:1547 ../../library/os.rst:1762 -#: ../../library/os.rst:1789 ../../library/os.rst:1837 -#: ../../library/os.rst:2164 ../../library/os.rst:2195 -#: ../../library/os.rst:2255 ../../library/os.rst:2580 -#: ../../library/os.rst:2592 ../../library/os.rst:3322 -#: ../../library/os.rst:3479 ../../library/os.rst:3712 -#: ../../library/os.rst:5496 ../../library/os.rst:5505 -#: ../../library/os.rst:5529 ../../library/os.rst:5556 -#: ../../library/os.rst:5565 -msgid ":ref:`Availability `: Unix." -msgstr ":ref:`適用 `:Unix。" - #: ../../library/os.rst:344 msgid "" "Returns the list of directories that will be searched for a named " @@ -593,10 +629,6 @@ 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 -msgid ":ref:`Availability `: Unix, Windows, not WASI." -msgstr ":ref:`適用 `:Unix、Windows、非 WASI。" - #: ../../library/os.rst:431 msgid "" "Return the process group id of the process with process id *pid*. If *pid* " @@ -638,10 +670,6 @@ msgid "" "Parameters for the :func:`getpriority` and :func:`setpriority` functions." msgstr "" -#: ../../library/os.rst:503 -msgid ":ref:`Availability `: macOS" -msgstr ":ref:`適用 `:macOS" - #: ../../library/os.rst:509 msgid "" "Return a tuple (ruid, euid, suid) denoting the current process's real, " @@ -665,13 +693,6 @@ msgid "" "group id." msgstr "" -#: ../../library/os.rst:545 ../../library/os.rst:579 ../../library/os.rst:586 -#: ../../library/os.rst:593 ../../library/os.rst:687 ../../library/os.rst:694 -#: ../../library/os.rst:703 ../../library/os.rst:712 ../../library/os.rst:735 -#: ../../library/os.rst:2181 -msgid ":ref:`Availability `: Unix, not WASI, not Android." -msgstr ":ref:`適用 `:Unix、非 WASI、非 Android。" - #: ../../library/os.rst:554 msgid "" "Set the environment variable named *key* to the string *value*. Such " @@ -783,10 +804,6 @@ msgstr "" "os.setns(fd, os.CLONE_NEWNET)\n" "os.close(fd)" -#: ../../library/os.rst:639 -msgid ":ref:`Availability `: Linux >= 3.0 with glibc >= 2.14." -msgstr ":ref:`適用 `:Linux 3.0 以上且具有 glibc 2.14 以上。" - #: ../../library/os.rst:645 msgid "The :func:`~os.unshare` function." msgstr ":func:`~os.unshare` 函式。" @@ -958,10 +975,6 @@ msgid "" "are made to the calling process's execution context." msgstr "" -#: ../../library/os.rst:831 -msgid ":ref:`Availability `: Linux >= 2.6.16." -msgstr ":ref:`適用 `:Linux 2.6.16 以上。" - #: ../../library/os.rst:837 msgid "The :func:`~os.setns` function." msgstr ":func:`~os.setns` 函式。" @@ -1095,10 +1108,6 @@ msgid "" "known Linux kernel issue." msgstr "" -#: ../../library/os.rst:953 -msgid ":ref:`Availability `: Linux >= 4.5 with glibc >= 2.27." -msgstr ":ref:`適用 `:Linux 4.5 以上且具有 glibc 2.27 以上。" - #: ../../library/os.rst:960 msgid "" "Return a string describing the encoding of the device associated with *fd* " @@ -1127,10 +1136,6 @@ msgid "" "stderr), the new file descriptor is :ref:`inheritable `." msgstr "" -#: ../../library/os.rst:979 ../../library/os.rst:992 -msgid ":ref:`Availability `: not WASI." -msgstr ":ref:`適用 `:非 WASI。" - #: ../../library/os.rst:981 ../../library/os.rst:1266 msgid "The new file descriptor is now non-inheritable." msgstr "" @@ -1446,10 +1451,6 @@ msgstr "" msgid "These operations only make sense for filesystems that support them." msgstr "" -#: ../../library/os.rst:1244 -msgid ":ref:`Availability `: Linux >= 3.1, macOS, Unix" -msgstr ":ref:`適用 `:Linux 3.1 以上、macOS、Unix。" - #: ../../library/os.rst:1251 msgid "" "Open the file *path* and set various flags according to *flags* and possibly " @@ -1689,14 +1690,6 @@ msgstr "" msgid "Combine the functionality of :func:`os.readv` and :func:`os.pread`." msgstr "" -#: ../../library/os.rst:1489 ../../library/os.rst:1574 -msgid "" -":ref:`Availability `: Linux >= 2.6.30, FreeBSD >= 6.0, OpenBSD " -">= 2.7, AIX >= 7.1." -msgstr "" -":ref:`適用 `:Linux 2.6.30 以上、FreeBSD 6.0 以上、OpenBSD 2.7 " -"以上、AIX 7.1 以上。" - #: ../../library/os.rst:1491 ../../library/os.rst:1576 msgid "Using flags requires Linux >= 4.6." msgstr "" @@ -1715,10 +1708,6 @@ msgid "" "EAGAIN`." msgstr "" -#: ../../library/os.rst:1506 -msgid ":ref:`Availability `: Linux >= 4.14." -msgstr ":ref:`適用 `:Linux 4.14 以上。" - #: ../../library/os.rst:1513 msgid "" "High priority read/write. Allows block-based filesystems to use polling of " @@ -1731,10 +1720,6 @@ msgid "" "using the :data:`O_DIRECT` flag." msgstr "" -#: ../../library/os.rst:1520 -msgid ":ref:`Availability `: Linux >= 4.6." -msgstr ":ref:`適用 `:Linux 4.6 以上。" - #: ../../library/os.rst:1527 msgid "" "Return the name of the slave pseudo-terminal device associated with the " @@ -1794,10 +1779,6 @@ msgid "" "This flag effect applies only to the data range written by the system call." msgstr "" -#: ../../library/os.rst:1586 ../../library/os.rst:1596 -msgid ":ref:`Availability `: Linux >= 4.7." -msgstr ":ref:`適用 `:Linux 4.7 以上。" - #: ../../library/os.rst:1593 msgid "" "Provide a per-write equivalent of the :data:`O_SYNC` :func:`os.open` flag. " @@ -1814,10 +1795,6 @@ msgid "" "*offset* is updated." msgstr "" -#: ../../library/os.rst:1610 -msgid ":ref:`Availability `: Linux >= 4.16." -msgstr ":ref:`適用 `:Linux 4.16 以上。" - #: ../../library/os.rst:1617 msgid "Read at most *n* bytes from file descriptor *fd*." msgstr "" @@ -1938,10 +1915,6 @@ msgid "" "the pipe." msgstr "" -#: ../../library/os.rst:1738 -msgid ":ref:`Availability `: Linux >= 2.6.17 with glibc >= 2.5" -msgstr ":ref:`適用 `:Linux 2.6.17 以上且具有 glibc 2.5 以上" - #: ../../library/os.rst:1751 msgid "" "Read from a file descriptor *fd* into a number of mutable :term:`bytes-like " @@ -2092,12 +2065,6 @@ msgstr "" msgid "Get the \"inheritable\" flag of the specified handle (a boolean)." msgstr "" -#: ../../library/os.rst:1915 ../../library/os.rst:1921 -#: ../../library/os.rst:4218 ../../library/os.rst:4894 -#: ../../library/os.rst:4939 -msgid ":ref:`Availability `: Windows." -msgstr ":ref:`適用 `:Windows。" - #: ../../library/os.rst:1919 msgid "Set the \"inheritable\" flag of the specified handle." msgstr "" @@ -2533,14 +2500,6 @@ msgid "" "changing the mode of symbolic links is supported." msgstr "" -#: ../../library/os.rst:2239 -msgid "" -":ref:`Availability `: Unix, Windows, not Linux, FreeBSD >= " -"1.3, NetBSD >= 1.3, not OpenBSD" -msgstr "" -":ref:`適用 `:Unix、Windows、非 Linux、FreeBSD 1.3 以上、" -"NetBSD 1.3 以上、非 OpenBSD。" - #: ../../library/os.rst:2249 msgid "" "Change the owner and group id of *path* to the numeric *uid* and *gid*. " @@ -2650,11 +2609,6 @@ msgid "" "arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``os.listdrives``。" -#: ../../library/os.rst:2334 ../../library/os.rst:2358 -#: ../../library/os.rst:2378 -msgid ":ref:`Availability `: Windows" -msgstr ":ref:`適用 `:Windows。" - #: ../../library/os.rst:2341 msgid "" "Return a list containing the mount points for a volume on a Windows system." @@ -4276,18 +4230,10 @@ msgid "" "side effects." msgstr "" -#: ../../library/os.rst:3737 -msgid ":ref:`Availability `: Linux >= 3.17 with glibc >= 2.27." -msgstr ":ref:`適用 `:Linux 3.17 以上且具有 glibc 2.27 以上。" - #: ../../library/os.rst:3760 msgid "These flags can be passed to :func:`memfd_create`." msgstr "這些旗標可以傳給 :func:`memfd_create`。" -#: ../../library/os.rst:3762 -msgid ":ref:`Availability `: Linux >= 3.17 with glibc >= 2.27" -msgstr ":ref:`適用 `:Linux 3.17 以上且具有 glibc 2.27 以上" - #: ../../library/os.rst:3764 msgid "The ``MFD_HUGE*`` flags are only available since Linux 4.14." msgstr "``MFD_HUGE*`` 旗標僅在 Linux 4.14 以上可用。" @@ -4359,25 +4305,12 @@ msgid "" " os.close(fd)" msgstr "" -#: ../../library/os.rst:3816 ../../library/os.rst:3932 -#: ../../library/os.rst:3995 ../../library/os.rst:4005 -#: ../../library/os.rst:4023 ../../library/os.rst:4032 -#: ../../library/os.rst:4042 ../../library/os.rst:4052 -#: ../../library/os.rst:4062 ../../library/os.rst:4073 -msgid ":ref:`Availability `: Linux >= 2.6.27 with glibc >= 2.8" -msgstr ":ref:`適用 `:Linux 2.6.27 以上且具有 glibc 2.8 以上" - #: ../../library/os.rst:3822 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:3825 ../../library/os.rst:3834 -#: ../../library/os.rst:3842 ../../library/os.rst:3851 -msgid ":ref:`Availability `: Linux >= 2.6.27" -msgstr ":ref:`適用 `:Linux 2.6.27 以上" - #: ../../library/os.rst:3831 msgid "" "Add value to an :func:`eventfd` file descriptor. *value* must be a 64 bit " @@ -4399,10 +4332,6 @@ msgid "" "descriptor. On read the internal counter is decremented by one." msgstr "" -#: ../../library/os.rst:3860 -msgid ":ref:`Availability `: Linux >= 2.6.30" -msgstr ":ref:`適用 `:Linux 2.6.30 以上" - #: ../../library/os.rst:3868 msgid "Timer File Descriptors" msgstr "" @@ -4649,7 +4578,7 @@ msgstr "" #: ../../library/os.rst:4021 msgid ":manpage:`timerfd_gettime(2)`" -msgstr "" +msgstr ":manpage:`timerfd_gettime(2)`" #: ../../library/os.rst:4030 msgid "Similar to :func:`timerfd_gettime`, but return time as nanoseconds." @@ -4932,15 +4861,6 @@ msgstr "" "引發一個附帶引數 ``path``、``args``、``env`` 的\\ :ref:`稽核事件 ` " "``os.exec``。" -#: ../../library/os.rst:4287 ../../library/os.rst:4852 -#: ../../library/os.rst:4976 ../../library/os.rst:5095 -#: ../../library/os.rst:5264 -msgid "" -":ref:`Availability `: Unix, Windows, not WASI, not Android, " -"not iOS." -msgstr "" -":ref:`適用 `:Unix、Windows、非 WASI、非 Android、非 iOS。" - #: ../../library/os.rst:4289 msgid "" "Added support for specifying *path* as an open file descriptor for :func:" @@ -5124,11 +5044,6 @@ msgid "" "this longstanding platform compatibility problem to developers." msgstr "" -#: ../../library/os.rst:4490 ../../library/os.rst:4750 -msgid "" -":ref:`Availability `: POSIX, not WASI, not Android, not iOS." -msgstr ":ref:`適用 `:POSIX、非 WASI、非 Android、非 iOS。" - #: ../../library/os.rst:4495 msgid "" "Fork a child process, using a new pseudo-terminal as the child's controlling " @@ -5156,22 +5071,6 @@ msgid "" "fork`." msgstr "" -#: ../../library/os.rst:4517 ../../library/os.rst:4734 -#: ../../library/os.rst:4783 ../../library/os.rst:5020 -#: ../../library/os.rst:5054 ../../library/os.rst:5115 -#: ../../library/os.rst:5129 ../../library/os.rst:5146 -#: ../../library/os.rst:5161 ../../library/os.rst:5172 -#: ../../library/os.rst:5184 ../../library/os.rst:5197 -#: ../../library/os.rst:5206 ../../library/os.rst:5216 -#: ../../library/os.rst:5229 ../../library/os.rst:5280 -#: ../../library/os.rst:5291 ../../library/os.rst:5303 -#: ../../library/os.rst:5310 ../../library/os.rst:5319 -#: ../../library/os.rst:5328 ../../library/os.rst:5337 -#: ../../library/os.rst:5346 -msgid "" -":ref:`Availability `: Unix, not WASI, not Android, not iOS." -msgstr ":ref:`適用 `:Unix、非 WASI、非 Android、非 iOS。" - #: ../../library/os.rst:4526 msgid "" "Send signal *sig* to the process *pid*. Constants for the specific signals " @@ -5201,10 +5100,6 @@ msgstr "" "引發一個附帶引數 ``pid``、``sig`` 的\\ :ref:`稽核事件 ` ``os." "kill``。" -#: ../../library/os.rst:4541 -msgid ":ref:`Availability `: Unix, Windows, not WASI, not iOS." -msgstr ":ref:`適用 `:Unix、Windows、非 WASI、非 iOS" - #: ../../library/os.rst:4553 msgid "Send the signal *sig* to the process group *pgid*." msgstr "" @@ -5217,10 +5112,6 @@ msgstr "" "引發一個附帶引數 ``pgid``、``sig`` 的\\ :ref:`稽核事件 ` ``os." "killpg``。" -#: ../../library/os.rst:4557 ../../library/os.rst:4594 -msgid ":ref:`Availability `: Unix, not WASI, not iOS." -msgstr ":ref:`適用 `:Unix、非 WASI、非 iOS。" - #: ../../library/os.rst:4562 msgid "" "Add *increment* to the process's \"niceness\". Return the new niceness." @@ -5237,14 +5128,6 @@ msgstr "" msgid "See the :manpage:`pidfd_open(2)` man page for more details." msgstr "更多細節請見 :manpage:`pidfd_open(2)` 手冊頁。" -#: ../../library/os.rst:4575 -msgid "" -":ref:`Availability `: Linux >= 5.3, Android >= :func:`build-" -"time ` API level 31" -msgstr "" -":ref:`適用 `:Linux 5.3 Android 6.0 以上、Android :func:`build-" -"time ` API level 31 以上" - #: ../../library/os.rst:4580 msgid "" "This flag indicates that the file descriptor will be non-blocking. If the " @@ -5253,10 +5136,6 @@ msgid "" "immediately return the error :const:`~errno.EAGAIN` rather than blocking." msgstr "" -#: ../../library/os.rst:4585 -msgid ":ref:`Availability `: Linux >= 5.10" -msgstr ":ref:`適用 `:Linux 5.10 以上" - #: ../../library/os.rst:4591 msgid "" "Lock program segments into memory. The value of *op* (defined in ```: not WASI, not Android, not iOS." -msgstr ":ref:`適用 `:非 WASI、非 Android、非 iOS。" - #: ../../library/os.rst:4629 msgid "" "The :ref:`Python UTF-8 Mode ` affects encodings used for *cmd* " @@ -6546,10 +6421,6 @@ msgid "" "pages/man2/getrandom.2.html>`_." msgstr "" -#: ../../library/os.rst:5688 -msgid ":ref:`Availability `: Linux >= 3.17." -msgstr ":ref:`適用 `:Linux 3.17 以上。" - #: ../../library/os.rst:5694 msgid "" "Return a bytestring of *size* random bytes suitable for cryptographic use." @@ -6775,18 +6646,3 @@ msgstr "path separator (POSIX)(路徑分隔器 (POSIX))" #: ../../library/os.rst:5619 msgid "; (semicolon)" msgstr "; (分號)" - -#~ msgid ":ref:`Availability `: Linux >= 5.3" -#~ msgstr ":ref:`適用 `:Linux 5.3 以上" - -#~ msgid ":ref:`Availability `: Unix, not Emscripten, not WASI." -#~ msgstr ":ref:`適用 `:Unix、非 Emscripten、非 WASI。" - -#~ msgid ":ref:`Availability `: Unix, not Emscripten." -#~ msgstr ":ref:`適用 `:Unix、非 Emscripten。" - -#~ msgid ":ref:`Availability `: Unix, Windows, not Emscripten." -#~ msgstr ":ref:`適用 `:Unix、Windows、非 Emscripten。" - -#~ msgid ":ref:`Availability `: not Emscripten, not WASI." -#~ msgstr ":ref:`適用 `:非 Emscripten、非 WASI。" diff --git a/library/pkgutil.po b/library/pkgutil.po index c8a23bee35..31147bebcb 100644 --- a/library/pkgutil.po +++ b/library/pkgutil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-01 22:24+0800\n" +"POT-Creation-Date: 2024-10-10 00:13+0000\n" "PO-Revision-Date: 2024-03-08 16:07+0000\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -55,15 +55,15 @@ msgstr "" #: ../../library/pkgutil.rst:28 msgid "" "For each directory on :data:`sys.path` that has a subdirectory that matches " -"the package name, add the subdirectory to the package's :attr:`__path__`. " -"This is useful if one wants to distribute different parts of a single " -"logical package as multiple directories." +"the package name, add the subdirectory to the package's :attr:`~module." +"__path__`. This is useful if one wants to distribute different parts of a " +"single logical package as multiple directories." msgstr "" "對於 :data:`sys.path` 上具有與套件名稱相符的子目錄的每個目錄,將該子目錄新增" -"至套件的 :attr:`__path__` 中。如果想要將單一邏輯套件的不同部分給分配到多個目" -"錄時,這會非常有用。" +"至套件的 :attr:`~module.__path__` 中。如果想要將單一邏輯套件的不同部分給分配" +"到多個目錄時,這會非常有用。" -#: ../../library/pkgutil.rst:33 +#: ../../library/pkgutil.rst:34 msgid "" "It also looks for :file:`\\*.pkg` files beginning where ``*`` matches the " "*name* argument. This feature is similar to :file:`\\*.pth` files (see the :" @@ -79,7 +79,7 @@ msgstr "" "過空行和備註之外,在 :file:`\\*.pkg` 檔案中找到的所有條目都將新增到路徑中,無" "論它們是否存在於檔案系統。(這是一個功能。)" -#: ../../library/pkgutil.rst:41 +#: ../../library/pkgutil.rst:42 msgid "" "If the input path is not a list (as is the case for frozen packages) it is " "returned unchanged. The input path is not modified; an extended copy is " @@ -88,7 +88,7 @@ msgstr "" "如果輸入路徑不是串列(像是凍結套件 (frozen package) 的情況),它將原封不動地" "被回傳。輸入路徑不會被修改;而是回傳擴充後的副本。僅將項目附加到副本的尾端。" -#: ../../library/pkgutil.rst:45 +#: ../../library/pkgutil.rst:46 msgid "" "It is assumed that :data:`sys.path` is a sequence. Items of :data:`sys." "path` that are not strings referring to existing directories are ignored. " @@ -100,11 +100,11 @@ msgstr "" "存目錄的字串則將被忽略。:data:`sys.path` 上用作檔案名稱時導致錯誤的 Unicode " "項目可能會導致此函式引發例外(與 :func:`os.path.isdir` 行為一致)。" -#: ../../library/pkgutil.rst:53 +#: ../../library/pkgutil.rst:54 msgid "Retrieve a module :term:`loader` for the given *fullname*." msgstr "取得給定之 *fullname* 的模組 :term:`loader`。" -#: ../../library/pkgutil.rst:55 +#: ../../library/pkgutil.rst:56 msgid "" "This is a backwards compatibility wrapper around :func:`importlib.util." "find_spec` that converts most failures to :exc:`ImportError` and only " @@ -115,9 +115,9 @@ msgstr "" "轉換為 :exc:`ImportError` 並且僅回傳載入器而不是完整的 :class:`importlib." "machinery.ModuleSpec`。" -#: ../../library/pkgutil.rst:60 ../../library/pkgutil.rst:81 -#: ../../library/pkgutil.rst:96 ../../library/pkgutil.rst:120 -#: ../../library/pkgutil.rst:141 ../../library/pkgutil.rst:180 +#: ../../library/pkgutil.rst:61 ../../library/pkgutil.rst:82 +#: ../../library/pkgutil.rst:97 ../../library/pkgutil.rst:121 +#: ../../library/pkgutil.rst:142 ../../library/pkgutil.rst:181 msgid "" "Updated to be based directly on :mod:`importlib` rather than relying on the " "package internal :pep:`302` import emulation." @@ -125,19 +125,19 @@ msgstr "" "更新為直接基於 :mod:`importlib`,而不是依賴套件內部 :pep:`302` 的引入模擬 " "(import emulation)。" -#: ../../library/pkgutil.rst:64 ../../library/pkgutil.rst:100 +#: ../../library/pkgutil.rst:65 ../../library/pkgutil.rst:101 msgid "Updated to be based on :pep:`451`" msgstr "基於 :pep:`451` 來更新" -#: ../../library/pkgutil.rst:67 ../../library/pkgutil.rst:103 +#: ../../library/pkgutil.rst:68 ../../library/pkgutil.rst:104 msgid "Use :func:`importlib.util.find_spec` instead." msgstr "改用 :func:`importlib.util.find_spec`。" -#: ../../library/pkgutil.rst:73 +#: ../../library/pkgutil.rst:74 msgid "Retrieve a :term:`finder` for the given *path_item*." msgstr "取得給定之 *path_item* 的 :term:`finder`。" -#: ../../library/pkgutil.rst:75 +#: ../../library/pkgutil.rst:76 msgid "" "The returned finder is cached in :data:`sys.path_importer_cache` if it was " "newly created by a path hook." @@ -145,18 +145,18 @@ msgstr "" "如果回傳的尋檢器 (finder) 是由路徑勾點 (path hook) 所新建立的,則它會被快取" "在 :data:`sys.path_importer_cache` 中。" -#: ../../library/pkgutil.rst:78 +#: ../../library/pkgutil.rst:79 msgid "" "The cache (or part of it) can be cleared manually if a rescan of :data:`sys." "path_hooks` is necessary." msgstr "" "如果需要重新掃描 :data:`sys.path_hooks`,可以手動清除快取(或部分快取)。" -#: ../../library/pkgutil.rst:88 +#: ../../library/pkgutil.rst:89 msgid "Get a :term:`loader` object for *module_or_name*." msgstr "取得 *module_or_name* 的 :term:`loader` 物件。" -#: ../../library/pkgutil.rst:90 +#: ../../library/pkgutil.rst:91 msgid "" "If the module or package is accessible via the normal import mechanism, a " "wrapper around the relevant part of that machinery is returned. Returns " @@ -168,11 +168,11 @@ msgstr "" "不到或無法引入模組,則回傳 ``None``。如果指定的模組尚未被引入,則引入其包含的" "套件(如有存在)以建立套件 ``__path__``。" -#: ../../library/pkgutil.rst:109 +#: ../../library/pkgutil.rst:110 msgid "Yield :term:`finder` objects for the given module name." msgstr "yield 給定模組名稱的 :term:`finder` 物件。" -#: ../../library/pkgutil.rst:111 +#: ../../library/pkgutil.rst:112 msgid "" "If fullname contains a ``'.'``, the finders will be for the package " "containing fullname, otherwise they will be all registered top level finders " @@ -182,7 +182,7 @@ msgstr "" "會是在頂層被註冊的尋檢器(即 :data:`sys.meta_path` 和 :data:`sys.path_hooks` " "上的尋檢器)。" -#: ../../library/pkgutil.rst:115 +#: ../../library/pkgutil.rst:116 msgid "" "If the named module is in a package, that package is imported as a side " "effect of invoking this function." @@ -190,11 +190,11 @@ msgstr "" "如果指定的模組位於套件中,則作為呼叫此函式的副作用 (side effect) ,該套件會被" "引入。" -#: ../../library/pkgutil.rst:118 +#: ../../library/pkgutil.rst:119 msgid "If no module name is specified, all top level finders are produced." msgstr "如果未指定模組名稱,則會產生所有頂層尋檢器。" -#: ../../library/pkgutil.rst:127 +#: ../../library/pkgutil.rst:128 msgid "" "Yields :class:`ModuleInfo` for all submodules on *path*, or, if *path* is " "``None``, all top-level modules on :data:`sys.path`." @@ -202,17 +202,17 @@ msgstr "" "yield *path* 上所有子模組的 :class:`ModuleInfo`,或者如果 *path* 為 " "``None``,則產生 :data:`sys.path` 上的所有頂層模組。" -#: ../../library/pkgutil.rst:130 ../../library/pkgutil.rst:151 +#: ../../library/pkgutil.rst:131 ../../library/pkgutil.rst:152 msgid "" "*path* should be either ``None`` or a list of paths to look for modules in." msgstr "*path* 應該是 ``None`` 或用來尋找模組的路徑串列。" -#: ../../library/pkgutil.rst:132 ../../library/pkgutil.rst:153 +#: ../../library/pkgutil.rst:133 ../../library/pkgutil.rst:154 msgid "" "*prefix* is a string to output on the front of every module name on output." msgstr "*prefix* 是在輸出的每個模組名稱前面的輸出字串。" -#: ../../library/pkgutil.rst:136 ../../library/pkgutil.rst:175 +#: ../../library/pkgutil.rst:137 ../../library/pkgutil.rst:176 msgid "" "Only works for a :term:`finder` which defines an ``iter_modules()`` method. " "This interface is non-standard, so the module also provides implementations " @@ -223,7 +223,7 @@ msgstr "" "因此該模組還提供了 :class:`importlib.machinery.FileFinder` 和 :class:" "`zipimport.zipimporter` 的實作。" -#: ../../library/pkgutil.rst:148 +#: ../../library/pkgutil.rst:149 msgid "" "Yields :class:`ModuleInfo` for all modules recursively on *path*, or, if " "*path* is ``None``, all accessible modules." @@ -231,7 +231,7 @@ msgstr "" "為 *path* 上的所有模組遞迴 yield 出 :class:`ModuleInfo`,或如果 *path* 為 " "``None`` 則 yield 所有可存取的模組。" -#: ../../library/pkgutil.rst:155 +#: ../../library/pkgutil.rst:156 msgid "" "Note that this function must import all *packages* (*not* all modules!) on " "the given *path*, in order to access the ``__path__`` attribute to find " @@ -240,7 +240,7 @@ msgstr "" "請注意,此函式必須引入給定之 *path* 上的所有\\ *套件*\\ (*不是*\\ 所有模" "組!),以便存取 ``__path__`` 屬性來尋找子模組。" -#: ../../library/pkgutil.rst:159 +#: ../../library/pkgutil.rst:160 msgid "" "*onerror* is a function which gets called with one argument (the name of the " "package which was being imported) if any exception occurs while trying to " @@ -252,11 +252,11 @@ msgstr "" "引入之套件的名稱)來呼叫函式。如果未提供 *onerror* 函式,則會捕獲並忽略 :exc:" "`ImportError`,同時傳播所有其他例外並終止搜尋。" -#: ../../library/pkgutil.rst:165 +#: ../../library/pkgutil.rst:166 msgid "Examples::" msgstr "範例: ::" -#: ../../library/pkgutil.rst:167 +#: ../../library/pkgutil.rst:168 msgid "" "# list all modules python can access\n" "walk_packages()\n" @@ -265,11 +265,11 @@ msgid "" "walk_packages(ctypes.__path__, ctypes.__name__ + '.')" msgstr "" -#: ../../library/pkgutil.rst:187 +#: ../../library/pkgutil.rst:188 msgid "Get a resource from a package." msgstr "從套件中取得資源。" -#: ../../library/pkgutil.rst:189 +#: ../../library/pkgutil.rst:190 msgid "" "This is a wrapper for the :term:`loader` :meth:`get_data ` API. The *package* argument should be the name of " @@ -283,19 +283,19 @@ msgstr "" "*resource* 引數應為相對檔案名稱的形式,並使用 ``/`` 作為路徑分隔符號。不允許" "使用父目錄名稱 ``..``,也不允許使用根目錄名稱(以 ``/`` 開頭)。" -#: ../../library/pkgutil.rst:196 +#: ../../library/pkgutil.rst:197 msgid "" "The function returns a binary string that is the contents of the specified " "resource." msgstr "該函式回傳一個二進位字串,它是指定資源的內容。" -#: ../../library/pkgutil.rst:199 +#: ../../library/pkgutil.rst:200 msgid "" "For packages located in the filesystem, which have already been imported, " "this is the rough equivalent of::" msgstr "對於位於檔案系統中且已被引入過的套件,這大致相當於: ::" -#: ../../library/pkgutil.rst:202 +#: ../../library/pkgutil.rst:203 msgid "" "d = os.path.dirname(sys.modules[package].__file__)\n" "data = open(os.path.join(d, resource), 'rb').read()" @@ -303,7 +303,7 @@ msgstr "" "d = os.path.dirname(sys.modules[package].__file__)\n" "data = open(os.path.join(d, resource), 'rb').read()" -#: ../../library/pkgutil.rst:205 +#: ../../library/pkgutil.rst:206 msgid "" "If the package cannot be located or loaded, or it uses a :term:`loader` " "which does not support :meth:`get_data `\\ 的 :term:`loader` 不支援 :meth:`get_data " "`。" -#: ../../library/pkgutil.rst:214 +#: ../../library/pkgutil.rst:215 msgid "Resolve a name to an object." msgstr "將名稱解析為物件。" -#: ../../library/pkgutil.rst:216 +#: ../../library/pkgutil.rst:217 msgid "" "This functionality is used in numerous places in the standard library (see :" "issue:`12915`) - and equivalent functionality is also in widely used third-" @@ -329,7 +329,7 @@ msgstr "" "標準函式庫中的許多地方都使用了此功能(請參閱 :issue:`12915`),且相同功能也被" "用於擁有廣大使用者的第三方套件,如 setuptools、Django 和 Pyramid。" -#: ../../library/pkgutil.rst:220 +#: ../../library/pkgutil.rst:221 msgid "" "It is expected that *name* will be a string in one of the following formats, " "where W is shorthand for a valid Python identifier and dot stands for a " @@ -338,15 +338,15 @@ msgstr "" "*name* 預期要是以下格式之一的字串,其中 W 是有效 Python 識別字的簡寫,而點 " "(dot) 代表這些偽正規表示式 (pseudo-regex) 中的字面句點 (literal period):" -#: ../../library/pkgutil.rst:224 +#: ../../library/pkgutil.rst:225 msgid "``W(.W)*``" msgstr "``W(.W)*``" -#: ../../library/pkgutil.rst:225 +#: ../../library/pkgutil.rst:226 msgid "``W(.W)*:(W(.W)*)?``" msgstr "``W(.W)*:(W(.W)*)?``" -#: ../../library/pkgutil.rst:227 +#: ../../library/pkgutil.rst:228 msgid "" "The first form is intended for backward compatibility only. It assumes that " "some part of the dotted name is a package, and the rest is an object " @@ -360,7 +360,7 @@ msgstr "" "於無法透過檢查 (inspection) 來推斷出套件停止的位置和物件層次結構的開始位置," "因此必須使用此形式來重複嘗試引入。" -#: ../../library/pkgutil.rst:234 +#: ../../library/pkgutil.rst:235 msgid "" "In the second form, the caller makes the division point clear through the " "provision of a single colon: the dotted name to the left of the colon is a " @@ -372,21 +372,21 @@ msgstr "" "引入的套件,右側的點名稱是該套件內的物件層次結構。這種形式只需要一次引入。如" "果它以冒號結尾,則回傳一個模組物件。" -#: ../../library/pkgutil.rst:240 +#: ../../library/pkgutil.rst:241 msgid "" "The function will return an object (which might be a module), or raise one " "of the following exceptions:" msgstr "此函式會回傳一個物件(可能是一個模組),或引發以下其中一個例外:" -#: ../../library/pkgutil.rst:243 +#: ../../library/pkgutil.rst:244 msgid ":exc:`ValueError` -- if *name* isn't in a recognised format." msgstr ":exc:`ValueError` -- 如果 *name* 不是可辨識的格式。" -#: ../../library/pkgutil.rst:245 +#: ../../library/pkgutil.rst:246 msgid ":exc:`ImportError` -- if an import failed when it shouldn't have." msgstr ":exc:`ImportError` -- 如果在不應該失敗的情況下引入失敗。" -#: ../../library/pkgutil.rst:247 +#: ../../library/pkgutil.rst:248 msgid "" ":exc:`AttributeError` -- If a failure occurred when traversing the object " "hierarchy within the imported package to get to the desired object." diff --git a/library/poplib.po b/library/poplib.po index 05056d6a9f..8777e9766c 100644 --- a/library/poplib.po +++ b/library/poplib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-11 00:13+0000\n" "PO-Revision-Date: 2018-05-23 16:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -52,8 +52,8 @@ msgid "" msgstr "" #: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not WASI." -msgstr ":ref:`適用 `:非 WASI。" +msgid "Availability" +msgstr "" #: ../../includes/wasm-notavail.rst:5 msgid "" @@ -349,19 +349,3 @@ msgstr "POP3" #: ../../library/poplib.rst:12 msgid "protocol" msgstr "protocol(協定)" - -#, fuzzy -#~ msgid "" -#~ "Raises an auditing event poplib.connect with arguments self, host, port." -#~ msgstr "" -#~ "引發一個附帶引數 ``self``、``host``、``port`` 的\\ :ref:`稽核事件 " -#~ "` ``poplib.connect``。" - -#, fuzzy -#~ msgid "" -#~ "All commands will raise an auditing event poplib.putline with arguments " -#~ "self and line, where line is the bytes about to be sent to the remote " -#~ "host." -#~ msgstr "" -#~ "引發一個附帶引數 ``self``、``line`` 的\\ :ref:`稽核事件 ` " -#~ "``poplib.putline``。其中 ``line`` 為即將傳送給遠端的位元組。" diff --git a/library/posix.po b/library/posix.po index 394ad55dc8..b80eda94d9 100644 --- a/library/posix.po +++ b/library/posix.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2024-10-11 00:13+0000\n" "PO-Revision-Date: 2023-01-24 00:05+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -33,8 +33,8 @@ msgstr "" "功能的存取。" #: ../../library/posix.rst:14 -msgid ":ref:`Availability `: Unix." -msgstr ":ref:`適用 `:Unix。" +msgid "Availability" +msgstr "" #: ../../library/posix.rst:18 msgid "" diff --git a/library/pty.po b/library/pty.po index f609bfc794..e6e9a6bb7f 100644 --- a/library/pty.po +++ b/library/pty.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2024-10-11 00:13+0000\n" "PO-Revision-Date: 2016-11-19 00:33+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -33,8 +33,8 @@ msgid "" msgstr "" #: ../../library/pty.rst:19 -msgid ":ref:`Availability `: Unix." -msgstr ":ref:`適用 `:Unix。" +msgid "Availability" +msgstr "" #: ../../library/pty.rst:21 msgid "" diff --git a/library/pwd.po b/library/pwd.po index 29507dc008..aac5275e62 100644 --- a/library/pwd.po +++ b/library/pwd.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-11 00:13+0000\n" "PO-Revision-Date: 2023-05-20 16:08+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -31,9 +31,8 @@ msgstr "" "此模組提供對 Unix 使用者帳戶和密碼資料庫的存取介面。它適用於所有 Unix 版本。" #: ../../library/pwd.rst:13 -#, fuzzy -msgid ":ref:`Availability `: Unix, not WASI, not iOS." -msgstr ":ref:`適用 `:Unix、非 Emscripten、非 WASI。" +msgid "Availability" +msgstr "" #: ../../library/pwd.rst:15 msgid "" @@ -190,23 +189,3 @@ msgstr ":mod:`grp` 模組" #: ../../library/pwd.rst:71 msgid "An interface to the group database, similar to this." msgstr "群組資料庫的介面,與此模組類似。" - -#~ msgid "Module :mod:`spwd`" -#~ msgstr ":mod:`spwd` 模組" - -#~ msgid "An interface to the shadow password database, similar to this." -#~ msgstr "Shadow 密碼資料庫的介面,與此模組類似。" - -#~ msgid "module" -#~ msgstr "module(模組)" - -#~ msgid "crypt" -#~ msgstr "crypt" - -#~ msgid "" -#~ "This module does not work or is not available on WebAssembly platforms " -#~ "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` " -#~ "for more information." -#~ msgstr "" -#~ "此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上不起" -#~ "作用或無法使用。更多資訊請參閱 :ref:`wasm-availability`。" diff --git a/library/readline.po b/library/readline.po index 40b729b026..a9c7721341 100644 --- a/library/readline.po +++ b/library/readline.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-11 00:13+0000\n" "PO-Revision-Date: 2018-05-23 16:09+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -44,8 +44,8 @@ msgid "" msgstr "" #: ../../includes/wasm-mobile-notavail.rst:3 -msgid ":ref:`Availability `: not Android, not iOS, not WASI." -msgstr ":ref:`適用 `:非 Android、非 iOS、非 WASI。" +msgid "Availability" +msgstr "" #: ../../includes/wasm-mobile-notavail.rst:5 msgid "" diff --git a/library/resource.po b/library/resource.po index f1f4e4a90c..52adbd9db0 100644 --- a/library/resource.po +++ b/library/resource.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-11 00:13+0000\n" "PO-Revision-Date: 2018-05-23 16:09+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -27,10 +27,14 @@ msgid "" "resources utilized by a program." msgstr "" -#: ../../library/resource.rst:16 -#, fuzzy -msgid ":ref:`Availability `: Unix, not WASI." -msgstr ":ref:`適用 `:Unix、非 Emscripten、非 WASI。" +#: ../../library/resource.rst:16 ../../library/resource.rst:104 +#: ../../library/resource.rst:180 ../../library/resource.rst:192 +#: ../../library/resource.rst:201 ../../library/resource.rst:210 +#: ../../library/resource.rst:220 ../../library/resource.rst:229 +#: ../../library/resource.rst:239 ../../library/resource.rst:252 +#: ../../library/resource.rst:260 ../../library/resource.rst:268 +msgid "Availability" +msgstr "" #: ../../library/resource.rst:18 msgid "" @@ -153,10 +157,6 @@ msgstr "" "引發一個附帶引數 ``pid``、``resource``、``limits`` 的\\ :ref:`稽核事件 " "` ``resource.prlimit``。" -#: ../../library/resource.rst:104 -msgid ":ref:`Availability `: Linux >= 2.6.36 with glibc >= 2.13." -msgstr ":ref:`適用 `:Linux 2.6.36 以上且具有 glibc 2.13 以上。" - #: ../../library/resource.rst:109 msgid "" "These symbols define resources whose consumption can be controlled using " @@ -227,10 +227,6 @@ msgstr "" msgid "The largest area of mapped memory which the process may occupy." msgstr "" -#: ../../library/resource.rst:180 ../../library/resource.rst:268 -msgid ":ref:`Availability `: FreeBSD >= 11." -msgstr ":ref:`適用 `:FreeBSD 11 以上。" - #: ../../library/resource.rst:185 msgid "" "The maximum area (in bytes) of address space which may be taken by the " @@ -241,18 +237,10 @@ msgstr "" msgid "The number of bytes that can be allocated for POSIX message queues." msgstr "" -#: ../../library/resource.rst:192 ../../library/resource.rst:229 -msgid ":ref:`Availability `: Linux >= 2.6.8." -msgstr ":ref:`適用 `:Linux 2.6.8 以上。" - #: ../../library/resource.rst:199 msgid "The ceiling for the process's nice level (calculated as 20 - rlim_cur)." msgstr "" -#: ../../library/resource.rst:201 ../../library/resource.rst:210 -msgid ":ref:`Availability `: Linux >= 2.6.12." -msgstr ":ref:`適用 `:Linux 2.6.12 以上。" - #: ../../library/resource.rst:208 msgid "The ceiling of the real-time priority." msgstr "" @@ -263,10 +251,6 @@ msgid "" "real-time scheduling without making a blocking syscall." msgstr "" -#: ../../library/resource.rst:220 -msgid ":ref:`Availability `: Linux >= 2.6.25." -msgstr ":ref:`適用 `:Linux 2.6.25 以上。" - #: ../../library/resource.rst:227 msgid "The number of signals which the process may queue." msgstr "" @@ -278,11 +262,6 @@ msgid "" "this user may hold at any time." msgstr "" -#: ../../library/resource.rst:239 ../../library/resource.rst:252 -#: ../../library/resource.rst:260 -msgid ":ref:`Availability `: FreeBSD." -msgstr ":ref:`適用 `:FreeBSD。" - #: ../../library/resource.rst:245 msgid "" "The maximum size (in bytes) of the swap space that may be reserved or used " @@ -607,11 +586,3 @@ msgid "" "Pass to :func:`getrusage` to request resources consumed by the current " "thread. May not be available on all systems." msgstr "" - -#~ msgid "" -#~ "This module does not work or is not available on WebAssembly platforms " -#~ "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` " -#~ "for more information." -#~ msgstr "" -#~ "此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法" -#~ "作用或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" diff --git a/library/select.po b/library/select.po index 17c60cfe83..e5c6383d40 100644 --- a/library/select.po +++ b/library/select.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-11 00:13+0000\n" "PO-Revision-Date: 2018-05-23 16:09+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -41,9 +41,9 @@ msgid "" "precise control over the OS-level primitives used." msgstr "" -#: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not WASI." -msgstr ":ref:`適用 `:非 WASI。" +#: ../../library/select.rst:177 ../../includes/wasm-notavail.rst:3 +msgid "Availability" +msgstr "" #: ../../includes/wasm-notavail.rst:5 msgid "" @@ -237,10 +237,6 @@ msgstr "" msgid "This value is guaranteed by POSIX to be at least 512." msgstr "" -#: ../../library/select.rst:177 -msgid ":ref:`Availability `: Unix" -msgstr ":ref:`適用 `:Unix。" - #: ../../library/select.rst:185 msgid "``/dev/poll`` Polling Objects" msgstr "" diff --git a/library/selectors.po b/library/selectors.po index bf3bb5b888..8ba4c1202d 100644 --- a/library/selectors.po +++ b/library/selectors.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-11 00:13+0000\n" "PO-Revision-Date: 2018-05-23 16:09+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -70,8 +70,8 @@ msgid "Low-level I/O multiplexing module." msgstr "" #: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not WASI." -msgstr ":ref:`適用 `:非 WASI。" +msgid "Availability" +msgstr "" #: ../../includes/wasm-notavail.rst:5 msgid "" diff --git a/library/shutil.po b/library/shutil.po index 6eab863585..496e83ef0e 100644 --- a/library/shutil.po +++ b/library/shutil.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-26 00:13+0000\n" +"POT-Creation-Date: 2024-10-11 00:13+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-" @@ -541,9 +541,9 @@ msgstr "" msgid "On Windows, *path* can now be a file or directory." msgstr "" -#: ../../library/shutil.rst:422 -msgid ":ref:`Availability `: Unix, Windows." -msgstr ":ref:`適用 `:Unix、Windows。" +#: ../../library/shutil.rst:422 ../../library/shutil.rst:436 +msgid "Availability" +msgstr "" #: ../../library/shutil.rst:427 msgid "Change owner *user* and/or *group* of the given *path*." @@ -567,10 +567,6 @@ msgstr "" "引發一個附帶引數 ``path``、``user``、``group`` 的\\ :ref:`稽核事件 " "` ``shutil.chown``。" -#: ../../library/shutil.rst:436 -msgid ":ref:`Availability `: Unix." -msgstr ":ref:`適用 `:Unix。" - #: ../../library/shutil.rst:440 #, fuzzy msgid "Added *dir_fd* and *follow_symlinks* parameters." diff --git a/library/signal.po b/library/signal.po index f177d710de..ca7802204d 100644 --- a/library/signal.po +++ b/library/signal.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-27 00:14+0000\n" +"POT-Creation-Date: 2024-10-11 00:13+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-" @@ -152,18 +152,21 @@ msgid "" msgstr "" #: ../../library/signal.rst:103 ../../library/signal.rst:136 -#: ../../library/signal.rst:148 ../../library/signal.rst:154 +#: ../../library/signal.rst:142 ../../library/signal.rst:148 +#: ../../library/signal.rst:154 ../../library/signal.rst:160 #: ../../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:217 ../../library/signal.rst:232 +#: ../../library/signal.rst:238 ../../library/signal.rst:244 +#: ../../library/signal.rst:262 ../../library/signal.rst:272 +#: ../../library/signal.rst:351 ../../library/signal.rst:390 +#: ../../library/signal.rst:414 ../../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。" +msgid "Availability" +msgstr "" #: ../../library/signal.rst:105 ../../library/signal.rst:473 msgid "" @@ -203,11 +206,6 @@ msgstr "" msgid "Interrupt from keyboard (CTRL + BREAK)." msgstr "" -#: ../../library/signal.rst:142 ../../library/signal.rst:262 -#: ../../library/signal.rst:272 -msgid ":ref:`Availability `: Windows." -msgstr ":ref:`適用 `:Windows。" - #: ../../library/signal.rst:146 msgid "Bus error (bad memory access)." msgstr "" @@ -220,10 +218,6 @@ msgstr "" msgid "Alias to :data:`SIGCHLD`." msgstr ":data:`SIGCHLD` 的別名。" -#: ../../library/signal.rst:160 -msgid ":ref:`Availability `: not macOS." -msgstr ":ref:`適用 `:非 macOS。" - #: ../../library/signal.rst:164 msgid "Continue the process if it is currently stopped" msgstr "" @@ -281,10 +275,6 @@ msgid "" "can only be raised in user space." msgstr "" -#: ../../library/signal.rst:217 -msgid ":ref:`Availability `: Linux." -msgstr ":ref:`適用 `:Linux。" - #: ../../library/signal.rst:219 msgid "" "On architectures where the signal is available. See the man page :manpage:" @@ -468,12 +458,6 @@ msgstr "" msgid "See the :manpage:`pidfd_send_signal(2)` man page for more information." msgstr "更多資訊請見 :manpage:`pidfd_send_signal(2)` 手冊頁。" -#: ../../library/signal.rst:414 -msgid "" -":ref:`Availability `: Linux >= 5.1, Android >= :func:`build-" -"time ` API level 31" -msgstr "" - #: ../../library/signal.rst:420 msgid "" "Send the signal *signalnum* to the thread *thread_id*, another thread in the " @@ -952,6 +936,3 @@ msgid "" "serve_forever(httpd)\n" "print(\"Shutdown...\")" msgstr "" - -#~ msgid ":ref:`Availability `: Linux >= 5.1" -#~ msgstr ":ref:`適用 `:Linux 5.1 以上" diff --git a/library/smtplib.po b/library/smtplib.po index b3e25996f0..5e46fd820e 100644 --- a/library/smtplib.po +++ b/library/smtplib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-11 00:13+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-" @@ -35,8 +35,8 @@ msgid "" msgstr "" #: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not WASI." -msgstr ":ref:`適用 `:非 WASI。" +msgid "Availability" +msgstr "" #: ../../includes/wasm-notavail.rst:5 msgid "" diff --git a/library/socket.po b/library/socket.po index 9d99c82d2a..16a36ca0b5 100644 --- a/library/socket.po +++ b/library/socket.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-11 00:13+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-" @@ -38,17 +38,37 @@ msgid "" "operating system socket APIs." msgstr "" -#: ../../library/socket.rst:709 ../../library/socket.rst:994 -#: ../../library/socket.rst:1010 ../../library/socket.rst:1023 -#: ../../library/socket.rst:1038 ../../library/socket.rst:1055 -#: ../../library/socket.rst:1066 ../../library/socket.rst:1077 -#: ../../library/socket.rst:1088 ../../library/socket.rst:1412 -#: ../../library/socket.rst:1459 ../../library/socket.rst:1473 -#: ../../library/socket.rst:1493 ../../library/socket.rst:1540 -#: ../../library/socket.rst:1585 ../../library/socket.rst:1969 -#: ../../library/socket.rst:1979 ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not WASI." -msgstr ":ref:`適用 `:非 WASI。" +#: ../../library/socket.rst:171 ../../library/socket.rst:181 +#: ../../library/socket.rst:209 ../../library/socket.rst:216 +#: ../../library/socket.rst:233 ../../library/socket.rst:383 +#: ../../library/socket.rst:461 ../../library/socket.rst:475 +#: ../../library/socket.rst:490 ../../library/socket.rst:501 +#: ../../library/socket.rst:510 ../../library/socket.rst:519 +#: ../../library/socket.rst:530 ../../library/socket.rst:542 +#: ../../library/socket.rst:553 ../../library/socket.rst:566 +#: ../../library/socket.rst:594 ../../library/socket.rst:606 +#: ../../library/socket.rst:612 ../../library/socket.rst:643 +#: ../../library/socket.rst:658 ../../library/socket.rst:667 +#: ../../library/socket.rst:684 ../../library/socket.rst:699 +#: ../../library/socket.rst:709 ../../library/socket.rst:898 +#: ../../library/socket.rst:994 ../../library/socket.rst:1010 +#: ../../library/socket.rst:1023 ../../library/socket.rst:1038 +#: ../../library/socket.rst:1055 ../../library/socket.rst:1066 +#: ../../library/socket.rst:1077 ../../library/socket.rst:1088 +#: ../../library/socket.rst:1177 ../../library/socket.rst:1197 +#: ../../library/socket.rst:1223 ../../library/socket.rst:1246 +#: ../../library/socket.rst:1275 ../../library/socket.rst:1286 +#: ../../library/socket.rst:1313 ../../library/socket.rst:1330 +#: ../../library/socket.rst:1347 ../../library/socket.rst:1361 +#: ../../library/socket.rst:1412 ../../library/socket.rst:1459 +#: ../../library/socket.rst:1473 ../../library/socket.rst:1493 +#: ../../library/socket.rst:1540 ../../library/socket.rst:1585 +#: ../../library/socket.rst:1715 ../../library/socket.rst:1759 +#: ../../library/socket.rst:1867 ../../library/socket.rst:1885 +#: ../../library/socket.rst:1969 ../../library/socket.rst:1979 +#: ../../library/socket.rst:1991 ../../includes/wasm-notavail.rst:3 +msgid "Availability" +msgstr "" #: ../../includes/wasm-notavail.rst:5 msgid "" @@ -294,11 +314,6 @@ msgstr "" msgid "*feat* and *mask* are unsigned 32bit integers." msgstr "" -#: ../../library/socket.rst:171 ../../library/socket.rst:594 -#: ../../library/socket.rst:1885 -msgid ":ref:`Availability `: Linux >= 2.6.38." -msgstr ":ref:`適用 `:Linux >= 2.6.38。" - #: ../../library/socket.rst:173 msgid "Some algorithm types require more recent Kernels." msgstr "" @@ -310,10 +325,6 @@ msgid "" "context ID or CID and port are integers." msgstr "" -#: ../../library/socket.rst:181 ../../library/socket.rst:667 -msgid ":ref:`Availability `: Linux >= 3.9" -msgstr ":ref:`適用 `:Linux 3.9 以上。" - #: ../../library/socket.rst:183 msgid "See :manpage:`vsock(7)`" msgstr "請見 :manpage:`vsock(7)`" @@ -375,10 +386,6 @@ msgid "" "address, whose interpretation depends on the device." msgstr "" -#: ../../library/socket.rst:209 ../../library/socket.rst:542 -msgid ":ref:`Availability `: Linux >= 2.2." -msgstr ":ref:`適用 `:Linux >= 2.2。" - #: ../../library/socket.rst:211 msgid "" ":const:`AF_QIPCRTR` is a Linux-only socket based interface for communicating " @@ -387,10 +394,6 @@ msgid "" "*port* are non-negative integers." msgstr "" -#: ../../library/socket.rst:216 ../../library/socket.rst:643 -msgid ":ref:`Availability `: Linux >= 4.7." -msgstr ":ref:`適用 `:Linux >= 4.7。" - #: ../../library/socket.rst:220 msgid "" ":const:`IPPROTO_UDPLITE` is a variant of UDP which allows you to specify " @@ -409,10 +412,6 @@ msgid "" "IPPROTO_UDPLITE)`` for IPv6." msgstr "" -#: ../../library/socket.rst:233 -msgid ":ref:`Availability `: Linux >= 2.6.20, FreeBSD >= 10.1" -msgstr ":ref:`適用 `:Linux 2.6.20 以上、FreeBSD 10.1 以上。" - #: ../../library/socket.rst:237 msgid "" ":const:`AF_HYPERV` is a Windows-only socket based interface for " @@ -595,10 +594,6 @@ msgid "" "html>`_ for a more thorough explanation." msgstr "" -#: ../../library/socket.rst:383 -msgid ":ref:`Availability `: Linux >= 2.6.27." -msgstr ":ref:`適用 `:Linux >= 2.6.27。" - #: ../../library/socket.rst:404 msgid "" "Many constants of these forms, documented in the Unix documentation on " @@ -673,10 +668,6 @@ msgid "" "also defined in the socket module." msgstr "" -#: ../../library/socket.rst:461 -msgid ":ref:`Availability `: Linux >= 2.6.25, NetBSD >= 8." -msgstr ":ref:`適用 `:Linux 2.6.25 以上、NetBSD 8 以上。" - #: ../../library/socket.rst:465 msgid "NetBSD support was added." msgstr "" @@ -688,10 +679,6 @@ msgid "" "documentation, are also defined in the socket module." msgstr "" -#: ../../library/socket.rst:475 ../../library/socket.rst:510 -msgid ":ref:`Availability `: Linux >= 2.6.25." -msgstr ":ref:`適用 `:Linux >= 2.6.25。" - #: ../../library/socket.rst:478 msgid "" "The :data:`CAN_BCM_CAN_FD_FRAME` flag is only available on Linux >= 4.8." @@ -708,20 +695,12 @@ msgstr "" msgid "This constant is documented in the Linux documentation." msgstr "" -#: ../../library/socket.rst:490 -msgid ":ref:`Availability `: Linux >= 3.6." -msgstr ":ref:`適用 `:Linux >= 3.6。" - #: ../../library/socket.rst:496 msgid "" "Joins the applied CAN filters such that only CAN frames that match all given " "CAN filters are passed to user space." msgstr "" -#: ../../library/socket.rst:501 -msgid ":ref:`Availability `: Linux >= 4.1." -msgstr ":ref:`適用 `:Linux >= 4.1。" - #: ../../library/socket.rst:507 msgid "" "CAN_ISOTP, in the CAN protocol family, is the ISO-TP (ISO 15765-2) protocol. " @@ -734,20 +713,12 @@ msgid "" "constants, documented in the Linux documentation." msgstr "" -#: ../../library/socket.rst:519 -msgid ":ref:`Availability `: Linux >= 5.4." -msgstr ":ref:`適用 `:Linux >= 5.4。" - #: ../../library/socket.rst:527 msgid "" "These two constants, documented in the FreeBSD divert(4) manual page, are " "also defined in the socket module." msgstr "" -#: ../../library/socket.rst:530 -msgid ":ref:`Availability `: FreeBSD >= 14.0." -msgstr ":ref:`適用 `:FreeBSD >= 14.0。" - #: ../../library/socket.rst:547 msgid "" ":data:`!ETH_P_ALL` can be used in the :class:`~socket.socket` constructor as " @@ -759,14 +730,6 @@ msgstr "" msgid "For more information, see the :manpage:`packet(7)` manpage." msgstr "" -#: ../../library/socket.rst:553 -msgid ":ref:`Availability `: Linux." -msgstr ":ref:`適用 `:Linux。" - -#: ../../library/socket.rst:566 -msgid ":ref:`Availability `: Linux >= 2.6.30." -msgstr ":ref:`適用 `:Linux >= 2.6.30。" - #: ../../library/socket.rst:576 msgid "" "Constants for Windows' WSAIoctl(). The constants are used as arguments to " @@ -791,14 +754,6 @@ msgstr "" msgid "Constants for Linux host/guest communication." msgstr "" -#: ../../library/socket.rst:606 -msgid ":ref:`Availability `: Linux >= 4.8." -msgstr ":ref:`適用 `:Linux >= 4.8。" - -#: ../../library/socket.rst:612 -msgid ":ref:`Availability `: BSD, macOS." -msgstr ":ref:`適用 `:BSD、macOS。" - #: ../../library/socket.rst:618 msgid "" "This constant contains a boolean value which indicates if IPv6 is supported " @@ -834,10 +789,6 @@ msgid "" "message type." msgstr "" -#: ../../library/socket.rst:658 -msgid ":ref:`Availability `: FreeBSD." -msgstr ":ref:`適用 `:FreeBSD。" - #: ../../library/socket.rst:662 msgid "" "Constant to optimize CPU locality, to be used in conjunction with :data:" @@ -848,21 +799,12 @@ msgstr "" msgid "Constants for Windows Hyper-V sockets for host/guest communications." msgstr "" -#: ../../library/socket.rst:684 ../../library/socket.rst:898 -#: ../../library/socket.rst:1991 -msgid ":ref:`Availability `: Windows." -msgstr ":ref:`適用 `:Windows。" - #: ../../library/socket.rst:695 msgid "" "`IEEE 802.3 protocol number `_. constants." msgstr "" -#: ../../library/socket.rst:699 -msgid ":ref:`Availability `: Linux, FreeBSD, macOS." -msgstr ":ref:`適用 `:Linux、FreeBSD、macOS。" - #: ../../library/socket.rst:707 msgid "" "These constants are used by the :meth:`~socket.socket.shutdown` method of " @@ -1455,10 +1397,6 @@ msgid "" "`inet_pton`." msgstr "" -#: ../../library/socket.rst:1177 ../../library/socket.rst:1197 -msgid ":ref:`Availability `: Unix, Windows." -msgstr ":ref:`適用 `:Unix、Windows。" - #: ../../library/socket.rst:1179 ../../library/socket.rst:1199 msgid "Windows support added" msgstr "" @@ -1491,11 +1429,6 @@ msgid "" "the permissible range of values." msgstr "" -#: ../../library/socket.rst:1223 ../../library/socket.rst:1246 -#: ../../library/socket.rst:1867 -msgid ":ref:`Availability `: Unix, not WASI." -msgstr ":ref:`適用 `:Unix、非 WASI。" - #: ../../library/socket.rst:1225 ../../library/socket.rst:1717 #: ../../library/socket.rst:1761 ../../library/socket.rst:1869 msgid "Most Unix platforms." @@ -1551,24 +1484,12 @@ msgstr "" "引發一個附帶引數 ``name`` 的\\ :ref:`稽核事件 ` ``socket." "sethostname``。" -#: ../../library/socket.rst:1275 -#, fuzzy -msgid ":ref:`Availability `: Unix, not Android." -msgstr ":ref:`適用 `:Unix、非 WASI。" - #: ../../library/socket.rst:1282 msgid "" "Return a list of network interface information (index int, name string) " "tuples. :exc:`OSError` if the system call fails." msgstr "" -#: ../../library/socket.rst:1286 ../../library/socket.rst:1313 -#: ../../library/socket.rst:1330 ../../library/socket.rst:1347 -#: ../../library/socket.rst:1361 -#, fuzzy -msgid ":ref:`Availability `: Unix, Windows, not WASI." -msgstr ":ref:`適用 `:Unix、非 WASI。" - #: ../../library/socket.rst:1290 ../../library/socket.rst:1317 #: ../../library/socket.rst:1334 msgid "Windows support was added." @@ -2017,10 +1938,6 @@ msgid "" " return msg, list(fds)" msgstr "" -#: ../../library/socket.rst:1715 ../../library/socket.rst:1759 -msgid ":ref:`Availability `: Unix." -msgstr ":ref:`適用 `:Unix。" - #: ../../library/socket.rst:1729 msgid "" "Receive normal data and ancillary data from the socket, behaving as :meth:" @@ -2715,14 +2632,3 @@ msgstr "module(模組)" #: ../../library/socket.rst:1951 msgid "struct" msgstr "struct" - -#~ msgid ":ref:`Availability `: not Emscripten, not WASI." -#~ msgstr ":ref:`適用 `:非 Emscripten、非 WASI。" - -#~ msgid ":ref:`Availability `: Unix, not Emscripten, not WASI." -#~ msgstr ":ref:`適用 `:Unix、非 Emscripten、非 WASI。" - -#~ msgid "" -#~ ":ref:`Availability `: Unix, Windows, not Emscripten, not " -#~ "WASI." -#~ msgstr ":ref:`適用 `:Unix、Windows、非 Emscripten、非 WASI。" diff --git a/library/socketserver.po b/library/socketserver.po index ac01c1ed20..4373fe8002 100644 --- a/library/socketserver.po +++ b/library/socketserver.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-11 00:13+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-" @@ -32,8 +32,8 @@ msgid "" msgstr "" #: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not WASI." -msgstr ":ref:`適用 `:非 WASI。" +msgid "Availability" +msgstr "" #: ../../includes/wasm-notavail.rst:5 msgid "" diff --git a/library/ssl.po b/library/ssl.po index 342879d494..a00c5acbd3 100644 --- a/library/ssl.po +++ b/library/ssl.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-11 00:13+0000\n" "PO-Revision-Date: 2024-08-28 00:43+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -59,9 +59,10 @@ msgstr "" "在使用此模組之前,請閱讀 :ref:`ssl-security`。如果不這樣做,可能會產生錯誤的" "安全性認知,因為 ssl 模組的預設設定未必適合你的應用程式。" +#: ../../library/ssl.rst:454 ../../library/ssl.rst:469 #: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not WASI." -msgstr ":ref:`適用 `:非 WASI。" +msgid "Availability" +msgstr "" #: ../../includes/wasm-notavail.rst:5 msgid "" @@ -721,10 +722,6 @@ msgstr "" "[(b'data...', 'x509_asn', {'1.3.6.1.5.5.7.3.1', '1.3.6.1.5.5.7.3.2'}),\n" " (b'data...', 'x509_asn', True)]" -#: ../../library/ssl.rst:454 ../../library/ssl.rst:469 -msgid ":ref:`Availability `: Windows." -msgstr ":ref:`適用 `:只有 Windows。" - #: ../../library/ssl.rst:460 msgid "" "Retrieve CRLs from Windows' system cert store. *store_name* may be one of " @@ -4145,6 +4142,3 @@ msgstr "certificates(憑證)" #: ../../library/ssl.rst:2147 msgid "X509 certificate" msgstr "X509 certificate(X509 憑證)" - -#~ msgid ":ref:`Availability `: not Emscripten, not WASI." -#~ msgstr ":ref:`適用 `: 非 Emscripten、非 WASI。" diff --git a/library/stat.po b/library/stat.po index 83b937fed9..d919c8307e 100644 --- a/library/stat.po +++ b/library/stat.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-11 00:13+0000\n" "PO-Revision-Date: 2016-11-19 00:34+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -429,7 +429,7 @@ msgid "All super-user supported flags" msgstr "" #: ../../library/stat.rst:409 ../../library/stat.rst:417 -msgid ":ref:`Availability `: macOS" +msgid "Availability" msgstr "" #: ../../library/stat.rst:415 diff --git a/library/stdtypes.po b/library/stdtypes.po index 6ba75aed17..e25ed787d8 100644 --- a/library/stdtypes.po +++ b/library/stdtypes.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-27 00:14+0000\n" +"POT-Creation-Date: 2024-10-12 00:13+0000\n" "PO-Revision-Date: 2022-06-12 15:22+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -3018,9 +3018,8 @@ msgid "" msgstr "" #: ../../library/stdtypes.rst:2027 -#, fuzzy msgid "*count* is now supported as a keyword argument." -msgstr "新增關鍵字引數的支援。" +msgstr "*count* 現在作為關鍵字引數被支援。" #: ../../library/stdtypes.rst:2033 msgid "" @@ -6223,13 +6222,14 @@ msgstr "" #: ../../library/stdtypes.rst:4471 msgid "" "If no positional argument is given, an empty dictionary is created. If a " -"positional argument is given and it is a mapping object, a dictionary is " -"created with the same key-value pairs as the mapping object. Otherwise, the " -"positional argument must be an :term:`iterable` object. Each item in the " -"iterable must itself be an iterable with exactly two objects. The first " -"object of each item becomes a key in the new dictionary, and the second " -"object the corresponding value. If a key occurs more than once, the last " -"value for that key becomes the corresponding value in the new dictionary." +"positional argument is given and it defines a ``keys()`` method, a " +"dictionary is created by calling :meth:`~object.__getitem__` on the argument " +"with each returned key from the method. Otherwise, the positional argument " +"must be an :term:`iterable` object. Each item in the iterable must itself " +"be an iterable with exactly two elements. The first element of each item " +"becomes a key in the new dictionary, and the second element the " +"corresponding value. If a key occurs more than once, the last value for " +"that key becomes the corresponding value in the new dictionary." msgstr "" #: ../../library/stdtypes.rst:4481 @@ -6445,26 +6445,27 @@ msgstr "" #: ../../library/stdtypes.rst:4636 msgid "" -":meth:`update` accepts either another dictionary object or an iterable of " -"key/value pairs (as tuples or other iterables of length two). If keyword " -"arguments are specified, the dictionary is then updated with those key/value " -"pairs: ``d.update(red=1, blue=2)``." +":meth:`update` accepts either another object with a ``keys()`` method (in " +"which case :meth:`~object.__getitem__` is called with every key returned " +"from the method). or an iterable of key/value pairs (as tuples or other " +"iterables of length two). If keyword arguments are specified, the dictionary " +"is then updated with those key/value pairs: ``d.update(red=1, blue=2)``." msgstr "" -#: ../../library/stdtypes.rst:4643 +#: ../../library/stdtypes.rst:4644 msgid "" "Return a new view of the dictionary's values. See the :ref:`documentation " "of view objects `." msgstr "" -#: ../../library/stdtypes.rst:4646 +#: ../../library/stdtypes.rst:4647 msgid "" "An equality comparison between one ``dict.values()`` view and another will " "always return ``False``. This also applies when comparing ``dict.values()`` " "to itself::" msgstr "" -#: ../../library/stdtypes.rst:4650 +#: ../../library/stdtypes.rst:4651 msgid "" ">>> d = {'a': 1}\n" ">>> d.values() == d.values()\n" @@ -6474,34 +6475,34 @@ msgstr "" ">>> d.values() == d.values()\n" "False" -#: ../../library/stdtypes.rst:4656 +#: ../../library/stdtypes.rst:4657 msgid "" "Create a new dictionary with the merged keys and values of *d* and *other*, " "which must both be dictionaries. The values of *other* take priority when " "*d* and *other* share keys." msgstr "" -#: ../../library/stdtypes.rst:4664 +#: ../../library/stdtypes.rst:4665 msgid "" "Update the dictionary *d* with keys and values from *other*, which may be " "either a :term:`mapping` or an :term:`iterable` of key/value pairs. The " "values of *other* take priority when *d* and *other* share keys." msgstr "" -#: ../../library/stdtypes.rst:4670 +#: ../../library/stdtypes.rst:4671 msgid "" "Dictionaries compare equal if and only if they have the same ``(key, " "value)`` pairs (regardless of ordering). Order comparisons ('<', '<=', '>=', " "'>') raise :exc:`TypeError`." msgstr "" -#: ../../library/stdtypes.rst:4674 +#: ../../library/stdtypes.rst:4675 msgid "" "Dictionaries preserve insertion order. Note that updating a key does not " "affect the order. Keys added after deletion are inserted at the end. ::" msgstr "" -#: ../../library/stdtypes.rst:4677 +#: ../../library/stdtypes.rst:4678 msgid "" ">>> d = {\"one\": 1, \"two\": 2, \"three\": 3, \"four\": 4}\n" ">>> d\n" @@ -6533,17 +6534,17 @@ msgstr "" ">>> d\n" "{'one': 42, 'three': 3, 'four': 4, 'two': None}" -#: ../../library/stdtypes.rst:4692 +#: ../../library/stdtypes.rst:4693 msgid "" "Dictionary order is guaranteed to be insertion order. This behavior was an " "implementation detail of CPython from 3.6." msgstr "" -#: ../../library/stdtypes.rst:4696 +#: ../../library/stdtypes.rst:4697 msgid "Dictionaries and dictionary views are reversible. ::" msgstr "" -#: ../../library/stdtypes.rst:4698 +#: ../../library/stdtypes.rst:4699 msgid "" ">>> d = {\"one\": 1, \"two\": 2, \"three\": 3, \"four\": 4}\n" ">>> d\n" @@ -6565,21 +6566,21 @@ msgstr "" ">>> list(reversed(d.items()))\n" "[('four', 4), ('three', 3), ('two', 2), ('one', 1)]" -#: ../../library/stdtypes.rst:4708 +#: ../../library/stdtypes.rst:4709 msgid "Dictionaries are now reversible." msgstr "" -#: ../../library/stdtypes.rst:4713 +#: ../../library/stdtypes.rst:4714 msgid "" ":class:`types.MappingProxyType` can be used to create a read-only view of a :" "class:`dict`." msgstr "" -#: ../../library/stdtypes.rst:4720 +#: ../../library/stdtypes.rst:4721 msgid "Dictionary view objects" msgstr "字典視圖物件" -#: ../../library/stdtypes.rst:4722 +#: ../../library/stdtypes.rst:4723 msgid "" "The objects returned by :meth:`dict.keys`, :meth:`dict.values` and :meth:" "`dict.items` are *view objects*. They provide a dynamic view on the " @@ -6587,23 +6588,23 @@ msgid "" "reflects these changes." msgstr "" -#: ../../library/stdtypes.rst:4727 +#: ../../library/stdtypes.rst:4728 msgid "" "Dictionary views can be iterated over to yield their respective data, and " "support membership tests:" msgstr "" -#: ../../library/stdtypes.rst:4732 +#: ../../library/stdtypes.rst:4733 msgid "Return the number of entries in the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4736 +#: ../../library/stdtypes.rst:4737 msgid "" "Return an iterator over the keys, values or items (represented as tuples of " "``(key, value)``) in the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4739 +#: ../../library/stdtypes.rst:4740 msgid "" "Keys and values are iterated over in insertion order. This allows the " "creation of ``(value, key)`` pairs using :func:`zip`: ``pairs = zip(d." @@ -6611,39 +6612,39 @@ msgid "" "[(v, k) for (k, v) in d.items()]``." msgstr "" -#: ../../library/stdtypes.rst:4744 +#: ../../library/stdtypes.rst:4745 msgid "" "Iterating views while adding or deleting entries in the dictionary may raise " "a :exc:`RuntimeError` or fail to iterate over all entries." msgstr "" -#: ../../library/stdtypes.rst:4747 +#: ../../library/stdtypes.rst:4748 msgid "Dictionary order is guaranteed to be insertion order." msgstr "" -#: ../../library/stdtypes.rst:4752 +#: ../../library/stdtypes.rst:4753 msgid "" "Return ``True`` if *x* is in the underlying dictionary's keys, values or " "items (in the latter case, *x* should be a ``(key, value)`` tuple)." msgstr "" -#: ../../library/stdtypes.rst:4757 +#: ../../library/stdtypes.rst:4758 msgid "" "Return a reverse iterator over the keys, values or items of the dictionary. " "The view will be iterated in reverse order of the insertion." msgstr "" -#: ../../library/stdtypes.rst:4760 +#: ../../library/stdtypes.rst:4761 msgid "Dictionary views are now reversible." msgstr "" -#: ../../library/stdtypes.rst:4765 +#: ../../library/stdtypes.rst:4766 msgid "" "Return a :class:`types.MappingProxyType` that wraps the original dictionary " "to which the view refers." msgstr "" -#: ../../library/stdtypes.rst:4770 +#: ../../library/stdtypes.rst:4771 msgid "" "Keys views are set-like since their entries are unique and :term:`hashable`. " "Items views also have set-like operations since the (key, value) pairs are " @@ -6657,11 +6658,11 @@ msgid "" "input." msgstr "" -#: ../../library/stdtypes.rst:4782 +#: ../../library/stdtypes.rst:4783 msgid "An example of dictionary view usage::" msgstr "" -#: ../../library/stdtypes.rst:4784 +#: ../../library/stdtypes.rst:4785 msgid "" ">>> dishes = {'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500}\n" ">>> keys = dishes.keys()\n" @@ -6702,11 +6703,11 @@ msgid "" "500" msgstr "" -#: ../../library/stdtypes.rst:4826 +#: ../../library/stdtypes.rst:4827 msgid "Context Manager Types" msgstr "情境管理器型別" -#: ../../library/stdtypes.rst:4833 +#: ../../library/stdtypes.rst:4834 msgid "" "Python's :keyword:`with` statement supports the concept of a runtime context " "defined by a context manager. This is implemented using a pair of methods " @@ -6717,7 +6718,7 @@ msgstr "" "要使用兩個方法來實作,該方法讓使用者定義類別能夠去定義 runtime 情境,且該情境" "在執行陳述式主體 (statement body) 之前進入、在陳述式結束時退出:" -#: ../../library/stdtypes.rst:4841 +#: ../../library/stdtypes.rst:4842 msgid "" "Enter the runtime context and return either this object or another object " "related to the runtime context. The value returned by this method is bound " @@ -6728,7 +6729,7 @@ msgstr "" "的值有被綁定到使用此情境管理器的 :keyword:`with` 陳述式的 :keyword:`!as` 子句" "中的識別字。" -#: ../../library/stdtypes.rst:4846 +#: ../../library/stdtypes.rst:4847 msgid "" "An example of a context manager that returns itself is a :term:`file " "object`. File objects return themselves from __enter__() to allow :func:" @@ -6737,7 +6738,7 @@ msgstr "" "一個會回傳自己的情境管理器範例是 :term:`file object`。檔案物件從 __enter__() " "回傳自己,以允許將 :func:`open` 用作 :keyword:`with` 陳述式中的情境運算式。" -#: ../../library/stdtypes.rst:4850 +#: ../../library/stdtypes.rst:4851 msgid "" "An example of a context manager that returns a related object is the one " "returned by :func:`decimal.localcontext`. These managers set the active " @@ -6751,7 +6752,7 @@ msgstr "" "本。這允許對 :keyword:`with` 陳述式主體中的當前十進位情境進行更改,而不會影" "響 :keyword:`!with` 陳述式外部的程式碼。" -#: ../../library/stdtypes.rst:4860 +#: ../../library/stdtypes.rst:4861 msgid "" "Exit the runtime context and return a Boolean flag indicating if any " "exception that occurred should be suppressed. If an exception occurred while " @@ -6763,7 +6764,7 @@ msgstr "" "keyword:`with` 陳述式主體時發生例外,則引數包含例外型別、值和回溯 " "(traceback) 資訊。否則,所有三個引數都是 ``None``。" -#: ../../library/stdtypes.rst:4865 +#: ../../library/stdtypes.rst:4866 msgid "" "Returning a true value from this method will cause the :keyword:`with` " "statement to suppress the exception and continue execution with the " @@ -6778,7 +6779,7 @@ msgstr "" "(propagate)。執行此方法期間發生的例外會取代 :keyword:`!with` 陳述式主體中發生" "的任何例外。" -#: ../../library/stdtypes.rst:4872 +#: ../../library/stdtypes.rst:4873 msgid "" "The exception passed in should never be reraised explicitly - instead, this " "method should return a false value to indicate that the method completed " @@ -6790,7 +6791,7 @@ msgstr "" "已成功完成且不希望抑制引發的例外。這讓情境管理程式碼能輕鬆檢測 :meth:" "`__exit__` 方法是否曾實際失敗過。" -#: ../../library/stdtypes.rst:4878 +#: ../../library/stdtypes.rst:4879 msgid "" "Python defines several context managers to support easy thread " "synchronisation, prompt closure of files or other objects, and simpler " @@ -6802,7 +6803,7 @@ msgstr "" "及對有效十進位算術情境的更簡單操作。除了情境管理協定的實作之外,不會對特定型" "別進行特殊處理。更多範例請參閱 :mod:`contextlib` 模組。" -#: ../../library/stdtypes.rst:4884 +#: ../../library/stdtypes.rst:4885 msgid "" "Python's :term:`generator`\\s and the :class:`contextlib.contextmanager` " "decorator provide a convenient way to implement these protocols. If a " @@ -6817,7 +6818,7 @@ msgstr "" "`~contextmanager.__enter__` 和 :meth:`~contextmanager.__exit__` 方法的情境管" "理器,而不是由未裝飾產生器函式產生的疊代器。" -#: ../../library/stdtypes.rst:4891 +#: ../../library/stdtypes.rst:4892 msgid "" "Note that there is no specific slot for any of these methods in the type " "structure for Python objects in the Python/C API. Extension types wanting to " @@ -6829,7 +6830,7 @@ msgstr "" "定義這些方法的擴充型別必須將它們作為普通的 Python 可存取方法提供。與設定 " "runtime 情境的開銷相比,單一類別字典查找的開銷可以忽略不計。" -#: ../../library/stdtypes.rst:4899 +#: ../../library/stdtypes.rst:4900 msgid "" "Type Annotation Types --- :ref:`Generic Alias `, :ref:" "`Union `" @@ -6837,7 +6838,7 @@ msgstr "" "型別註釋的型別 --- :ref:`泛型別名 (Generic Alias) `、:" "ref:`聯合 (Union) `" -#: ../../library/stdtypes.rst:4904 +#: ../../library/stdtypes.rst:4905 msgid "" "The core built-in types for :term:`type annotations ` are :ref:" "`Generic Alias ` and :ref:`Union `." @@ -6845,11 +6846,11 @@ msgstr "" ":term:`型別註釋 ` 的核心內建型別是\\ :ref:`泛型別名 `\\ 和\\ :ref:`聯合 `。" -#: ../../library/stdtypes.rst:4911 +#: ../../library/stdtypes.rst:4912 msgid "Generic Alias Type" msgstr "泛型別名型別" -#: ../../library/stdtypes.rst:4917 +#: ../../library/stdtypes.rst:4918 msgid "" "``GenericAlias`` objects are generally created by :ref:`subscripting " "` a class. They are most often used with :ref:`container " @@ -6864,7 +6865,7 @@ msgstr "" "物件,它是透過使用引數 :class:`int` 來下標 ``list`` 類別而建立的。" "``GenericAlias`` 物件主要會與\\ :term:`型別註釋 ` 一起使用。" -#: ../../library/stdtypes.rst:4927 +#: ../../library/stdtypes.rst:4928 msgid "" "It is generally only possible to subscript a class if the class implements " "the special method :meth:`~object.__class_getitem__`." @@ -6872,7 +6873,7 @@ msgstr "" "通常只有當類別有實作特殊方法 :meth:`~object.__class_getitem__` 時才可以去下標" "該類別。" -#: ../../library/stdtypes.rst:4930 +#: ../../library/stdtypes.rst:4931 msgid "" "A ``GenericAlias`` object acts as a proxy for a :term:`generic type`, " "implementing *parameterized generics*." @@ -6880,7 +6881,7 @@ msgstr "" "將一個 ``GenericAlias`` 物件用作 :term:`generic type` 的代理,實作\\ *參數化" "泛型 (parameterized generics)*。" -#: ../../library/stdtypes.rst:4933 +#: ../../library/stdtypes.rst:4934 msgid "" "For a container class, the argument(s) supplied to a :ref:`subscription " "` of the class may indicate the type(s) of the elements an " @@ -6892,7 +6893,7 @@ msgstr "" "物件所包含元素的型別。例如 ``set[bytes]`` 可以用於型別註釋來表示一個 :class:" "`set`,其中所有元素的型別都是 :class:`bytes`。" -#: ../../library/stdtypes.rst:4939 +#: ../../library/stdtypes.rst:4940 msgid "" "For a class which defines :meth:`~object.__class_getitem__` but is not a " "container, the argument(s) supplied to a subscription of the class will " @@ -6904,7 +6905,7 @@ msgstr "" "標引數通常會指示物件上有定義的一個或多個方法的回傳型別。例如\\ :mod:`正規表示" "式 `\\ 可以用於 :class:`str` 和 :class:`bytes` 資料型別:" -#: ../../library/stdtypes.rst:4945 +#: ../../library/stdtypes.rst:4946 msgid "" "If ``x = re.search('foo', 'foo')``, ``x`` will be a :ref:`re.Match ` object where the return values of ``x.group(0)`` and ``x[0]`` will " @@ -6916,7 +6917,7 @@ msgstr "" "別。我們就可以用 ``GenericAlias`` ``re.Match[str]`` 在型別註釋中表示這種物" "件。" -#: ../../library/stdtypes.rst:4951 +#: ../../library/stdtypes.rst:4952 msgid "" "If ``y = re.search(b'bar', b'bar')``, (note the ``b`` for :class:`bytes`), " "``y`` will also be an instance of ``re.Match``, but the return values of ``y." @@ -6929,7 +6930,7 @@ msgstr "" "別都是 :class:`bytes`。在型別註釋中,我們將用 ``re.Match[bytes]`` 來表示各" "種 :ref:`re.Match ` 物件。" -#: ../../library/stdtypes.rst:4957 +#: ../../library/stdtypes.rst:4958 msgid "" "``GenericAlias`` objects are instances of the class :class:`types." "GenericAlias`, which can also be used to create ``GenericAlias`` objects " @@ -6938,7 +6939,7 @@ msgstr "" "``GenericAlias`` 物件是 :class:`types.GenericAlias` 類別的實例,也可以用來直" "接建立 ``GenericAlias`` 物件。" -#: ../../library/stdtypes.rst:4963 +#: ../../library/stdtypes.rst:4964 msgid "" "Creates a ``GenericAlias`` representing a type ``T`` parameterized by types " "*X*, *Y*, and more depending on the ``T`` used. For example, a function " @@ -6948,7 +6949,7 @@ msgstr "" "所使用的 ``T``)來參數化。例如,一個函式需要一個包含 :class:`float` 元素的 :" "class:`list`: ::" -#: ../../library/stdtypes.rst:4968 +#: ../../library/stdtypes.rst:4969 msgid "" "def average(values: list[float]) -> float:\n" " return sum(values) / len(values)" @@ -6956,7 +6957,7 @@ msgstr "" "def average(values: list[float]) -> float:\n" " return sum(values) / len(values)" -#: ../../library/stdtypes.rst:4971 +#: ../../library/stdtypes.rst:4972 msgid "" "Another example for :term:`mapping` objects, using a :class:`dict`, which is " "a generic type expecting two type parameters representing the key type and " @@ -6967,7 +6968,7 @@ msgstr "" "別,需要兩個型別參數,分別表示鍵型別和值型別。在此範例中,函式需要一個 " "``dict``,其帶有 :class:`str` 型別的鍵和 :class:`int` 型別的值: ::" -#: ../../library/stdtypes.rst:4976 +#: ../../library/stdtypes.rst:4977 msgid "" "def send_post_request(url: str, body: dict[str, int]) -> None:\n" " ..." @@ -6975,7 +6976,7 @@ msgstr "" "def send_post_request(url: str, body: dict[str, int]) -> None:\n" " ..." -#: ../../library/stdtypes.rst:4979 +#: ../../library/stdtypes.rst:4980 msgid "" "The builtin functions :func:`isinstance` and :func:`issubclass` do not " "accept ``GenericAlias`` types for their second argument::" @@ -6983,7 +6984,7 @@ msgstr "" "內建函式 :func:`isinstance` 和 :func:`issubclass` 不接受 ``GenericAlias`` 型" "別作為第二個引數: ::" -#: ../../library/stdtypes.rst:4982 +#: ../../library/stdtypes.rst:4983 msgid "" ">>> isinstance([1, 2], list[str])\n" "Traceback (most recent call last):\n" @@ -6995,7 +6996,7 @@ msgstr "" " File \"\", line 1, in \n" "TypeError: isinstance() argument 2 cannot be a parameterized generic" -#: ../../library/stdtypes.rst:4987 +#: ../../library/stdtypes.rst:4988 msgid "" "The Python runtime does not enforce :term:`type annotations `. " "This extends to generic types and their type parameters. When creating a " @@ -7007,7 +7008,7 @@ msgstr "" "及其型別參數。當從 ``GenericAlias`` 建立容器物件時,不會檢查容器中元素的型" "別。例如,不鼓勵使用以下程式碼,但 runtime 不會出現錯誤: ::" -#: ../../library/stdtypes.rst:4993 +#: ../../library/stdtypes.rst:4994 msgid "" ">>> t = list[str]\n" ">>> t([1, 2, 3])\n" @@ -7017,13 +7018,13 @@ msgstr "" ">>> t([1, 2, 3])\n" "[1, 2, 3]" -#: ../../library/stdtypes.rst:4997 +#: ../../library/stdtypes.rst:4998 msgid "" "Furthermore, parameterized generics erase type parameters during object " "creation::" msgstr "此外,參數化泛型在物件建立期間會擦除 (erase) 型別參數: ::" -#: ../../library/stdtypes.rst:5000 +#: ../../library/stdtypes.rst:5001 msgid "" ">>> t = list[str]\n" ">>> type(t)\n" @@ -7041,13 +7042,13 @@ msgstr "" ">>> type(l)\n" "" -#: ../../library/stdtypes.rst:5008 +#: ../../library/stdtypes.rst:5009 msgid "" "Calling :func:`repr` or :func:`str` on a generic shows the parameterized " "type::" msgstr "在泛型上呼叫 :func:`repr` 或 :func:`str` 會顯示參數化型別: ::" -#: ../../library/stdtypes.rst:5010 +#: ../../library/stdtypes.rst:5011 msgid "" ">>> repr(list[int])\n" "'list[int]'\n" @@ -7061,7 +7062,7 @@ msgstr "" ">>> str(list[int])\n" "'list[int]'" -#: ../../library/stdtypes.rst:5016 +#: ../../library/stdtypes.rst:5017 msgid "" "The :meth:`~object.__getitem__` method of generic containers will raise an " "exception to disallow mistakes like ``dict[str][str]``::" @@ -7069,7 +7070,7 @@ msgstr "" "為防止像是 ``dict[str][str]`` 的錯誤出現,泛型容器的 :meth:`~object." "__getitem__` 方法會在這種情況下引發例外: ::" -#: ../../library/stdtypes.rst:5019 +#: ../../library/stdtypes.rst:5020 msgid "" ">>> dict[str][str]\n" "Traceback (most recent call last):\n" @@ -7081,7 +7082,7 @@ msgstr "" " ...\n" "TypeError: dict[str] is not a generic class" -#: ../../library/stdtypes.rst:5024 +#: ../../library/stdtypes.rst:5025 msgid "" "However, such expressions are valid when :ref:`type variables ` " "are used. The index must have as many elements as there are type variable " @@ -7091,7 +7092,7 @@ msgstr "" "的。索引的元素數量必須與 ``GenericAlias`` 物件的 :attr:`~genericalias." "__args__` 中的型別變數項目一樣多: ::" -#: ../../library/stdtypes.rst:5028 +#: ../../library/stdtypes.rst:5029 msgid "" ">>> from typing import TypeVar\n" ">>> Y = TypeVar('Y')\n" @@ -7103,245 +7104,245 @@ msgstr "" ">>> dict[str, Y][int]\n" "dict[str, int]" -#: ../../library/stdtypes.rst:5035 +#: ../../library/stdtypes.rst:5036 msgid "Standard Generic Classes" msgstr "標準泛型類別" -#: ../../library/stdtypes.rst:5037 +#: ../../library/stdtypes.rst:5038 msgid "" "The following standard library classes support parameterized generics. This " "list is non-exhaustive." msgstr "以下標準函式庫類別有支援參數化泛型。此列表並非詳盡無遺。" -#: ../../library/stdtypes.rst:5040 +#: ../../library/stdtypes.rst:5041 msgid ":class:`tuple`" msgstr ":class:`tuple`" -#: ../../library/stdtypes.rst:5041 +#: ../../library/stdtypes.rst:5042 msgid ":class:`list`" msgstr ":class:`list`" -#: ../../library/stdtypes.rst:5042 +#: ../../library/stdtypes.rst:5043 msgid ":class:`dict`" msgstr ":class:`dict`" -#: ../../library/stdtypes.rst:5043 +#: ../../library/stdtypes.rst:5044 msgid ":class:`set`" msgstr ":class:`set`" -#: ../../library/stdtypes.rst:5044 +#: ../../library/stdtypes.rst:5045 msgid ":class:`frozenset`" msgstr ":class:`frozenset`" -#: ../../library/stdtypes.rst:5045 +#: ../../library/stdtypes.rst:5046 msgid ":class:`type`" msgstr ":class:`type`" -#: ../../library/stdtypes.rst:5046 +#: ../../library/stdtypes.rst:5047 msgid ":class:`collections.deque`" msgstr ":class:`collections.deque`" -#: ../../library/stdtypes.rst:5047 +#: ../../library/stdtypes.rst:5048 msgid ":class:`collections.defaultdict`" msgstr ":class:`collections.defaultdict`" -#: ../../library/stdtypes.rst:5048 +#: ../../library/stdtypes.rst:5049 msgid ":class:`collections.OrderedDict`" msgstr ":class:`collections.OrderedDict`" -#: ../../library/stdtypes.rst:5049 +#: ../../library/stdtypes.rst:5050 msgid ":class:`collections.Counter`" msgstr ":class:`collections.Counter`" -#: ../../library/stdtypes.rst:5050 +#: ../../library/stdtypes.rst:5051 msgid ":class:`collections.ChainMap`" msgstr ":class:`collections.ChainMap`" -#: ../../library/stdtypes.rst:5051 +#: ../../library/stdtypes.rst:5052 msgid ":class:`collections.abc.Awaitable`" msgstr ":class:`collections.abc.Awaitable`" -#: ../../library/stdtypes.rst:5052 +#: ../../library/stdtypes.rst:5053 msgid ":class:`collections.abc.Coroutine`" msgstr ":class:`collections.abc.Coroutine`" -#: ../../library/stdtypes.rst:5053 +#: ../../library/stdtypes.rst:5054 msgid ":class:`collections.abc.AsyncIterable`" msgstr ":class:`collections.abc.AsyncIterable`" -#: ../../library/stdtypes.rst:5054 +#: ../../library/stdtypes.rst:5055 msgid ":class:`collections.abc.AsyncIterator`" msgstr ":class:`collections.abc.AsyncIterator`" -#: ../../library/stdtypes.rst:5055 +#: ../../library/stdtypes.rst:5056 msgid ":class:`collections.abc.AsyncGenerator`" msgstr ":class:`collections.abc.AsyncGenerator`" -#: ../../library/stdtypes.rst:5056 +#: ../../library/stdtypes.rst:5057 msgid ":class:`collections.abc.Iterable`" msgstr ":class:`collections.abc.Iterable`" -#: ../../library/stdtypes.rst:5057 +#: ../../library/stdtypes.rst:5058 msgid ":class:`collections.abc.Iterator`" msgstr ":class:`collections.abc.Iterator`" -#: ../../library/stdtypes.rst:5058 +#: ../../library/stdtypes.rst:5059 msgid ":class:`collections.abc.Generator`" msgstr ":class:`collections.abc.Generator`" -#: ../../library/stdtypes.rst:5059 +#: ../../library/stdtypes.rst:5060 msgid ":class:`collections.abc.Reversible`" msgstr ":class:`collections.abc.Reversible`" -#: ../../library/stdtypes.rst:5060 +#: ../../library/stdtypes.rst:5061 msgid ":class:`collections.abc.Container`" msgstr ":class:`collections.abc.Container`" -#: ../../library/stdtypes.rst:5061 +#: ../../library/stdtypes.rst:5062 msgid ":class:`collections.abc.Collection`" msgstr ":class:`collections.abc.Collection`" -#: ../../library/stdtypes.rst:5062 +#: ../../library/stdtypes.rst:5063 msgid ":class:`collections.abc.Callable`" msgstr ":class:`collections.abc.Callable`" -#: ../../library/stdtypes.rst:5063 +#: ../../library/stdtypes.rst:5064 msgid ":class:`collections.abc.Set`" msgstr ":class:`collections.abc.Set`" -#: ../../library/stdtypes.rst:5064 +#: ../../library/stdtypes.rst:5065 msgid ":class:`collections.abc.MutableSet`" msgstr ":class:`collections.abc.MutableSet`" -#: ../../library/stdtypes.rst:5065 +#: ../../library/stdtypes.rst:5066 msgid ":class:`collections.abc.Mapping`" msgstr ":class:`collections.abc.Mapping`" -#: ../../library/stdtypes.rst:5066 +#: ../../library/stdtypes.rst:5067 msgid ":class:`collections.abc.MutableMapping`" msgstr ":class:`collections.abc.MutableMapping`" -#: ../../library/stdtypes.rst:5067 +#: ../../library/stdtypes.rst:5068 msgid ":class:`collections.abc.Sequence`" msgstr ":class:`collections.abc.Sequence`" -#: ../../library/stdtypes.rst:5068 +#: ../../library/stdtypes.rst:5069 msgid ":class:`collections.abc.MutableSequence`" msgstr ":class:`collections.abc.MutableSequence`" -#: ../../library/stdtypes.rst:5069 +#: ../../library/stdtypes.rst:5070 msgid ":class:`collections.abc.ByteString`" msgstr ":class:`collections.abc.ByteString`" -#: ../../library/stdtypes.rst:5070 +#: ../../library/stdtypes.rst:5071 msgid ":class:`collections.abc.MappingView`" msgstr ":class:`collections.abc.MappingView`" -#: ../../library/stdtypes.rst:5071 +#: ../../library/stdtypes.rst:5072 msgid ":class:`collections.abc.KeysView`" msgstr ":class:`collections.abc.KeysView`" -#: ../../library/stdtypes.rst:5072 +#: ../../library/stdtypes.rst:5073 msgid ":class:`collections.abc.ItemsView`" msgstr ":class:`collections.abc.ItemsView`" -#: ../../library/stdtypes.rst:5073 +#: ../../library/stdtypes.rst:5074 msgid ":class:`collections.abc.ValuesView`" msgstr ":class:`collections.abc.ValuesView`" -#: ../../library/stdtypes.rst:5074 +#: ../../library/stdtypes.rst:5075 msgid ":class:`contextlib.AbstractContextManager`" msgstr ":class:`contextlib.AbstractContextManager`" -#: ../../library/stdtypes.rst:5075 +#: ../../library/stdtypes.rst:5076 msgid ":class:`contextlib.AbstractAsyncContextManager`" msgstr ":class:`contextlib.AbstractAsyncContextManager`" -#: ../../library/stdtypes.rst:5076 +#: ../../library/stdtypes.rst:5077 msgid ":class:`dataclasses.Field`" msgstr ":class:`dataclasses.Field`" -#: ../../library/stdtypes.rst:5077 +#: ../../library/stdtypes.rst:5078 msgid ":class:`functools.cached_property`" msgstr ":class:`functools.cached_property`" -#: ../../library/stdtypes.rst:5078 +#: ../../library/stdtypes.rst:5079 msgid ":class:`functools.partialmethod`" msgstr ":class:`functools.partialmethod`" -#: ../../library/stdtypes.rst:5079 +#: ../../library/stdtypes.rst:5080 msgid ":class:`os.PathLike`" msgstr ":class:`os.PathLike`" -#: ../../library/stdtypes.rst:5080 +#: ../../library/stdtypes.rst:5081 msgid ":class:`queue.LifoQueue`" msgstr ":class:`queue.LifoQueue`" -#: ../../library/stdtypes.rst:5081 +#: ../../library/stdtypes.rst:5082 msgid ":class:`queue.Queue`" msgstr ":class:`queue.Queue`" -#: ../../library/stdtypes.rst:5082 +#: ../../library/stdtypes.rst:5083 msgid ":class:`queue.PriorityQueue`" msgstr ":class:`queue.PriorityQueue`" -#: ../../library/stdtypes.rst:5083 +#: ../../library/stdtypes.rst:5084 msgid ":class:`queue.SimpleQueue`" msgstr ":class:`queue.SimpleQueue`" -#: ../../library/stdtypes.rst:5084 +#: ../../library/stdtypes.rst:5085 msgid ":ref:`re.Pattern `" msgstr ":ref:`re.Pattern `" -#: ../../library/stdtypes.rst:5085 +#: ../../library/stdtypes.rst:5086 msgid ":ref:`re.Match `" msgstr ":ref:`re.Match `" -#: ../../library/stdtypes.rst:5086 +#: ../../library/stdtypes.rst:5087 msgid ":class:`shelve.BsdDbShelf`" msgstr ":class:`shelve.BsdDbShelf`" -#: ../../library/stdtypes.rst:5087 +#: ../../library/stdtypes.rst:5088 msgid ":class:`shelve.DbfilenameShelf`" msgstr ":class:`shelve.DbfilenameShelf`" -#: ../../library/stdtypes.rst:5088 +#: ../../library/stdtypes.rst:5089 msgid ":class:`shelve.Shelf`" msgstr ":class:`shelve.Shelf`" -#: ../../library/stdtypes.rst:5089 +#: ../../library/stdtypes.rst:5090 msgid ":class:`types.MappingProxyType`" msgstr ":class:`types.MappingProxyType`" -#: ../../library/stdtypes.rst:5090 +#: ../../library/stdtypes.rst:5091 msgid ":class:`weakref.WeakKeyDictionary`" msgstr ":class:`weakref.WeakKeyDictionary`" -#: ../../library/stdtypes.rst:5091 +#: ../../library/stdtypes.rst:5092 msgid ":class:`weakref.WeakMethod`" msgstr ":class:`weakref.WeakMethod`" -#: ../../library/stdtypes.rst:5092 +#: ../../library/stdtypes.rst:5093 msgid ":class:`weakref.WeakSet`" msgstr ":class:`weakref.WeakSet`" -#: ../../library/stdtypes.rst:5093 +#: ../../library/stdtypes.rst:5094 msgid ":class:`weakref.WeakValueDictionary`" msgstr ":class:`weakref.WeakValueDictionary`" -#: ../../library/stdtypes.rst:5098 +#: ../../library/stdtypes.rst:5099 msgid "Special Attributes of ``GenericAlias`` objects" msgstr "``GenericAlias`` 物件的特殊屬性" -#: ../../library/stdtypes.rst:5100 +#: ../../library/stdtypes.rst:5101 msgid "All parameterized generics implement special read-only attributes." msgstr "所有參數化泛型都有實作特殊的唯讀屬性。" -#: ../../library/stdtypes.rst:5104 +#: ../../library/stdtypes.rst:5105 msgid "This attribute points at the non-parameterized generic class::" msgstr "此屬性指向非參數化泛型類別: ::" -#: ../../library/stdtypes.rst:5106 +#: ../../library/stdtypes.rst:5107 msgid "" ">>> list[int].__origin__\n" "" @@ -7349,7 +7350,7 @@ msgstr "" ">>> list[int].__origin__\n" "" -#: ../../library/stdtypes.rst:5112 +#: ../../library/stdtypes.rst:5113 msgid "" "This attribute is a :class:`tuple` (possibly of length 1) of generic types " "passed to the original :meth:`~object.__class_getitem__` of the generic " @@ -7358,7 +7359,7 @@ msgstr "" "此屬性是傳遞給泛型類別之原始 :meth:`~object.__class_getitem__` 的泛型型別 :" "class:`tuple`\\ (長度可以為 1): ::" -#: ../../library/stdtypes.rst:5116 +#: ../../library/stdtypes.rst:5117 msgid "" ">>> dict[str, list[int]].__args__\n" "(, list[int])" @@ -7366,7 +7367,7 @@ msgstr "" ">>> dict[str, list[int]].__args__\n" "(, list[int])" -#: ../../library/stdtypes.rst:5122 +#: ../../library/stdtypes.rst:5123 msgid "" "This attribute is a lazily computed tuple (possibly empty) of unique type " "variables found in ``__args__``::" @@ -7374,7 +7375,7 @@ msgstr "" "此屬性是個會被延遲計算 (lazily computed) 的元組(可能為空),包含了在 " "``__args__`` 中找得到的不重複型別變數: ::" -#: ../../library/stdtypes.rst:5125 +#: ../../library/stdtypes.rst:5126 msgid "" ">>> from typing import TypeVar\n" "\n" @@ -7388,7 +7389,7 @@ msgstr "" ">>> list[T].__parameters__\n" "(~T,)" -#: ../../library/stdtypes.rst:5133 +#: ../../library/stdtypes.rst:5134 msgid "" "A ``GenericAlias`` object with :class:`typing.ParamSpec` parameters may not " "have correct ``__parameters__`` after substitution because :class:`typing." @@ -7398,7 +7399,7 @@ msgstr "" "有正確的 ``__parameters__``,因為 :class:`typing.ParamSpec` 主要用於靜態型別" "檢查。" -#: ../../library/stdtypes.rst:5140 +#: ../../library/stdtypes.rst:5141 msgid "" "A boolean that is true if the alias has been unpacked using the ``*`` " "operator (see :data:`~typing.TypeVarTuple`)." @@ -7406,19 +7407,19 @@ msgstr "" "如果別名已使用 ``*`` 運算子解包 (unpack) 則為 true 的布林值(請參閱 :data:" "`~typing.TypeVarTuple`\\ )。" -#: ../../library/stdtypes.rst:5148 +#: ../../library/stdtypes.rst:5149 msgid ":pep:`484` - Type Hints" msgstr ":pep:`484` - 型別提示" -#: ../../library/stdtypes.rst:5149 +#: ../../library/stdtypes.rst:5150 msgid "Introducing Python's framework for type annotations." msgstr "引入 Python 的型別註釋框架。" -#: ../../library/stdtypes.rst:5151 +#: ../../library/stdtypes.rst:5152 msgid ":pep:`585` - Type Hinting Generics In Standard Collections" msgstr ":pep:`585` - 標準集合 (Standard Collections) 中的型別提示泛型" -#: ../../library/stdtypes.rst:5152 +#: ../../library/stdtypes.rst:5153 msgid "" "Introducing the ability to natively parameterize standard-library classes, " "provided they implement the special class method :meth:`~object." @@ -7427,7 +7428,7 @@ msgstr "" "引入原生參數化標準函式庫類別的能力,前提是它們有實作特殊的類別方法 :meth:" "`~object.__class_getitem__`。" -#: ../../library/stdtypes.rst:5156 +#: ../../library/stdtypes.rst:5157 msgid "" ":ref:`Generics`, :ref:`user-defined generics ` and :" "class:`typing.Generic`" @@ -7435,18 +7436,18 @@ msgstr "" ":ref:`Generics`、:ref:`使用者定義泛型 `\\ 和 :class:" "`typing.Generic`" -#: ../../library/stdtypes.rst:5157 +#: ../../library/stdtypes.rst:5158 msgid "" "Documentation on how to implement generic classes that can be parameterized " "at runtime and understood by static type-checkers." msgstr "" "有關如何實作可以在 runtime 參數化並能被靜態型別檢查器理解的泛型類別的文件。" -#: ../../library/stdtypes.rst:5166 +#: ../../library/stdtypes.rst:5167 msgid "Union Type" msgstr "聯合型別 (Union Type)" -#: ../../library/stdtypes.rst:5172 +#: ../../library/stdtypes.rst:5173 msgid "" "A union object holds the value of the ``|`` (bitwise or) operation on " "multiple :ref:`type objects `. These types are intended " @@ -7459,7 +7460,7 @@ msgstr "" "釋 (type annotation) `。與 :data:`typing.Union` 相比,聯合型別運" "算式可以讓型別提示語法更清晰簡潔。" -#: ../../library/stdtypes.rst:5179 +#: ../../library/stdtypes.rst:5180 msgid "" "Defines a union object which holds types *X*, *Y*, and so forth. ``X | Y`` " "means either X or Y. It is equivalent to ``typing.Union[X, Y]``. For " @@ -7470,7 +7471,7 @@ msgstr "" "``typing.Union[X, Y]``。舉例來說,下列函式需要一個型別為 :class:`int` 或 :" "class:`float` 的引數: ::" -#: ../../library/stdtypes.rst:5184 +#: ../../library/stdtypes.rst:5185 msgid "" "def square(number: int | float) -> int | float:\n" " return number ** 2" @@ -7478,7 +7479,7 @@ msgstr "" "def square(number: int | float) -> int | float:\n" " return number ** 2" -#: ../../library/stdtypes.rst:5189 +#: ../../library/stdtypes.rst:5190 msgid "" "The ``|`` operand cannot be used at runtime to define unions where one or " "more members is a forward reference. For example, ``int | \"Foo\"``, where " @@ -7491,58 +7492,58 @@ msgstr "" "義類別的參照,將在 runtime 失敗。對於包含向前參照的聯合,請將整個運算式以字串" "呈現,例如 ``\"int | Foo\"``。" -#: ../../library/stdtypes.rst:5197 +#: ../../library/stdtypes.rst:5198 msgid "" "Union objects can be tested for equality with other union objects. Details:" msgstr "聯合物件可以與其他聯合物件一起進行相等性測試。細節如下:" -#: ../../library/stdtypes.rst:5199 +#: ../../library/stdtypes.rst:5200 msgid "Unions of unions are flattened::" msgstr "聯合的聯合會被扁平化: ::" -#: ../../library/stdtypes.rst:5201 +#: ../../library/stdtypes.rst:5202 msgid "(int | str) | float == int | str | float" msgstr "(int | str) | float == int | str | float" -#: ../../library/stdtypes.rst:5203 +#: ../../library/stdtypes.rst:5204 msgid "Redundant types are removed::" msgstr "冗餘型別會被刪除: ::" -#: ../../library/stdtypes.rst:5205 +#: ../../library/stdtypes.rst:5206 msgid "int | str | int == int | str" msgstr "int | str | int == int | str" -#: ../../library/stdtypes.rst:5207 +#: ../../library/stdtypes.rst:5208 msgid "When comparing unions, the order is ignored::" msgstr "比較聯合時,順序會被忽略: ::" -#: ../../library/stdtypes.rst:5209 +#: ../../library/stdtypes.rst:5210 msgid "int | str == str | int" msgstr "int | str == str | int" -#: ../../library/stdtypes.rst:5211 +#: ../../library/stdtypes.rst:5212 msgid "It is compatible with :data:`typing.Union`::" msgstr "它與 :data:`typing.Union` 相容: ::" -#: ../../library/stdtypes.rst:5213 +#: ../../library/stdtypes.rst:5214 msgid "int | str == typing.Union[int, str]" msgstr "int | str == typing.Union[int, str]" -#: ../../library/stdtypes.rst:5215 +#: ../../library/stdtypes.rst:5216 msgid "Optional types can be spelled as a union with ``None``::" msgstr "可選型別可以表示為與 ``None`` 的聯合: ::" -#: ../../library/stdtypes.rst:5217 +#: ../../library/stdtypes.rst:5218 msgid "str | None == typing.Optional[str]" msgstr "str | None == typing.Optional[str]" -#: ../../library/stdtypes.rst:5222 +#: ../../library/stdtypes.rst:5223 msgid "" "Calls to :func:`isinstance` and :func:`issubclass` are also supported with a " "union object::" msgstr "聯合物件也支援 :func:`isinstance` 和 :func:`issubclass` 的呼叫: ::" -#: ../../library/stdtypes.rst:5225 +#: ../../library/stdtypes.rst:5226 msgid "" ">>> isinstance(\"\", int | str)\n" "True" @@ -7550,14 +7551,14 @@ msgstr "" ">>> isinstance(\"\", int | str)\n" "True" -#: ../../library/stdtypes.rst:5228 +#: ../../library/stdtypes.rst:5229 msgid "" "However, :ref:`parameterized generics ` in union objects " "cannot be checked::" msgstr "" "然而聯合物件中的\\ :ref:`參數化泛型 `\\ 則無法被檢查: ::" -#: ../../library/stdtypes.rst:5231 +#: ../../library/stdtypes.rst:5232 msgid "" ">>> isinstance(1, int | list[int]) # short-circuit evaluation\n" "True\n" @@ -7567,7 +7568,7 @@ msgid "" "TypeError: isinstance() argument 2 cannot be a parameterized generic" msgstr "" -#: ../../library/stdtypes.rst:5238 +#: ../../library/stdtypes.rst:5239 msgid "" "The user-exposed type for the union object can be accessed from :data:`types." "UnionType` and used for :func:`isinstance` checks. An object cannot be " @@ -7576,7 +7577,7 @@ msgstr "" "構成聯合物件的對使用者公開型別 (user-exposed type) 可以透過 :data:`types." "UnionType` 存取並用於 :func:`isinstance` 檢查。物件不能以型別來實例化: ::" -#: ../../library/stdtypes.rst:5242 +#: ../../library/stdtypes.rst:5243 msgid "" ">>> import types\n" ">>> isinstance(int | str, types.UnionType)\n" @@ -7594,7 +7595,7 @@ msgstr "" " File \"\", line 1, in \n" "TypeError: cannot create 'types.UnionType' instances" -#: ../../library/stdtypes.rst:5251 +#: ../../library/stdtypes.rst:5252 msgid "" "The :meth:`!__or__` method for type objects was added to support the syntax " "``X | Y``. If a metaclass implements :meth:`!__or__`, the Union may " @@ -7603,7 +7604,7 @@ msgstr "" "新增了型別物件的 :meth:`!__or__` 方法來支援 ``X | Y`` 語法。如果元類別有實" "作 :meth:`!__or__`,則 Union 可以覆寫 (override) 它: ::" -#: ../../library/stdtypes.rst:5255 +#: ../../library/stdtypes.rst:5256 msgid "" ">>> class M(type):\n" "... def __or__(self, other):\n" @@ -7629,25 +7630,25 @@ msgstr "" ">>> int | C\n" "int | C" -#: ../../library/stdtypes.rst:5271 +#: ../../library/stdtypes.rst:5272 msgid ":pep:`604` -- PEP proposing the ``X | Y`` syntax and the Union type." msgstr ":pep:`604` -- PEP 提出 ``X | Y`` 語法和聯合型別。" -#: ../../library/stdtypes.rst:5279 +#: ../../library/stdtypes.rst:5280 msgid "Other Built-in Types" msgstr "" -#: ../../library/stdtypes.rst:5281 +#: ../../library/stdtypes.rst:5282 msgid "" "The interpreter supports several other kinds of objects. Most of these " "support only one or two operations." msgstr "" -#: ../../library/stdtypes.rst:5288 +#: ../../library/stdtypes.rst:5289 msgid "Modules" msgstr "模組" -#: ../../library/stdtypes.rst:5290 +#: ../../library/stdtypes.rst:5291 msgid "" "The only special operation on a module is attribute access: ``m.name``, " "where *m* is a module and *name* accesses a name defined in *m*'s symbol " @@ -7658,7 +7659,7 @@ msgid "" "*foo* somewhere.)" msgstr "" -#: ../../library/stdtypes.rst:5297 +#: ../../library/stdtypes.rst:5298 msgid "" "A special attribute of every module is :attr:`~object.__dict__`. This is the " "dictionary containing the module's symbol table. Modifying this dictionary " @@ -7669,32 +7670,32 @@ msgid "" "recommended." msgstr "" -#: ../../library/stdtypes.rst:5305 +#: ../../library/stdtypes.rst:5306 msgid "" "Modules built into the interpreter are written like this: ````. If loaded from a file, they are written as ````." msgstr "" -#: ../../library/stdtypes.rst:5313 +#: ../../library/stdtypes.rst:5314 msgid "Classes and Class Instances" msgstr "" -#: ../../library/stdtypes.rst:5315 +#: ../../library/stdtypes.rst:5316 msgid "See :ref:`objects` and :ref:`class` for these." msgstr "" -#: ../../library/stdtypes.rst:5321 +#: ../../library/stdtypes.rst:5322 msgid "Functions" msgstr "函式" -#: ../../library/stdtypes.rst:5323 +#: ../../library/stdtypes.rst:5324 msgid "" "Function objects are created by function definitions. The only operation on " "a function object is to call it: ``func(argument-list)``." msgstr "" -#: ../../library/stdtypes.rst:5326 +#: ../../library/stdtypes.rst:5327 msgid "" "There are really two flavors of function objects: built-in functions and " "user-defined functions. Both support the same operation (to call the " @@ -7702,15 +7703,15 @@ msgid "" "types." msgstr "" -#: ../../library/stdtypes.rst:5330 +#: ../../library/stdtypes.rst:5331 msgid "See :ref:`function` for more information." msgstr "更多資訊請見 :ref:`function`。" -#: ../../library/stdtypes.rst:5336 +#: ../../library/stdtypes.rst:5337 msgid "Methods" msgstr "" -#: ../../library/stdtypes.rst:5340 +#: ../../library/stdtypes.rst:5341 msgid "" "Methods are functions that are called using the attribute notation. There " "are two flavors: :ref:`built-in methods ` (such as :meth:" @@ -7718,7 +7719,7 @@ msgid "" "Built-in methods are described with the types that support them." msgstr "" -#: ../../library/stdtypes.rst:5345 +#: ../../library/stdtypes.rst:5346 msgid "" "If you access a method (a function defined in a class namespace) through an " "instance, you get a special object: a :dfn:`bound method` (also called :ref:" @@ -7731,7 +7732,7 @@ msgid "" "arg-2, ..., arg-n)``." msgstr "" -#: ../../library/stdtypes.rst:5356 +#: ../../library/stdtypes.rst:5357 msgid "" "Like :ref:`function objects `, bound method objects " "support getting arbitrary attributes. However, since method attributes are " @@ -7742,7 +7743,7 @@ msgid "" "underlying function object:" msgstr "" -#: ../../library/stdtypes.rst:5364 +#: ../../library/stdtypes.rst:5365 msgid "" ">>> class C:\n" "... def method(self):\n" @@ -7770,15 +7771,15 @@ msgstr "" ">>> c.method.whoami\n" "'my name is method'" -#: ../../library/stdtypes.rst:5379 +#: ../../library/stdtypes.rst:5380 msgid "See :ref:`instance-methods` for more information." msgstr "更多資訊請見 :ref:`instance-methods`。" -#: ../../library/stdtypes.rst:5387 +#: ../../library/stdtypes.rst:5388 msgid "Code Objects" msgstr "" -#: ../../library/stdtypes.rst:5393 +#: ../../library/stdtypes.rst:5394 msgid "" "Code objects are used by the implementation to represent \"pseudo-compiled\" " "executable Python code such as a function body. They differ from function " @@ -7788,7 +7789,7 @@ msgid "" "`~function.__code__` attribute. See also the :mod:`code` module." msgstr "" -#: ../../library/stdtypes.rst:5400 +#: ../../library/stdtypes.rst:5401 msgid "" "Accessing :attr:`~function.__code__` raises an :ref:`auditing event " "` ``object.__getattr__`` with arguments ``obj`` and " @@ -7797,21 +7798,21 @@ msgstr "" "存取 :attr:`~function.__code__` 會引發一個附帶引數 ``obj`` 與 " "``\"__code__\"`` 的\\ :ref:`稽核事件 ` ``object.__getattr__``。" -#: ../../library/stdtypes.rst:5407 +#: ../../library/stdtypes.rst:5408 msgid "" "A code object can be executed or evaluated by passing it (instead of a " "source string) to the :func:`exec` or :func:`eval` built-in functions." msgstr "" -#: ../../library/stdtypes.rst:5410 +#: ../../library/stdtypes.rst:5411 msgid "See :ref:`types` for more information." msgstr "更多資訊請見 :ref:`types`。" -#: ../../library/stdtypes.rst:5416 +#: ../../library/stdtypes.rst:5417 msgid "Type Objects" msgstr "" -#: ../../library/stdtypes.rst:5422 +#: ../../library/stdtypes.rst:5423 msgid "" "Type objects represent the various object types. An object's type is " "accessed by the built-in function :func:`type`. There are no special " @@ -7819,30 +7820,30 @@ msgid "" "standard built-in types." msgstr "" -#: ../../library/stdtypes.rst:5427 +#: ../../library/stdtypes.rst:5428 msgid "Types are written like this: ````." msgstr "" -#: ../../library/stdtypes.rst:5433 +#: ../../library/stdtypes.rst:5434 msgid "The Null Object" msgstr "" -#: ../../library/stdtypes.rst:5435 +#: ../../library/stdtypes.rst:5436 msgid "" "This object is returned by functions that don't explicitly return a value. " "It supports no special operations. There is exactly one null object, named " "``None`` (a built-in name). ``type(None)()`` produces the same singleton." msgstr "" -#: ../../library/stdtypes.rst:5439 +#: ../../library/stdtypes.rst:5440 msgid "It is written as ``None``." msgstr "它被寫為 ``None``。" -#: ../../library/stdtypes.rst:5446 +#: ../../library/stdtypes.rst:5447 msgid "The Ellipsis Object" msgstr "" -#: ../../library/stdtypes.rst:5448 +#: ../../library/stdtypes.rst:5449 msgid "" "This object is commonly used by slicing (see :ref:`slicings`). It supports " "no special operations. There is exactly one ellipsis object, named :const:" @@ -7850,15 +7851,15 @@ msgid "" "`Ellipsis` singleton." msgstr "" -#: ../../library/stdtypes.rst:5453 +#: ../../library/stdtypes.rst:5454 msgid "It is written as ``Ellipsis`` or ``...``." msgstr "它被寫為 ``Ellipsis`` 或 ``...``。" -#: ../../library/stdtypes.rst:5459 +#: ../../library/stdtypes.rst:5460 msgid "The NotImplemented Object" msgstr "NotImplemented 物件" -#: ../../library/stdtypes.rst:5461 +#: ../../library/stdtypes.rst:5462 msgid "" "This object is returned from comparisons and binary operations when they are " "asked to operate on types they don't support. See :ref:`comparisons` for " @@ -7866,64 +7867,64 @@ msgid "" "`type(NotImplemented)()` produces the singleton instance." msgstr "" -#: ../../library/stdtypes.rst:5466 +#: ../../library/stdtypes.rst:5467 msgid "It is written as :code:`NotImplemented`." msgstr "" -#: ../../library/stdtypes.rst:5472 +#: ../../library/stdtypes.rst:5473 msgid "Internal Objects" msgstr "" -#: ../../library/stdtypes.rst:5474 +#: ../../library/stdtypes.rst:5475 msgid "" "See :ref:`types` for this information. It describes :ref:`stack frame " "objects `, :ref:`traceback objects `, and " "slice objects." msgstr "" -#: ../../library/stdtypes.rst:5482 +#: ../../library/stdtypes.rst:5483 msgid "Special Attributes" msgstr "特殊屬性" -#: ../../library/stdtypes.rst:5484 +#: ../../library/stdtypes.rst:5485 msgid "" "The implementation adds a few special read-only attributes to several object " "types, where they are relevant. Some of these are not reported by the :func:" "`dir` built-in function." msgstr "" -#: ../../library/stdtypes.rst:5491 +#: ../../library/stdtypes.rst:5492 msgid "" "The name of the class, function, method, descriptor, or generator instance." msgstr "" -#: ../../library/stdtypes.rst:5497 +#: ../../library/stdtypes.rst:5498 msgid "" "The :term:`qualified name` of the class, function, method, descriptor, or " "generator instance." msgstr "" -#: ../../library/stdtypes.rst:5505 +#: ../../library/stdtypes.rst:5506 msgid "The name of the module in which a class or function was defined." msgstr "" -#: ../../library/stdtypes.rst:5510 +#: ../../library/stdtypes.rst:5511 msgid "" "The documentation string of a class or function, or ``None`` if undefined." msgstr "" -#: ../../library/stdtypes.rst:5515 +#: ../../library/stdtypes.rst:5516 msgid "" "The :ref:`type parameters ` of generic classes, functions, and :" "ref:`type aliases `. For classes and functions that are not " "generic, this will be an empty tuple." msgstr "" -#: ../../library/stdtypes.rst:5525 +#: ../../library/stdtypes.rst:5526 msgid "Integer string conversion length limitation" msgstr "" -#: ../../library/stdtypes.rst:5527 +#: ../../library/stdtypes.rst:5528 msgid "" "CPython has a global limit for converting between :class:`int` and :class:" "`str` to mitigate denial of service attacks. This limit *only* applies to " @@ -7931,7 +7932,7 @@ msgid "" "binary conversions are unlimited. The limit can be configured." msgstr "" -#: ../../library/stdtypes.rst:5532 +#: ../../library/stdtypes.rst:5533 msgid "" "The :class:`int` type in CPython is an arbitrary length number stored in " "binary form (commonly known as a \"bignum\"). There exists no algorithm that " @@ -7941,24 +7942,24 @@ msgid "" "value such as ``int('1' * 500_000)`` can take over a second on a fast CPU." msgstr "" -#: ../../library/stdtypes.rst:5539 +#: ../../library/stdtypes.rst:5540 msgid "" "Limiting conversion size offers a practical way to avoid :cve:`2020-10735`." msgstr "" -#: ../../library/stdtypes.rst:5541 +#: ../../library/stdtypes.rst:5542 msgid "" "The limit is applied to the number of digit characters in the input or " "output string when a non-linear conversion algorithm would be involved. " "Underscores and the sign are not counted towards the limit." msgstr "" -#: ../../library/stdtypes.rst:5545 +#: ../../library/stdtypes.rst:5546 msgid "" "When an operation would exceed the limit, a :exc:`ValueError` is raised:" msgstr "" -#: ../../library/stdtypes.rst:5547 +#: ../../library/stdtypes.rst:5548 msgid "" ">>> import sys\n" ">>> sys.set_int_max_str_digits(4300) # Illustrative, this is the default.\n" @@ -7982,7 +7983,7 @@ msgid "" ">>> assert int(hex(i_squared), base=16) == i*i # Hexadecimal is unlimited." msgstr "" -#: ../../library/stdtypes.rst:5567 +#: ../../library/stdtypes.rst:5568 msgid "" "The default limit is 4300 digits as provided in :data:`sys.int_info." "default_max_str_digits `. The lowest limit that can be " @@ -7990,11 +7991,11 @@ msgid "" "str_digits_check_threshold `." msgstr "" -#: ../../library/stdtypes.rst:5572 +#: ../../library/stdtypes.rst:5573 msgid "Verification:" msgstr "" -#: ../../library/stdtypes.rst:5574 +#: ../../library/stdtypes.rst:5575 msgid "" ">>> import sys\n" ">>> assert sys.int_info.default_max_str_digits == 4300, sys.int_info\n" @@ -8005,84 +8006,84 @@ msgid "" "..." msgstr "" -#: ../../library/stdtypes.rst:5587 +#: ../../library/stdtypes.rst:5588 msgid "Affected APIs" msgstr "受影響的 API" -#: ../../library/stdtypes.rst:5589 +#: ../../library/stdtypes.rst:5590 msgid "" "The limitation only applies to potentially slow conversions between :class:" "`int` and :class:`str` or :class:`bytes`:" msgstr "" -#: ../../library/stdtypes.rst:5592 +#: ../../library/stdtypes.rst:5593 msgid "``int(string)`` with default base 10." msgstr "``int(string)`` 以預設的 10 為底。" -#: ../../library/stdtypes.rst:5593 +#: ../../library/stdtypes.rst:5594 msgid "``int(string, base)`` for all bases that are not a power of 2." msgstr "" -#: ../../library/stdtypes.rst:5594 +#: ../../library/stdtypes.rst:5595 msgid "``str(integer)``." msgstr "``str(integer)``。" -#: ../../library/stdtypes.rst:5595 +#: ../../library/stdtypes.rst:5596 msgid "``repr(integer)``." msgstr "``repr(integer)``。" -#: ../../library/stdtypes.rst:5596 +#: ../../library/stdtypes.rst:5597 msgid "" "any other string conversion to base 10, for example ``f\"{integer}\"``, " "``\"{}\".format(integer)``, or ``b\"%d\" % integer``." msgstr "" -#: ../../library/stdtypes.rst:5599 +#: ../../library/stdtypes.rst:5600 msgid "The limitations do not apply to functions with a linear algorithm:" msgstr "" -#: ../../library/stdtypes.rst:5601 +#: ../../library/stdtypes.rst:5602 msgid "``int(string, base)`` with base 2, 4, 8, 16, or 32." msgstr "" -#: ../../library/stdtypes.rst:5602 +#: ../../library/stdtypes.rst:5603 msgid ":func:`int.from_bytes` and :func:`int.to_bytes`." msgstr ":func:`int.from_bytes` 和 :func:`int.to_bytes`。" -#: ../../library/stdtypes.rst:5603 +#: ../../library/stdtypes.rst:5604 msgid ":func:`hex`, :func:`oct`, :func:`bin`." msgstr ":func:`hex`、:func:`oct`、:func:`bin`。" -#: ../../library/stdtypes.rst:5604 +#: ../../library/stdtypes.rst:5605 msgid ":ref:`formatspec` for hex, octal, and binary numbers." msgstr "" -#: ../../library/stdtypes.rst:5605 +#: ../../library/stdtypes.rst:5606 msgid ":class:`str` to :class:`float`." msgstr "" -#: ../../library/stdtypes.rst:5606 +#: ../../library/stdtypes.rst:5607 msgid ":class:`str` to :class:`decimal.Decimal`." msgstr "" -#: ../../library/stdtypes.rst:5609 +#: ../../library/stdtypes.rst:5610 msgid "Configuring the limit" msgstr "設定限制" -#: ../../library/stdtypes.rst:5611 +#: ../../library/stdtypes.rst:5612 msgid "" "Before Python starts up you can use an environment variable or an " "interpreter command line flag to configure the limit:" msgstr "" -#: ../../library/stdtypes.rst:5614 +#: ../../library/stdtypes.rst:5615 msgid "" ":envvar:`PYTHONINTMAXSTRDIGITS`, e.g. ``PYTHONINTMAXSTRDIGITS=640 python3`` " "to set the limit to 640 or ``PYTHONINTMAXSTRDIGITS=0 python3`` to disable " "the limitation." msgstr "" -#: ../../library/stdtypes.rst:5617 +#: ../../library/stdtypes.rst:5618 msgid "" ":option:`-X int_max_str_digits <-X>`, e.g. ``python3 -X " "int_max_str_digits=640``" @@ -8090,7 +8091,7 @@ msgstr "" ":option:`-X int_max_str_digits <-X>`,例如 ``python3 -X " "int_max_str_digits=640``" -#: ../../library/stdtypes.rst:5619 +#: ../../library/stdtypes.rst:5620 msgid "" ":data:`sys.flags.int_max_str_digits` contains the value of :envvar:" "`PYTHONINTMAXSTRDIGITS` or :option:`-X int_max_str_digits <-X>`. If both the " @@ -8099,38 +8100,38 @@ msgid "" "int_info.default_max_str_digits` was used during initialization." msgstr "" -#: ../../library/stdtypes.rst:5625 +#: ../../library/stdtypes.rst:5626 msgid "" "From code, you can inspect the current limit and set a new one using these :" "mod:`sys` APIs:" msgstr "" -#: ../../library/stdtypes.rst:5628 +#: ../../library/stdtypes.rst:5629 msgid "" ":func:`sys.get_int_max_str_digits` and :func:`sys.set_int_max_str_digits` " "are a getter and setter for the interpreter-wide limit. Subinterpreters have " "their own limit." msgstr "" -#: ../../library/stdtypes.rst:5632 +#: ../../library/stdtypes.rst:5633 msgid "" "Information about the default and minimum can be found in :data:`sys." "int_info`:" msgstr "" -#: ../../library/stdtypes.rst:5634 +#: ../../library/stdtypes.rst:5635 msgid "" ":data:`sys.int_info.default_max_str_digits ` is the compiled-" "in default limit." msgstr "" -#: ../../library/stdtypes.rst:5636 +#: ../../library/stdtypes.rst:5637 msgid "" ":data:`sys.int_info.str_digits_check_threshold ` is the lowest " "accepted value for the limit (other than 0 which disables it)." msgstr "" -#: ../../library/stdtypes.rst:5643 +#: ../../library/stdtypes.rst:5644 msgid "" "Setting a low limit *can* lead to problems. While rare, code exists that " "contains integer constants in decimal in their source that exceed the " @@ -8142,7 +8143,7 @@ msgid "" "constants is to convert them to ``0x`` hexadecimal form as it has no limit." msgstr "" -#: ../../library/stdtypes.rst:5652 +#: ../../library/stdtypes.rst:5653 msgid "" "Test your application thoroughly if you use a low limit. Ensure your tests " "run with the limit set early via the environment or flag so that it applies " @@ -8150,11 +8151,11 @@ msgid "" "to precompile ``.py`` sources to ``.pyc`` files." msgstr "" -#: ../../library/stdtypes.rst:5658 +#: ../../library/stdtypes.rst:5659 msgid "Recommended configuration" msgstr "建議的配置" -#: ../../library/stdtypes.rst:5660 +#: ../../library/stdtypes.rst:5661 msgid "" "The default :data:`sys.int_info.default_max_str_digits` is expected to be " "reasonable for most applications. If your application requires a different " @@ -8162,11 +8163,11 @@ msgid "" "as these APIs were added in security patch releases in versions before 3.12." msgstr "" -#: ../../library/stdtypes.rst:5665 +#: ../../library/stdtypes.rst:5666 msgid "Example::" msgstr "範例: ::" -#: ../../library/stdtypes.rst:5667 +#: ../../library/stdtypes.rst:5668 msgid "" ">>> import sys\n" ">>> if hasattr(sys, \"set_int_max_str_digits\"):\n" @@ -8179,38 +8180,38 @@ msgid "" "... sys.set_int_max_str_digits(lower_bound)" msgstr "" -#: ../../library/stdtypes.rst:5677 +#: ../../library/stdtypes.rst:5678 msgid "If you need to disable it entirely, set it to ``0``." msgstr "" -#: ../../library/stdtypes.rst:5681 +#: ../../library/stdtypes.rst:5682 msgid "Footnotes" msgstr "註腳" -#: ../../library/stdtypes.rst:5682 +#: ../../library/stdtypes.rst:5683 msgid "" "Additional information on these special methods may be found in the Python " "Reference Manual (:ref:`customization`)." msgstr "" -#: ../../library/stdtypes.rst:5685 +#: ../../library/stdtypes.rst:5686 msgid "" "As a consequence, the list ``[1, 2]`` is considered equal to ``[1.0, 2.0]``, " "and similarly for tuples." msgstr "" -#: ../../library/stdtypes.rst:5688 +#: ../../library/stdtypes.rst:5689 msgid "They must have since the parser can't tell the type of the operands." msgstr "" -#: ../../library/stdtypes.rst:5690 +#: ../../library/stdtypes.rst:5691 msgid "" "Cased characters are those with general category property being one of " "\"Lu\" (Letter, uppercase), \"Ll\" (Letter, lowercase), or \"Lt\" (Letter, " "titlecase)." msgstr "" -#: ../../library/stdtypes.rst:5693 +#: ../../library/stdtypes.rst:5694 msgid "" "To format only a tuple you should therefore provide a singleton tuple whose " "only element is the tuple to be formatted." @@ -8224,7 +8225,7 @@ msgstr "built-in(內建)" #: ../../library/stdtypes.rst:393 ../../library/stdtypes.rst:950 #: ../../library/stdtypes.rst:1117 ../../library/stdtypes.rst:1139 #: ../../library/stdtypes.rst:1154 ../../library/stdtypes.rst:4435 -#: ../../library/stdtypes.rst:5418 +#: ../../library/stdtypes.rst:5419 msgid "types" msgstr "type(型別)" @@ -8353,9 +8354,9 @@ msgstr "is not" #: ../../library/stdtypes.rst:1504 ../../library/stdtypes.rst:1540 #: ../../library/stdtypes.rst:2526 ../../library/stdtypes.rst:2545 #: ../../library/stdtypes.rst:2652 ../../library/stdtypes.rst:4233 -#: ../../library/stdtypes.rst:4435 ../../library/stdtypes.rst:4913 -#: ../../library/stdtypes.rst:5168 ../../library/stdtypes.rst:5338 -#: ../../library/stdtypes.rst:5382 +#: ../../library/stdtypes.rst:4435 ../../library/stdtypes.rst:4914 +#: ../../library/stdtypes.rst:5169 ../../library/stdtypes.rst:5339 +#: ../../library/stdtypes.rst:5383 msgid "object" msgstr "object(物件)" @@ -8448,8 +8449,8 @@ msgstr "arithmetic(算術)" #: ../../library/stdtypes.rst:246 ../../library/stdtypes.rst:950 #: ../../library/stdtypes.rst:1117 ../../library/stdtypes.rst:4435 -#: ../../library/stdtypes.rst:5389 ../../library/stdtypes.rst:5403 -#: ../../library/stdtypes.rst:5418 +#: ../../library/stdtypes.rst:5390 ../../library/stdtypes.rst:5404 +#: ../../library/stdtypes.rst:5419 msgid "built-in function" msgstr "built-in function(內建函式)" @@ -8516,7 +8517,7 @@ msgid "conjugate() (complex number method)" msgstr "conjugate()(複數方法)" #: ../../library/stdtypes.rst:335 ../../library/stdtypes.rst:1606 -#: ../../library/stdtypes.rst:2526 ../../library/stdtypes.rst:5418 +#: ../../library/stdtypes.rst:2526 ../../library/stdtypes.rst:5419 msgid "module" msgstr "模組" @@ -8584,7 +8585,7 @@ msgstr "values" msgid "iterator protocol" msgstr "iterator protocol(疊代器協定)" -#: ../../library/stdtypes.rst:847 ../../library/stdtypes.rst:4828 +#: ../../library/stdtypes.rst:847 ../../library/stdtypes.rst:4829 msgid "protocol" msgstr "protocol(協定)" @@ -8694,7 +8695,7 @@ msgid "bytearray" msgstr "bytearray(位元組陣列)" #: ../../library/stdtypes.rst:1154 ../../library/stdtypes.rst:4435 -#: ../../library/stdtypes.rst:5168 ../../library/stdtypes.rst:5418 +#: ../../library/stdtypes.rst:5169 ../../library/stdtypes.rst:5419 msgid "type" msgstr "type(型別)" @@ -8887,79 +8888,79 @@ msgstr "dictionary(字典)" msgid "__missing__()" msgstr "__missing__()" -#: ../../library/stdtypes.rst:4828 +#: ../../library/stdtypes.rst:4829 msgid "context manager" msgstr "context manager(情境管理器)" -#: ../../library/stdtypes.rst:4828 +#: ../../library/stdtypes.rst:4829 msgid "context management protocol" msgstr "context management protocol(情境管理協定)" -#: ../../library/stdtypes.rst:4828 +#: ../../library/stdtypes.rst:4829 msgid "context management" msgstr "context management(情境管理)" -#: ../../library/stdtypes.rst:4901 +#: ../../library/stdtypes.rst:4902 msgid "annotation" msgstr "annotation(註記)" -#: ../../library/stdtypes.rst:4901 +#: ../../library/stdtypes.rst:4902 msgid "type annotation; type hint" msgstr "type annotation(型別註記);type hint(型別提示)" -#: ../../library/stdtypes.rst:4913 +#: ../../library/stdtypes.rst:4914 msgid "GenericAlias" msgstr "GenericAlias(泛型別名)" -#: ../../library/stdtypes.rst:4913 +#: ../../library/stdtypes.rst:4914 msgid "Generic" msgstr "Generic(泛型)" -#: ../../library/stdtypes.rst:4913 +#: ../../library/stdtypes.rst:4914 msgid "Alias" msgstr "Alias(別名)" -#: ../../library/stdtypes.rst:5168 +#: ../../library/stdtypes.rst:5169 msgid "Union" msgstr "Union(聯合)" -#: ../../library/stdtypes.rst:5168 +#: ../../library/stdtypes.rst:5169 msgid "union" msgstr "union(聯集)" -#: ../../library/stdtypes.rst:5338 +#: ../../library/stdtypes.rst:5339 msgid "method" msgstr "method(方法)" -#: ../../library/stdtypes.rst:5382 +#: ../../library/stdtypes.rst:5383 msgid "code" msgstr "code(程式碼)" -#: ../../library/stdtypes.rst:5382 +#: ../../library/stdtypes.rst:5383 msgid "code object" msgstr "code object(程式碼物件)" -#: ../../library/stdtypes.rst:5389 +#: ../../library/stdtypes.rst:5390 msgid "compile" msgstr "compile(編譯)" -#: ../../library/stdtypes.rst:5389 +#: ../../library/stdtypes.rst:5390 msgid "__code__ (function object attribute)" msgstr "__code__(函式物件屬性)" -#: ../../library/stdtypes.rst:5403 +#: ../../library/stdtypes.rst:5404 msgid "exec" msgstr "exec" -#: ../../library/stdtypes.rst:5403 +#: ../../library/stdtypes.rst:5404 msgid "eval" msgstr "eval" -#: ../../library/stdtypes.rst:5442 +#: ../../library/stdtypes.rst:5443 msgid "..." msgstr "..." -#: ../../library/stdtypes.rst:5442 +#: ../../library/stdtypes.rst:5443 msgid "ellipsis literal" msgstr "ellipsis literal(刪節號)" diff --git a/library/string.po b/library/string.po index f35d8e3922..e780be5352 100644 --- a/library/string.po +++ b/library/string.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-27 00:14+0000\n" +"POT-Creation-Date: 2024-10-15 00:14+0000\n" "PO-Revision-Date: 2024-03-10 15:57+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -666,7 +666,7 @@ msgid "String format. This is the default type for strings and may be omitted." msgstr "" #: ../../library/string.rst:461 ../../library/string.rst:490 -#: ../../library/string.rst:577 +#: ../../library/string.rst:575 msgid "None" msgstr "None" @@ -735,7 +735,7 @@ msgstr "" "十六進位格式。輸出以 16 為基數的數字,9 以上的數字使用大寫字母。如果指定了 " "``'#'``,則前綴 ``'0x'`` 也會被轉成大寫的 ``'0X'``。" -#: ../../library/string.rst:486 ../../library/string.rst:570 +#: ../../library/string.rst:486 ../../library/string.rst:568 msgid "``'n'``" msgstr "``'n'``" @@ -775,50 +775,49 @@ msgid "" "decimal point, for a total of ``p + 1`` significant digits. With no " "precision given, uses a precision of ``6`` digits after the decimal point " "for :class:`float`, and shows all coefficient digits for :class:`~decimal." -"Decimal`. If no digits follow the decimal point, the decimal point is also " -"removed unless the ``#`` option is used." +"Decimal`. If ``p=0``, the decimal point is omitted unless the ``#`` option " +"is used." msgstr "" -#: ../../library/string.rst:516 +#: ../../library/string.rst:515 msgid "``'E'``" msgstr "``'E'``" -#: ../../library/string.rst:516 +#: ../../library/string.rst:515 msgid "" "Scientific notation. Same as ``'e'`` except it uses an upper case 'E' as the " "separator character." msgstr "" -#: ../../library/string.rst:519 +#: ../../library/string.rst:518 msgid "``'f'``" msgstr "``'f'``" -#: ../../library/string.rst:519 +#: ../../library/string.rst:518 msgid "" "Fixed-point notation. For a given precision ``p``, formats the number as a " "decimal number with exactly ``p`` digits following the decimal point. With " "no precision given, uses a precision of ``6`` digits after the decimal point " "for :class:`float`, and uses a precision large enough to show all " -"coefficient digits for :class:`~decimal.Decimal`. If no digits follow the " -"decimal point, the decimal point is also removed unless the ``#`` option is " -"used." +"coefficient digits for :class:`~decimal.Decimal`. If ``p=0``, the decimal " +"point is omitted unless the ``#`` option is used." msgstr "" -#: ../../library/string.rst:529 +#: ../../library/string.rst:527 msgid "``'F'``" msgstr "``'F'``" -#: ../../library/string.rst:529 +#: ../../library/string.rst:527 msgid "" "Fixed-point notation. Same as ``'f'``, but converts ``nan`` to ``NAN`` and " "``inf`` to ``INF``." msgstr "" -#: ../../library/string.rst:532 +#: ../../library/string.rst:530 msgid "``'g'``" msgstr "``'g'``" -#: ../../library/string.rst:532 +#: ../../library/string.rst:530 msgid "" "General format. For a given precision ``p >= 1``, this rounds the number to " "``p`` significant digits and then formats the result in either fixed-point " @@ -826,7 +825,7 @@ msgid "" "``0`` is treated as equivalent to a precision of ``1``." msgstr "" -#: ../../library/string.rst:539 +#: ../../library/string.rst:537 msgid "" "The precise rules are as follows: suppose that the result formatted with " "presentation type ``'e'`` and precision ``p-1`` would have exponent " @@ -839,7 +838,7 @@ msgid "" "unless the ``'#'`` option is used." msgstr "" -#: ../../library/string.rst:552 +#: ../../library/string.rst:550 msgid "" "With no precision given, uses a precision of ``6`` significant digits for :" "class:`float`. For :class:`~decimal.Decimal`, the coefficient of the result " @@ -849,40 +848,40 @@ msgid "" "notation is used otherwise." msgstr "" -#: ../../library/string.rst:561 +#: ../../library/string.rst:559 msgid "" "Positive and negative infinity, positive and negative zero, and nans, are " "formatted as ``inf``, ``-inf``, ``0``, ``-0`` and ``nan`` respectively, " "regardless of the precision." msgstr "" -#: ../../library/string.rst:566 +#: ../../library/string.rst:564 msgid "``'G'``" msgstr "``'G'``" -#: ../../library/string.rst:566 +#: ../../library/string.rst:564 msgid "" "General format. Same as ``'g'`` except switches to ``'E'`` if the number " "gets too large. The representations of infinity and NaN are uppercased, too." msgstr "" -#: ../../library/string.rst:570 +#: ../../library/string.rst:568 msgid "" "Number. This is the same as ``'g'``, except that it uses the current locale " "setting to insert the appropriate number separator characters." msgstr "" -#: ../../library/string.rst:574 +#: ../../library/string.rst:572 msgid "``'%'``" msgstr "``'%'``" -#: ../../library/string.rst:574 +#: ../../library/string.rst:572 msgid "" "Percentage. Multiplies the number by 100 and displays in fixed (``'f'``) " "format, followed by a percent sign." msgstr "" -#: ../../library/string.rst:577 +#: ../../library/string.rst:575 msgid "" "For :class:`float` this is like the ``'g'`` type, except that when fixed-" "point notation is used to format the result, it always includes at least one " @@ -891,30 +890,30 @@ msgid "" "as large as needed to represent the given value faithfully." msgstr "" -#: ../../library/string.rst:585 +#: ../../library/string.rst:583 msgid "" "For :class:`~decimal.Decimal`, this is the same as either ``'g'`` or ``'G'`` " "depending on the value of ``context.capitals`` for the current decimal " "context." msgstr "" -#: ../../library/string.rst:589 +#: ../../library/string.rst:587 msgid "" "The overall effect is to match the output of :func:`str` as altered by the " "other format modifiers." msgstr "" -#: ../../library/string.rst:597 +#: ../../library/string.rst:595 msgid "Format examples" msgstr "格式範例" -#: ../../library/string.rst:599 +#: ../../library/string.rst:597 msgid "" "This section contains examples of the :meth:`str.format` syntax and " "comparison with the old ``%``-formatting." msgstr "本節包含 :meth:`str.format` 語法以及與舊式 ``%`` 格式的比較。" -#: ../../library/string.rst:602 +#: ../../library/string.rst:600 msgid "" "In most of the cases the syntax is similar to the old ``%``-formatting, with " "the addition of the ``{}`` and with ``:`` used instead of ``%``. For " @@ -923,17 +922,17 @@ msgstr "" "此語法在大多情況下與舊式的 ``%`` 格式類似,只是增加了 ``{}`` 和 ``:`` 來取代 " "``%``。例如,``'%03.2f'`` 可以改寫為 ``'{:03.2f}'``。" -#: ../../library/string.rst:606 +#: ../../library/string.rst:604 msgid "" "The new format syntax also supports new and different options, shown in the " "following examples." msgstr "新的語法還支援新的選項,將在以下的範例中說明。" -#: ../../library/string.rst:609 +#: ../../library/string.rst:607 msgid "Accessing arguments by position::" msgstr "按位置存取引數: ::" -#: ../../library/string.rst:611 +#: ../../library/string.rst:609 msgid "" ">>> '{0}, {1}, {2}'.format('a', 'b', 'c')\n" "'a, b, c'\n" @@ -948,11 +947,11 @@ msgid "" "'abracadabra'" msgstr "" -#: ../../library/string.rst:622 +#: ../../library/string.rst:620 msgid "Accessing arguments by name::" msgstr "按名稱存取引數: ::" -#: ../../library/string.rst:624 +#: ../../library/string.rst:622 msgid "" ">>> 'Coordinates: {latitude}, {longitude}'.format(latitude='37.24N', " "longitude='-115.81W')\n" @@ -962,11 +961,11 @@ msgid "" "'Coordinates: 37.24N, -115.81W'" msgstr "" -#: ../../library/string.rst:630 +#: ../../library/string.rst:628 msgid "Accessing arguments' attributes::" msgstr "存取引數的屬性: ::" -#: ../../library/string.rst:632 +#: ../../library/string.rst:630 msgid "" ">>> c = 3-5j\n" ">>> ('The complex number {0} is formed from the real part {0.real} '\n" @@ -983,22 +982,22 @@ msgid "" "'Point(4, 2)'" msgstr "" -#: ../../library/string.rst:645 +#: ../../library/string.rst:643 msgid "Accessing arguments' items::" msgstr "存取引數的內容: ::" -#: ../../library/string.rst:647 +#: ../../library/string.rst:645 msgid "" ">>> coord = (3, 5)\n" ">>> 'X: {0[0]}; Y: {0[1]}'.format(coord)\n" "'X: 3; Y: 5'" msgstr "" -#: ../../library/string.rst:651 +#: ../../library/string.rst:649 msgid "Replacing ``%s`` and ``%r``::" msgstr "替換 ``%s`` 和 ``%r``: ::" -#: ../../library/string.rst:653 +#: ../../library/string.rst:651 msgid "" ">>> \"repr() shows quotes: {!r}; str() doesn't: {!s}\".format('test1', " "'test2')\n" @@ -1008,11 +1007,11 @@ msgstr "" "'test2')\n" "\"repr() shows quotes: 'test1'; str() doesn't: test2\"" -#: ../../library/string.rst:656 +#: ../../library/string.rst:654 msgid "Aligning the text and specifying a width::" msgstr "對齊文字以及指定寬度: ::" -#: ../../library/string.rst:658 +#: ../../library/string.rst:656 msgid "" ">>> '{:<30}'.format('left aligned')\n" "'left aligned '\n" @@ -1024,11 +1023,11 @@ msgid "" "'***********centered***********'" msgstr "" -#: ../../library/string.rst:667 +#: ../../library/string.rst:665 msgid "Replacing ``%+f``, ``%-f``, and ``% f`` and specifying a sign::" msgstr "替換 ``%+f``、``%-f`` 和 ``% f`` 以及指定正負號: ::" -#: ../../library/string.rst:669 +#: ../../library/string.rst:667 msgid "" ">>> '{:+f}; {:+f}'.format(3.14, -3.14) # show it always\n" "'+3.140000; -3.140000'\n" @@ -1039,12 +1038,12 @@ msgid "" "'3.140000; -3.140000'" msgstr "" -#: ../../library/string.rst:676 +#: ../../library/string.rst:674 msgid "" "Replacing ``%x`` and ``%o`` and converting the value to different bases::" msgstr "替換 ``%x`` 和 ``%o`` 並將其值轉換為不同的進位制: ::" -#: ../../library/string.rst:678 +#: ../../library/string.rst:676 msgid "" ">>> # format also supports binary numbers\n" ">>> \"int: {0:d}; hex: {0:x}; oct: {0:o}; bin: {0:b}\".format(42)\n" @@ -1054,11 +1053,11 @@ msgid "" "'int: 42; hex: 0x2a; oct: 0o52; bin: 0b101010'" msgstr "" -#: ../../library/string.rst:685 +#: ../../library/string.rst:683 msgid "Using the comma as a thousands separator::" msgstr "使用逗號作為千位分隔符: ::" -#: ../../library/string.rst:687 +#: ../../library/string.rst:685 msgid "" ">>> '{:,}'.format(1234567890)\n" "'1,234,567,890'" @@ -1066,11 +1065,11 @@ msgstr "" ">>> '{:,}'.format(1234567890)\n" "'1,234,567,890'" -#: ../../library/string.rst:690 +#: ../../library/string.rst:688 msgid "Expressing a percentage::" msgstr "表示為百分比: ::" -#: ../../library/string.rst:692 +#: ../../library/string.rst:690 msgid "" ">>> points = 19\n" ">>> total = 22\n" @@ -1082,11 +1081,11 @@ msgstr "" ">>> 'Correct answers: {:.2%}'.format(points/total)\n" "'Correct answers: 86.36%'" -#: ../../library/string.rst:697 +#: ../../library/string.rst:695 msgid "Using type-specific formatting::" msgstr "作為特定型別格式: ::" -#: ../../library/string.rst:699 +#: ../../library/string.rst:697 msgid "" ">>> import datetime\n" ">>> d = datetime.datetime(2010, 7, 4, 12, 15, 58)\n" @@ -1098,11 +1097,11 @@ msgstr "" ">>> '{:%Y-%m-%d %H:%M:%S}'.format(d)\n" "'2010-07-04 12:15:58'" -#: ../../library/string.rst:704 +#: ../../library/string.rst:702 msgid "Nesting arguments and more complex examples::" msgstr "巢狀引數及更多複雜範例: ::" -#: ../../library/string.rst:706 +#: ../../library/string.rst:704 msgid "" ">>> for align, text in zip('<^>', ['left', 'center', 'right']):\n" "... '{0:{fill}{align}16}'.format(text, fill=align, align=align)\n" @@ -1160,11 +1159,11 @@ msgstr "" " 10 A 12 1010\n" " 11 B 13 1011" -#: ../../library/string.rst:738 +#: ../../library/string.rst:736 msgid "Template strings" msgstr "模板字串" -#: ../../library/string.rst:740 +#: ../../library/string.rst:738 msgid "" "Template strings provide simpler string substitutions as described in :pep:" "`292`. A primary use case for template strings is for internationalization " @@ -1178,17 +1177,17 @@ msgstr "" "化工具更容易翻譯。基於模板字串建構的 i18n 函式庫範例,請參閱 `flufl.i18n " "`_ 套件。" -#: ../../library/string.rst:750 +#: ../../library/string.rst:748 msgid "" "Template strings support ``$``-based substitutions, using the following " "rules:" msgstr "" -#: ../../library/string.rst:752 +#: ../../library/string.rst:750 msgid "``$$`` is an escape; it is replaced with a single ``$``." msgstr "" -#: ../../library/string.rst:754 +#: ../../library/string.rst:752 msgid "" "``$identifier`` names a substitution placeholder matching a mapping key of " "``\"identifier\"``. By default, ``\"identifier\"`` is restricted to any " @@ -1198,30 +1197,30 @@ msgid "" "specification." msgstr "" -#: ../../library/string.rst:761 +#: ../../library/string.rst:759 msgid "" "``${identifier}`` is equivalent to ``$identifier``. It is required when " "valid identifier characters follow the placeholder but are not part of the " "placeholder, such as ``\"${noun}ification\"``." msgstr "" -#: ../../library/string.rst:765 +#: ../../library/string.rst:763 msgid "" "Any other appearance of ``$`` in the string will result in a :exc:" "`ValueError` being raised." msgstr "" -#: ../../library/string.rst:768 +#: ../../library/string.rst:766 msgid "" "The :mod:`string` module provides a :class:`Template` class that implements " "these rules. The methods of :class:`Template` are:" msgstr "" -#: ../../library/string.rst:774 +#: ../../library/string.rst:772 msgid "The constructor takes a single argument which is the template string." msgstr "" -#: ../../library/string.rst:779 +#: ../../library/string.rst:777 msgid "" "Performs the template substitution, returning a new string. *mapping* is " "any dictionary-like object with keys that match the placeholders in the " @@ -1233,7 +1232,7 @@ msgstr "" "的字典型物件。或者如果關鍵字就是佔位符號時,你也可以改提供關鍵字引數。當 " "*mapping* 跟 *kwds* 同時給定並存在重複時,*kwds* 的佔位符號會被優先使用。" -#: ../../library/string.rst:788 +#: ../../library/string.rst:786 msgid "" "Like :meth:`substitute`, except that if placeholders are missing from " "*mapping* and *kwds*, instead of raising a :exc:`KeyError` exception, the " @@ -1246,7 +1245,7 @@ msgstr "" "與 :meth:`substitute` 不同的是,任何包含 ``$`` 的字句會直接回傳 ``$`` 而非引" "發 :exc:`ValueError`。" -#: ../../library/string.rst:794 +#: ../../library/string.rst:792 msgid "" "While other exceptions may still occur, this method is called \"safe\" " "because it always tries to return a usable string instead of raising an " @@ -1260,7 +1259,7 @@ msgstr "" "完全安全,因為它會默默忽略格式錯誤的模板,這些模板包含了多餘的左右定界符、不" "匹配的括號,或者不是有效的 Python 識別字的佔位符號。" -#: ../../library/string.rst:804 +#: ../../library/string.rst:802 msgid "" "Returns false if the template has invalid placeholders that will cause :meth:" "`substitute` to raise :exc:`ValueError`." @@ -1268,18 +1267,18 @@ msgstr "" "如果模板有將導致 :meth:`substitute` 引發 :exc:`ValueError` 的無效佔位符號,就" "會回傳 false。" -#: ../../library/string.rst:812 +#: ../../library/string.rst:810 msgid "" "Returns a list of the valid identifiers in the template, in the order they " "first appear, ignoring any invalid identifiers." msgstr "" "回傳模板中有效識別字的串列,按照它們首次出現的順序,並忽略任何無效的識別字。" -#: ../../library/string.rst:817 +#: ../../library/string.rst:815 msgid ":class:`Template` instances also provide one public data attribute:" msgstr ":class:`Template` 實例也提供一個公開的資料屬性:" -#: ../../library/string.rst:821 +#: ../../library/string.rst:819 msgid "" "This is the object passed to the constructor's *template* argument. In " "general, you shouldn't change it, but read-only access is not enforced." @@ -1287,11 +1286,11 @@ msgstr "" "這是傳遞給建構函式 *template* 引數的物件。一般來說,你不應該改變它,但並沒有" "強制設定成唯讀。" -#: ../../library/string.rst:824 +#: ../../library/string.rst:822 msgid "Here is an example of how to use a Template::" msgstr "以下是如何使用 Template 的一個範例: ::" -#: ../../library/string.rst:826 +#: ../../library/string.rst:824 msgid "" ">>> from string import Template\n" ">>> s = Template('$who likes $what')\n" @@ -1325,7 +1324,7 @@ msgstr "" ">>> Template('$who likes $what').safe_substitute(d)\n" "'tim likes $what'" -#: ../../library/string.rst:842 +#: ../../library/string.rst:840 msgid "" "Advanced usage: you can derive subclasses of :class:`Template` to customize " "the placeholder syntax, delimiter character, or the entire regular " @@ -1335,7 +1334,7 @@ msgstr "" "進階用法:你可以衍生 :class:`Template` 類別來自定義佔位符號語法、左右定界符字" "元,或者用於剖析模板字串的正規表示式。你可以透過覆寫這些類別屬性來達成:" -#: ../../library/string.rst:847 +#: ../../library/string.rst:845 msgid "" "*delimiter* -- This is the literal string describing a placeholder " "introducing delimiter. The default value is ``$``. Note that this should " @@ -1349,7 +1348,7 @@ msgstr "" "注意你不能在建立類別後修改左右定界符。(意即在子類別的命名空間中必須設置不同" "的左右定界符)" -#: ../../library/string.rst:854 +#: ../../library/string.rst:852 msgid "" "*idpattern* -- This is the regular expression describing the pattern for non-" "braced placeholders. The default value is the regular expression ``(?a:[_a-" @@ -1357,19 +1356,19 @@ msgid "" "pattern will also apply to braced placeholders." msgstr "" -#: ../../library/string.rst:861 +#: ../../library/string.rst:859 msgid "" "Since default *flags* is ``re.IGNORECASE``, pattern ``[a-z]`` can match with " "some non-ASCII characters. That's why we use the local ``a`` flag here." msgstr "" -#: ../../library/string.rst:865 +#: ../../library/string.rst:863 msgid "" "*braceidpattern* can be used to define separate patterns used inside and " "outside the braces." msgstr "" -#: ../../library/string.rst:869 +#: ../../library/string.rst:867 msgid "" "*braceidpattern* -- This is like *idpattern* but describes the pattern for " "braced placeholders. Defaults to ``None`` which means to fall back to " @@ -1378,7 +1377,7 @@ msgid "" "unbraced placeholders." msgstr "" -#: ../../library/string.rst:877 +#: ../../library/string.rst:875 msgid "" "*flags* -- The regular expression flags that will be applied when compiling " "the regular expression used for recognizing substitutions. The default " @@ -1387,7 +1386,7 @@ msgid "" "regular expressions." msgstr "" -#: ../../library/string.rst:885 +#: ../../library/string.rst:883 msgid "" "Alternatively, you can provide the entire regular expression pattern by " "overriding the class attribute *pattern*. If you do this, the value must be " @@ -1396,13 +1395,13 @@ msgid "" "placeholder rule:" msgstr "" -#: ../../library/string.rst:891 +#: ../../library/string.rst:889 msgid "" "*escaped* -- This group matches the escape sequence, e.g. ``$$``, in the " "default pattern." msgstr "*escaped* -- 此群組與跳脫序列匹配,例如在預設模式下為 ``$$``。" -#: ../../library/string.rst:894 +#: ../../library/string.rst:892 msgid "" "*named* -- This group matches the unbraced placeholder name; it should not " "include the delimiter in capturing group." @@ -1410,7 +1409,7 @@ msgstr "" "*named* -- 此群組與不帶大括號的佔位符號名稱匹配;它不應包含擷取群組中的左右定" "界符號。" -#: ../../library/string.rst:897 +#: ../../library/string.rst:895 msgid "" "*braced* -- This group matches the brace enclosed placeholder name; it " "should not include either the delimiter or braces in the capturing group." @@ -1418,7 +1417,7 @@ msgstr "" "*braced* -- 此群組與大括號括起來的佔位符號名稱匹配;它不應在擷取群組中包含左" "右定界符或大括號。" -#: ../../library/string.rst:900 +#: ../../library/string.rst:898 msgid "" "*invalid* -- This group matches any other delimiter pattern (usually a " "single delimiter), and it should appear last in the regular expression." @@ -1426,7 +1425,7 @@ msgstr "" "*invalid* -- 此群組與任何其他左右定界符模式(通常是單一左右定界符)匹配,且它" "應該出現在正規表示式的最後。" -#: ../../library/string.rst:903 +#: ../../library/string.rst:901 msgid "" "The methods on this class will raise :exc:`ValueError` if the pattern " "matches the template without one of these named groups matching." @@ -1434,11 +1433,11 @@ msgstr "" "當此模式有匹配於模板但這些命名組中卻有任一個不匹配,此類別的方法將引發 :exc:" "`ValueError`。" -#: ../../library/string.rst:908 +#: ../../library/string.rst:906 msgid "Helper functions" msgstr "輔助函式" -#: ../../library/string.rst:912 +#: ../../library/string.rst:910 msgid "" "Split the argument into words using :meth:`str.split`, capitalize each word " "using :meth:`str.capitalize`, and join the capitalized words using :meth:" @@ -1519,10 +1518,10 @@ msgstr ", (逗號)" msgid "_ (underscore)" msgstr "_ (底線)" -#: ../../library/string.rst:748 +#: ../../library/string.rst:746 msgid "$ (dollar)" msgstr "$ (金錢符號)" -#: ../../library/string.rst:748 +#: ../../library/string.rst:746 msgid "in template strings" msgstr "於 template strings(模板字串)" diff --git a/library/subprocess.po b/library/subprocess.po index d6d98f3bfc..a5a9086c53 100644 --- a/library/subprocess.po +++ b/library/subprocess.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-11 00:13+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-" @@ -50,9 +50,13 @@ msgstr "" msgid ":pep:`324` -- PEP proposing the subprocess module" msgstr ":pep:`324` -- 提議 subprocess 模組的 PEP" +#: ../../library/subprocess.rst:598 ../../library/subprocess.rst:605 +#: ../../library/subprocess.rst:615 ../../library/subprocess.rst:624 +#: ../../library/subprocess.rst:633 ../../library/subprocess.rst:639 +#: ../../library/subprocess.rst:1560 ../../library/subprocess.rst:1582 #: ../../includes/wasm-mobile-notavail.rst:3 -msgid ":ref:`Availability `: not Android, not iOS, not WASI." -msgstr ":ref:`適用 `:、非 Android、非 iOS、非 WASI。" +msgid "Availability" +msgstr "" #: ../../includes/wasm-mobile-notavail.rst:5 msgid "" @@ -778,12 +782,6 @@ msgid "" "the child process prior to the execution of the subprocess." msgstr "" -#: ../../library/subprocess.rst:598 ../../library/subprocess.rst:605 -#: ../../library/subprocess.rst:615 ../../library/subprocess.rst:624 -#: ../../library/subprocess.rst:633 ../../library/subprocess.rst:639 -msgid ":ref:`Availability `: POSIX" -msgstr ":ref:`適用 `:POSIX" - #: ../../library/subprocess.rst:599 msgid "*start_new_session* was added." msgstr "新增 *start_new_session*。" @@ -2046,10 +2044,6 @@ msgstr "" ">>> subprocess.getstatusoutput('/bin/kill $$')\n" "(-15, '')" -#: ../../library/subprocess.rst:1560 ../../library/subprocess.rst:1582 -msgid ":ref:`Availability `: Unix, Windows." -msgstr ":ref:`適用 `:Unix 和 Windows。" - #: ../../library/subprocess.rst:1562 msgid "Windows support was added." msgstr "新增對 Windows 的支援。" @@ -2214,13 +2208,3 @@ msgstr "universal newlines" #: ../../library/subprocess.rst:296 msgid "subprocess module" msgstr "subprocess 模組" - -#, fuzzy -#~ msgid "" -#~ "This module does not work or is not available on WebAssembly platforms, " -#~ "or on iOS. See :ref:`wasm-availability` for more information on WASM " -#~ "availability; see :ref:`iOS-availability` for more information on iOS " -#~ "availability." -#~ msgstr "" -#~ "此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法" -#~ "作用或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" diff --git a/library/symtable.po b/library/symtable.po index 48c873ff47..86a561a35b 100644 --- a/library/symtable.po +++ b/library/symtable.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-09 00:13+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -34,8 +34,8 @@ msgid "" "examine these tables." msgstr "" "符號表 (symbol table) 是在生成位元組碼 (bytecode) 之前由編譯器從 AST 生成的。" -"符號表負責計算程式碼中每個識別器 (identifier) 的範圍。:mod:`symtable` 提供了" -"一個介面來檢查這些表。" +"符號表負責計算程式碼中每個識別器 (identifier) 的作用域。:mod:`symtable` 提供" +"了一個介面來檢查這些表。" #: ../../library/symtable.rst:22 msgid "Generating Symbol Tables" @@ -56,40 +56,42 @@ msgstr "檢查符號表" #: ../../library/symtable.rst:36 msgid "An enumeration indicating the type of a :class:`SymbolTable` object." -msgstr "" +msgstr "表明 :class:`SymbolTable` 物件型別的列舉。" #: ../../library/symtable.rst:41 msgid "Used for the symbol table of a module." -msgstr "" +msgstr "用於模組的符號表。" #: ../../library/symtable.rst:46 msgid "Used for the symbol table of a function." -msgstr "" +msgstr "用於函式的符號表。" #: ../../library/symtable.rst:51 msgid "Used for the symbol table of a class." -msgstr "" +msgstr "用於類別的符號表。" #: ../../library/symtable.rst:53 msgid "" "The following members refer to different flavors of :ref:`annotation scopes " "`." -msgstr "" +msgstr "以下成員代表不同風格的\\ :ref:`註釋作用域 `。" #: ../../library/symtable.rst:59 msgid "" "Used for annotations if ``from __future__ import annotations`` is active." -msgstr "" +msgstr "如果 ``from __future__ import annotations`` 處於活動狀態,則用於註解。" #: ../../library/symtable.rst:64 msgid "Used for the symbol table of :keyword:`type` constructions." -msgstr "" +msgstr "用於 :keyword:`type` 結構的符號表。" #: ../../library/symtable.rst:69 msgid "" "Used for the symbol table of :ref:`generic functions ` " "or :ref:`generic classes `." msgstr "" +"用於\\ :ref:`泛型函式 (generic functions) `\\ 或\\ :ref:`" +"泛型類別 (generic classes) `\\ 的符號表。" #: ../../library/symtable.rst:75 msgid "" @@ -98,6 +100,9 @@ msgid "" "TypeVarTuple or a ParamSpec object (the latter two do not support a bound or " "a constraint tuple)." msgstr "" +"用於形式意義上 (formal sense) 的繫結、約束元組 (constraint tuple) 或單一型別" +"變數的預設值的符號表,即 TypeVar、TypeVarTuple 或 ParamSpec 物件(後兩者不支" +"援繫結或約束元組)。" #: ../../library/symtable.rst:84 msgid "A namespace table for a block. The constructor is not public." @@ -109,7 +114,7 @@ msgstr "" msgid "" "Return the type of the symbol table. Possible values are members of the :" "class:`SymbolTableType` enumeration." -msgstr "" +msgstr "回傳符號表的類型。可能的值為 :class:`SymbolTableType` 列舉的成員。" #: ../../library/symtable.rst:91 msgid "" @@ -121,7 +126,7 @@ msgstr "" #: ../../library/symtable.rst:95 msgid "Return values are members of the :class:`SymbolTableType` enumeration." -msgstr "" +msgstr "回傳值是 :class:`SymbolTableType` 列舉的成員。" #: ../../library/symtable.rst:98 msgid "" @@ -129,6 +134,8 @@ msgid "" "it is recommended to use :class:`SymbolTableType` members instead of hard-" "coded strings." msgstr "" +"回傳字串的確切值在未來可能會發生變化,因此建議使用 :class:`SymbolTableType` " +"成員而不是寫死 (hard-coded) 字串。" #: ../../library/symtable.rst:104 msgid "Return the table's identifier." @@ -148,7 +155,7 @@ msgstr "" "名稱;如果表是全域的,則為 ``'top'`` (:meth:`get_type` 會回傳 " "``'module'``)。對於型別參數作用域(用於泛型類別、函式和型別別名),它是底層" "類別、函式或型別別名的名稱。對於型別別名作用域,它是型別別名的名稱。對於 :" -"class:`~typing.TypeVar` 綁定範圍,它會是 ``TypeVar`` 的名稱。" +"class:`~typing.TypeVar` 綁定作用域,它會是 ``TypeVar`` 的名稱。" #: ../../library/symtable.rst:118 msgid "Return the number of the first line in the block this table represents." @@ -167,7 +174,7 @@ msgid "" "Return ``True`` if the block has nested namespaces within it. These can be " "obtained with :meth:`get_children`." msgstr "" -"如果區塊內有巢狀命名空間,則回傳 ``True``。這些可以通過 :meth:`get_children` " +"如果區塊內有巢狀命名空間,則回傳 ``True``。這些可以透過 :meth:`get_children` " "獲得。" #: ../../library/symtable.rst:135 @@ -209,90 +216,101 @@ msgid "Return a tuple containing names of globals in this function." msgstr "回傳一個包含此函式中全域變數 (globals) 名稱的元組。" #: ../../library/symtable.rst:170 -msgid "Return a tuple containing names of nonlocals in this function." -msgstr "回傳一個包含此函式中非區域變數 (nonlocals) 名稱的元組。" +msgid "" +"Return a tuple containing names of explicitly declared nonlocals in this " +"function." +msgstr "回傳一個包含此函式中明確宣告的非區域變數 (nonlocals) 名稱的元組。" #: ../../library/symtable.rst:174 -msgid "Return a tuple containing names of free variables in this function." -msgstr "回傳一個包含此函式中自由變數 (free variables) 名稱的元組。" +msgid "" +"Return a tuple containing names of :term:`free (closure) variables ` in this function." +msgstr "" +"回傳一個包含此函式中的\\ :term:`自由(閉包)變數 (free (closure) variables) " +"` 名稱的元組。" -#: ../../library/symtable.rst:179 +#: ../../library/symtable.rst:180 msgid "A namespace of a class. This class inherits from :class:`SymbolTable`." msgstr "一個類別的命名空間。該類別繼承自 :class:`SymbolTable`。" -#: ../../library/symtable.rst:183 +#: ../../library/symtable.rst:184 msgid "" "Return a tuple containing the names of method-like functions declared in the " "class." msgstr "回傳一個包含類別中聲明的類似方法之函式名稱的元組。" -#: ../../library/symtable.rst:186 +#: ../../library/symtable.rst:187 msgid "" "Here, the term 'method' designates *any* function defined in the class body " "via :keyword:`def` or :keyword:`async def`." msgstr "" +"在這裡,術語「方法 (method)」表示透過 :keyword:`def` 或 :keyword:`async def` " +"在類別主體中定義的\\ *任何*\\ 函式。" -#: ../../library/symtable.rst:189 +#: ../../library/symtable.rst:190 msgid "" "Functions defined in a deeper scope (e.g., in an inner class) are not picked " "up by :meth:`get_methods`." msgstr "" +":meth:`get_methods` 不會取得更深作用域內定義的函式(例如在內部類別中)。" -#: ../../library/symtable.rst:192 +#: ../../library/symtable.rst:193 msgid "For example:" msgstr "舉例來說:" -#: ../../library/symtable.rst:214 +#: ../../library/symtable.rst:215 msgid "" "Although ``A().f()`` raises :exc:`TypeError` at runtime, ``A.f`` is still " "considered as a method-like function." msgstr "" +"儘管 ``A().f()`` 會在 runtime 引發 :exc:`TypeError`,但 ``A.f`` 仍然被視為類" +"似方法的函式。" -#: ../../library/symtable.rst:219 +#: ../../library/symtable.rst:220 msgid "" "An entry in a :class:`SymbolTable` corresponding to an identifier in the " "source. The constructor is not public." msgstr "" ":class:`SymbolTable` 中的條目對應於來源中的識別器。建構函式不是公開的。" -#: ../../library/symtable.rst:224 +#: ../../library/symtable.rst:225 msgid "Return the symbol's name." msgstr "回傳符號的名稱。" -#: ../../library/symtable.rst:228 +#: ../../library/symtable.rst:229 msgid "Return ``True`` if the symbol is used in its block." msgstr "如果該符號在其區塊中使用,則回傳 ``True``。" -#: ../../library/symtable.rst:232 +#: ../../library/symtable.rst:233 msgid "Return ``True`` if the symbol is created from an import statement." msgstr "如果符號是從 import 陳述式建立的,則回傳 ``True``。" -#: ../../library/symtable.rst:236 +#: ../../library/symtable.rst:237 msgid "Return ``True`` if the symbol is a parameter." msgstr "如果符號是一個參數,則回傳 ``True``。" -#: ../../library/symtable.rst:240 +#: ../../library/symtable.rst:241 msgid "Return ``True`` if the symbol is global." msgstr "如果符號是全域的,則回傳 ``True``。" -#: ../../library/symtable.rst:244 +#: ../../library/symtable.rst:245 msgid "Return ``True`` if the symbol is nonlocal." msgstr "如果符號是非區域的,則回傳 ``True``。" -#: ../../library/symtable.rst:248 +#: ../../library/symtable.rst:249 msgid "" "Return ``True`` if the symbol is declared global with a global statement." msgstr "如果使用全域陳述式將符號聲明為全域的,則回傳 ``True``。" -#: ../../library/symtable.rst:252 +#: ../../library/symtable.rst:253 msgid "Return ``True`` if the symbol is local to its block." msgstr "如果符號是其區塊的區域符號,則回傳 ``True``。" -#: ../../library/symtable.rst:256 +#: ../../library/symtable.rst:257 msgid "Return ``True`` if the symbol is annotated." msgstr "如果符號有被註釋,則回傳 ``True``。" -#: ../../library/symtable.rst:262 +#: ../../library/symtable.rst:263 msgid "" "Return ``True`` if the symbol is referenced in its block, but not assigned " "to." @@ -300,25 +318,25 @@ msgstr "" "如果該符號在其區塊中被參照 (referenced) 但未被賦值 (assigned),則回傳 " "``True``。" -#: ../../library/symtable.rst:267 +#: ../../library/symtable.rst:268 msgid "Return ``True`` if the symbol is assigned to in its block." msgstr "如果該符號被賦值到其區塊中,則回傳 ``True``。" -#: ../../library/symtable.rst:271 +#: ../../library/symtable.rst:272 msgid "Return ``True`` if name binding introduces new namespace." msgstr "如果名稱綁定引入 (introduce) 新的命名空間,則回傳 ``True``。" -#: ../../library/symtable.rst:273 +#: ../../library/symtable.rst:274 msgid "" "If the name is used as the target of a function or class statement, this " "will be true." msgstr "如果名稱用作函式或類別陳述式的目標,則這將會是 true。" -#: ../../library/symtable.rst:276 +#: ../../library/symtable.rst:277 msgid "For example::" msgstr "舉例來說: ::" -#: ../../library/symtable.rst:278 +#: ../../library/symtable.rst:279 msgid "" ">>> table = symtable.symtable(\"def some_func(): pass\", \"string\", " "\"exec\")\n" @@ -330,7 +348,7 @@ msgstr "" ">>> table.lookup(\"some_func\").is_namespace()\n" "True" -#: ../../library/symtable.rst:282 +#: ../../library/symtable.rst:283 msgid "" "Note that a single name can be bound to multiple objects. If the result is " "``True``, the name may also be bound to other objects, like an int or list, " @@ -339,11 +357,11 @@ msgstr "" "請注意,單個名稱可以綁定到多個物件。如果結果為 ``True``,則該名稱也可能被綁定" "到其他物件,例如 int 或 list,而不會引入新的命名空間。" -#: ../../library/symtable.rst:288 +#: ../../library/symtable.rst:289 msgid "Return a list of namespaces bound to this name." msgstr "回傳綁定到該名稱的命名空間的串列。" -#: ../../library/symtable.rst:292 +#: ../../library/symtable.rst:293 msgid "" "Return the namespace bound to this name. If more than one or no namespace is " "bound to this name, a :exc:`ValueError` is raised." @@ -351,32 +369,23 @@ msgstr "" "回傳綁定到該名稱的命名空間。如果該名稱綁定了多個命名空間或沒有命名空間,則會" "引發 :exc:`ValueError`。" -#: ../../library/symtable.rst:299 +#: ../../library/symtable.rst:300 msgid "Command-Line Usage" -msgstr "" +msgstr "命令列用法" -#: ../../library/symtable.rst:303 +#: ../../library/symtable.rst:304 msgid "" "The :mod:`symtable` module can be executed as a script from the command line." -msgstr "" +msgstr ":mod:`symtable` 模組可以從命令列作為腳本執行。" -#: ../../library/symtable.rst:305 +#: ../../library/symtable.rst:306 msgid "python -m symtable [infile...]" -msgstr "" +msgstr "python -m symtable [infile...]" -#: ../../library/symtable.rst:309 +#: ../../library/symtable.rst:310 msgid "" "Symbol tables are generated for the specified Python source files and dumped " "to stdout. If no input file is specified, the content is read from stdin." msgstr "" - -#~ msgid "" -#~ "Return the type of the symbol table. Possible values are ``'class'``, " -#~ "``'module'``, ``'function'``, ``'annotation'``, ``'TypeVar bound'``, " -#~ "``'type alias'``, and ``'type parameter'``. The latter four refer to " -#~ "different flavors of :ref:`annotation scopes `." -#~ msgstr "" -#~ "回傳符號表的種類。可能的值為 ``'class'``、``'module'``、``'function'``、" -#~ "``'annotation'``、``'TypeVar bound'``、``'type alias'`` 和 ``'type " -#~ "parameter'``。後四個是指不同的\\ :ref:`註釋範圍 (annotation scopes) " -#~ "`。" +"為指定的 Python 原始檔產生符號表並轉儲 (dump) 到 stdout。如果未指定輸入檔案," +"則從 stdin 讀取內容。" diff --git a/library/sys.po b/library/sys.po index 32c11aa68d..096b946f75 100644 --- a/library/sys.po +++ b/library/sys.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-11 00:13+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-" @@ -42,10 +42,14 @@ msgid "" "removed)." msgstr "" -#: ../../library/sys.rst:25 ../../library/sys.rst:778 -#: ../../library/sys.rst:1489 -msgid ":ref:`Availability `: Unix." -msgstr ":ref:`適用 `:Unix。" +#: ../../library/sys.rst:25 ../../library/sys.rst:299 ../../library/sys.rst:369 +#: ../../library/sys.rst:760 ../../library/sys.rst:778 +#: ../../library/sys.rst:991 ../../library/sys.rst:1490 +#: ../../library/sys.rst:1731 ../../library/sys.rst:1746 +#: ../../library/sys.rst:1754 ../../library/sys.rst:1770 +#: ../../library/sys.rst:2014 +msgid "Availability" +msgstr "" #: ../../library/sys.rst:30 msgid "" @@ -381,11 +385,6 @@ msgstr "" msgid "Integer specifying the handle of the Python DLL." msgstr "" -#: ../../library/sys.rst:299 ../../library/sys.rst:991 -#: ../../library/sys.rst:1769 ../../library/sys.rst:2013 -msgid ":ref:`Availability `: Windows." -msgstr ":ref:`適用 `:Windows。" - #: ../../library/sys.rst:304 msgid "" "If *value* is not ``None``, this function prints ``repr(value)`` to ``sys." @@ -470,10 +469,6 @@ msgstr "" msgid "``True`` if Python is compiled with shared memory support." msgstr "" -#: ../../library/sys.rst:369 -msgid ":ref:`Availability `: Emscripten." -msgstr ":ref:`適用 `:Emscripten。" - #: ../../library/sys.rst:376 msgid "" "If this is set (not ``None``), Python will write bytecode-cache ``.pyc`` " @@ -998,10 +993,6 @@ msgid "" "version information, see :func:`platform.android_ver`." msgstr "" -#: ../../library/sys.rst:760 -msgid ":ref:`Availability `: Android." -msgstr ":ref:`適用 `:Android。" - #: ../../library/sys.rst:767 msgid "" "Return the name of the current default string encoding used by the Unicode " @@ -1300,7 +1291,7 @@ msgstr "" msgid "See :pep:`525` for more details." msgstr "更多細節請見 :pep:`525`。" -#: ../../library/sys.rst:1014 ../../library/sys.rst:1701 +#: ../../library/sys.rst:1014 ../../library/sys.rst:1702 msgid "" "This function has been added on a provisional basis (see :pep:`411` for " "details.)" @@ -1312,7 +1303,7 @@ msgid "" "`set_coroutine_origin_tracking_depth`." msgstr "" -#: ../../library/sys.rst:1026 ../../library/sys.rst:1722 +#: ../../library/sys.rst:1026 ../../library/sys.rst:1723 msgid "" "This function has been added on a provisional basis (see :pep:`411` for " "details.) Use it only for debugging purposes." @@ -1588,45 +1579,45 @@ msgid "" "implement Python's default import semantics. The :meth:`~importlib.abc." "MetaPathFinder.find_spec` method is called with at least the absolute name " "of the module being imported. If the module to be imported is contained in a " -"package, then the parent package's :attr:`__path__` attribute is passed in " -"as a second argument. The method returns a :term:`module spec`, or ``None`` " -"if the module cannot be found." +"package, then the parent package's :attr:`~module.__path__` attribute is " +"passed in as a second argument. The method returns a :term:`module spec`, or " +"``None`` if the module cannot be found." msgstr "" -#: ../../library/sys.rst:1283 +#: ../../library/sys.rst:1284 msgid ":class:`importlib.abc.MetaPathFinder`" msgstr ":class:`importlib.abc.MetaPathFinder`" -#: ../../library/sys.rst:1284 +#: ../../library/sys.rst:1285 msgid "" "The abstract base class defining the interface of finder objects on :data:" "`meta_path`." msgstr "" -#: ../../library/sys.rst:1286 +#: ../../library/sys.rst:1287 msgid ":class:`importlib.machinery.ModuleSpec`" msgstr ":class:`importlib.machinery.ModuleSpec`" -#: ../../library/sys.rst:1287 +#: ../../library/sys.rst:1288 msgid "" "The concrete class which :meth:`~importlib.abc.MetaPathFinder.find_spec` " "should return instances of." msgstr "" -#: ../../library/sys.rst:1293 +#: ../../library/sys.rst:1294 msgid "" ":term:`Module specs ` were introduced in Python 3.4, by :pep:" "`451`." msgstr "" -#: ../../library/sys.rst:1298 +#: ../../library/sys.rst:1299 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:1304 +#: ../../library/sys.rst:1305 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 " @@ -1638,13 +1629,13 @@ msgid "" "other threads." msgstr "" -#: ../../library/sys.rst:1316 +#: ../../library/sys.rst:1317 msgid "" "The list of the original command line arguments passed to the Python " "executable." msgstr "" -#: ../../library/sys.rst:1319 +#: ../../library/sys.rst:1320 msgid "" "The elements of :data:`sys.orig_argv` are the arguments to the Python " "interpreter, while the elements of :data:`sys.argv` are the arguments to the " @@ -1652,68 +1643,68 @@ msgid "" "in :data:`sys.orig_argv` and missing from :data:`sys.argv`." msgstr "" -#: ../../library/sys.rst:1331 +#: ../../library/sys.rst:1332 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:1335 +#: ../../library/sys.rst:1336 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:1339 +#: ../../library/sys.rst:1340 msgid "" "``python -m module`` command line: prepend the current working directory." msgstr "" -#: ../../library/sys.rst:1341 +#: ../../library/sys.rst:1342 msgid "" "``python script.py`` command line: prepend the script's directory. If it's a " "symbolic link, resolve symbolic links." msgstr "" -#: ../../library/sys.rst:1343 +#: ../../library/sys.rst:1344 msgid "" "``python -c code`` and ``python`` (REPL) command lines: prepend an empty " "string, which means the current working directory." msgstr "" -#: ../../library/sys.rst:1346 +#: ../../library/sys.rst:1347 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:1349 +#: ../../library/sys.rst:1350 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:1355 +#: ../../library/sys.rst:1356 msgid "" "Module :mod:`site` This describes how to use .pth files to extend :data:`sys." "path`." msgstr "" -#: ../../library/sys.rst:1360 +#: ../../library/sys.rst:1361 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:1364 ../../library/sys.rst:1375 +#: ../../library/sys.rst:1365 ../../library/sys.rst:1376 msgid "Originally specified in :pep:`302`." msgstr "" -#: ../../library/sys.rst:1369 +#: ../../library/sys.rst:1370 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 " @@ -1721,92 +1712,91 @@ msgid "" "is found on :data:`sys.path_hooks` then ``None`` is stored." msgstr "" -#: ../../library/sys.rst:1380 +#: ../../library/sys.rst:1381 msgid "A string containing a platform identifier. Known values are:" msgstr "" -#: ../../library/sys.rst:1383 +#: ../../library/sys.rst:1384 msgid "System" msgstr "" -#: ../../library/sys.rst:1383 +#: ../../library/sys.rst:1384 msgid "``platform`` value" msgstr "" -#: ../../library/sys.rst:1385 +#: ../../library/sys.rst:1386 msgid "AIX" msgstr "AIX" -#: ../../library/sys.rst:1385 +#: ../../library/sys.rst:1386 msgid "``'aix'``" msgstr "``'aix'``" -#: ../../library/sys.rst:1386 +#: ../../library/sys.rst:1387 msgid "Android" -msgstr "" +msgstr "Android" -#: ../../library/sys.rst:1386 -#, fuzzy +#: ../../library/sys.rst:1387 msgid "``'android'``" -msgstr "``'aix'``" +msgstr "``'android'``" -#: ../../library/sys.rst:1387 +#: ../../library/sys.rst:1388 msgid "Emscripten" msgstr "Emscripten" -#: ../../library/sys.rst:1387 +#: ../../library/sys.rst:1388 msgid "``'emscripten'``" msgstr "``'emscripten'``" -#: ../../library/sys.rst:1388 +#: ../../library/sys.rst:1389 msgid "iOS" -msgstr "" +msgstr "iOS" -#: ../../library/sys.rst:1388 +#: ../../library/sys.rst:1389 msgid "``'ios'``" msgstr "``'ios'``" -#: ../../library/sys.rst:1389 +#: ../../library/sys.rst:1390 msgid "Linux" msgstr "Linux" -#: ../../library/sys.rst:1389 +#: ../../library/sys.rst:1390 msgid "``'linux'``" msgstr "``'linux'``" -#: ../../library/sys.rst:1390 +#: ../../library/sys.rst:1391 msgid "macOS" msgstr "macOS" -#: ../../library/sys.rst:1390 +#: ../../library/sys.rst:1391 msgid "``'darwin'``" msgstr "``'darwin'``" -#: ../../library/sys.rst:1391 +#: ../../library/sys.rst:1392 msgid "Windows" msgstr "Windows" -#: ../../library/sys.rst:1391 +#: ../../library/sys.rst:1392 msgid "``'win32'``" msgstr "``'win32'``" -#: ../../library/sys.rst:1392 +#: ../../library/sys.rst:1393 msgid "Windows/Cygwin" msgstr "Windows/Cygwin" -#: ../../library/sys.rst:1392 +#: ../../library/sys.rst:1393 msgid "``'cygwin'``" msgstr "``'cygwin'``" -#: ../../library/sys.rst:1393 +#: ../../library/sys.rst:1394 msgid "WASI" msgstr "WASI" -#: ../../library/sys.rst:1393 +#: ../../library/sys.rst:1394 msgid "``'wasi'``" msgstr "``'wasi'``" -#: ../../library/sys.rst:1396 +#: ../../library/sys.rst:1397 msgid "" "On Unix systems not listed in the table, the value is the lowercased OS name " "as returned by ``uname -s``, with the first part of the version as returned " @@ -1815,81 +1805,81 @@ msgid "" "version, it is therefore recommended to use the following idiom::" msgstr "" -#: ../../library/sys.rst:1402 +#: ../../library/sys.rst:1403 msgid "" "if sys.platform.startswith('freebsd'):\n" " # FreeBSD-specific code here..." msgstr "" -#: ../../library/sys.rst:1405 +#: ../../library/sys.rst:1406 msgid "" "On Linux, :data:`sys.platform` doesn't contain the major version anymore. It " "is always ``'linux'``, instead of ``'linux2'`` or ``'linux3'``." msgstr "" -#: ../../library/sys.rst:1409 +#: ../../library/sys.rst:1410 msgid "" "On AIX, :data:`sys.platform` doesn't contain the major version anymore. It " "is always ``'aix'``, instead of ``'aix5'`` or ``'aix7'``." msgstr "" -#: ../../library/sys.rst:1413 +#: ../../library/sys.rst:1414 msgid "" "On Android, :data:`sys.platform` now returns ``'android'`` rather than " "``'linux'``." msgstr "" -#: ../../library/sys.rst:1419 +#: ../../library/sys.rst:1420 msgid "" ":data:`os.name` has a coarser granularity. :func:`os.uname` gives system-" "dependent version information." msgstr "" -#: ../../library/sys.rst:1422 +#: ../../library/sys.rst:1423 msgid "" "The :mod:`platform` module provides detailed checks for the system's " "identity." msgstr "" -#: ../../library/sys.rst:1428 +#: ../../library/sys.rst:1429 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:1431 +#: ../../library/sys.rst:1432 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:1435 +#: ../../library/sys.rst:1436 msgid "" "``/usr/lib64/pythonX.Y/``: Standard library (like ``os.py`` of the :mod:`os` " "module)" msgstr "" -#: ../../library/sys.rst:1437 +#: ../../library/sys.rst:1438 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:1440 +#: ../../library/sys.rst:1441 msgid "" "``/usr/lib/pythonX.Y/site-packages/`` (always use ``lib``, not :data:`sys." "platlibdir`): Third-party modules" msgstr "" -#: ../../library/sys.rst:1442 +#: ../../library/sys.rst:1443 msgid "" "``/usr/lib64/pythonX.Y/site-packages/``: C extension modules of third-party " "packages" msgstr "" -#: ../../library/sys.rst:1450 +#: ../../library/sys.rst:1451 msgid "" "A string giving the site-specific directory prefix where the platform " "independent Python files are installed; on Unix, the default is :file:`/usr/" @@ -1898,14 +1888,14 @@ msgid "" "derived paths." msgstr "" -#: ../../library/sys.rst:1456 +#: ../../library/sys.rst:1457 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:1471 +#: ../../library/sys.rst:1472 msgid "" "Strings specifying the primary and secondary prompt of the interpreter. " "These are only defined if the interpreter is in interactive mode. Their " @@ -1915,7 +1905,7 @@ msgid "" "used to implement a dynamic prompt." msgstr "" -#: ../../library/sys.rst:1481 +#: ../../library/sys.rst:1482 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 " @@ -1926,14 +1916,14 @@ msgid "" "g. :const:`os.RTLD_LAZY`)." msgstr "" -#: ../../library/sys.rst:1493 +#: ../../library/sys.rst:1494 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:1505 +#: ../../library/sys.rst:1506 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 " @@ -1948,14 +1938,14 @@ msgid "" "in the profile function will cause itself unset." msgstr "" -#: ../../library/sys.rst:1517 +#: ../../library/sys.rst:1518 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:1521 +#: ../../library/sys.rst:1522 msgid "" "Profile functions should have three arguments: *frame*, *event*, and *arg*. " "*frame* is the current stack frame. *event* is a string: ``'call'``, " @@ -1963,71 +1953,71 @@ msgid "" "depends on the event type." msgstr "" -#: ../../library/sys.rst:1526 ../../library/sys.rst:1613 +#: ../../library/sys.rst:1527 ../../library/sys.rst:1614 msgid "The events have the following meaning:" msgstr "" -#: ../../library/sys.rst:1528 ../../library/sys.rst:1615 +#: ../../library/sys.rst:1529 ../../library/sys.rst:1616 msgid "``'call'``" msgstr "``'call'``" -#: ../../library/sys.rst:1529 +#: ../../library/sys.rst:1530 msgid "" "A function is called (or some other code block entered). The profile " "function is called; *arg* is ``None``." msgstr "" -#: ../../library/sys.rst:1532 ../../library/sys.rst:1630 +#: ../../library/sys.rst:1533 ../../library/sys.rst:1631 msgid "``'return'``" msgstr "``'return'``" -#: ../../library/sys.rst:1533 +#: ../../library/sys.rst:1534 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:1537 +#: ../../library/sys.rst:1538 msgid "``'c_call'``" msgstr "``'c_call'``" -#: ../../library/sys.rst:1538 +#: ../../library/sys.rst:1539 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:1541 +#: ../../library/sys.rst:1542 msgid "``'c_return'``" msgstr "``'c_return'``" -#: ../../library/sys.rst:1542 +#: ../../library/sys.rst:1543 msgid "A C function has returned. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1544 +#: ../../library/sys.rst:1545 msgid "``'c_exception'``" msgstr "``'c_exception'``" -#: ../../library/sys.rst:1545 +#: ../../library/sys.rst:1546 msgid "A C function has raised an exception. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1547 +#: ../../library/sys.rst:1548 msgid "" "Raises an :ref:`auditing event ` ``sys.setprofile`` with no " "arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys.setprofile``。" -#: ../../library/sys.rst:1552 +#: ../../library/sys.rst:1553 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:1556 +#: ../../library/sys.rst:1557 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 " @@ -2035,19 +2025,19 @@ msgid "" "because a too-high limit can lead to a crash." msgstr "" -#: ../../library/sys.rst:1561 +#: ../../library/sys.rst:1562 msgid "" "If the new limit is too low at the current recursion depth, a :exc:" "`RecursionError` exception is raised." msgstr "" -#: ../../library/sys.rst:1564 +#: ../../library/sys.rst:1565 msgid "" "A :exc:`RecursionError` exception is now raised if the new limit is too low " "at the current recursion depth." msgstr "" -#: ../../library/sys.rst:1571 +#: ../../library/sys.rst:1572 msgid "" "Set the interpreter's thread switch interval (in seconds). This floating-" "point value determines the ideal duration of the \"timeslices\" allocated to " @@ -2058,7 +2048,7 @@ msgid "" "scheduler." msgstr "" -#: ../../library/sys.rst:1588 +#: ../../library/sys.rst:1589 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 " @@ -2067,7 +2057,7 @@ msgid "" "`threading.settrace`." msgstr "" -#: ../../library/sys.rst:1593 +#: ../../library/sys.rst:1594 msgid "" "Trace functions should have three arguments: *frame*, *event*, and *arg*. " "*frame* is the current stack frame. *event* is a string: ``'call'``, " @@ -2075,7 +2065,7 @@ msgid "" "the event type." msgstr "" -#: ../../library/sys.rst:1598 +#: ../../library/sys.rst:1599 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 " @@ -2083,36 +2073,36 @@ msgid "" "traced." msgstr "" -#: ../../library/sys.rst:1603 +#: ../../library/sys.rst:1604 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:1606 +#: ../../library/sys.rst:1607 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:1610 +#: ../../library/sys.rst:1611 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:1616 +#: ../../library/sys.rst:1617 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:1620 +#: ../../library/sys.rst:1621 msgid "``'line'``" msgstr "``'line'``" -#: ../../library/sys.rst:1621 +#: ../../library/sys.rst:1622 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``; " @@ -2122,7 +2112,7 @@ msgid "" "to :const:`False` on that :ref:`frame `." msgstr "" -#: ../../library/sys.rst:1631 +#: ../../library/sys.rst:1632 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 " @@ -2130,22 +2120,22 @@ msgid "" "return value is ignored." msgstr "" -#: ../../library/sys.rst:1636 +#: ../../library/sys.rst:1637 msgid "``'exception'``" msgstr "``'exception'``" -#: ../../library/sys.rst:1637 +#: ../../library/sys.rst:1638 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:1641 +#: ../../library/sys.rst:1642 msgid "``'opcode'``" msgstr "``'opcode'``" -#: ../../library/sys.rst:1642 +#: ../../library/sys.rst:1643 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 " @@ -2155,13 +2145,13 @@ msgid "" "objects>`." msgstr "" -#: ../../library/sys.rst:1649 +#: ../../library/sys.rst:1650 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:1652 +#: ../../library/sys.rst:1653 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 " @@ -2175,17 +2165,17 @@ msgid "" "on each frame)." msgstr "" -#: ../../library/sys.rst:1663 +#: ../../library/sys.rst:1664 msgid "For more information on code and frame objects, refer to :ref:`types`." msgstr "" -#: ../../library/sys.rst:1665 +#: ../../library/sys.rst:1666 msgid "" "Raises an :ref:`auditing event ` ``sys.settrace`` with no " "arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys.settrace``。" -#: ../../library/sys.rst:1669 +#: ../../library/sys.rst:1670 msgid "" "The :func:`settrace` function is intended only for implementing debuggers, " "profilers, coverage tools and the like. Its behavior is part of the " @@ -2193,13 +2183,13 @@ msgid "" "thus may not be available in all Python implementations." msgstr "" -#: ../../library/sys.rst:1676 +#: ../../library/sys.rst:1677 msgid "" "``'opcode'`` event type added; :attr:`~frame.f_trace_lines` and :attr:" "`~frame.f_trace_opcodes` attributes added to frames" msgstr "" -#: ../../library/sys.rst:1681 +#: ../../library/sys.rst:1682 msgid "" "Accepts two optional keyword arguments which are callables that accept an :" "term:`asynchronous generator iterator` as an argument. The *firstiter* " @@ -2208,7 +2198,7 @@ msgid "" "about to be garbage collected." msgstr "" -#: ../../library/sys.rst:1687 +#: ../../library/sys.rst:1688 msgid "" "Raises an :ref:`auditing event ` ``sys." "set_asyncgen_hooks_firstiter`` with no arguments." @@ -2216,7 +2206,7 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys." "set_asyncgen_hooks_firstiter``。" -#: ../../library/sys.rst:1689 +#: ../../library/sys.rst:1690 msgid "" "Raises an :ref:`auditing event ` ``sys." "set_asyncgen_hooks_finalizer`` with no arguments." @@ -2224,20 +2214,20 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys." "set_asyncgen_hooks_finalizer``。" -#: ../../library/sys.rst:1691 +#: ../../library/sys.rst:1692 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:1694 +#: ../../library/sys.rst:1695 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:1706 +#: ../../library/sys.rst:1707 msgid "" "Allows enabling or disabling coroutine origin tracking. When enabled, the " "``cr_origin`` attribute on coroutine objects will contain a tuple of " @@ -2246,116 +2236,111 @@ msgid "" "disabled, ``cr_origin`` will be ``None``." msgstr "" -#: ../../library/sys.rst:1713 +#: ../../library/sys.rst:1714 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:1717 +#: ../../library/sys.rst:1718 msgid "This setting is thread-specific." msgstr "" -#: ../../library/sys.rst:1727 +#: ../../library/sys.rst:1728 msgid "" "Activate the stack profiler trampoline *backend*. The only supported backend " "is ``\"perf\"``." msgstr "" -#: ../../library/sys.rst:1730 ../../library/sys.rst:1745 -#: ../../library/sys.rst:1753 -msgid ":ref:`Availability `: Linux." -msgstr ":ref:`適用 `:Linux。" - -#: ../../library/sys.rst:1736 +#: ../../library/sys.rst:1737 msgid ":ref:`perf_profiling`" msgstr ":ref:`perf_profiling`" -#: ../../library/sys.rst:1737 +#: ../../library/sys.rst:1738 msgid "https://perf.wiki.kernel.org" msgstr "https://perf.wiki.kernel.org" -#: ../../library/sys.rst:1741 +#: ../../library/sys.rst:1742 msgid "Deactivate the current stack profiler trampoline backend." msgstr "" -#: ../../library/sys.rst:1743 +#: ../../library/sys.rst:1744 msgid "If no stack profiler is activated, this function has no effect." msgstr "" -#: ../../library/sys.rst:1751 +#: ../../library/sys.rst:1752 msgid "Return ``True`` if a stack profiler trampoline is active." msgstr "" -#: ../../library/sys.rst:1759 +#: ../../library/sys.rst:1760 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:1763 +#: ../../library/sys.rst:1764 msgid "" "This is equivalent to defining the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` " "environment variable before launching Python." msgstr "" -#: ../../library/sys.rst:1766 +#: ../../library/sys.rst:1767 msgid "" "See also :func:`sys.getfilesystemencoding` and :func:`sys." "getfilesystemencodeerrors`." msgstr "" -#: ../../library/sys.rst:1772 +#: ../../library/sys.rst:1773 msgid "" "Changing the filesystem encoding after Python startup is risky because the " "old fsencoding or paths encoded by the old fsencoding may be cached " "somewhere. Use :envvar:`PYTHONLEGACYWINDOWSFSENCODING` instead." msgstr "" -#: ../../library/sys.rst:1776 +#: ../../library/sys.rst:1777 msgid "See :pep:`529` for more details." msgstr "更多細節請見 :pep:`529`。" -#: ../../library/sys.rst:1779 +#: ../../library/sys.rst:1780 msgid "Use :envvar:`PYTHONLEGACYWINDOWSFSENCODING` instead." msgstr "" -#: ../../library/sys.rst:1786 +#: ../../library/sys.rst:1787 msgid "" ":term:`File objects ` used by the interpreter for standard " "input, output and errors:" msgstr "" -#: ../../library/sys.rst:1789 +#: ../../library/sys.rst:1790 msgid "" "``stdin`` is used for all interactive input (including calls to :func:" "`input`);" msgstr "" -#: ../../library/sys.rst:1791 +#: ../../library/sys.rst:1792 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:1793 +#: ../../library/sys.rst:1794 msgid "The interpreter's own prompts and its error messages go to ``stderr``." msgstr "" -#: ../../library/sys.rst:1795 +#: ../../library/sys.rst:1796 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:1799 +#: ../../library/sys.rst:1800 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:1802 +#: ../../library/sys.rst:1803 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 " @@ -2366,14 +2351,14 @@ msgid "" "initially attached to a console." msgstr "" -#: ../../library/sys.rst:1811 +#: ../../library/sys.rst:1812 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:1816 +#: ../../library/sys.rst:1817 msgid "" "Under all platforms, you can override the character encoding by setting the :" "envvar:`PYTHONIOENCODING` environment variable before starting Python or by " @@ -2382,7 +2367,7 @@ msgid "" "only applies when :envvar:`PYTHONLEGACYWINDOWSSTDIO` is also set." msgstr "" -#: ../../library/sys.rst:1823 +#: ../../library/sys.rst:1824 msgid "" "When interactive, the ``stdout`` stream is line-buffered. Otherwise, it is " "block-buffered like regular text files. The ``stderr`` stream is line-" @@ -2391,19 +2376,19 @@ msgid "" "`PYTHONUNBUFFERED` environment variable." msgstr "" -#: ../../library/sys.rst:1829 +#: ../../library/sys.rst:1830 msgid "" "Non-interactive ``stderr`` is now line-buffered instead of fully buffered." msgstr "" -#: ../../library/sys.rst:1835 +#: ../../library/sys.rst:1836 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:1839 +#: ../../library/sys.rst:1840 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 " @@ -2411,7 +2396,7 @@ msgid "" "support the :attr:`!buffer` attribute." msgstr "" -#: ../../library/sys.rst:1849 +#: ../../library/sys.rst:1850 msgid "" "These objects contain the original values of ``stdin``, ``stderr`` and " "``stdout`` at the start of the program. They are used during finalization, " @@ -2419,7 +2404,7 @@ msgid "" "``sys.std*`` object has been redirected." msgstr "" -#: ../../library/sys.rst:1854 +#: ../../library/sys.rst:1855 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, " @@ -2427,7 +2412,7 @@ msgid "" "before replacing it, and restore the saved object." msgstr "" -#: ../../library/sys.rst:1860 +#: ../../library/sys.rst:1861 msgid "" "Under some conditions ``stdin``, ``stdout`` and ``stderr`` as well as the " "original values ``__stdin__``, ``__stdout__`` and ``__stderr__`` can be " @@ -2435,12 +2420,12 @@ msgid "" "to a console and Python apps started with :program:`pythonw`." msgstr "" -#: ../../library/sys.rst:1868 +#: ../../library/sys.rst:1869 msgid "" "A frozenset of strings containing the names of standard library modules." msgstr "" -#: ../../library/sys.rst:1870 +#: ../../library/sys.rst:1871 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 " @@ -2448,7 +2433,7 @@ msgid "" "modules are excluded." msgstr "" -#: ../../library/sys.rst:1875 +#: ../../library/sys.rst:1876 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 " @@ -2456,60 +2441,60 @@ msgid "" "listed." msgstr "" -#: ../../library/sys.rst:1880 +#: ../../library/sys.rst:1881 msgid "See also the :data:`sys.builtin_module_names` list." msgstr "另請參閱 :attr:`sys.builtin_module_names` 清單。" -#: ../../library/sys.rst:1887 +#: ../../library/sys.rst:1888 msgid "" "A :term:`named tuple` holding information about the thread implementation." msgstr "" -#: ../../library/sys.rst:1892 +#: ../../library/sys.rst:1893 msgid "The name of the thread implementation:" msgstr "" -#: ../../library/sys.rst:1894 +#: ../../library/sys.rst:1895 msgid "``\"nt\"``: Windows threads" msgstr "``\"nt\"``: Windows 執行緒" -#: ../../library/sys.rst:1895 +#: ../../library/sys.rst:1896 msgid "``\"pthread\"``: POSIX threads" msgstr "``\"pthread\"``: POSIX 執行緒" -#: ../../library/sys.rst:1896 +#: ../../library/sys.rst:1897 msgid "" "``\"pthread-stubs\"``: stub POSIX threads (on WebAssembly platforms without " "threading support)" msgstr "" -#: ../../library/sys.rst:1898 +#: ../../library/sys.rst:1899 msgid "``\"solaris\"``: Solaris threads" msgstr "" -#: ../../library/sys.rst:1902 +#: ../../library/sys.rst:1903 msgid "The name of the lock implementation:" msgstr "" -#: ../../library/sys.rst:1904 +#: ../../library/sys.rst:1905 msgid "``\"semaphore\"``: a lock uses a semaphore" msgstr "" -#: ../../library/sys.rst:1905 +#: ../../library/sys.rst:1906 msgid "``\"mutex+cond\"``: a lock uses a mutex and a condition variable" msgstr "" -#: ../../library/sys.rst:1906 +#: ../../library/sys.rst:1907 msgid "``None`` if this information is unknown" msgstr "為 ``None`` 表示此資訊未知" -#: ../../library/sys.rst:1910 +#: ../../library/sys.rst:1911 msgid "" "The name and version of the thread library. It is a string, or ``None`` if " "this information is unknown." msgstr "" -#: ../../library/sys.rst:1918 +#: ../../library/sys.rst:1919 msgid "" "When this variable is set to an integer value, it determines the maximum " "number of levels of traceback information printed when an unhandled " @@ -2518,73 +2503,73 @@ msgid "" "are printed." msgstr "" -#: ../../library/sys.rst:1926 +#: ../../library/sys.rst:1927 msgid "Handle an unraisable exception." msgstr "處理一個不可被引發的例外。" -#: ../../library/sys.rst:1928 +#: ../../library/sys.rst:1929 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:1932 +#: ../../library/sys.rst:1933 msgid "The *unraisable* argument has the following attributes:" msgstr "" -#: ../../library/sys.rst:1934 +#: ../../library/sys.rst:1935 msgid ":attr:`!exc_type`: Exception type." msgstr ":attr:`!exc_type`: 例外型別。" -#: ../../library/sys.rst:1935 +#: ../../library/sys.rst:1936 msgid ":attr:`!exc_value`: Exception value, can be ``None``." msgstr ":attr:`!exc_value`: 例外值,可以為 ``None``。" -#: ../../library/sys.rst:1936 +#: ../../library/sys.rst:1937 msgid ":attr:`!exc_traceback`: Exception traceback, can be ``None``." msgstr ":attr:`!exc_traceback`: 例外追蹤,可以為 ``None``。" -#: ../../library/sys.rst:1937 +#: ../../library/sys.rst:1938 msgid ":attr:`!err_msg`: Error message, can be ``None``." msgstr ":attr:`!err_msg`: 錯誤訊息,可以為 ``None``。" -#: ../../library/sys.rst:1938 +#: ../../library/sys.rst:1939 msgid ":attr:`!object`: Object causing the exception, can be ``None``." msgstr ":attr:`!object`: 導致例外的物件,可以為 ``None``。" -#: ../../library/sys.rst:1940 +#: ../../library/sys.rst:1941 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:1944 +#: ../../library/sys.rst:1945 msgid "" ":func:`sys.unraisablehook` can be overridden to control how unraisable " "exceptions are handled." msgstr "" -#: ../../library/sys.rst:1949 +#: ../../library/sys.rst:1950 msgid ":func:`excepthook` which handles uncaught exceptions." msgstr "處理未被捕捉到例外的 :func:`excepthook`。" -#: ../../library/sys.rst:1953 +#: ../../library/sys.rst:1954 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:1957 +#: ../../library/sys.rst:1958 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:1961 ../../library/sys.rst:1963 +#: ../../library/sys.rst:1962 ../../library/sys.rst:1964 msgid "" "Raise an auditing event ``sys.unraisablehook`` with arguments *hook*, " "*unraisable* when an exception that cannot be handled occurs. The " @@ -2592,7 +2577,7 @@ msgid "" "hook has been set, *hook* may be ``None``." msgstr "" -#: ../../library/sys.rst:1972 +#: ../../library/sys.rst:1973 msgid "" "A string containing the version number of the Python interpreter plus " "additional information on the build number and compiler used. This string " @@ -2601,13 +2586,13 @@ msgid "" "functions provided by the :mod:`platform` module." msgstr "" -#: ../../library/sys.rst:1981 +#: ../../library/sys.rst:1982 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:1987 +#: ../../library/sys.rst:1988 msgid "" "A tuple containing the five components of the version number: *major*, " "*minor*, *micro*, *releaselevel*, and *serial*. All values except " @@ -2618,18 +2603,18 @@ msgid "" "version_info.major`` and so on." msgstr "" -#: ../../library/sys.rst:1995 +#: ../../library/sys.rst:1996 msgid "Added named component attributes." msgstr "新增了附名的元件屬性。" -#: ../../library/sys.rst:2000 +#: ../../library/sys.rst:2001 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:2007 +#: ../../library/sys.rst:2008 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 " @@ -2638,20 +2623,20 @@ msgid "" "has no effect on the registry keys used by Python." msgstr "" -#: ../../library/sys.rst:2019 +#: ../../library/sys.rst:2020 msgid "" "Namespace containing functions and constants for register callbacks and " "controlling monitoring events. See :mod:`sys.monitoring` for details." msgstr "" -#: ../../library/sys.rst:2025 +#: ../../library/sys.rst:2026 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:2029 +#: ../../library/sys.rst:2030 msgid "" "$ ./python -Xa=b -Xc\n" "Python 3.2a3+ (py3k, Oct 16 2010, 20:14:50)\n" @@ -2671,18 +2656,18 @@ msgstr "" ">>> sys._xoptions\n" "{'a': 'b', 'c': True}" -#: ../../library/sys.rst:2041 +#: ../../library/sys.rst:2042 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:2049 +#: ../../library/sys.rst:2050 msgid "Citations" msgstr "引用" -#: ../../library/sys.rst:2050 +#: ../../library/sys.rst:2051 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/" @@ -2703,50 +2688,50 @@ msgstr "object(物件)" msgid "traceback" msgstr "traceback" -#: ../../library/sys.rst:925 ../../library/sys.rst:1501 +#: ../../library/sys.rst:925 ../../library/sys.rst:1502 msgid "profile function" msgstr "" -#: ../../library/sys.rst:925 ../../library/sys.rst:1501 +#: ../../library/sys.rst:925 ../../library/sys.rst:1502 msgid "profiler" msgstr "" -#: ../../library/sys.rst:934 ../../library/sys.rst:1584 +#: ../../library/sys.rst:934 ../../library/sys.rst:1585 msgid "trace function" msgstr "" -#: ../../library/sys.rst:934 ../../library/sys.rst:1584 +#: ../../library/sys.rst:934 ../../library/sys.rst:1585 msgid "debugger" msgstr "debugger(除錯器)" -#: ../../library/sys.rst:1329 +#: ../../library/sys.rst:1330 msgid "module" msgstr "module(模組)" -#: ../../library/sys.rst:1329 +#: ../../library/sys.rst:1330 msgid "search" msgstr "search(搜尋)" -#: ../../library/sys.rst:1329 +#: ../../library/sys.rst:1330 msgid "path" msgstr "path(路徑)" -#: ../../library/sys.rst:1465 +#: ../../library/sys.rst:1466 msgid "interpreter prompts" msgstr "interpreter prompts(直譯器提示)" -#: ../../library/sys.rst:1465 +#: ../../library/sys.rst:1466 msgid "prompts, interpreter" msgstr "prompts, interpreter(提示、直譯器)" -#: ../../library/sys.rst:1465 +#: ../../library/sys.rst:1466 msgid ">>>" msgstr ">>>" -#: ../../library/sys.rst:1465 +#: ../../library/sys.rst:1466 msgid "interpreter prompt" msgstr "interpreter prompt(直譯器提示)" -#: ../../library/sys.rst:1465 +#: ../../library/sys.rst:1466 msgid "..." msgstr "..." diff --git a/library/syslog.po b/library/syslog.po index 9fb0489e10..80f33bd74f 100644 --- a/library/syslog.po +++ b/library/syslog.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-11 00:13+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -30,9 +30,8 @@ msgid "" msgstr "" #: ../../library/syslog.rst:14 -#, fuzzy -msgid ":ref:`Availability `: Unix, not WASI, not iOS." -msgstr ":ref:`適用 `:Unix、非 Emscripten、非 WASI。" +msgid "Availability" +msgstr "" #: ../../library/syslog.rst:16 msgid "" diff --git a/library/termios.po b/library/termios.po index d801678336..20ce680561 100644 --- a/library/termios.po +++ b/library/termios.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-01 22:24+0800\n" +"POT-Creation-Date: 2024-10-11 00:13+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-" @@ -31,8 +31,8 @@ msgid "" msgstr "" #: ../../library/termios.rst:19 -msgid ":ref:`Availability `: Unix." -msgstr ":ref:`適用 `:Unix。" +msgid "Availability" +msgstr "" #: ../../library/termios.rst:21 msgid "" diff --git a/library/threading.po b/library/threading.po index 35adbe0595..4fc83a7965 100644 --- a/library/threading.po +++ b/library/threading.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-11 00:13+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-" @@ -73,9 +73,10 @@ msgid "" "appropriate model if you want to run multiple I/O-bound tasks simultaneously." msgstr "" -#: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not WASI." -msgstr ":ref:`適用 `:非 WASI。" +#: ../../library/threading.rst:130 ../../library/threading.rst:229 +#: ../../library/threading.rst:468 ../../includes/wasm-notavail.rst:3 +msgid "Availability" +msgstr "" #: ../../includes/wasm-notavail.rst:5 msgid "" @@ -195,12 +196,6 @@ msgid "" "after which the value may be recycled by the OS)." msgstr "" -#: ../../library/threading.rst:130 -msgid "" -":ref:`Availability `: Windows, FreeBSD, Linux, macOS, OpenBSD, " -"NetBSD, AIX, DragonFlyBSD, GNU/kFreeBSD." -msgstr "" - #: ../../library/threading.rst:134 msgid "Added support for GNU/kFreeBSD." msgstr "" @@ -285,10 +280,6 @@ msgid "" "information)." msgstr "" -#: ../../library/threading.rst:229 -msgid ":ref:`Availability `: Windows, pthreads." -msgstr ":ref:`適用 `:Windows, pthreads。" - #: ../../library/threading.rst:231 msgid "Unix platforms with POSIX threads support." msgstr "" @@ -633,12 +624,6 @@ msgid "" "terminated." msgstr "" -#: ../../library/threading.rst:468 -msgid "" -":ref:`Availability `: Windows, FreeBSD, Linux, macOS, OpenBSD, " -"NetBSD, AIX, DragonFlyBSD." -msgstr "" - #: ../../library/threading.rst:474 msgid "Return whether the thread is alive." msgstr "" diff --git a/library/time.po b/library/time.po index a31807549b..c3f7ef4998 100644 --- a/library/time.po +++ b/library/time.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-11 00:13+0000\n" "PO-Revision-Date: 2024-08-14 16:05+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -263,9 +263,19 @@ msgstr "" "傳遞無效或過期的 *thread_id* 可能會導致未定義的行為,例如分段錯誤 " "(segmentation fault)。" -#: ../../library/time.rst:149 -msgid ":ref:`Availability `: Unix" -msgstr ":ref:`適用 `:Unix" +#: ../../library/time.rst:149 ../../library/time.rst:161 +#: ../../library/time.rst:174 ../../library/time.rst:183 +#: ../../library/time.rst:196 ../../library/time.rst:205 +#: ../../library/time.rst:721 ../../library/time.rst:745 +#: ../../library/time.rst:841 ../../library/time.rst:852 +#: ../../library/time.rst:862 ../../library/time.rst:872 +#: ../../library/time.rst:881 ../../library/time.rst:890 +#: ../../library/time.rst:899 ../../library/time.rst:910 +#: ../../library/time.rst:918 ../../library/time.rst:929 +#: ../../library/time.rst:940 ../../library/time.rst:949 +#: ../../library/time.rst:962 +msgid "Availability" +msgstr "" #: ../../library/time.rst:151 msgid "" @@ -281,13 +291,6 @@ msgstr "" "回傳指定時鐘 *clk_id* 的解析度(精確度)。有關 *clk_id* 可接受的值的串列,請" "參閱 :ref:`time-clock-id-constants`。" -#: ../../library/time.rst:161 ../../library/time.rst:174 -#: ../../library/time.rst:183 ../../library/time.rst:745 -#: ../../library/time.rst:862 ../../library/time.rst:890 -#: ../../library/time.rst:918 ../../library/time.rst:962 -msgid ":ref:`Availability `: Unix." -msgstr ":ref:`適用 `:Unix。" - #: ../../library/time.rst:168 msgid "" "Return the time of the specified clock *clk_id*. Refer to :ref:`time-clock-" @@ -323,10 +326,6 @@ msgid "" msgstr "" "使用 :func:`clock_settime_ns` 以避免 :class:`float` 型別造成的精確度損失。" -#: ../../library/time.rst:196 ../../library/time.rst:205 -msgid ":ref:`Availability `: Unix, not Android, not iOS." -msgstr ":ref:`適用 `:Unix、非 Android、非 iOS。" - #: ../../library/time.rst:203 msgid "Similar to :func:`clock_settime` but set time with nanoseconds." msgstr "類似於 :func:`clock_settime`,但設定以奈秒為單位的時間。" @@ -1273,10 +1272,6 @@ msgid "" "`float` type." msgstr "" -#: ../../library/time.rst:721 -msgid ":ref:`Availability `: Linux, Unix, Windows." -msgstr ":ref:`適用 `:Linux、Unix、Windows。" - #: ../../library/time.rst:723 msgid "Unix systems supporting ``CLOCK_THREAD_CPUTIME_ID``." msgstr "" @@ -1458,10 +1453,6 @@ msgid "" "similar." msgstr "" -#: ../../library/time.rst:841 -msgid ":ref:`Availability `: Linux >= 2.6.39." -msgstr ":ref:`適用 `:Linux 2.6.39 以上。" - #: ../../library/time.rst:848 msgid "" "The Solaris OS has a ``CLOCK_HIGHRES`` timer that attempts to use an optimal " @@ -1469,10 +1460,6 @@ msgid "" "``CLOCK_HIGHRES`` is the nonadjustable, high-resolution clock." msgstr "" -#: ../../library/time.rst:852 -msgid ":ref:`Availability `: Solaris." -msgstr ":ref:`適用 `:Solaris。" - #: ../../library/time.rst:859 msgid "" "Clock that cannot be set and represents monotonic time since some " @@ -1485,29 +1472,16 @@ msgid "" "based time that is not subject to NTP adjustments." msgstr "" -#: ../../library/time.rst:872 -msgid ":ref:`Availability `: Linux >= 2.6.28, macOS >= 10.12." -msgstr ":ref:`適用 `:Linux 2.6.28 以上、macOS 10.12 以上。" - #: ../../library/time.rst:878 msgid "" "Similar to :data:`CLOCK_MONOTONIC_RAW`, but reads a value cached by the " "system at context switch and hence has less accuracy." msgstr "" -#: ../../library/time.rst:881 ../../library/time.rst:940 -#: ../../library/time.rst:949 -msgid ":ref:`Availability `: macOS >= 10.12." -msgstr ":ref:`適用 `:macOS 10.12 以上。" - #: ../../library/time.rst:888 ../../library/time.rst:897 msgid "High-resolution per-process timer from the CPU." msgstr "" -#: ../../library/time.rst:899 -msgid ":ref:`Availability `: FreeBSD, NetBSD >= 7, OpenBSD." -msgstr ":ref:`適用 `:FreeBSD、NetBSD 7 以上、OpenBSD。" - #: ../../library/time.rst:905 msgid "" "`International Atomic Time `: Linux." -msgstr ":ref:`適用 `:Linux。" - #: ../../library/time.rst:916 msgid "Thread-specific CPU-time clock." msgstr "" @@ -1534,10 +1504,6 @@ msgid "" "suspended, providing accurate uptime measurement, both absolute and interval." msgstr "" -#: ../../library/time.rst:929 -msgid ":ref:`Availability `: FreeBSD, OpenBSD >= 5.5." -msgstr ":ref:`適用 `:FreeBSD、OpenBSD 5.5 以上。" - #: ../../library/time.rst:936 msgid "" "Clock that increments monotonically, tracking the time since an arbitrary " @@ -1695,36 +1661,3 @@ msgstr "% (百分號)" #: ../../library/time.rst:416 ../../library/time.rst:562 msgid "datetime format" msgstr "datetime format(日期時間格式)" - -#~ msgid ":attr:`tm_year`" -#~ msgstr ":attr:`tm_year`" - -#~ msgid ":attr:`tm_mon`" -#~ msgstr ":attr:`tm_mon`" - -#~ msgid ":attr:`tm_mday`" -#~ msgstr ":attr:`tm_mday`" - -#~ msgid ":attr:`tm_hour`" -#~ msgstr ":attr:`tm_hour`" - -#~ msgid ":attr:`tm_min`" -#~ msgstr ":attr:`tm_min`" - -#~ msgid ":attr:`tm_sec`" -#~ msgstr ":attr:`tm_sec`" - -#~ msgid ":attr:`tm_wday`" -#~ msgstr ":attr:`tm_wday`" - -#~ msgid ":attr:`tm_yday`" -#~ msgstr ":attr:`tm_yday`" - -#~ msgid ":attr:`tm_isdst`" -#~ msgstr ":attr:`tm_isdst`" - -#~ msgid ":attr:`tm_zone`" -#~ msgstr ":attr:`tm_zone`" - -#~ msgid ":attr:`tm_gmtoff`" -#~ msgstr ":attr:`tm_gmtoff`" diff --git a/library/traceback.po b/library/traceback.po index 5d2a56c436..b2fbc3ea87 100644 --- a/library/traceback.po +++ b/library/traceback.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-11 00:13+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-" @@ -29,13 +29,16 @@ msgstr "**原始碼:**\\ :source:`Lib/traceback.py`" #: ../../library/traceback.rst:11 msgid "" "This module provides a standard interface to extract, format and print stack " -"traces of Python programs. It exactly mimics the behavior of the Python " -"interpreter when it prints a stack trace. This is useful when you want to " -"print stack traces under program control, such as in a \"wrapper\" around " -"the interpreter." +"traces of Python programs. It is more flexible than the interpreter's " +"default traceback display, and therefore makes it possible to configure " +"certain aspects of the output. Finally, it contains a utility for capturing " +"enough information about an exception to print it later, without the need to " +"save a reference to the actual exception. Since exceptions can be the roots " +"of large objects graph, this utility can significantly improve memory " +"management." msgstr "" -#: ../../library/traceback.rst:19 +#: ../../library/traceback.rst:23 msgid "" "The module uses :ref:`traceback objects ` --- these are " "objects of type :class:`types.TracebackType`, which are assigned to the :" @@ -43,29 +46,48 @@ msgid "" "instances." msgstr "" -#: ../../library/traceback.rst:26 +#: ../../library/traceback.rst:30 msgid "Module :mod:`faulthandler`" msgstr ":mod:`faulthandler` 模組" -#: ../../library/traceback.rst:27 +#: ../../library/traceback.rst:31 msgid "" "Used to dump Python tracebacks explicitly, on a fault, after a timeout, or " "on a user signal." msgstr "" -#: ../../library/traceback.rst:29 +#: ../../library/traceback.rst:33 msgid "Module :mod:`pdb`" msgstr ":mod:`pdb` 模組" -#: ../../library/traceback.rst:30 +#: ../../library/traceback.rst:34 msgid "Interactive source code debugger for Python programs." msgstr "" -#: ../../library/traceback.rst:32 -msgid "The module defines the following functions:" -msgstr "此模組定義了以下函式:" - #: ../../library/traceback.rst:36 +msgid "The module's API can be divided into two parts:" +msgstr "" + +#: ../../library/traceback.rst:38 +msgid "" +"Module-level functions offering basic functionality, which are useful for " +"interactive inspection of exceptions and tracebacks." +msgstr "" + +#: ../../library/traceback.rst:41 +msgid "" +":class:`TracebackException` class and its helper classes :class:" +"`StackSummary` and :class:`FrameSummary`. These offer both more flexibility " +"in the output generated and the ability to store the information necessary " +"for later formatting without holding references to actual exception and " +"traceback objects." +msgstr "" + +#: ../../library/traceback.rst:49 +msgid "Module-Level Functions" +msgstr "" + +#: ../../library/traceback.rst:53 msgid "" "Print up to *limit* stack trace entries from :ref:`traceback object " "` *tb* (starting from the caller's frame) if *limit* is " @@ -76,7 +98,7 @@ msgid "" "output." msgstr "" -#: ../../library/traceback.rst:47 +#: ../../library/traceback.rst:64 msgid "" "The meaning of the *limit* parameter is different than the meaning of :const:" "`sys.tracebacklimit`. A negative *limit* value corresponds to a positive " @@ -84,42 +106,42 @@ msgid "" "*limit* value cannot be achieved with :const:`!sys.tracebacklimit`." msgstr "" -#: ../../library/traceback.rst:53 ../../library/traceback.rst:118 +#: ../../library/traceback.rst:70 ../../library/traceback.rst:135 msgid "Added negative *limit* support." msgstr "新增負數 *limit* 的支援。" -#: ../../library/traceback.rst:60 +#: ../../library/traceback.rst:77 msgid "" "Print exception information and stack trace entries from :ref:`traceback " "object ` *tb* to *file*. This differs from :func:" "`print_tb` in the following ways:" msgstr "" -#: ../../library/traceback.rst:65 +#: ../../library/traceback.rst:82 msgid "" "if *tb* is not ``None``, it prints a header ``Traceback (most recent call " "last):``" msgstr "" -#: ../../library/traceback.rst:68 +#: ../../library/traceback.rst:85 msgid "it prints the exception type and *value* after the stack trace" msgstr "" -#: ../../library/traceback.rst:72 +#: ../../library/traceback.rst:89 msgid "" "if *type(value)* is :exc:`SyntaxError` and *value* has the appropriate " "format, it prints the line where the syntax error occurred with a caret " "indicating the approximate position of the error." msgstr "" -#: ../../library/traceback.rst:76 +#: ../../library/traceback.rst:93 msgid "" "Since Python 3.10, instead of passing *value* and *tb*, an exception object " "can be passed as the first argument. If *value* and *tb* are provided, the " "first argument is ignored in order to provide backwards compatibility." msgstr "" -#: ../../library/traceback.rst:80 +#: ../../library/traceback.rst:97 msgid "" "The optional *limit* argument has the same meaning as for :func:`print_tb`. " "If *chain* is true (the default), then chained exceptions (the :attr:" @@ -128,29 +150,29 @@ msgid "" "when printing an unhandled exception." msgstr "" -#: ../../library/traceback.rst:87 ../../library/traceback.rst:191 +#: ../../library/traceback.rst:104 ../../library/traceback.rst:208 msgid "The *etype* argument is ignored and inferred from the type of *value*." msgstr "" -#: ../../library/traceback.rst:90 ../../library/traceback.rst:171 +#: ../../library/traceback.rst:107 ../../library/traceback.rst:188 msgid "" "The *etype* parameter has been renamed to *exc* and is now positional-only." msgstr "" -#: ../../library/traceback.rst:97 +#: ../../library/traceback.rst:114 msgid "" "This is a shorthand for ``print_exception(sys.exception(), limit, file, " "chain)``." msgstr "" -#: ../../library/traceback.rst:103 +#: ../../library/traceback.rst:120 msgid "" "This is a shorthand for ``print_exception(sys.last_exc, limit, file, " "chain)``. In general it will work only after an exception has reached an " "interactive prompt (see :data:`sys.last_exc`)." msgstr "" -#: ../../library/traceback.rst:110 +#: ../../library/traceback.rst:127 msgid "" "Print up to *limit* stack trace entries (starting from the invocation point) " "if *limit* is positive. Otherwise, print the last ``abs(limit)`` entries. " @@ -160,7 +182,7 @@ msgid "" "for :func:`print_tb`." msgstr "" -#: ../../library/traceback.rst:124 +#: ../../library/traceback.rst:141 msgid "" "Return a :class:`StackSummary` object representing a list of \"pre-" "processed\" stack trace entries extracted from the :ref:`traceback object " @@ -173,7 +195,7 @@ msgid "" "for a stack trace." msgstr "" -#: ../../library/traceback.rst:137 +#: ../../library/traceback.rst:154 msgid "" "Extract the raw traceback from the current :ref:`stack frame `. The return value has the same format as for :func:`extract_tb`. " @@ -181,7 +203,7 @@ msgid "" "`print_stack`." msgstr "" -#: ../../library/traceback.rst:145 +#: ../../library/traceback.rst:162 msgid "" "Given a list of tuples or :class:`FrameSummary` objects as returned by :func:" "`extract_tb` or :func:`extract_stack`, return a list of strings ready for " @@ -191,7 +213,7 @@ msgid "" "text line is not ``None``." msgstr "" -#: ../../library/traceback.rst:155 +#: ../../library/traceback.rst:172 msgid "" "Format the exception part of a traceback using an exception value such as " "given by :data:`sys.last_value`. The return value is a list of strings, " @@ -202,31 +224,31 @@ msgid "" "contains the exception's :attr:`notes `." msgstr "" -#: ../../library/traceback.rst:163 +#: ../../library/traceback.rst:180 msgid "" "Since Python 3.10, instead of passing *value*, an exception object can be " "passed as the first argument. If *value* is provided, the first argument is " "ignored in order to provide backwards compatibility." msgstr "" -#: ../../library/traceback.rst:167 ../../library/traceback.rst:394 +#: ../../library/traceback.rst:184 ../../library/traceback.rst:415 msgid "" "When *show_group* is ``True``, and the exception is an instance of :exc:" "`BaseExceptionGroup`, the nested exceptions are included as well, " "recursively, with indentation relative to their nesting depth." msgstr "" -#: ../../library/traceback.rst:175 +#: ../../library/traceback.rst:192 msgid "" "The returned list now includes any :attr:`notes ` " "attached to the exception." msgstr "" -#: ../../library/traceback.rst:179 +#: ../../library/traceback.rst:196 msgid "*show_group* parameter was added." msgstr "" -#: ../../library/traceback.rst:185 +#: ../../library/traceback.rst:202 msgid "" "Format a stack trace and the exception information. The arguments have the " "same meaning as the corresponding arguments to :func:`print_exception`. The " @@ -235,68 +257,69 @@ msgid "" "printed, exactly the same text is printed as does :func:`print_exception`." msgstr "" -#: ../../library/traceback.rst:194 +#: ../../library/traceback.rst:211 msgid "" "This function's behavior and signature were modified to match :func:" "`print_exception`." msgstr "" -#: ../../library/traceback.rst:201 +#: ../../library/traceback.rst:218 msgid "" "This is like ``print_exc(limit)`` but returns a string instead of printing " "to a file." msgstr "" -#: ../../library/traceback.rst:207 +#: ../../library/traceback.rst:224 msgid "A shorthand for ``format_list(extract_tb(tb, limit))``." msgstr "``format_list(extract_tb(tb, limit))`` 的簡寫。" -#: ../../library/traceback.rst:212 +#: ../../library/traceback.rst:229 msgid "A shorthand for ``format_list(extract_stack(f, limit))``." msgstr "``format_list(extract_stack(f, limit))`` 的簡寫。" -#: ../../library/traceback.rst:216 +#: ../../library/traceback.rst:233 msgid "" "Clears the local variables of all the stack frames in a :ref:`traceback " "` *tb* by calling the :meth:`~frame.clear` method of " "each :ref:`frame object `." msgstr "" -#: ../../library/traceback.rst:225 +#: ../../library/traceback.rst:242 msgid "" "Walk a stack following :attr:`f.f_back ` from the given frame, " "yielding the frame and line number for each frame. If *f* is ``None``, the " "current stack is used. This helper is used with :meth:`StackSummary.extract`." msgstr "" -#: ../../library/traceback.rst:234 +#: ../../library/traceback.rst:251 msgid "" "Walk a traceback following :attr:`~traceback.tb_next` yielding the frame and " "line number for each frame. This helper is used with :meth:`StackSummary." "extract`." msgstr "" -#: ../../library/traceback.rst:240 -msgid "The module also defines the following classes:" -msgstr "" - -#: ../../library/traceback.rst:243 +#: ../../library/traceback.rst:259 msgid ":class:`!TracebackException` Objects" msgstr ":class:`!TracebackException` 物件" -#: ../../library/traceback.rst:247 +#: ../../library/traceback.rst:263 msgid "" ":class:`!TracebackException` objects are created from actual exceptions to " -"capture data for later printing in a lightweight fashion." +"capture data for later printing. They offer a more lightweight method of " +"storing this information by avoiding holding references to :ref:" +"`traceback` and :ref:`frame` objects In " +"addition, they expose more options to configure the output compared to the " +"module-level functions described above." msgstr "" -#: ../../library/traceback.rst:252 ../../library/traceback.rst:359 +#: ../../library/traceback.rst:272 msgid "" -"Capture an exception for later rendering. *limit*, *lookup_lines* and " -"*capture_locals* are as for the :class:`StackSummary` class." +"Capture an exception for later rendering. The meaning of *limit*, " +"*lookup_lines* and *capture_locals* are as for the :class:`StackSummary` " +"class." msgstr "" -#: ../../library/traceback.rst:255 +#: ../../library/traceback.rst:276 msgid "" "If *compact* is true, only data that is required by :class:`!" "TracebackException`'s :meth:`format` method is saved in the class " @@ -304,12 +327,12 @@ msgid "" "if :attr:`__cause__` is ``None`` and :attr:`__suppress_context__` is false." msgstr "" -#: ../../library/traceback.rst:261 ../../library/traceback.rst:362 +#: ../../library/traceback.rst:282 ../../library/traceback.rst:383 msgid "" "Note that when locals are captured, they are also shown in the traceback." msgstr "" -#: ../../library/traceback.rst:263 +#: ../../library/traceback.rst:284 msgid "" "*max_group_width* and *max_group_depth* control the formatting of exception " "groups (see :exc:`BaseExceptionGroup`). The depth refers to the nesting " @@ -318,122 +341,128 @@ msgid "" "limit is exceeded." msgstr "" -#: ../../library/traceback.rst:269 +#: ../../library/traceback.rst:290 msgid "Added the *compact* parameter." msgstr "新增 *compact* 參數。" -#: ../../library/traceback.rst:272 +#: ../../library/traceback.rst:293 msgid "Added the *max_group_width* and *max_group_depth* parameters." msgstr "新增 *max_group_width* 和 *max_group_depth* 參數。" -#: ../../library/traceback.rst:277 +#: ../../library/traceback.rst:298 msgid "" "A :class:`!TracebackException` of the original :attr:`~BaseException." "__cause__`." msgstr "" -#: ../../library/traceback.rst:282 +#: ../../library/traceback.rst:303 msgid "" "A :class:`!TracebackException` of the original :attr:`~BaseException." "__context__`." msgstr "" -#: ../../library/traceback.rst:287 +#: ../../library/traceback.rst:308 msgid "" "If ``self`` represents an :exc:`ExceptionGroup`, this field holds a list of :" "class:`!TracebackException` instances representing the nested exceptions. " "Otherwise it is ``None``." msgstr "" -#: ../../library/traceback.rst:295 +#: ../../library/traceback.rst:316 msgid "" "The :attr:`~BaseException.__suppress_context__` value from the original " "exception." msgstr "" -#: ../../library/traceback.rst:300 +#: ../../library/traceback.rst:321 msgid "" "The :attr:`~BaseException.__notes__` value from the original exception, or " "``None`` if the exception does not have any notes. If it is not ``None`` is " "it formatted in the traceback after the exception string." msgstr "" -#: ../../library/traceback.rst:309 +#: ../../library/traceback.rst:330 msgid "A :class:`StackSummary` representing the traceback." msgstr "" -#: ../../library/traceback.rst:313 +#: ../../library/traceback.rst:334 msgid "The class of the original traceback." msgstr "" -#: ../../library/traceback.rst:319 +#: ../../library/traceback.rst:340 msgid "String display of the class of the original exception." msgstr "" -#: ../../library/traceback.rst:325 +#: ../../library/traceback.rst:346 msgid "For syntax errors - the file name where the error occurred." msgstr "" -#: ../../library/traceback.rst:329 +#: ../../library/traceback.rst:350 msgid "For syntax errors - the line number where the error occurred." msgstr "" -#: ../../library/traceback.rst:333 +#: ../../library/traceback.rst:354 msgid "" "For syntax errors - the end line number where the error occurred. Can be " "``None`` if not present." msgstr "" -#: ../../library/traceback.rst:340 +#: ../../library/traceback.rst:361 msgid "For syntax errors - the text where the error occurred." msgstr "" -#: ../../library/traceback.rst:344 +#: ../../library/traceback.rst:365 msgid "For syntax errors - the offset into the text where the error occurred." msgstr "" -#: ../../library/traceback.rst:348 +#: ../../library/traceback.rst:369 msgid "" "For syntax errors - the end offset into the text where the error occurred. " "Can be ``None`` if not present." msgstr "" -#: ../../library/traceback.rst:355 +#: ../../library/traceback.rst:376 msgid "For syntax errors - the compiler error message." msgstr "" -#: ../../library/traceback.rst:366 +#: ../../library/traceback.rst:380 +msgid "" +"Capture an exception for later rendering. *limit*, *lookup_lines* and " +"*capture_locals* are as for the :class:`StackSummary` class." +msgstr "" + +#: ../../library/traceback.rst:387 msgid "" "Print to *file* (default ``sys.stderr``) the exception information returned " "by :meth:`format`." msgstr "" -#: ../../library/traceback.rst:373 +#: ../../library/traceback.rst:394 msgid "Format the exception." msgstr "" -#: ../../library/traceback.rst:375 +#: ../../library/traceback.rst:396 msgid "" "If *chain* is not ``True``, :attr:`__cause__` and :attr:`__context__` will " "not be formatted." msgstr "" -#: ../../library/traceback.rst:378 +#: ../../library/traceback.rst:399 msgid "" "The return value is a generator of strings, each ending in a newline and " "some containing internal newlines. :func:`~traceback.print_exception` is a " "wrapper around this method which just prints the lines to a file." msgstr "" -#: ../../library/traceback.rst:384 +#: ../../library/traceback.rst:405 msgid "Format the exception part of the traceback." msgstr "" -#: ../../library/traceback.rst:386 +#: ../../library/traceback.rst:407 msgid "The return value is a generator of strings, each ending in a newline." msgstr "" -#: ../../library/traceback.rst:388 +#: ../../library/traceback.rst:409 msgid "" "When *show_group* is ``False``, the generator emits the exception's message " "followed by its notes (if it has any). The exception message is normally a " @@ -442,33 +471,32 @@ msgid "" "the syntax error occurred." msgstr "" -#: ../../library/traceback.rst:398 +#: ../../library/traceback.rst:419 msgid "" "The exception's :attr:`notes ` are now included in " "the output." msgstr "" -#: ../../library/traceback.rst:402 -#, fuzzy +#: ../../library/traceback.rst:423 msgid "Added the *show_group* parameter." -msgstr "新增 *compact* 參數。" +msgstr "新增 *show_group* 參數。" -#: ../../library/traceback.rst:407 +#: ../../library/traceback.rst:428 msgid ":class:`!StackSummary` Objects" msgstr ":class:`!StackSummary` 物件" -#: ../../library/traceback.rst:411 +#: ../../library/traceback.rst:432 msgid "" ":class:`!StackSummary` objects represent a call stack ready for formatting." msgstr "" -#: ../../library/traceback.rst:417 +#: ../../library/traceback.rst:438 msgid "" "Construct a :class:`!StackSummary` object from a frame generator (such as is " "returned by :func:`~traceback.walk_stack` or :func:`~traceback.walk_tb`)." msgstr "" -#: ../../library/traceback.rst:421 +#: ../../library/traceback.rst:442 msgid "" "If *limit* is supplied, only this many frames are taken from *frame_gen*. If " "*lookup_lines* is ``False``, the returned :class:`FrameSummary` objects will " @@ -478,20 +506,20 @@ msgid "" "class:`!FrameSummary` are captured as object representations." msgstr "" -#: ../../library/traceback.rst:429 +#: ../../library/traceback.rst:450 msgid "" "Exceptions raised from :func:`repr` on a local variable (when " "*capture_locals* is ``True``) are no longer propagated to the caller." msgstr "" -#: ../../library/traceback.rst:435 +#: ../../library/traceback.rst:456 msgid "" "Construct a :class:`!StackSummary` object from a supplied list of :class:" "`FrameSummary` objects or old-style list of tuples. Each tuple should be a " "4-tuple with *filename*, *lineno*, *name*, *line* as the elements." msgstr "" -#: ../../library/traceback.rst:442 +#: ../../library/traceback.rst:463 msgid "" "Returns a list of strings ready for printing. Each string in the resulting " "list corresponds to a single :ref:`frame ` from the stack. " @@ -499,18 +527,18 @@ msgid "" "well, for those items with source text lines." msgstr "" -#: ../../library/traceback.rst:448 +#: ../../library/traceback.rst:469 msgid "" "For long sequences of the same frame and line, the first few repetitions are " "shown, followed by a summary line stating the exact number of further " "repetitions." msgstr "" -#: ../../library/traceback.rst:452 +#: ../../library/traceback.rst:473 msgid "Long sequences of repeated frames are now abbreviated." msgstr "" -#: ../../library/traceback.rst:457 +#: ../../library/traceback.rst:478 msgid "" "Returns a string for printing one of the :ref:`frames ` " "involved in the stack. This method is called for each :class:`FrameSummary` " @@ -518,17 +546,17 @@ msgid "" "the frame is omitted from the output." msgstr "" -#: ../../library/traceback.rst:467 +#: ../../library/traceback.rst:488 msgid ":class:`!FrameSummary` Objects" msgstr ":class:`!FrameSummary` 物件" -#: ../../library/traceback.rst:471 +#: ../../library/traceback.rst:492 msgid "" "A :class:`!FrameSummary` object represents a single :ref:`frame ` in a :ref:`traceback `." msgstr "" -#: ../../library/traceback.rst:476 +#: ../../library/traceback.rst:497 msgid "" "Represents a single :ref:`frame ` in the :ref:`traceback " "` or stack that is being formatted or printed. It may " @@ -542,38 +570,38 @@ msgid "" "display." msgstr "" -#: ../../library/traceback.rst:487 +#: ../../library/traceback.rst:508 msgid ":class:`!FrameSummary` instances have the following attributes:" msgstr "" -#: ../../library/traceback.rst:491 +#: ../../library/traceback.rst:512 msgid "" "The filename of the source code for this frame. Equivalent to accessing :" "attr:`f.f_code.co_filename ` on a :ref:`frame object " "` *f*." msgstr "" -#: ../../library/traceback.rst:497 +#: ../../library/traceback.rst:518 msgid "The line number of the source code for this frame." msgstr "" -#: ../../library/traceback.rst:501 +#: ../../library/traceback.rst:522 msgid "" "Equivalent to accessing :attr:`f.f_code.co_name ` on a :" "ref:`frame object ` *f*." msgstr "" -#: ../../library/traceback.rst:506 +#: ../../library/traceback.rst:527 msgid "" "A string representing the source code for this frame, with leading and " "trailing whitespace stripped. If the source is not available, it is ``None``." msgstr "" -#: ../../library/traceback.rst:513 -msgid "Traceback Examples" +#: ../../library/traceback.rst:534 +msgid "Examples of Using the Module-Level Functions" msgstr "" -#: ../../library/traceback.rst:515 +#: ../../library/traceback.rst:536 msgid "" "This simple example implements a basic read-eval-print loop, similar to (but " "less useful than) the standard Python interactive interpreter loop. For a " @@ -581,7 +609,7 @@ msgid "" "`code` module. ::" msgstr "" -#: ../../library/traceback.rst:520 +#: ../../library/traceback.rst:541 msgid "" "import sys, traceback\n" "\n" @@ -600,13 +628,13 @@ msgid "" " run_user_code(envdir)" msgstr "" -#: ../../library/traceback.rst:537 +#: ../../library/traceback.rst:558 msgid "" "The following example demonstrates the different ways to print and format " "the exception and traceback:" msgstr "" -#: ../../library/traceback.rst:540 +#: ../../library/traceback.rst:561 msgid "" "import sys, traceback\n" "\n" @@ -618,8 +646,7 @@ msgid "" "\n" "try:\n" " lumberjack()\n" -"except IndexError:\n" -" exc = sys.exception()\n" +"except IndexError as exc:\n" " print(\"*** print_tb:\")\n" " traceback.print_tb(exc.__traceback__, limit=1, file=sys.stdout)\n" " print(\"*** print_exception:\")\n" @@ -639,11 +666,11 @@ msgid "" " print(\"*** tb_lineno:\", exc.__traceback__.tb_lineno)" msgstr "" -#: ../../library/traceback.rst:572 +#: ../../library/traceback.rst:592 msgid "The output for the example would look similar to this:" msgstr "" -#: ../../library/traceback.rst:574 +#: ../../library/traceback.rst:594 msgid "" "*** print_tb:\n" " File \"\", line 10, in \n" @@ -693,13 +720,13 @@ msgid "" "*** tb_lineno: 10" msgstr "" -#: ../../library/traceback.rst:619 +#: ../../library/traceback.rst:639 msgid "" "The following example shows the different ways to print and format the " "stack::" msgstr "" -#: ../../library/traceback.rst:621 +#: ../../library/traceback.rst:641 msgid "" ">>> import traceback\n" ">>> def another_function():\n" @@ -751,11 +778,11 @@ msgstr "" " ' File \"\", line 8, in lumberstack\\n print(repr(traceback." "format_stack()))\\n']" -#: ../../library/traceback.rst:645 +#: ../../library/traceback.rst:665 msgid "This last example demonstrates the final few formatting functions:" msgstr "" -#: ../../library/traceback.rst:647 +#: ../../library/traceback.rst:667 msgid "" ">>> import traceback\n" ">>> traceback.format_list([('spam.py', 3, '', 'spam.eggs()'),\n" @@ -763,22 +790,113 @@ msgid "" "[' File \"spam.py\", line 3, in \\n spam.eggs()\\n',\n" " ' File \"eggs.py\", line 42, in eggs\\n return \"bacon\"\\n']\n" ">>> an_error = IndexError('tuple index out of range')\n" -">>> traceback.format_exception_only(type(an_error), an_error)\n" +">>> traceback.format_exception_only(an_error)\n" "['IndexError: tuple index out of range\\n']" msgstr "" -#: ../../library/traceback.rst:17 +#: ../../library/traceback.rst:681 +msgid "Examples of Using :class:`TracebackException`" +msgstr ":class:`TracebackException` 的使用範例" + +#: ../../library/traceback.rst:683 +msgid "With the helper class, we have more options::" +msgstr "" + +#: ../../library/traceback.rst:685 +msgid "" +">>> import sys\n" +">>> from traceback import TracebackException\n" +">>>\n" +">>> def lumberjack():\n" +"... bright_side_of_life()\n" +"...\n" +">>> def bright_side_of_life():\n" +"... t = \"bright\", \"side\", \"of\", \"life\"\n" +"... return t[5]\n" +"...\n" +">>> try:\n" +"... lumberjack()\n" +"... except IndexError as e:\n" +"... exc = e\n" +"...\n" +">>> try:\n" +"... try:\n" +"... lumberjack()\n" +"... except:\n" +"... 1/0\n" +"... except Exception as e:\n" +"... chained_exc = e\n" +"...\n" +">>> # limit works as with the module-level functions\n" +">>> TracebackException.from_exception(exc, limit=-2).print()\n" +"Traceback (most recent call last):\n" +" File \"\", line 6, in lumberjack\n" +" bright_side_of_life()\n" +" ~~~~~~~~~~~~~~~~~~~^^\n" +" File \"\", line 10, in bright_side_of_life\n" +" return t[5]\n" +" ~^^^\n" +"IndexError: tuple index out of range\n" +"\n" +">>> # capture_locals adds local variables in frames\n" +">>> TracebackException.from_exception(exc, limit=-2, capture_locals=True)." +"print()\n" +"Traceback (most recent call last):\n" +" File \"\", line 6, in lumberjack\n" +" bright_side_of_life()\n" +" ~~~~~~~~~~~~~~~~~~~^^\n" +" File \"\", line 10, in bright_side_of_life\n" +" return t[5]\n" +" ~^^^\n" +" t = (\"bright\", \"side\", \"of\", \"life\")\n" +"IndexError: tuple index out of range\n" +"\n" +">>> # The *chain* kwarg to print() controls whether chained\n" +">>> # exceptions are displayed\n" +">>> TracebackException.from_exception(chained_exc).print()\n" +"Traceback (most recent call last):\n" +" File \"\", line 4, in \n" +" lumberjack()\n" +" ~~~~~~~~~~^^\n" +" File \"\", line 7, in lumberjack\n" +" bright_side_of_life()\n" +" ~~~~~~~~~~~~~~~~~~~^^\n" +" File \"\", line 11, in bright_side_of_life\n" +" return t[5]\n" +" ~^^^\n" +"IndexError: tuple index out of range\n" +"\n" +"During handling of the above exception, another exception occurred:\n" +"\n" +"Traceback (most recent call last):\n" +" File \"\", line 6, in \n" +" 1/0\n" +" ~^~\n" +"ZeroDivisionError: division by zero\n" +"\n" +">>> TracebackException.from_exception(chained_exc).print(chain=False)\n" +"Traceback (most recent call last):\n" +" File \"\", line 6, in \n" +" 1/0\n" +" ~^~\n" +"ZeroDivisionError: division by zero" +msgstr "" + +#: ../../library/traceback.rst:21 msgid "object" msgstr "object(物件)" -#: ../../library/traceback.rst:17 +#: ../../library/traceback.rst:21 msgid "traceback" msgstr "traceback" -#: ../../library/traceback.rst:70 +#: ../../library/traceback.rst:87 msgid "^ (caret)" msgstr "^ (插入符號)" -#: ../../library/traceback.rst:70 +#: ../../library/traceback.rst:87 msgid "marker" msgstr "marker(標記)" + +#~ msgid "The module defines the following functions:" +#~ msgstr "此模組定義了以下函式:" diff --git a/library/tty.po b/library/tty.po index 56c833a6f6..86b6a46e29 100644 --- a/library/tty.po +++ b/library/tty.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-09 00:03+0000\n" +"POT-Creation-Date: 2024-10-11 00:13+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-" @@ -36,8 +36,8 @@ msgid "" msgstr ":mod:`tty` 模組定義了將 tty 放入 cbreak 和 raw 模式的函式。" #: ../../library/tty.rst:18 -msgid ":ref:`Availability `: Unix." -msgstr ":ref:`適用 `:Unix。" +msgid "Availability" +msgstr "" #: ../../library/tty.rst:20 msgid "" diff --git a/library/types.po b/library/types.po index cd7e8ca1ba..7d9a6f6bb4 100644 --- a/library/types.po +++ b/library/types.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-27 00:14+0000\n" +"POT-Creation-Date: 2024-10-10 00:13+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-" @@ -299,7 +299,7 @@ msgstr "" #: ../../library/types.rst:201 msgid "" "The type for cell objects: such objects are used as containers for a " -"function's free variables." +"function's :term:`closure variables `." msgstr "" #: ../../library/types.rst:209 @@ -346,90 +346,47 @@ msgid "" "module to be created and optionally its :term:`docstring`." msgstr "" -#: ../../library/types.rst:264 -msgid "" -"Use :func:`importlib.util.module_from_spec` to create a new module if you " -"wish to set the various import-controlled attributes." -msgstr "" - -#: ../../library/types.rst:269 -msgid "The :term:`docstring` of the module. Defaults to ``None``." -msgstr "" - -#: ../../library/types.rst:273 -msgid "The :term:`loader` which loaded the module. Defaults to ``None``." -msgstr "" - -#: ../../library/types.rst:275 -msgid "" -"This attribute is to match :attr:`importlib.machinery.ModuleSpec.loader` as " -"stored in the :attr:`__spec__` object." -msgstr "" - -#: ../../library/types.rst:279 -msgid "" -"A future version of Python may stop setting this attribute by default. To " -"guard against this potential change, preferably read from the :attr:" -"`__spec__` attribute instead or use ``getattr(module, \"__loader__\", " -"None)`` if you explicitly need to use this attribute." -msgstr "" - -#: ../../library/types.rst:285 ../../library/types.rst:310 -msgid "Defaults to ``None``. Previously the attribute was optional." -msgstr "" - -#: ../../library/types.rst:290 -msgid "" -"The name of the module. Expected to match :attr:`importlib.machinery." -"ModuleSpec.name`." +#: ../../library/types.rst:265 +msgid ":ref:`Documentation on module objects `" msgstr "" -#: ../../library/types.rst:295 +#: ../../library/types.rst:266 msgid "" -"Which :term:`package` a module belongs to. If the module is top-level (i.e. " -"not a part of any specific package) then the attribute should be set to " -"``''``, else it should be set to the name of the package (which can be :attr:" -"`__name__` if the module is a package itself). Defaults to ``None``." +"Provides details on the special attributes that can be found on instances " +"of :class:`!ModuleType`." msgstr "" -#: ../../library/types.rst:300 -msgid "" -"This attribute is to match :attr:`importlib.machinery.ModuleSpec.parent` as " -"stored in the :attr:`__spec__` object." -msgstr "" - -#: ../../library/types.rst:304 -msgid "" -"A future version of Python may stop setting this attribute by default. To " -"guard against this potential change, preferably read from the :attr:" -"`__spec__` attribute instead or use ``getattr(module, \"__package__\", " -"None)`` if you explicitly need to use this attribute." -msgstr "" +#: ../../library/types.rst:269 +msgid ":func:`importlib.util.module_from_spec`" +msgstr ":func:`importlib.util.module_from_spec`" -#: ../../library/types.rst:315 +#: ../../library/types.rst:270 msgid "" -"A record of the module's import-system-related state. Expected to be an " -"instance of :class:`importlib.machinery.ModuleSpec`." +"Modules created using the :class:`!ModuleType` constructor are created with " +"many of their special attributes unset or set to default values. :func:`!" +"module_from_spec` provides a more robust way of creating :class:`!" +"ModuleType` instances which ensures the various attributes are set " +"appropriately." msgstr "" -#: ../../library/types.rst:323 +#: ../../library/types.rst:278 msgid "The type of :data:`Ellipsis`." msgstr "" -#: ../../library/types.rst:329 +#: ../../library/types.rst:284 msgid "" "The type of :ref:`parameterized generics ` such as " "``list[int]``." msgstr "" -#: ../../library/types.rst:332 +#: ../../library/types.rst:287 msgid "" "``t_origin`` should be a non-parameterized generic class, such as ``list``, " "``tuple`` or ``dict``. ``t_args`` should be a :class:`tuple` (possibly of " "length 1) of types which parameterize ``t_origin``::" msgstr "" -#: ../../library/types.rst:336 +#: ../../library/types.rst:291 msgid "" ">>> from types import GenericAlias\n" "\n" @@ -445,50 +402,50 @@ msgstr "" ">>> dict[str, int] == GenericAlias(dict, (str, int))\n" "True" -#: ../../library/types.rst:345 +#: ../../library/types.rst:300 msgid "This type can now be subclassed." msgstr "" -#: ../../library/types.rst:350 +#: ../../library/types.rst:305 msgid ":ref:`Generic Alias Types`" msgstr "" -#: ../../library/types.rst:351 +#: ../../library/types.rst:306 msgid "In-depth documentation on instances of :class:`!types.GenericAlias`" msgstr "" -#: ../../library/types.rst:353 +#: ../../library/types.rst:308 msgid ":pep:`585` - Type Hinting Generics In Standard Collections" msgstr "" -#: ../../library/types.rst:354 +#: ../../library/types.rst:309 msgid "Introducing the :class:`!types.GenericAlias` class" msgstr "" -#: ../../library/types.rst:358 +#: ../../library/types.rst:313 msgid "The type of :ref:`union type expressions`." msgstr "" -#: ../../library/types.rst:364 +#: ../../library/types.rst:319 msgid "" "The type of traceback objects such as found in ``sys.exception()." "__traceback__``." msgstr "" -#: ../../library/types.rst:366 +#: ../../library/types.rst:321 msgid "" "See :ref:`the language reference ` for details of the " "available attributes and operations, and guidance on creating tracebacks " "dynamically." msgstr "" -#: ../../library/types.rst:373 +#: ../../library/types.rst:328 msgid "" "The type of :ref:`frame objects ` such as found in :attr:`tb." "tb_frame ` if ``tb`` is a traceback object." msgstr "" -#: ../../library/types.rst:379 +#: ../../library/types.rst:334 msgid "" "The type of objects defined in extension modules with ``PyGetSetDef``, such " "as :attr:`FrameType.f_locals ` or ``array.array.typecode``. " @@ -497,7 +454,7 @@ msgid "" "modules." msgstr "" -#: ../../library/types.rst:388 +#: ../../library/types.rst:343 msgid "" "The type of objects defined in extension modules with ``PyMemberDef``, such " "as ``datetime.timedelta.days``. This type is used as descriptor for simple " @@ -506,7 +463,7 @@ msgid "" "modules." msgstr "" -#: ../../library/types.rst:393 +#: ../../library/types.rst:348 msgid "" "In addition, when a class is defined with a :attr:`~object.__slots__` " "attribute, then for each slot, an instance of :class:`!MemberDescriptorType` " @@ -514,99 +471,99 @@ msgid "" "in the class's :attr:`~type.__dict__`." msgstr "" -#: ../../library/types.rst:399 +#: ../../library/types.rst:354 msgid "" "In other implementations of Python, this type may be identical to " "``GetSetDescriptorType``." msgstr "" -#: ../../library/types.rst:404 +#: ../../library/types.rst:359 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:412 +#: ../../library/types.rst:367 msgid "" "Updated to support the new union (``|``) operator from :pep:`584`, which " "simply delegates to the underlying mapping." msgstr "" -#: ../../library/types.rst:417 +#: ../../library/types.rst:372 msgid "" "Return ``True`` if the underlying mapping has a key *key*, else ``False``." msgstr "" -#: ../../library/types.rst:422 +#: ../../library/types.rst:377 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:427 +#: ../../library/types.rst:382 msgid "" "Return an iterator over the keys of the underlying mapping. This is a " "shortcut for ``iter(proxy.keys())``." msgstr "" -#: ../../library/types.rst:432 +#: ../../library/types.rst:387 msgid "Return the number of items in the underlying mapping." msgstr "" -#: ../../library/types.rst:436 +#: ../../library/types.rst:391 msgid "Return a shallow copy of the underlying mapping." msgstr "" -#: ../../library/types.rst:440 +#: ../../library/types.rst:395 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:446 +#: ../../library/types.rst:401 msgid "" "Return a new view of the underlying mapping's items (``(key, value)`` pairs)." msgstr "" -#: ../../library/types.rst:451 +#: ../../library/types.rst:406 msgid "Return a new view of the underlying mapping's keys." msgstr "" -#: ../../library/types.rst:455 +#: ../../library/types.rst:410 msgid "Return a new view of the underlying mapping's values." msgstr "" -#: ../../library/types.rst:459 +#: ../../library/types.rst:414 msgid "Return a reverse iterator over the keys of the underlying mapping." msgstr "" -#: ../../library/types.rst:465 +#: ../../library/types.rst:420 msgid "Return a hash of the underlying mapping." msgstr "" -#: ../../library/types.rst:471 +#: ../../library/types.rst:426 msgid "The type of :ref:`capsule objects `." msgstr "" -#: ../../library/types.rst:477 +#: ../../library/types.rst:432 msgid "Additional Utility Classes and Functions" msgstr "" -#: ../../library/types.rst:481 +#: ../../library/types.rst:436 msgid "" "A simple :class:`object` subclass that provides attribute access to its " "namespace, as well as a meaningful repr." msgstr "" -#: ../../library/types.rst:484 +#: ../../library/types.rst:439 msgid "" "Unlike :class:`object`, with :class:`!SimpleNamespace` you can add and " "remove attributes." msgstr "" -#: ../../library/types.rst:487 +#: ../../library/types.rst:442 msgid "" ":py:class:`SimpleNamespace` objects may be initialized in the same way as :" "class:`dict`: either with keyword arguments, with a single positional " @@ -617,11 +574,11 @@ msgid "" "`iterable` object producing key-value pairs). All such keys must be strings." msgstr "" -#: ../../library/types.rst:498 +#: ../../library/types.rst:453 msgid "The type is roughly equivalent to the following code::" msgstr "" -#: ../../library/types.rst:500 +#: ../../library/types.rst:455 msgid "" "class SimpleNamespace:\n" " def __init__(self, mapping_or_iterable=(), /, **kwargs):\n" @@ -653,33 +610,33 @@ msgstr "" " return self.__dict__ == other.__dict__\n" " return NotImplemented" -#: ../../library/types.rst:514 +#: ../../library/types.rst:469 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:518 +#: ../../library/types.rst:473 msgid "" ":class:`!SimpleNamespace` objects are supported by :func:`copy.replace`." msgstr "" -#: ../../library/types.rst:522 +#: ../../library/types.rst:477 msgid "" "Attribute order in the repr changed from alphabetical to insertion (like " "``dict``)." msgstr "" -#: ../../library/types.rst:526 +#: ../../library/types.rst:481 msgid "Added support for an optional positional argument." msgstr "" -#: ../../library/types.rst:531 +#: ../../library/types.rst:486 msgid "Route attribute access on a class to __getattr__." msgstr "" -#: ../../library/types.rst:533 +#: ../../library/types.rst:488 msgid "" "This is a descriptor, used to define attributes that act differently when " "accessed through an instance and through a class. Instance access remains " @@ -687,18 +644,18 @@ msgid "" "class's __getattr__ method; this is done by raising AttributeError." msgstr "" -#: ../../library/types.rst:538 +#: ../../library/types.rst:493 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:545 +#: ../../library/types.rst:500 msgid "Coroutine Utility Functions" msgstr "" -#: ../../library/types.rst:549 +#: ../../library/types.rst:504 msgid "" "This function transforms a :term:`generator` function into a :term:" "`coroutine function` which returns a generator-based coroutine. The " @@ -708,11 +665,11 @@ msgid "" "method." msgstr "" -#: ../../library/types.rst:556 +#: ../../library/types.rst:511 msgid "If *gen_func* is a generator function, it will be modified in-place." msgstr "" -#: ../../library/types.rst:558 +#: ../../library/types.rst:513 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/typing.po b/library/typing.po index f9b1cfb9a4..2c5d63c990 100644 --- a/library/typing.po +++ b/library/typing.po @@ -5800,7 +5800,7 @@ msgstr ":pep:`695`" #: ../../library/typing.rst:3916 msgid ":func:`@typing.no_type_check_decorator `" -msgstr "" +msgstr ":func:`@typing.no_type_check_decorator `" #: ../../library/typing.rst:3917 ../../library/typing.rst:3921 msgid "3.13" diff --git a/library/unittest.mock.po b/library/unittest.mock.po index c4159ff0b8..720ca6deba 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-27 00:14+0000\n" +"POT-Creation-Date: 2024-10-10 00:13+0000\n" "PO-Revision-Date: 2024-02-19 21:27+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -95,10 +95,11 @@ msgstr "" #: ../../library/unittest.mock.rst:71 msgid "" -":attr:`side_effect` allows you to perform side effects, including raising an " -"exception when a mock is called:" +":attr:`~Mock.side_effect` allows you to perform side effects, including " +"raising an exception when a mock is called:" msgstr "" -":attr:`side_effect` 允許你執行 side effects,包含在 mock 被呼叫時引發例外:" +":attr:`~Mock.side_effect` 允許你執行 side effects,包含在 mock 被呼叫時引發例" +"外:" #: ../../library/unittest.mock.rst:92 msgid "" @@ -755,21 +756,21 @@ msgstr "" #: ../../library/unittest.mock.rst:740 msgid "" -"Normally the :attr:`__class__` attribute of an object will return its type. " -"For a mock object with a :attr:`spec`, ``__class__`` returns the spec class " -"instead. This allows mock objects to pass :func:`isinstance` tests for the " -"object they are replacing / masquerading as:" +"Normally the :attr:`!__class__` attribute of an object will return its type. " +"For a mock object with a :attr:`!spec`, :attr:`!__class__` returns the spec " +"class instead. This allows mock objects to pass :func:`isinstance` tests for " +"the object they are replacing / masquerading as:" msgstr "" -"通常,物件的 :attr:`__class__` 屬性會回傳它的型別。但對於擁有 :attr:`spec` " -"的 mock 物件,``__class__`` 會回傳 spec 的類別。這允許 mock 物件通過對它們所" -"替代或偽裝的物件進行的 :func:`isinstance` 測試:" +"通常,物件的 :attr:`!__class__` 屬性會回傳它的型別。但對於擁有 :attr:`!spec` " +"的 mock 物件,:attr:`!__class__` 會回傳 spec 的類別。這允許 mock 物件通過對它" +"們所替代或偽裝的物件進行的 :func:`isinstance` 測試:" #: ../../library/unittest.mock.rst:749 msgid "" -":attr:`__class__` is assignable to, this allows a mock to pass an :func:" +":attr:`!__class__` is assignable to, this allows a mock to pass an :func:" "`isinstance` check without forcing you to use a spec:" msgstr "" -":attr:`__class__` 可以被指定,這允許 mock 通過 :func:`isinstance` 檢查,而不" +":attr:`!__class__` 可以被指定,這允許 mock 通過 :func:`isinstance` 檢查,而不" "需要強制使用 spec:" #: ../../library/unittest.mock.rst:759 @@ -783,10 +784,10 @@ msgstr "" #: ../../library/unittest.mock.rst:763 msgid "" -"Mock objects that use a class or an instance as a :attr:`spec` or :attr:" -"`spec_set` are able to pass :func:`isinstance` tests:" +"Mock objects that use a class or an instance as a :attr:`!spec` or :attr:`!" +"spec_set` are able to pass :func:`isinstance` tests:" msgstr "" -"使用類別或實例作為 :attr:`spec` 或 :attr:`spec_set` 的 mock 物件能夠通過 :" +"使用類別或實例作為 :attr:`!spec` 或 :attr:`!spec_set` 的 mock 物件能夠通過 :" "func:`isinstance` 測試:" #: ../../library/unittest.mock.rst:773 @@ -1200,11 +1201,11 @@ msgstr "" #: ../../library/unittest.mock.rst:1177 msgid "" "If :attr:`~Mock.side_effect` is set then it will be called after the call " -"has been recorded, so if :attr:`side_effect` raises an exception the call is " -"still recorded." +"has been recorded, so if :attr:`!side_effect` raises an exception the call " +"is still recorded." msgstr "" "如果 :attr:`~Mock.side_effect` 被設定,那麼在呼叫被記錄後它才會被呼叫,所以如" -"果 :attr:`side_effect` 引發例外,呼叫仍然會被記錄。" +"果 :attr:`!side_effect` 引發例外,呼叫仍然會被記錄。" #: ../../library/unittest.mock.rst:1181 msgid "" @@ -1216,42 +1217,42 @@ msgstr "" #: ../../library/unittest.mock.rst:1199 msgid "" -"If :attr:`side_effect` is a function then whatever that function returns is " -"what calls to the mock return. The :attr:`side_effect` function is called " -"with the same arguments as the mock. This allows you to vary the return " -"value of the call dynamically, based on the input:" +"If :attr:`~Mock.side_effect` is a function then whatever that function " +"returns is what calls to the mock return. The :attr:`!side_effect` function " +"is called with the same arguments as the mock. This allows you to vary the " +"return value of the call dynamically, based on the input:" msgstr "" -"如果 :attr:`side_effect` 是一個函式,則該函式回傳的東西就是對 mock 的呼叫所回" -"傳的值。:attr:`side_effect` 函式會使用與 mock 相同的引數被呼叫。這讓你可以根" -"據輸入動態地變更呼叫的回傳值:" +"如果 :attr:`~Mock.side_effect` 是一個函式,則該函式回傳的東西就是對 mock 的呼" +"叫所回傳的值。:attr:`!side_effect` 函式會使用與 mock 相同的引數被呼叫。這讓你" +"可以根據輸入動態地變更呼叫的回傳值:" #: ../../library/unittest.mock.rst:1215 msgid "" "If you want the mock to still return the default return value (a new mock), " "or any set return value, then there are two ways of doing this. Either " -"return :attr:`mock.return_value` from inside :attr:`side_effect`, or return :" -"data:`DEFAULT`:" +"return :attr:`~Mock.return_value` from inside :attr:`~Mock.side_effect`, or " +"return :data:`DEFAULT`:" msgstr "" "如果你希望 mock 仍然回傳預設的回傳值(一個新的 mock),或者是任何已設定的回傳" -"值,有兩種方法可以實現。從 :attr:`side_effect` 內部回傳 :attr:`mock." +"值,有兩種方法可以實現。從 :attr:`~Mock.side_effect` 內部回傳 :attr:`~Mock." "return_value`,或回傳 :data:`DEFAULT`:" #: ../../library/unittest.mock.rst:1234 msgid "" -"To remove a :attr:`side_effect`, and return to the default behaviour, set " -"the :attr:`side_effect` to ``None``:" +"To remove a :attr:`~Mock.side_effect`, and return to the default behaviour, " +"set the :attr:`!side_effect` to ``None``:" msgstr "" -"要刪除 :attr:`side_effect`,並恢復預設行為,將 :attr:`side_effect` 設為 " -"``None``:" +"要刪除 :attr:`~Mock.side_effect`,並恢復預設行為,將 :attr:`!side_effect` 設" +"為 ``None``:" #: ../../library/unittest.mock.rst:1248 msgid "" -"The :attr:`side_effect` can also be any iterable object. Repeated calls to " -"the mock will return values from the iterable (until the iterable is " -"exhausted and a :exc:`StopIteration` is raised):" +"The :attr:`~Mock.side_effect` can also be any iterable object. Repeated " +"calls to the mock will return values from the iterable (until the iterable " +"is exhausted and a :exc:`StopIteration` is raised):" msgstr "" -":attr:`side_effect` 也可以是任何可疊代的物件。對 mock 的重複呼叫將從可疊代物" -"件中回傳值(直到疊代物件耗盡並引發 :exc:`StopIteration` 為止):" +":attr:`~Mock.side_effect` 也可以是任何可疊代的物件。對 mock 的重複呼叫將從可" +"疊代物件中回傳值(直到疊代物件耗盡並引發 :exc:`StopIteration` 為止):" #: ../../library/unittest.mock.rst:1264 msgid "" @@ -1297,12 +1298,12 @@ msgstr "Mock 物件會在需要時建立屬性。這使得它們可以假裝成 msgid "" "You may want a mock object to return ``False`` to a :func:`hasattr` call, or " "raise an :exc:`AttributeError` when an attribute is fetched. You can do this " -"by providing an object as a :attr:`spec` for a mock, but that isn't always " +"by providing an object as a :attr:`!spec` for a mock, but that isn't always " "convenient." msgstr "" "你可能希望一個 mock 物件在 :func:`hasattr` 呼叫時回傳 ``False``,或者在屬性被" -"提取時引發 :exc:`AttributeError`。你可以通過將物件提供為 mock 的 :attr:" -"`spec` 來實現這一點,但這並不總是那麼好用。" +"提取時引發 :exc:`AttributeError`。你可以通過將物件提供為 mock 的 :attr:`!" +"spec` 來實現這一點,但這並不總是那麼好用。" #: ../../library/unittest.mock.rst:1291 msgid "" @@ -1573,19 +1574,19 @@ msgstr "" #: ../../library/unittest.mock.rst:1458 msgid "" -"Patch can be used as a :class:`TestCase` class decorator. It works by " -"decorating each test method in the class. This reduces the boilerplate code " -"when your test methods share a common patchings set. :func:`patch` finds " -"tests by looking for method names that start with ``patch.TEST_PREFIX``. By " -"default this is ``'test'``, which matches the way :mod:`unittest` finds " -"tests. You can specify an alternative prefix by setting ``patch." -"TEST_PREFIX``." +"Patch can be used as a :class:`~unittest.TestCase` class decorator. It works " +"by decorating each test method in the class. This reduces the boilerplate " +"code when your test methods share a common patchings set. :func:`patch` " +"finds tests by looking for method names that start with ``patch." +"TEST_PREFIX``. By default this is ``'test'``, which matches the way :mod:" +"`unittest` finds tests. You can specify an alternative prefix by setting " +"``patch.TEST_PREFIX``." msgstr "" -"patch 可以做為 :class:`TestCase` 類別的裝飾器使用。它透過裝飾類別中的每個測試" -"方法來運作。當你的測試方法共享一組常見的 patch 時,這會減少繁冗的代碼。:func:" -"`patch` 通過搜尋以 ``patch.TEST_PREFIX`` 開頭的方法名來尋找測試。預設情況下會" -"是 ``'test'``,這與 :mod:`unittest` 尋找測試的方式相匹配。你可以通過設定 " -"``patch.TEST_PREFIX`` 來指定別的前綴。" +"patch 可以做為 :class:`~unittest.TestCase` 類別的裝飾器使用。它透過裝飾類別中" +"的每個測試方法來運作。當你的測試方法共享一組常見的 patch 時,這會減少繁冗的代" +"碼。:func:`patch` 通過搜尋以 ``patch.TEST_PREFIX`` 開頭的方法名來尋找測試。預" +"設情況下會是 ``'test'``,這與 :mod:`unittest` 尋找測試的方式相匹配。你可以通" +"過設定 ``patch.TEST_PREFIX`` 來指定別的前綴。" #: ../../library/unittest.mock.rst:1465 msgid "" @@ -1661,10 +1662,10 @@ msgstr "" #: ../../library/unittest.mock.rst:1495 msgid "" "To configure return values on methods of *instances* on the patched class " -"you must do this on the :attr:`return_value`. For example::" +"you must do this on the :attr:`~Mock.return_value`. For example::" msgstr "" -"若要配置被 patch 的類別的\\ *實例*\\ 方法的回傳值,你必須在 :attr:" -"`return_value` 上進行配置。 例如: ::" +"若要配置被 patch 的類別的\\ *實例*\\ 方法的回傳值,你必須在 :attr:`~Mock." +"return_value` 上進行配置。例如: ::" #: ../../library/unittest.mock.rst:1498 msgid "" @@ -2209,24 +2210,24 @@ msgstr "patch 方法:啟動與停止" #: ../../library/unittest.mock.rst:1817 msgid "" -"All the patchers have :meth:`start` and :meth:`stop` methods. These make it " -"simpler to do patching in ``setUp`` methods or where you want to do multiple " -"patches without nesting decorators or with statements." +"All the patchers have :meth:`!start` and :meth:`!stop` methods. These make " +"it simpler to do patching in ``setUp`` methods or where you want to do " +"multiple patches without nesting decorators or with statements." msgstr "" -"所有的 patcher 都有 :meth:`start` 與 :meth:`stop` 方法。這使得在 ``setUp`` 方" -"法中進行 patch 或在你想要在沒有巢狀使用裝飾器或 with 陳述式的情況下進行多個 " -"patch 時變得更簡單。" +"所有的 patcher 都有 :meth:`!start` 與 :meth:`!stop` 方法。這使得在 ``setUp`` " +"方法中進行 patch 或在你想要在沒有巢狀使用裝飾器或 with 陳述式的情況下進行多" +"個 patch 時變得更簡單。" #: ../../library/unittest.mock.rst:1821 msgid "" "To use them call :func:`patch`, :func:`patch.object` or :func:`patch.dict` " "as normal and keep a reference to the returned ``patcher`` object. You can " -"then call :meth:`start` to put the patch in place and :meth:`stop` to undo " +"then call :meth:`!start` to put the patch in place and :meth:`!stop` to undo " "it." msgstr "" "要使用它們,請像平常一樣呼叫 :func:`patch`、:func:`patch.object` 或 :func:" "`patch.dict` ,並保留對回傳的 ``patcher`` 物件的參照。之後你就可以呼叫 :meth:" -"`start` 將 patch 準備就緒,並呼叫 :meth:`stop` 來取消 patch。" +"`!start` 將 patch 準備就緒,並呼叫 :meth:`!stop` 來取消 patch。" #: ../../library/unittest.mock.rst:1825 msgid "" @@ -2261,10 +2262,10 @@ msgstr "" #: ../../library/unittest.mock.rst:1839 msgid "" "A typical use case for this might be for doing multiple patches in the " -"``setUp`` method of a :class:`TestCase`::" +"``setUp`` method of a :class:`~unittest.TestCase`::" msgstr "" -"一個典型的用法是在一個 :class:`TestCase` 的 ``setUp`` 方法中執行多個 " -"patch: ::" +"一個典型的用法是在一個 :class:`~unittest.TestCase` 的 ``setUp`` 方法中執行多" +"個 patch: ::" #: ../../library/unittest.mock.rst:1842 msgid "" @@ -3355,11 +3356,11 @@ msgstr "" msgid "" "Alternatively you can just use ``vars(my_mock)`` (instance members) and " "``dir(type(my_mock))`` (type members) to bypass the filtering irrespective " -"of :const:`mock.FILTER_DIR`." +"of :const:`FILTER_DIR`." msgstr "" "或者,你可以只使用 ``vars(my_mock)``\\ (實例成員)和 " -"``dir(type(my_mock))``\\ (型別成員)來略過過濾,而不考慮 :const:`mock." -"FILTER_DIR`。" +"``dir(type(my_mock))``\\ (型別成員)來略過過濾,而不考慮 :const:" +"`FILTER_DIR`。" #: ../../library/unittest.mock.rst:2517 msgid "mock_open" @@ -3384,17 +3385,17 @@ msgstr "" #: ../../library/unittest.mock.rst:2528 msgid "" -"*read_data* is a string for the :meth:`~io.IOBase.read`, :meth:`~io.IOBase." -"readline`, and :meth:`~io.IOBase.readlines` methods of the file handle to " -"return. Calls to those methods will take data from *read_data* until it is " -"depleted. The mock of these methods is pretty simplistic: every time the " -"*mock* is called, the *read_data* is rewound to the start. If you need more " -"control over the data that you are feeding to the tested code you will need " -"to customize this mock for yourself. When that is insufficient, one of the " -"in-memory filesystem packages on `PyPI `_ can offer a " -"realistic filesystem for testing." -msgstr "" -"*read_data* 是檔案處理方法 :meth:`~io.IOBase.read`、:meth:`~io.IOBase." +"*read_data* is a string for the :meth:`~io.RawIOBase.read`, :meth:`~io." +"IOBase.readline`, and :meth:`~io.IOBase.readlines` methods of the file " +"handle to return. Calls to those methods will take data from *read_data* " +"until it is depleted. The mock of these methods is pretty simplistic: every " +"time the *mock* is called, the *read_data* is rewound to the start. If you " +"need more control over the data that you are feeding to the tested code you " +"will need to customize this mock for yourself. When that is insufficient, " +"one of the in-memory filesystem packages on `PyPI `_ can " +"offer a realistic filesystem for testing." +msgstr "" +"*read_data* 是檔案處理方法 :meth:`~io.RawIOBase.read`、:meth:`~io.IOBase." "readline` 和 :meth:`~io.IOBase.readlines` 的回傳字串。對這些方法的呼叫將從 " "*read_data* 取得資料,直到資料耗盡。對這些方法的 mock 非常單純:每次呼叫 " "*mock* 時,*read_data* 都會倒回到起點。如果你需要對提供給測試程式碼的資料進行" @@ -3405,12 +3406,12 @@ msgstr "" #: ../../library/unittest.mock.rst:2538 msgid "" "Added :meth:`~io.IOBase.readline` and :meth:`~io.IOBase.readlines` support. " -"The mock of :meth:`~io.IOBase.read` changed to consume *read_data* rather " +"The mock of :meth:`~io.RawIOBase.read` changed to consume *read_data* rather " "than returning it on each call." msgstr "" "新增對 :meth:`~io.IOBase.readline` 和 :meth:`~io.IOBase.readlines` 的支援。:" -"meth:`~io.IOBase.read` 的 mock 更改為消耗 *read_data* 而不是在每次呼叫時回傳" -"它。" +"meth:`~io.RawIOBase.read` 的 mock 更改為消耗 *read_data* 而不是在每次呼叫時回" +"傳它。" #: ../../library/unittest.mock.rst:2543 msgid "*read_data* is now reset on each call to the *mock*." @@ -3514,17 +3515,17 @@ msgstr "Autospeccing(自動規格)" #: ../../library/unittest.mock.rst:2592 msgid "" -"Autospeccing is based on the existing :attr:`spec` feature of mock. It " +"Autospeccing is based on the existing :attr:`!spec` feature of mock. It " "limits the api of mocks to the api of an original object (the spec), but it " "is recursive (implemented lazily) so that attributes of mocks only have the " "same api as the attributes of the spec. In addition mocked functions / " "methods have the same call signature as the original so they raise a :exc:" "`TypeError` if they are called incorrectly." msgstr "" -"自動規格以 mock 現有的 :attr:`spec` 功能作為基礎。它將 mock 的 api 限制為原始" -"物件(規格)的 api,但它是遞迴的(惰性 (lazily) 實現),因此 mock 的屬性僅具" -"有與規格的屬性相同的 api。此外,被 mock 的函式/方法具有與原始的函式/方法相同" -"的呼叫簽名,因此如果它們被不正確地呼叫,就會引發 :exc:`TypeError`。" +"自動規格以 mock 現有的 :attr:`!spec` 功能作為基礎。它將 mock 的 api 限制為原" +"始物件(規格)的 api,但它是遞迴的(惰性 (lazily) 實現),因此 mock 的屬性僅" +"具有與規格的屬性相同的 api。此外,被 mock 的函式/方法具有與原始的函式/方法相" +"同的呼叫簽名,因此如果它們被不正確地呼叫,就會引發 :exc:`TypeError`。" #: ../../library/unittest.mock.rst:2599 msgid "Before I explain how auto-speccing works, here's why it is needed." @@ -3564,13 +3565,13 @@ msgstr "" #: ../../library/unittest.mock.rst:2617 msgid "" -":mod:`mock` already provides a feature to help with this, called speccing. " -"If you use a class or instance as the :attr:`spec` for a mock then you can " -"only access attributes on the mock that exist on the real class:" +":mod:`unittest.mock` already provides a feature to help with this, called " +"speccing. If you use a class or instance as the :attr:`!spec` for a mock " +"then you can only access attributes on the mock that exist on the real class:" msgstr "" -":mod:`mock` 已經提供了一個功能來幫助解決這個問題,其稱為 speccing。如果你使用" -"類別或實例作為 mock 的 :attr:`spec`,那麼你在 mock 上只能存取真實類別中存在的" -"屬性:" +":mod:`unittest.mock` 已經提供了一個功能來幫助解決這個問題,其稱為 speccing。" +"如果你使用類別或實例作為 mock 的 :attr:`!spec`,那麼你在 mock 上只能存取真實" +"類別中存在的屬性:" #: ../../library/unittest.mock.rst:2628 msgid "" @@ -3630,13 +3631,13 @@ msgstr "" #: ../../library/unittest.mock.rst:2656 msgid "" -"You can see that :class:`request.Request` has a spec. :class:`request." +"You can see that :class:`!request.Request` has a spec. :class:`!request." "Request` takes two arguments in the constructor (one of which is *self*). " "Here's what happens if we try to call it incorrectly::" msgstr "" -"你可以看到 :class:`request.Request` 有一個規格。:class:`request.Request` 在建" -"構函式中接受兩個引數(其中之一是 *self*\\ )。如果我們錯誤地呼叫它,會發生以" -"下情況: ::" +"你可以看到 :class:`!request.Request` 有一個規格。:class:`!request.Request` 在" +"建構函式中接受兩個引數(其中之一是 *self*\\ )。如果我們錯誤地呼叫它,會發生" +"以下情況: ::" #: ../../library/unittest.mock.rst:2660 msgid "" @@ -3668,13 +3669,13 @@ msgstr "" #: ../../library/unittest.mock.rst:2672 msgid "" -":class:`Request` objects are not callable, so the return value of " -"instantiating our mocked out :class:`request.Request` is a non-callable " +":class:`!Request` objects are not callable, so the return value of " +"instantiating our mocked out :class:`!request.Request` is a non-callable " "mock. With the spec in place any typos in our asserts will raise the correct " "error::" msgstr "" -":class:`Request` 物件不是可呼叫物件,因此實例化我們 mock out 的 :class:" -"`request.Request` 的回傳值是不可呼叫的 mock。規格到位後,斷言中的任何拼字錯誤" +":class:`!Request` 物件不是可呼叫物件,因此實例化我們 mock out 的 :class:`!" +"request.Request` 的回傳值是不可呼叫的 mock。規格到位後,斷言中的任何拼字錯誤" "都會引發正確的錯誤: ::" #: ../../library/unittest.mock.rst:2676 @@ -3930,8 +3931,9 @@ msgstr "" #: ../../library/unittest.mock.rst:2826 msgid "" -"Order of precedence of :attr:`side_effect`, :attr:`return_value` and *wraps*" -msgstr ":attr:`side_effect`、:attr:`return_value` 和 *wraps* 的優先順序" +"Order of precedence of :attr:`!side_effect`, :attr:`!return_value` and " +"*wraps*" +msgstr ":attr:`!side_effect`、:attr:`!return_value` 和 *wraps* 的優先順序" #: ../../library/unittest.mock.rst:2828 msgid "The order of their precedence is:" diff --git a/library/urllib.request.po b/library/urllib.request.po index 5720f797b8..aa86249d18 100644 --- a/library/urllib.request.po +++ b/library/urllib.request.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-11 00:13+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-" @@ -54,8 +54,8 @@ msgid "" msgstr "" #: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not WASI." -msgstr ":ref:`適用 `:非 WASI。" +msgid "Availability" +msgstr "" #: ../../includes/wasm-notavail.rst:5 msgid "" @@ -2161,44 +2161,3 @@ msgstr "FTP" #: ../../library/urllib.request.rst:1557 msgid "HTML" msgstr "HTML" - -#~ msgid "" -#~ "The optional *cafile* and *capath* parameters specify a set of trusted CA " -#~ "certificates for HTTPS requests. *cafile* should point to a single file " -#~ "containing a bundle of CA certificates, whereas *capath* should point to " -#~ "a directory of hashed certificate files. More information can be found " -#~ "in :meth:`ssl.SSLContext.load_verify_locations`." -#~ msgstr "" -#~ "選擇性參數 *cafile* 與 *capath* 用來指定一組 HTTPS 請求中所需之受信任 CA " -#~ "憑證。*cafile* 的值應該指向內容包含一堆 CA 憑證的單一檔案,而 *capath* 則" -#~ "指向存放一堆雜湊後的憑證檔案的目錄。欲瞭解更多的資訊請參見 :meth:`ssl." -#~ "SSLContext.load_verify_locations`。" - -#~ msgid "The *cadefault* parameter is ignored." -#~ msgstr "參數 *cadefault* 已被忽略。" - -#~ msgid "" -#~ "*cafile*, *capath* and *cadefault* 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 "" -#~ "*cafile*、*capath*、*cadefault* 已經被棄用並應改為使用 *context*。請改用 :" -#~ "meth:`ssl.SSLContext.load_cert_chain`,或是讓 :func:`ssl." -#~ "create_default_context` 選取系統中受信任的 CA 憑證。" - -#, fuzzy -#~ msgid "" -#~ "The default opener raises an auditing event urllib.Request with arguments " -#~ "fullurl, data, headers, method taken from the request object." -#~ msgstr "" -#~ "預設的 opener 會觸發一個 :ref:`auditing event ` ``urllib." -#~ "Request`` 與其從請求物件中所獲得的引數 ``fullurl``、``data``、" -#~ "``headers``、``method``。" - -#~ msgid "" -#~ "Raises an :ref:`auditing event ` ``urllib.Request`` with " -#~ "arguments ``fullurl``, ``data``, ``headers``, ``method``." -#~ msgstr "" -#~ "觸發一個 :ref:`auditing event ` ``urllib.Request`` 及其引數 " -#~ "``fullurl``、``data``、``headers``、``method``。" diff --git a/library/venv.po b/library/venv.po index ab4f0f4050..0ed5da76cd 100644 --- a/library/venv.po +++ b/library/venv.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.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-30 09:19+0000\n" +"POT-Creation-Date: 2024-10-11 00:13+0000\n" "PO-Revision-Date: 2023-07-09 15:09+0800\n" "Last-Translator: Po-Chuan Chen \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -92,8 +91,8 @@ msgid "" msgstr "" #: ../../includes/wasm-mobile-notavail.rst:3 -msgid ":ref:`Availability `: not Android, not iOS, not WASI." -msgstr ":ref:`適用 `:非 Android、非 iOS、非 WASI。" +msgid "Availability" +msgstr "" #: ../../includes/wasm-mobile-notavail.rst:5 msgid "" @@ -403,9 +402,9 @@ msgstr "csh/tcsh" msgid ":samp:`$ source {}/bin/activate.csh`" msgstr ":samp:`$ source {}/bin/activate.csh`" -#: ../../library/venv.rst:218 ../../library/venv.rst:222 -msgid "PowerShell" -msgstr "PowerShell" +#: ../../library/venv.rst:218 +msgid "pwsh" +msgstr "pwsh" #: ../../library/venv.rst:218 msgid ":samp:`$ {}/bin/Activate.ps1`" @@ -423,6 +422,10 @@ msgstr "cmd.exe" msgid ":samp:`C:\\\\> {}\\\\Scripts\\\\activate.bat`" msgstr ":samp:`C:\\\\> {}\\\\Scripts\\\\activate.bat`" +#: ../../library/venv.rst:222 +msgid "PowerShell" +msgstr "PowerShell" + #: ../../library/venv.rst:222 msgid ":samp:`PS C:\\\\> {}\\\\Scripts\\\\Activate.ps1`" msgstr ":samp:`PS C:\\\\> {}\\\\Scripts\\\\Activate.ps1`" @@ -613,7 +616,7 @@ msgstr "新增 ``scm_ignore_files`` 參數" #: ../../library/venv.rst:333 msgid ":class:`EnvBuilder` may be used as a base class." -msgstr "" +msgstr ":class:`EnvBuilder` 可以被用作為基底類別。" #: ../../library/venv.rst:337 msgid "" diff --git a/library/webbrowser.po b/library/webbrowser.po index 0bed38a963..d65090b5fb 100644 --- a/library/webbrowser.po +++ b/library/webbrowser.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-11 00:13+0000\n" "PO-Revision-Date: 2024-09-24 18:27+0000\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -56,10 +56,10 @@ msgid "" "with the argument URL substituted for ``%s``; if the part does not contain " "``%s``, it is simply interpreted as the name of the browser to launch. [1]_" msgstr "" -"如果環境變數 :envvar:`BROWSER` 存在,它會被直譯為以 :data:`os.pathsep` 分隔的瀏" -"覽器串列,以在平台預設值之前嘗試。當串列部分的值包含字串 ``%s`` 時,它會被直" -"譯為字面瀏覽器命令列,並使用引數 URL 替換 ``%s``;如果該部分不包含 ``%s``,則" -"它僅被直譯為要啟動的瀏覽器的名稱。 [1]_" +"如果環境變數 :envvar:`BROWSER` 存在,它會被直譯為以 :data:`os.pathsep` 分隔的" +"瀏覽器串列,以在平台預設值之前嘗試。當串列部分的值包含字串 ``%s`` 時,它會被" +"直譯為字面瀏覽器命令列,並使用引數 URL 替換 ``%s``;如果該部分不包含 ``%s``," +"則它僅被直譯為要啟動的瀏覽器的名稱。 [1]_" #: ../../library/webbrowser.rst:30 msgid "" @@ -115,8 +115,8 @@ msgid "python -m webbrowser -t \"https://www.python.org\"" msgstr "python -m webbrowser -t \"https://www.python.org\"" #: ../../library/webbrowser.rst:54 -msgid ":ref:`Availability `: not WASI, not Android." -msgstr ":ref:`可用性 `:非 WASI、非 Android。" +msgid "Availability" +msgstr "" #: ../../library/webbrowser.rst:56 msgid "The following exception is defined:" @@ -188,8 +188,8 @@ msgid "" "``None``, return a controller for a default browser appropriate to the " "caller's environment." msgstr "" -"回傳瀏覽器類型\\ *使用*(以引數 *using* 給定)的控制器物件。如果 *using* 為 ``None``,則回傳適合" -"呼叫者環境的預設瀏覽器控制器。" +"回傳瀏覽器類型\\ *使用*(以引數 *using* 給定)的控制器物件。如果 *using* 為 " +"``None``,則回傳適合呼叫者環境的預設瀏覽器控制器。" #: ../../library/webbrowser.rst:109 msgid "" @@ -199,10 +199,10 @@ msgid "" "without parameters to create an instance when needed. If *instance* is " "provided, *constructor* will never be called, and may be ``None``." msgstr "" -"註冊瀏覽器類型\\ *名稱*(以引數 *name* 給定)。一旦註冊了瀏覽器類型,:func:`get` 函式就可以回傳該瀏" -"覽器類型的控制器。如果沒有提供 *instance* 或為 ``None``,則會在需要時不帶參數" -"地呼叫 *constructor* 來建立實例。如果提供了 *instance*,*constructor* 將永遠" -"不會被呼叫,並且可能為 ``None``。" +"註冊瀏覽器類型\\ *名稱*(以引數 *name* 給定)。一旦註冊了瀏覽器類型,:func:" +"`get` 函式就可以回傳該瀏覽器類型的控制器。如果沒有提供 *instance* 或為 " +"``None``,則會在需要時不帶參數地呼叫 *constructor* 來建立實例。如果提供了 " +"*instance*,*constructor* 將永遠不會被呼叫,並且可能為 ``None``。" #: ../../library/webbrowser.rst:115 msgid "" diff --git a/library/xmlrpc.client.po b/library/xmlrpc.client.po index 927aeeba24..4ea29b3a93 100644 --- a/library/xmlrpc.client.po +++ b/library/xmlrpc.client.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-11 00:13+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-" @@ -48,8 +48,8 @@ msgid "" msgstr "" #: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not WASI." -msgstr ":ref:`適用 `:非 WASI。" +msgid "Availability" +msgstr "" #: ../../includes/wasm-notavail.rst:5 msgid "" diff --git a/library/xmlrpc.server.po b/library/xmlrpc.server.po index 7e1eba8c5a..7a0eb729b9 100644 --- a/library/xmlrpc.server.po +++ b/library/xmlrpc.server.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-11 00:13+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-" @@ -42,8 +42,8 @@ msgid "" msgstr "" #: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not WASI." -msgstr ":ref:`適用 `:非 WASI。" +msgid "Availability" +msgstr "" #: ../../includes/wasm-notavail.rst:5 msgid "" diff --git a/library/zoneinfo.po b/library/zoneinfo.po index 0859e10f69..c86aa43ca4 100644 --- a/library/zoneinfo.po +++ b/library/zoneinfo.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-11 00:13+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-" @@ -46,7 +46,7 @@ msgstr "" #: ../../library/zoneinfo.rst:28 msgid "Package :pypi:`tzdata`" -msgstr "" +msgstr ":pypi:`tzdata` 套件" #: ../../library/zoneinfo.rst:29 msgid "" @@ -55,8 +55,8 @@ msgid "" msgstr "" #: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not WASI." -msgstr ":ref:`適用 `:非 WASI。" +msgid "Availability" +msgstr "" #: ../../includes/wasm-notavail.rst:5 msgid "" diff --git a/reference/datamodel.po b/reference/datamodel.po index 4a7709654d..abda8ae6ec 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-04 00:13+0000\n" +"POT-Creation-Date: 2024-10-10 00:13+0000\n" "PO-Revision-Date: 2024-09-24 19:03+0900\n" "Last-Translator: Kisaragi Hiu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -668,18 +668,18 @@ msgid "" "containing the same number of items as the function's formal parameter list." msgstr "" -#: ../../reference/datamodel.rst:545 ../../reference/datamodel.rst:1206 -#: ../../reference/datamodel.rst:1403 +#: ../../reference/datamodel.rst:545 ../../reference/datamodel.rst:1395 +#: ../../reference/datamodel.rst:1596 msgid "Special read-only attributes" msgstr "特殊唯讀屬性" -#: ../../reference/datamodel.rst:555 ../../reference/datamodel.rst:589 -#: ../../reference/datamodel.rst:981 +#: ../../reference/datamodel.rst:555 ../../reference/datamodel.rst:590 +#: ../../reference/datamodel.rst:1170 msgid "Attribute" msgstr "屬性" -#: ../../reference/datamodel.rst:556 ../../reference/datamodel.rst:590 -#: ../../reference/datamodel.rst:982 +#: ../../reference/datamodel.rst:556 ../../reference/datamodel.rst:591 +#: ../../reference/datamodel.rst:1171 msgid "Meaning" msgstr "含義" @@ -692,66 +692,67 @@ msgstr "" #: ../../reference/datamodel.rst:564 msgid "" -"``None`` or a :class:`tuple` of cells that contain bindings for the " -"function's free variables." +"``None`` or a :class:`tuple` of cells that contain bindings for the names " +"specified in the :attr:`~codeobject.co_freevars` attribute of the " +"function's :attr:`code object `." msgstr "" -#: ../../reference/datamodel.rst:567 +#: ../../reference/datamodel.rst:568 msgid "" "A cell object has the attribute ``cell_contents``. This can be used to get " "the value of the cell, as well as set the value." msgstr "" -#: ../../reference/datamodel.rst:571 ../../reference/datamodel.rst:1445 +#: ../../reference/datamodel.rst:572 ../../reference/datamodel.rst:1638 msgid "Special writable attributes" msgstr "特殊可寫屬性" -#: ../../reference/datamodel.rst:584 +#: ../../reference/datamodel.rst:585 msgid "Most of these attributes check the type of the assigned value:" msgstr "" -#: ../../reference/datamodel.rst:593 +#: ../../reference/datamodel.rst:594 msgid "The function's documentation string, or ``None`` if unavailable." msgstr "函式的文件字串,若不可用則為 ``None``。" -#: ../../reference/datamodel.rst:596 +#: ../../reference/datamodel.rst:597 msgid "" "The function's name. See also: :attr:`__name__ attributes `." msgstr "" -#: ../../reference/datamodel.rst:600 +#: ../../reference/datamodel.rst:601 msgid "" "The function's :term:`qualified name`. See also: :attr:`__qualname__ " "attributes `." msgstr "" -#: ../../reference/datamodel.rst:606 +#: ../../reference/datamodel.rst:607 msgid "" "The name of the module the function was defined in, or ``None`` if " "unavailable." msgstr "" -#: ../../reference/datamodel.rst:610 +#: ../../reference/datamodel.rst:611 msgid "" "A :class:`tuple` containing default :term:`parameter` values for those " "parameters that have defaults, or ``None`` if no parameters have a default " "value." msgstr "" -#: ../../reference/datamodel.rst:615 +#: ../../reference/datamodel.rst:616 msgid "" "The :ref:`code object ` representing the compiled function " "body." msgstr "代表編譯函式主體的\\ :ref:`程式碼物件 `。" -#: ../../reference/datamodel.rst:619 +#: ../../reference/datamodel.rst:620 msgid "" "The namespace supporting arbitrary function attributes. See also: :attr:" "`__dict__ attributes `." msgstr "" -#: ../../reference/datamodel.rst:623 +#: ../../reference/datamodel.rst:624 msgid "" "A :class:`dictionary ` containing annotations of :term:`parameters " "`. The keys of the dictionary are the parameter names, and " @@ -759,88 +760,88 @@ msgid "" "`annotations-howto`." msgstr "" -#: ../../reference/datamodel.rst:630 +#: ../../reference/datamodel.rst:631 msgid "" "A :class:`dictionary ` containing defaults for keyword-only :term:" "`parameters `." msgstr "" -#: ../../reference/datamodel.rst:634 +#: ../../reference/datamodel.rst:635 msgid "" "A :class:`tuple` containing the :ref:`type parameters ` of a :" "ref:`generic function `." msgstr "" -#: ../../reference/datamodel.rst:639 +#: ../../reference/datamodel.rst:640 msgid "" "Function objects also support getting and setting arbitrary attributes, " "which can be used, for example, to attach metadata to functions. Regular " "attribute dot-notation is used to get and set such attributes." msgstr "" -#: ../../reference/datamodel.rst:645 +#: ../../reference/datamodel.rst:646 msgid "" "CPython's current implementation only supports function attributes on user-" "defined functions. Function attributes on :ref:`built-in functions ` may be supported in the future." msgstr "" -#: ../../reference/datamodel.rst:650 +#: ../../reference/datamodel.rst:651 msgid "" "Additional information about a function's definition can be retrieved from " "its :ref:`code object ` (accessible via the :attr:`~function." "__code__` attribute)." msgstr "" -#: ../../reference/datamodel.rst:658 +#: ../../reference/datamodel.rst:659 msgid "Instance methods" msgstr "" -#: ../../reference/datamodel.rst:665 +#: ../../reference/datamodel.rst:666 msgid "" "An instance method object combines a class, a class instance and any " "callable object (normally a user-defined function)." msgstr "" -#: ../../reference/datamodel.rst:675 ../../reference/datamodel.rst:1541 +#: ../../reference/datamodel.rst:676 ../../reference/datamodel.rst:1734 msgid "Special read-only attributes:" msgstr "特殊唯讀屬性:" -#: ../../reference/datamodel.rst:680 +#: ../../reference/datamodel.rst:681 msgid "" "Refers to the class instance object to which the method is :ref:`bound " "`" msgstr "" -#: ../../reference/datamodel.rst:684 +#: ../../reference/datamodel.rst:685 msgid "Refers to the original :ref:`function object `" msgstr "" -#: ../../reference/datamodel.rst:687 +#: ../../reference/datamodel.rst:688 msgid "" "The method's documentation (same as :attr:`method.__func__.__doc__ `). A :class:`string ` if the original function had a " "docstring, else ``None``." msgstr "" -#: ../../reference/datamodel.rst:693 +#: ../../reference/datamodel.rst:694 msgid "" "The name of the method (same as :attr:`method.__func__.__name__ `)" msgstr "" -#: ../../reference/datamodel.rst:697 +#: ../../reference/datamodel.rst:698 msgid "" "The name of the module the method was defined in, or ``None`` if unavailable." msgstr "" -#: ../../reference/datamodel.rst:700 +#: ../../reference/datamodel.rst:701 msgid "" "Methods also support accessing (but not setting) the arbitrary function " "attributes on the underlying :ref:`function object `." msgstr "" -#: ../../reference/datamodel.rst:703 +#: ../../reference/datamodel.rst:704 msgid "" "User-defined method objects may be created when getting an attribute of a " "class (perhaps via an instance of that class), if that attribute is a user-" @@ -848,7 +849,7 @@ msgid "" "`classmethod` object." msgstr "" -#: ../../reference/datamodel.rst:710 +#: ../../reference/datamodel.rst:711 msgid "" "When an instance method object is created by retrieving a user-defined :ref:" "`function object ` from a class via one of its " @@ -857,7 +858,7 @@ msgid "" "__func__` attribute is the original function object." msgstr "" -#: ../../reference/datamodel.rst:716 +#: ../../reference/datamodel.rst:717 msgid "" "When an instance method object is created by retrieving a :class:" "`classmethod` object from a class or instance, its :attr:`~method.__self__` " @@ -865,7 +866,7 @@ msgid "" "the function object underlying the class method." msgstr "" -#: ../../reference/datamodel.rst:721 +#: ../../reference/datamodel.rst:722 msgid "" "When an instance method object is called, the underlying function (:attr:" "`~method.__func__`) is called, inserting the class instance (:attr:`~method." @@ -875,7 +876,7 @@ msgid "" "f(x, 1)``." msgstr "" -#: ../../reference/datamodel.rst:728 +#: ../../reference/datamodel.rst:729 msgid "" "When an instance method object is derived from a :class:`classmethod` " "object, the \"class instance\" stored in :attr:`~method.__self__` will " @@ -884,18 +885,18 @@ msgid "" "function." msgstr "" -#: ../../reference/datamodel.rst:733 +#: ../../reference/datamodel.rst:734 msgid "" "It is important to note that user-defined functions which are attributes of " "a class instance are not converted to bound methods; this *only* happens " "when the function is an attribute of the class." msgstr "" -#: ../../reference/datamodel.rst:740 +#: ../../reference/datamodel.rst:741 msgid "Generator functions" msgstr "Generator(產生器)函式" -#: ../../reference/datamodel.rst:746 +#: ../../reference/datamodel.rst:747 msgid "" "A function or method which uses the :keyword:`yield` statement (see section :" "ref:`yield`) is called a :dfn:`generator function`. Such a function, when " @@ -908,11 +909,11 @@ msgid "" "values to be returned." msgstr "" -#: ../../reference/datamodel.rst:758 +#: ../../reference/datamodel.rst:759 msgid "Coroutine functions" msgstr "Coroutine(協程)函式" -#: ../../reference/datamodel.rst:763 +#: ../../reference/datamodel.rst:764 msgid "" "A function or method which is defined using :keyword:`async def` is called " "a :dfn:`coroutine function`. Such a function, when called, returns a :term:" @@ -921,11 +922,11 @@ msgid "" "ref:`coroutine-objects` section." msgstr "" -#: ../../reference/datamodel.rst:771 +#: ../../reference/datamodel.rst:772 msgid "Asynchronous generator functions" msgstr "" -#: ../../reference/datamodel.rst:777 +#: ../../reference/datamodel.rst:778 msgid "" "A function or method which is defined using :keyword:`async def` and which " "uses the :keyword:`yield` statement is called a :dfn:`asynchronous generator " @@ -934,7 +935,7 @@ msgid "" "execute the body of the function." msgstr "" -#: ../../reference/datamodel.rst:783 +#: ../../reference/datamodel.rst:784 msgid "" "Calling the asynchronous iterator's :meth:`aiterator.__anext__ ` method will return an :term:`awaitable` which when awaited will " @@ -945,11 +946,11 @@ msgid "" "yielded." msgstr "" -#: ../../reference/datamodel.rst:796 +#: ../../reference/datamodel.rst:797 msgid "Built-in functions" msgstr "內建函式" -#: ../../reference/datamodel.rst:803 +#: ../../reference/datamodel.rst:804 msgid "" "A built-in function object is a wrapper around a C function. Examples of " "built-in functions are :func:`len` and :func:`math.sin` (:mod:`math` is a " @@ -960,7 +961,7 @@ msgstr "" "func:`math.sin`\\ (\\ :mod:`math` 是一個標準的內建模組)。內建函式的引數數量" "與其型別由其包裝的 C 函式所決定。特殊唯讀屬性:" -#: ../../reference/datamodel.rst:808 +#: ../../reference/datamodel.rst:809 msgid "" ":attr:`!__doc__` is the function's documentation string, or ``None`` if " "unavailable. See :attr:`function.__doc__`." @@ -968,26 +969,26 @@ msgstr "" ":attr:`!__doc__` 是函式的文件字串,若不可用則為 ``None``。請見 :attr:" "`function.__doc__`。" -#: ../../reference/datamodel.rst:810 +#: ../../reference/datamodel.rst:811 msgid "" ":attr:`!__name__` is the function's name. See :attr:`function.__name__`." msgstr ":attr:`!__name__` 是函式的名稱。請見 :attr:`function.__name__`。" -#: ../../reference/datamodel.rst:811 +#: ../../reference/datamodel.rst:812 msgid ":attr:`!__self__` is set to ``None`` (but see the next item)." msgstr "" -#: ../../reference/datamodel.rst:812 +#: ../../reference/datamodel.rst:813 msgid "" ":attr:`!__module__` is the name of the module the function was defined in or " "``None`` if unavailable. See :attr:`function.__module__`." msgstr "" -#: ../../reference/datamodel.rst:820 +#: ../../reference/datamodel.rst:821 msgid "Built-in methods" msgstr "" -#: ../../reference/datamodel.rst:827 +#: ../../reference/datamodel.rst:828 msgid "" "This is really a different disguise of a built-in function, this time " "containing an object passed to the C function as an implicit extra " @@ -998,11 +999,11 @@ msgid "" "__self__>`.)" msgstr "" -#: ../../reference/datamodel.rst:837 +#: ../../reference/datamodel.rst:838 msgid "Classes" msgstr "" -#: ../../reference/datamodel.rst:839 +#: ../../reference/datamodel.rst:840 msgid "" "Classes are callable. These objects normally act as factories for new " "instances of themselves, but variations are possible for class types that " @@ -1011,21 +1012,21 @@ msgid "" "initialize the new instance." msgstr "" -#: ../../reference/datamodel.rst:847 +#: ../../reference/datamodel.rst:848 msgid "Class Instances" msgstr "" -#: ../../reference/datamodel.rst:849 +#: ../../reference/datamodel.rst:850 msgid "" "Instances of arbitrary classes can be made callable by defining a :meth:" "`~object.__call__` method in their class." msgstr "" -#: ../../reference/datamodel.rst:854 +#: ../../reference/datamodel.rst:857 msgid "Modules" msgstr "模組" -#: ../../reference/datamodel.rst:860 +#: ../../reference/datamodel.rst:863 msgid "" "Modules are a basic organizational unit of Python code, and are created by " "the :ref:`import system ` as invoked either by the :keyword:" @@ -1040,63 +1041,288 @@ msgid "" "done)." msgstr "" -#: ../../reference/datamodel.rst:873 +#: ../../reference/datamodel.rst:876 msgid "" "Attribute assignment updates the module's namespace dictionary, e.g., ``m.x " "= 1`` is equivalent to ``m.__dict__[\"x\"] = 1``." msgstr "" -#: ../../reference/datamodel.rst:883 -msgid "Predefined (writable) attributes:" +#: ../../reference/datamodel.rst:894 +msgid "Import-related attributes on module objects" msgstr "" -#: ../../reference/datamodel.rst:885 -msgid ":attr:`__name__`" -msgstr ":attr:`__name__`" +#: ../../reference/datamodel.rst:896 +msgid "" +"Module objects have the following attributes that relate to the :ref:`import " +"system `. When a module is created using the machinery " +"associated with the import system, these attributes are filled in based on " +"the module's :term:`spec `, before the :term:`loader` executes " +"and loads the module." +msgstr "" -#: ../../reference/datamodel.rst:886 -msgid "The module's name." +#: ../../reference/datamodel.rst:902 +msgid "" +"To create a module dynamically rather than using the import system, it's " +"recommended to use :func:`importlib.util.module_from_spec`, which will set " +"the various import-controlled attributes to appropriate values. It's also " +"possible to use the :class:`types.ModuleType` constructor to create modules " +"directly, but this technique is more error-prone, as most attributes must be " +"manually set on the module object after it has been created when using this " +"approach." msgstr "" -#: ../../reference/datamodel.rst:888 -msgid ":attr:`__doc__`" -msgstr ":attr:`__doc__`" +#: ../../reference/datamodel.rst:912 +msgid "" +"With the exception of :attr:`~module.__name__`, it is **strongly** " +"recommended that you rely on :attr:`~module.__spec__` and its attributes " +"instead of any of the other individual attributes listed in this subsection. " +"Note that updating an attribute on :attr:`!__spec__` will not update the " +"corresponding attribute on the module itself:" +msgstr "" -#: ../../reference/datamodel.rst:889 -msgid "The module's documentation string, or ``None`` if unavailable." +#: ../../reference/datamodel.rst:918 +msgid "" +">>> import typing\n" +">>> typing.__name__, typing.__spec__.name\n" +"('typing', 'typing')\n" +">>> typing.__spec__.name = 'spelling'\n" +">>> typing.__name__, typing.__spec__.name\n" +"('typing', 'spelling')\n" +">>> typing.__name__ = 'keyboard_smashing'\n" +">>> typing.__name__, typing.__spec__.name\n" +"('keyboard_smashing', 'spelling')" msgstr "" -#: ../../reference/datamodel.rst:892 -msgid ":attr:`__file__`" -msgstr ":attr:`__file__`" +#: ../../reference/datamodel.rst:932 +msgid "" +"The name used to uniquely identify the module in the import system. For a " +"directly executed module, this will be set to ``\"__main__\"``." +msgstr "" -#: ../../reference/datamodel.rst:893 +#: ../../reference/datamodel.rst:935 msgid "" -"The pathname of the file from which the module was loaded, if it was loaded " -"from a file. The :attr:`__file__` attribute may be missing for certain types " -"of modules, such as C modules that are statically linked into the " -"interpreter. For extension modules loaded dynamically from a shared " -"library, it's the pathname of the shared library file." +"This attribute must be set to the fully qualified name of the module. It is " +"expected to match the value of :attr:`module.__spec__.name `." msgstr "" -#: ../../reference/datamodel.rst:901 -msgid ":attr:`__annotations__`" -msgstr ":attr:`__annotations__`" +#: ../../reference/datamodel.rst:941 +msgid "A record of the module's import-system-related state." +msgstr "" -#: ../../reference/datamodel.rst:902 +#: ../../reference/datamodel.rst:943 +msgid "" +"Set to the :class:`module spec ` that was " +"used when importing the module. See :ref:`module-specs` for more details." +msgstr "" + +#: ../../reference/datamodel.rst:950 +msgid "The :term:`package` a module belongs to." +msgstr "" + +#: ../../reference/datamodel.rst:952 +msgid "" +"If the module is top-level (that is, not a part of any specific package) " +"then the attribute should be set to ``''`` (the empty string). Otherwise, it " +"should be set to the name of the module's package (which can be equal to :" +"attr:`module.__name__` if the module itself is a package). See :pep:`366` " +"for further details." +msgstr "" + +#: ../../reference/datamodel.rst:958 +msgid "" +"This attribute is used instead of :attr:`~module.__name__` to calculate " +"explicit relative imports for main modules. It defaults to ``None`` for " +"modules created dynamically using the :class:`types.ModuleType` constructor; " +"use :func:`importlib.util.module_from_spec` instead to ensure the attribute " +"is set to a :class:`str`." +msgstr "" + +#: ../../reference/datamodel.rst:964 +msgid "" +"It is **strongly** recommended that you use :attr:`module.__spec__.parent " +"` instead of :attr:`!module." +"__package__`. :attr:`__package__` is now only used as a fallback if :attr:`!" +"__spec__.parent` is not set, and this fallback path is deprecated." +msgstr "" + +#: ../../reference/datamodel.rst:970 ../../reference/datamodel.rst:1011 +msgid "" +"This attribute now defaults to ``None`` for modules created dynamically " +"using the :class:`types.ModuleType` constructor. Previously the attribute " +"was optional." +msgstr "" + +#: ../../reference/datamodel.rst:975 +msgid "" +"The value of :attr:`!__package__` is expected to be the same as :attr:" +"`__spec__.parent `. :attr:" +"`__package__` is now only used as a fallback during import resolution if :" +"attr:`!__spec__.parent` is not defined." +msgstr "" + +#: ../../reference/datamodel.rst:981 +msgid "" +":exc:`ImportWarning` is raised if an import resolution falls back to :attr:`!" +"__package__` instead of :attr:`__spec__.parent `." +msgstr "" + +#: ../../reference/datamodel.rst:986 +msgid "" +"Raise :exc:`DeprecationWarning` instead of :exc:`ImportWarning` when falling " +"back to :attr:`!__package__` during import resolution." +msgstr "" + +#: ../../reference/datamodel.rst:990 +msgid "" +":attr:`!__package__` will cease to be set or taken into consideration by the " +"import system or standard library." +msgstr "" + +#: ../../reference/datamodel.rst:996 +msgid "" +"The :term:`loader` object that the import machinery used to load the module." +msgstr "" + +#: ../../reference/datamodel.rst:998 +msgid "" +"This attribute is mostly useful for introspection, but can be used for " +"additional loader-specific functionality, for example getting data " +"associated with a loader." +msgstr "" + +#: ../../reference/datamodel.rst:1002 +msgid "" +":attr:`!__loader__` defaults to ``None`` for modules created dynamically " +"using the :class:`types.ModuleType` constructor; use :func:`importlib.util." +"module_from_spec` instead to ensure the attribute is set to a :term:`loader` " +"object." +msgstr "" + +#: ../../reference/datamodel.rst:1007 +msgid "" +"It is **strongly** recommended that you use :attr:`module.__spec__.loader " +"` instead of :attr:`!module." +"__loader__`." +msgstr "" + +#: ../../reference/datamodel.rst:1016 +msgid "" +"Setting :attr:`!__loader__` on a module while failing to set :attr:`!" +"__spec__.loader` is deprecated. In Python 3.14, :attr:`!__loader__` will " +"cease to be set or taken into consideration by the import system or the " +"standard library." +msgstr "" + +#: ../../reference/datamodel.rst:1024 +msgid "" +"A (possibly empty) :term:`sequence` of strings enumerating the locations " +"where the package's submodules will be found. Non-package modules should not " +"have a :attr:`!__path__` attribute. See :ref:`package-path-rules` for more " +"details." +msgstr "" + +#: ../../reference/datamodel.rst:1029 +msgid "" +"It is **strongly** recommended that you use :attr:`module.__spec__." +"submodule_search_locations ` instead of :attr:`!module.__path__`." +msgstr "" + +#: ../../reference/datamodel.rst:1036 +msgid "" +":attr:`!__file__` and :attr:`!__cached__` are both optional attributes that " +"may or may not be set. Both attributes should be a :class:`str` when they " +"are available." +msgstr "" + +#: ../../reference/datamodel.rst:1040 +msgid "" +":attr:`!__file__` indicates the pathname of the file from which the module " +"was loaded (if loaded from a file), or the pathname of the shared library " +"file for extension modules loaded dynamically from a shared library. It " +"might be missing for certain types of modules, such as C modules that are " +"statically linked into the interpreter, and the :ref:`import system " +"` may opt to leave it unset if it has no semantic meaning (for " +"example, a module loaded from a database)." +msgstr "" + +#: ../../reference/datamodel.rst:1048 +msgid "" +"If :attr:`!__file__` is set then the :attr:`!__cached__` attribute might " +"also be set, which is the path to any compiled version of the code (for " +"example, a byte-compiled file). The file does not need to exist to set this " +"attribute; the path can simply point to where the compiled file *would* " +"exist (see :pep:`3147`)." +msgstr "" + +#: ../../reference/datamodel.rst:1054 +msgid "" +"Note that :attr:`!__cached__` may be set even if :attr:`!__file__` is not " +"set. However, that scenario is quite atypical. Ultimately, the :term:" +"`loader` is what makes use of the module spec provided by the :term:`finder` " +"(from which :attr:`!__file__` and :attr:`!__cached__` are derived). So if a " +"loader can load from a cached module but otherwise does not load from a " +"file, that atypical scenario may be appropriate." +msgstr "" + +#: ../../reference/datamodel.rst:1061 +msgid "" +"It is **strongly** recommended that you use :attr:`module.__spec__.cached " +"` instead of :attr:`!module." +"__cached__`." +msgstr "" + +#: ../../reference/datamodel.rst:1065 +msgid "" +"Setting :attr:`!__cached__` on a module while failing to set :attr:`!" +"__spec__.cached` is deprecated. In Python 3.15, :attr:`!__cached__` will " +"cease to be set or taken into consideration by the import system or standard " +"library." +msgstr "" + +#: ../../reference/datamodel.rst:1072 +msgid "Other writable attributes on module objects" +msgstr "模組物件的其他可寫入屬性" + +#: ../../reference/datamodel.rst:1074 +msgid "" +"As well as the import-related attributes listed above, module objects also " +"have the following writable attributes:" +msgstr "" + +#: ../../reference/datamodel.rst:1079 +msgid "" +"The module's documentation string, or ``None`` if unavailable. See also: :" +"attr:`__doc__ attributes `." +msgstr "" +"模組的文件字串,若不可用則為 ``None``。請見 :attr:`__doc__ attributes " +"`。" + +#: ../../reference/datamodel.rst:1084 msgid "" "A dictionary containing :term:`variable annotations ` " "collected during module body execution. For best practices on working with :" "attr:`__annotations__`, please see :ref:`annotations-howto`." msgstr "" -#: ../../reference/datamodel.rst:909 +#: ../../reference/datamodel.rst:1090 +msgid "Module dictionaries" +msgstr "模組字典" + +#: ../../reference/datamodel.rst:1092 +msgid "Module objects also have the following special read-only attribute:" +msgstr "" + +#: ../../reference/datamodel.rst:1097 msgid "" -"Special read-only attribute: :attr:`~object.__dict__` is the module's " -"namespace as a dictionary object." +"The module's namespace as a dictionary object. Uniquely among the attributes " +"listed here, :attr:`!__dict__` cannot be accessed as a global variable from " +"within a module; it can only be accessed as an attribute on module objects." msgstr "" -#: ../../reference/datamodel.rst:914 +#: ../../reference/datamodel.rst:1103 msgid "" "Because of the way CPython clears module dictionaries, the module dictionary " "will be cleared when the module falls out of scope even if the dictionary " @@ -1104,11 +1330,11 @@ msgid "" "module around while using its dictionary directly." msgstr "" -#: ../../reference/datamodel.rst:923 +#: ../../reference/datamodel.rst:1112 msgid "Custom classes" msgstr "" -#: ../../reference/datamodel.rst:925 +#: ../../reference/datamodel.rst:1114 msgid "" "Custom class types are typically created by class definitions (see section :" "ref:`class`). A class has a namespace implemented by a dictionary object. " @@ -1123,7 +1349,7 @@ msgid "" "found at :ref:`python_2.3_mro`." msgstr "" -#: ../../reference/datamodel.rst:946 +#: ../../reference/datamodel.rst:1135 msgid "" "When a class attribute reference (for class :class:`!C`, say) would yield a " "class method object, it is transformed into an instance method object whose :" @@ -1134,66 +1360,66 @@ msgid "" "contained in its :attr:`~object.__dict__`." msgstr "" -#: ../../reference/datamodel.rst:957 +#: ../../reference/datamodel.rst:1146 msgid "" "Class attribute assignments update the class's dictionary, never the " "dictionary of a base class." msgstr "" -#: ../../reference/datamodel.rst:962 +#: ../../reference/datamodel.rst:1151 msgid "" "A class object can be called (see above) to yield a class instance (see " "below)." msgstr "" -#: ../../reference/datamodel.rst:965 ../../reference/datamodel.rst:1112 +#: ../../reference/datamodel.rst:1154 ../../reference/datamodel.rst:1301 msgid "Special attributes" msgstr "特殊屬性" -#: ../../reference/datamodel.rst:985 +#: ../../reference/datamodel.rst:1174 msgid "" "The class's name. See also: :attr:`__name__ attributes `." msgstr "" -#: ../../reference/datamodel.rst:989 +#: ../../reference/datamodel.rst:1178 msgid "" "The class's :term:`qualified name`. See also: :attr:`__qualname__ attributes " "`." msgstr "" -#: ../../reference/datamodel.rst:993 +#: ../../reference/datamodel.rst:1182 msgid "The name of the module in which the class was defined." msgstr "" -#: ../../reference/datamodel.rst:996 +#: ../../reference/datamodel.rst:1185 msgid "" "A :class:`mapping proxy ` providing a read-only view " "of the class's namespace. See also: :attr:`__dict__ attributes `." msgstr "" -#: ../../reference/datamodel.rst:1001 +#: ../../reference/datamodel.rst:1190 msgid "" "A :class:`tuple` containing the class's bases. In most cases, for a class " "defined as ``class X(A, B, C)``, ``X.__bases__`` will be exactly equal to " "``(A, B, C)``." msgstr "" -#: ../../reference/datamodel.rst:1006 +#: ../../reference/datamodel.rst:1195 msgid "" "The class's documentation string, or ``None`` if undefined. Not inherited by " "subclasses." msgstr "" -#: ../../reference/datamodel.rst:1010 +#: ../../reference/datamodel.rst:1199 msgid "" "A dictionary containing :term:`variable annotations ` " "collected during class body execution. For best practices on working with :" "attr:`!__annotations__`, please see :ref:`annotations-howto`." msgstr "" -#: ../../reference/datamodel.rst:1017 +#: ../../reference/datamodel.rst:1206 msgid "" "Accessing the :attr:`!__annotations__` attribute of a class object directly " "may yield incorrect results in the presence of metaclasses. In addition, the " @@ -1201,56 +1427,56 @@ msgid "" "get_annotations` to retrieve class annotations safely." msgstr "" -#: ../../reference/datamodel.rst:1024 +#: ../../reference/datamodel.rst:1213 msgid "" "A :class:`tuple` containing the :ref:`type parameters ` of a :" "ref:`generic class `." msgstr "" -#: ../../reference/datamodel.rst:1030 +#: ../../reference/datamodel.rst:1219 msgid "" "A :class:`tuple` containing names of attributes of this class which are " "assigned through ``self.X`` from any function in its body." msgstr "" -#: ../../reference/datamodel.rst:1036 +#: ../../reference/datamodel.rst:1225 msgid "" "The line number of the first line of the class definition, including " "decorators. Setting the :attr:`__module__` attribute removes the :attr:`!" "__firstlineno__` item from the type's dictionary." msgstr "" -#: ../../reference/datamodel.rst:1044 +#: ../../reference/datamodel.rst:1233 msgid "" "The :class:`tuple` of classes that are considered when looking for base " "classes during method resolution." msgstr "" -#: ../../reference/datamodel.rst:1049 +#: ../../reference/datamodel.rst:1238 msgid "Special methods" msgstr "特殊方法" -#: ../../reference/datamodel.rst:1051 +#: ../../reference/datamodel.rst:1240 msgid "" "In addition to the special attributes described above, all Python classes " "also have the following two methods available:" msgstr "" -#: ../../reference/datamodel.rst:1056 +#: ../../reference/datamodel.rst:1245 msgid "" "This method can be overridden by a metaclass to customize the method " "resolution order for its instances. It is called at class instantiation, " "and its result is stored in :attr:`~type.__mro__`." msgstr "" -#: ../../reference/datamodel.rst:1062 +#: ../../reference/datamodel.rst:1251 msgid "" "Each class keeps a list of weak references to its immediate subclasses. This " "method returns a list of all those references still alive. The list is in " "definition order. Example:" msgstr "" -#: ../../reference/datamodel.rst:1066 +#: ../../reference/datamodel.rst:1255 msgid "" ">>> class A: pass\n" ">>> class B(A): pass\n" @@ -1258,11 +1484,11 @@ msgid "" "[]" msgstr "" -#: ../../reference/datamodel.rst:1074 +#: ../../reference/datamodel.rst:1263 msgid "Class instances" msgstr "" -#: ../../reference/datamodel.rst:1082 +#: ../../reference/datamodel.rst:1271 msgid "" "A class instance is created by calling a class object (see above). A class " "instance has a namespace implemented as a dictionary which is the first " @@ -1279,7 +1505,7 @@ msgid "" "__getattr__` method, that is called to satisfy the lookup." msgstr "" -#: ../../reference/datamodel.rst:1098 +#: ../../reference/datamodel.rst:1287 msgid "" "Attribute assignments and deletions update the instance's dictionary, never " "a class's dictionary. If the class has a :meth:`~object.__setattr__` or :" @@ -1287,28 +1513,28 @@ msgid "" "instance dictionary directly." msgstr "" -#: ../../reference/datamodel.rst:1108 +#: ../../reference/datamodel.rst:1297 msgid "" "Class instances can pretend to be numbers, sequences, or mappings if they " "have methods with certain special names. See section :ref:`specialnames`." msgstr "" -#: ../../reference/datamodel.rst:1120 +#: ../../reference/datamodel.rst:1309 msgid "The class to which a class instance belongs." msgstr "" -#: ../../reference/datamodel.rst:1124 +#: ../../reference/datamodel.rst:1313 msgid "" "A dictionary or other mapping object used to store an object's (writable) " "attributes. Not all instances have a :attr:`!__dict__` attribute; see the " "section on :ref:`slots` for more details." msgstr "" -#: ../../reference/datamodel.rst:1130 +#: ../../reference/datamodel.rst:1319 msgid "I/O objects (also known as file objects)" msgstr "" -#: ../../reference/datamodel.rst:1145 +#: ../../reference/datamodel.rst:1334 msgid "" "A :term:`file object` represents an open file. Various shortcuts are " "available to create file objects: the :func:`open` built-in function, and " @@ -1317,7 +1543,7 @@ msgid "" "methods provided by extension modules)." msgstr "" -#: ../../reference/datamodel.rst:1151 +#: ../../reference/datamodel.rst:1340 msgid "" "The objects ``sys.stdin``, ``sys.stdout`` and ``sys.stderr`` are initialized " "to file objects corresponding to the interpreter's standard input, output " @@ -1325,22 +1551,22 @@ msgid "" "interface defined by the :class:`io.TextIOBase` abstract class." msgstr "" -#: ../../reference/datamodel.rst:1159 +#: ../../reference/datamodel.rst:1348 msgid "Internal types" msgstr "" -#: ../../reference/datamodel.rst:1165 +#: ../../reference/datamodel.rst:1354 msgid "" "A few types used internally by the interpreter are exposed to the user. " "Their definitions may change with future versions of the interpreter, but " "they are mentioned here for completeness." msgstr "" -#: ../../reference/datamodel.rst:1173 +#: ../../reference/datamodel.rst:1362 msgid "Code objects" msgstr "" -#: ../../reference/datamodel.rst:1177 +#: ../../reference/datamodel.rst:1366 msgid "" "Code objects represent *byte-compiled* executable Python code, or :term:" "`bytecode`. The difference between a code object and a function object is " @@ -1352,103 +1578,111 @@ msgid "" "no references (directly or indirectly) to mutable objects." msgstr "" -#: ../../reference/datamodel.rst:1211 +#: ../../reference/datamodel.rst:1400 msgid "The function name" msgstr "函式名稱" -#: ../../reference/datamodel.rst:1214 +#: ../../reference/datamodel.rst:1403 msgid "The fully qualified function name" msgstr "" -#: ../../reference/datamodel.rst:1219 +#: ../../reference/datamodel.rst:1408 msgid "" "The total number of positional :term:`parameters ` (including " "positional-only parameters and parameters with default values) that the " "function has" msgstr "" -#: ../../reference/datamodel.rst:1224 +#: ../../reference/datamodel.rst:1413 msgid "" "The number of positional-only :term:`parameters ` (including " "arguments with default values) that the function has" msgstr "" -#: ../../reference/datamodel.rst:1228 +#: ../../reference/datamodel.rst:1417 msgid "" "The number of keyword-only :term:`parameters ` (including " "arguments with default values) that the function has" msgstr "" -#: ../../reference/datamodel.rst:1232 +#: ../../reference/datamodel.rst:1421 msgid "" "The number of :ref:`local variables ` used by the function " "(including parameters)" msgstr "" -#: ../../reference/datamodel.rst:1236 +#: ../../reference/datamodel.rst:1425 msgid "" "A :class:`tuple` containing the names of the local variables in the function " "(starting with the parameter names)" msgstr "" -#: ../../reference/datamodel.rst:1240 +#: ../../reference/datamodel.rst:1429 msgid "" "A :class:`tuple` containing the names of :ref:`local variables ` " -"that are referenced by nested functions inside the function" +"that are referenced from at least one :term:`nested scope` inside the " +"function" msgstr "" -#: ../../reference/datamodel.rst:1244 -msgid "A :class:`tuple` containing the names of free variables in the function" +#: ../../reference/datamodel.rst:1433 +msgid "" +"A :class:`tuple` containing the names of :term:`free (closure) variables " +"` that a :term:`nested scope` references in an outer " +"scope. See also :attr:`function.__closure__`." msgstr "" -#: ../../reference/datamodel.rst:1247 +#: ../../reference/datamodel.rst:1437 +msgid "Note: references to global and builtin names are *not* included." +msgstr "" + +#: ../../reference/datamodel.rst:1440 msgid "" "A string representing the sequence of :term:`bytecode` instructions in the " "function" msgstr "" -#: ../../reference/datamodel.rst:1251 +#: ../../reference/datamodel.rst:1444 msgid "" "A :class:`tuple` containing the literals used by the :term:`bytecode` in the " "function" msgstr "" -#: ../../reference/datamodel.rst:1255 +#: ../../reference/datamodel.rst:1448 msgid "" "A :class:`tuple` containing the names used by the :term:`bytecode` in the " "function" msgstr "" -#: ../../reference/datamodel.rst:1259 +#: ../../reference/datamodel.rst:1452 msgid "The name of the file from which the code was compiled" msgstr "" -#: ../../reference/datamodel.rst:1262 +#: ../../reference/datamodel.rst:1455 msgid "The line number of the first line of the function" msgstr "" -#: ../../reference/datamodel.rst:1265 +#: ../../reference/datamodel.rst:1458 msgid "" "A string encoding the mapping from :term:`bytecode` offsets to line numbers. " "For details, see the source code of the interpreter." msgstr "" -#: ../../reference/datamodel.rst:1268 +#: ../../reference/datamodel.rst:1461 msgid "" "This attribute of code objects is deprecated, and may be removed in Python " "3.14." msgstr "" -#: ../../reference/datamodel.rst:1273 +#: ../../reference/datamodel.rst:1466 msgid "The required stack size of the code object" msgstr "" -#: ../../reference/datamodel.rst:1276 +#: ../../reference/datamodel.rst:1469 msgid "" "An :class:`integer ` encoding a number of flags for the interpreter." msgstr "" -#: ../../reference/datamodel.rst:1281 +#: ../../reference/datamodel.rst:1474 msgid "" "The following flag bits are defined for :attr:`~codeobject.co_flags`: bit " "``0x04`` is set if the function uses the ``*arguments`` syntax to accept an " @@ -1459,7 +1693,7 @@ msgid "" "might be present." msgstr "" -#: ../../reference/datamodel.rst:1289 +#: ../../reference/datamodel.rst:1482 msgid "" "Future feature declarations (``from __future__ import division``) also use " "bits in :attr:`~codeobject.co_flags` to indicate whether a code object was " @@ -1468,29 +1702,29 @@ msgid "" "``0x1000`` were used in earlier versions of Python." msgstr "" -#: ../../reference/datamodel.rst:1295 +#: ../../reference/datamodel.rst:1488 msgid "" "Other bits in :attr:`~codeobject.co_flags` are reserved for internal use." msgstr "" -#: ../../reference/datamodel.rst:1299 +#: ../../reference/datamodel.rst:1492 msgid "" "If a code object represents a function, the first item in :attr:`~codeobject." "co_consts` is the documentation string of the function, or ``None`` if " "undefined." msgstr "" -#: ../../reference/datamodel.rst:1304 +#: ../../reference/datamodel.rst:1497 msgid "Methods on code objects" msgstr "用於程式碼物件的方法" -#: ../../reference/datamodel.rst:1308 +#: ../../reference/datamodel.rst:1501 msgid "" "Returns an iterable over the source code positions of each :term:`bytecode` " "instruction in the code object." msgstr "" -#: ../../reference/datamodel.rst:1311 +#: ../../reference/datamodel.rst:1504 msgid "" "The iterator returns :class:`tuple`\\s containing the ``(start_line, " "end_line, start_column, end_column)``. The *i-th* tuple corresponds to the " @@ -1498,37 +1732,37 @@ msgid "" "information is 0-indexed utf-8 byte offsets on the given source line." msgstr "" -#: ../../reference/datamodel.rst:1317 +#: ../../reference/datamodel.rst:1510 msgid "" "This positional information can be missing. A non-exhaustive lists of cases " "where this may happen:" msgstr "" -#: ../../reference/datamodel.rst:1320 +#: ../../reference/datamodel.rst:1513 msgid "Running the interpreter with :option:`-X` ``no_debug_ranges``." msgstr "" -#: ../../reference/datamodel.rst:1321 +#: ../../reference/datamodel.rst:1514 msgid "" "Loading a pyc file compiled while using :option:`-X` ``no_debug_ranges``." msgstr "" -#: ../../reference/datamodel.rst:1322 +#: ../../reference/datamodel.rst:1515 msgid "Position tuples corresponding to artificial instructions." msgstr "" -#: ../../reference/datamodel.rst:1323 +#: ../../reference/datamodel.rst:1516 msgid "" "Line and column numbers that can't be represented due to implementation " "specific limitations." msgstr "" -#: ../../reference/datamodel.rst:1326 +#: ../../reference/datamodel.rst:1519 msgid "" "When this occurs, some or all of the tuple elements can be :const:`None`." msgstr "" -#: ../../reference/datamodel.rst:1332 +#: ../../reference/datamodel.rst:1525 msgid "" "This feature requires storing column positions in code objects which may " "result in a small increase of disk usage of compiled Python files or " @@ -1538,100 +1772,100 @@ msgid "" "environment variable can be used." msgstr "" -#: ../../reference/datamodel.rst:1341 +#: ../../reference/datamodel.rst:1534 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:1345 +#: ../../reference/datamodel.rst:1538 msgid "" "``start`` (an :class:`int`) represents the offset (inclusive) of the start " "of the :term:`bytecode` range" msgstr "" -#: ../../reference/datamodel.rst:1347 +#: ../../reference/datamodel.rst:1540 msgid "" "``end`` (an :class:`int`) represents the offset (exclusive) of the end of " "the :term:`bytecode` range" msgstr "" -#: ../../reference/datamodel.rst:1349 +#: ../../reference/datamodel.rst:1542 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:1353 +#: ../../reference/datamodel.rst:1546 msgid "The items yielded will have the following properties:" msgstr "" -#: ../../reference/datamodel.rst:1355 +#: ../../reference/datamodel.rst:1548 msgid "The first range yielded will have a ``start`` of 0." msgstr "" -#: ../../reference/datamodel.rst:1356 +#: ../../reference/datamodel.rst:1549 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:1359 +#: ../../reference/datamodel.rst:1552 msgid "No range will be backwards: ``end >= start`` for all triples." msgstr "" -#: ../../reference/datamodel.rst:1360 +#: ../../reference/datamodel.rst:1553 msgid "" "The last :class:`tuple` yielded will have ``end`` equal to the size of the :" "term:`bytecode`." msgstr "" -#: ../../reference/datamodel.rst:1363 +#: ../../reference/datamodel.rst:1556 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:1371 +#: ../../reference/datamodel.rst:1564 msgid ":pep:`626` - Precise line numbers for debugging and other tools." msgstr "" -#: ../../reference/datamodel.rst:1372 +#: ../../reference/datamodel.rst:1565 msgid "The PEP that introduced the :meth:`!co_lines` method." msgstr "" -#: ../../reference/datamodel.rst:1376 +#: ../../reference/datamodel.rst:1569 msgid "" "Return a copy of the code object with new values for the specified fields." msgstr "" -#: ../../reference/datamodel.rst:1378 +#: ../../reference/datamodel.rst:1571 msgid "" "Code objects are also supported by the generic function :func:`copy.replace`." msgstr "" -#: ../../reference/datamodel.rst:1386 +#: ../../reference/datamodel.rst:1579 msgid "Frame objects" msgstr "" -#: ../../reference/datamodel.rst:1390 +#: ../../reference/datamodel.rst:1583 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:1408 +#: ../../reference/datamodel.rst:1601 msgid "" "Points to the previous stack frame (towards the caller), or ``None`` if this " "is the bottom stack frame" msgstr "" -#: ../../reference/datamodel.rst:1412 +#: ../../reference/datamodel.rst:1605 msgid "" "The :ref:`code object ` being executed in this frame. " "Accessing this attribute raises an :ref:`auditing event ` ``object." @@ -1641,55 +1875,55 @@ msgstr "" "這個屬性會引發一個附帶引數 ``obj`` 與 ``\"f_code\"`` 的\\ :ref:`稽核事件 " "` ``object.__getattr__``。" -#: ../../reference/datamodel.rst:1417 +#: ../../reference/datamodel.rst:1610 msgid "" "The mapping used by the frame to look up :ref:`local variables `. If " "the frame refers to an :term:`optimized scope`, this may return a write-" "through proxy object." msgstr "" -#: ../../reference/datamodel.rst:1422 +#: ../../reference/datamodel.rst:1615 msgid "Return a proxy for optimized scopes." msgstr "" -#: ../../reference/datamodel.rst:1426 +#: ../../reference/datamodel.rst:1619 msgid "" "The dictionary used by the frame to look up :ref:`global variables `" msgstr "" -#: ../../reference/datamodel.rst:1430 +#: ../../reference/datamodel.rst:1623 msgid "" "The dictionary used by the frame to look up :ref:`built-in (intrinsic) names " "`" msgstr "" -#: ../../reference/datamodel.rst:1434 +#: ../../reference/datamodel.rst:1627 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:1450 +#: ../../reference/datamodel.rst:1643 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:1455 +#: ../../reference/datamodel.rst:1648 msgid "" "Set this attribute to :const:`False` to disable triggering a tracing event " "for each source line." msgstr "" -#: ../../reference/datamodel.rst:1459 +#: ../../reference/datamodel.rst:1652 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:1465 +#: ../../reference/datamodel.rst:1658 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 " @@ -1697,15 +1931,15 @@ msgid "" "this attribute." msgstr "" -#: ../../reference/datamodel.rst:1471 +#: ../../reference/datamodel.rst:1664 msgid "Frame object methods" msgstr "" -#: ../../reference/datamodel.rst:1473 +#: ../../reference/datamodel.rst:1666 msgid "Frame objects support one method:" msgstr "" -#: ../../reference/datamodel.rst:1477 +#: ../../reference/datamodel.rst:1670 msgid "" "This method clears all references to :ref:`local variables ` held by " "the frame. Also, if the frame belonged to a :term:`generator`, the " @@ -1714,34 +1948,34 @@ msgid "" "and storing its :ref:`traceback ` for later use)." msgstr "" -#: ../../reference/datamodel.rst:1483 +#: ../../reference/datamodel.rst:1676 msgid "" ":exc:`RuntimeError` is raised if the frame is currently executing or " "suspended." msgstr "" -#: ../../reference/datamodel.rst:1488 +#: ../../reference/datamodel.rst:1681 msgid "" "Attempting to clear a suspended frame raises :exc:`RuntimeError` (as has " "always been the case for executing frames)." msgstr "" -#: ../../reference/datamodel.rst:1496 +#: ../../reference/datamodel.rst:1689 msgid "Traceback objects" msgstr "" -#: ../../reference/datamodel.rst:1509 +#: ../../reference/datamodel.rst:1702 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:1514 +#: ../../reference/datamodel.rst:1707 msgid "Traceback objects can now be explicitly instantiated from Python code." msgstr "" -#: ../../reference/datamodel.rst:1517 +#: ../../reference/datamodel.rst:1710 msgid "" "For implicitly created tracebacks, when the search for an exception handler " "unwinds the execution stack, at each unwound level a traceback object is " @@ -1752,7 +1986,7 @@ msgid "" "the caught exception." msgstr "" -#: ../../reference/datamodel.rst:1526 +#: ../../reference/datamodel.rst:1719 msgid "" "When the program contains no suitable handler, the stack trace is written " "(nicely formatted) to the standard error stream; if the interpreter is " @@ -1760,19 +1994,19 @@ msgid "" "last_traceback`." msgstr "" -#: ../../reference/datamodel.rst:1531 +#: ../../reference/datamodel.rst:1724 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:1546 +#: ../../reference/datamodel.rst:1739 msgid "" "Points to the execution :ref:`frame ` of the current level." msgstr "" -#: ../../reference/datamodel.rst:1549 +#: ../../reference/datamodel.rst:1742 msgid "" "Accessing this attribute raises an :ref:`auditing event ` ``object." "__getattr__`` with arguments ``obj`` and ``\"tb_frame\"``." @@ -1780,15 +2014,15 @@ msgstr "" "存取此屬性會引發一個附帶引數 ``obj`` 與 ``\"tb_frame\"`` 的\\ :ref:`稽核事件 " "` ``object.__getattr__``。" -#: ../../reference/datamodel.rst:1554 +#: ../../reference/datamodel.rst:1747 msgid "Gives the line number where the exception occurred" msgstr "" -#: ../../reference/datamodel.rst:1557 +#: ../../reference/datamodel.rst:1750 msgid "Indicates the \"precise instruction\"." msgstr "" -#: ../../reference/datamodel.rst:1559 +#: ../../reference/datamodel.rst:1752 msgid "" "The line number and last instruction in the traceback may differ from the " "line number of its :ref:`frame object ` if the exception " @@ -1796,39 +2030,39 @@ msgid "" "with a :keyword:`finally` clause." msgstr "" -#: ../../reference/datamodel.rst:1570 +#: ../../reference/datamodel.rst:1763 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:1574 +#: ../../reference/datamodel.rst:1767 msgid "This attribute is now writable" msgstr "" -#: ../../reference/datamodel.rst:1579 +#: ../../reference/datamodel.rst:1772 msgid "Slice objects" msgstr "" -#: ../../reference/datamodel.rst:1583 +#: ../../reference/datamodel.rst:1776 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:1592 +#: ../../reference/datamodel.rst:1785 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:1596 +#: ../../reference/datamodel.rst:1789 msgid "Slice objects support one method:" msgstr "" -#: ../../reference/datamodel.rst:1600 +#: ../../reference/datamodel.rst:1793 msgid "" "This method takes a single integer argument *length* and computes " "information about the slice that the slice object would describe if applied " @@ -1838,11 +2072,11 @@ msgid "" "a manner consistent with regular slices." msgstr "" -#: ../../reference/datamodel.rst:1609 +#: ../../reference/datamodel.rst:1802 msgid "Static method objects" msgstr "" -#: ../../reference/datamodel.rst:1611 +#: ../../reference/datamodel.rst:1804 msgid "" "Static method objects provide a way of defeating the transformation of " "function objects to method objects described above. A static method object " @@ -1853,11 +2087,11 @@ msgid "" "method objects are created by the built-in :func:`staticmethod` constructor." msgstr "" -#: ../../reference/datamodel.rst:1621 +#: ../../reference/datamodel.rst:1814 msgid "Class method objects" msgstr "" -#: ../../reference/datamodel.rst:1623 +#: ../../reference/datamodel.rst:1816 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 " @@ -1867,11 +2101,11 @@ msgid "" "`classmethod` constructor." msgstr "" -#: ../../reference/datamodel.rst:1633 +#: ../../reference/datamodel.rst:1826 msgid "Special method names" msgstr "" -#: ../../reference/datamodel.rst:1639 +#: ../../reference/datamodel.rst:1832 msgid "" "A class can implement certain operations that are invoked by special syntax " "(such as arithmetic operations or subscripting and slicing) by defining " @@ -1885,7 +2119,7 @@ msgid "" "`TypeError`)." msgstr "" -#: ../../reference/datamodel.rst:1650 +#: ../../reference/datamodel.rst:1843 msgid "" "Setting a special method to ``None`` indicates that the corresponding " "operation is not available. For example, if a class sets :meth:`~object." @@ -1894,7 +2128,7 @@ msgid "" "`~object.__getitem__`). [#]_" msgstr "" -#: ../../reference/datamodel.rst:1656 +#: ../../reference/datamodel.rst:1849 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 " @@ -1904,11 +2138,11 @@ msgid "" "the W3C's Document Object Model.)" msgstr "" -#: ../../reference/datamodel.rst:1667 +#: ../../reference/datamodel.rst:1860 msgid "Basic customization" msgstr "" -#: ../../reference/datamodel.rst:1673 +#: ../../reference/datamodel.rst:1866 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 " @@ -1918,7 +2152,7 @@ msgid "" "new object instance (usually an instance of *cls*)." msgstr "" -#: ../../reference/datamodel.rst:1680 +#: ../../reference/datamodel.rst:1873 msgid "" "Typical implementations create a new instance of the class by invoking the " "superclass's :meth:`__new__` method using ``super().__new__(cls[, ...])`` " @@ -1926,7 +2160,7 @@ msgid "" "necessary before returning it." msgstr "" -#: ../../reference/datamodel.rst:1685 +#: ../../reference/datamodel.rst:1878 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 " @@ -1935,13 +2169,13 @@ msgid "" "constructor." msgstr "" -#: ../../reference/datamodel.rst:1690 +#: ../../reference/datamodel.rst:1883 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:1693 +#: ../../reference/datamodel.rst:1886 msgid "" ":meth:`__new__` is intended mainly to allow subclasses of immutable types " "(like int, str, or tuple) to customize instance creation. It is also " @@ -1949,7 +2183,7 @@ msgid "" "creation." msgstr "" -#: ../../reference/datamodel.rst:1702 +#: ../../reference/datamodel.rst:1895 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 " @@ -1959,7 +2193,7 @@ msgid "" "example: ``super().__init__([args...])``." msgstr "" -#: ../../reference/datamodel.rst:1709 +#: ../../reference/datamodel.rst:1902 msgid "" "Because :meth:`__new__` and :meth:`__init__` work together in constructing " "objects (:meth:`__new__` to create it, and :meth:`__init__` to customize " @@ -1967,7 +2201,7 @@ msgid "" "will cause a :exc:`TypeError` to be raised at runtime." msgstr "" -#: ../../reference/datamodel.rst:1722 +#: ../../reference/datamodel.rst:1915 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:" @@ -1976,7 +2210,7 @@ msgid "" "instance." msgstr "" -#: ../../reference/datamodel.rst:1728 +#: ../../reference/datamodel.rst:1921 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. " @@ -1986,7 +2220,7 @@ msgid "" "it once." msgstr "" -#: ../../reference/datamodel.rst:1735 +#: ../../reference/datamodel.rst:1928 msgid "" "It is not guaranteed that :meth:`__del__` methods are called for objects " "that still exist when the interpreter exits. :class:`weakref.finalize` " @@ -1994,14 +2228,14 @@ msgid "" "when an object is garbage collected." msgstr "" -#: ../../reference/datamodel.rst:1742 +#: ../../reference/datamodel.rst:1935 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:1747 +#: ../../reference/datamodel.rst:1940 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 " @@ -2012,18 +2246,18 @@ msgid "" "caught in the traceback." msgstr "" -#: ../../reference/datamodel.rst:1757 +#: ../../reference/datamodel.rst:1950 msgid "Documentation for the :mod:`gc` module." msgstr "" -#: ../../reference/datamodel.rst:1761 +#: ../../reference/datamodel.rst:1954 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:1765 +#: ../../reference/datamodel.rst:1958 msgid "" ":meth:`__del__` can be invoked when arbitrary code is being executed, " "including from any arbitrary thread. If :meth:`__del__` needs to take a " @@ -2032,7 +2266,7 @@ msgid "" "`__del__`." msgstr "" -#: ../../reference/datamodel.rst:1771 +#: ../../reference/datamodel.rst:1964 msgid "" ":meth:`__del__` can be executed during interpreter shutdown. As a " "consequence, the global variables it needs to access (including other " @@ -2043,7 +2277,7 @@ msgid "" "still available at the time when the :meth:`__del__` method is called." msgstr "" -#: ../../reference/datamodel.rst:1786 +#: ../../reference/datamodel.rst:1979 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 " @@ -2055,13 +2289,13 @@ msgid "" "an \"informal\" string representation of instances of that class is required." msgstr "" -#: ../../reference/datamodel.rst:1795 +#: ../../reference/datamodel.rst:1988 msgid "" "This is typically used for debugging, so it is important that the " "representation is information-rich and unambiguous." msgstr "" -#: ../../reference/datamodel.rst:1806 +#: ../../reference/datamodel.rst:1999 msgid "" "Called by :func:`str(object) ` and the built-in functions :func:" "`format` and :func:`print` to compute the \"informal\" or nicely printable " @@ -2069,26 +2303,26 @@ msgid "" "` object." msgstr "" -#: ../../reference/datamodel.rst:1811 +#: ../../reference/datamodel.rst:2004 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:1815 +#: ../../reference/datamodel.rst:2008 msgid "" "The default implementation defined by the built-in type :class:`object` " "calls :meth:`object.__repr__`." msgstr "" -#: ../../reference/datamodel.rst:1825 +#: ../../reference/datamodel.rst:2018 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:1836 +#: ../../reference/datamodel.rst:2029 msgid "" "Called by the :func:`format` built-in function, and by extension, evaluation " "of :ref:`formatted string literals ` and the :meth:`str.format` " @@ -2100,28 +2334,28 @@ msgid "" "formatting option syntax." msgstr "" -#: ../../reference/datamodel.rst:1846 +#: ../../reference/datamodel.rst:2039 msgid "" "See :ref:`formatspec` for a description of the standard formatting syntax." msgstr "" -#: ../../reference/datamodel.rst:1848 +#: ../../reference/datamodel.rst:2041 msgid "The return value must be a string object." msgstr "" -#: ../../reference/datamodel.rst:1850 +#: ../../reference/datamodel.rst:2043 msgid "" "The __format__ method of ``object`` itself raises a :exc:`TypeError` if " "passed any non-empty string." msgstr "" -#: ../../reference/datamodel.rst:1854 +#: ../../reference/datamodel.rst:2047 msgid "" "``object.__format__(x, '')`` is now equivalent to ``str(x)`` rather than " "``format(str(x), '')``." msgstr "" -#: ../../reference/datamodel.rst:1870 +#: ../../reference/datamodel.rst:2063 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:1962 +#: ../../reference/datamodel.rst:2155 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 " @@ -2255,7 +2489,7 @@ msgid "" "``isinstance(obj, collections.abc.Hashable)`` call." msgstr "" -#: ../../reference/datamodel.rst:1971 +#: ../../reference/datamodel.rst:2164 msgid "" "By default, the :meth:`__hash__` values of str and bytes objects are " "\"salted\" with an unpredictable random value. Although they remain " @@ -2263,7 +2497,7 @@ msgid "" "between repeated invocations of Python." msgstr "" -#: ../../reference/datamodel.rst:1976 +#: ../../reference/datamodel.rst:2169 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 " @@ -2271,22 +2505,22 @@ msgid "" "advisories/ocert-2011-003.html for details." msgstr "" -#: ../../reference/datamodel.rst:1981 +#: ../../reference/datamodel.rst:2174 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:1985 +#: ../../reference/datamodel.rst:2178 msgid "See also :envvar:`PYTHONHASHSEED`." msgstr "另請參閱 :envvar:`PYTHONHASHSEED`。" -#: ../../reference/datamodel.rst:1987 +#: ../../reference/datamodel.rst:2180 msgid "Hash randomization is enabled by default." msgstr "" -#: ../../reference/datamodel.rst:1995 +#: ../../reference/datamodel.rst:2188 msgid "" "Called to implement truth value testing and the built-in operation " "``bool()``; should return ``False`` or ``True``. When this method is not " @@ -2295,18 +2529,18 @@ msgid "" "meth:`!__len__` nor :meth:`!__bool__`, all its instances are considered true." msgstr "" -#: ../../reference/datamodel.rst:2006 +#: ../../reference/datamodel.rst:2199 msgid "Customizing attribute access" msgstr "" -#: ../../reference/datamodel.rst:2008 +#: ../../reference/datamodel.rst:2201 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:2016 +#: ../../reference/datamodel.rst:2209 msgid "" "Called when the default attribute access fails with an :exc:`AttributeError` " "(either :meth:`__getattribute__` raises an :exc:`AttributeError` because " @@ -2316,7 +2550,7 @@ msgid "" "attribute value or raise an :exc:`AttributeError` exception." msgstr "" -#: ../../reference/datamodel.rst:2023 +#: ../../reference/datamodel.rst:2216 msgid "" "Note that if the attribute is found through the normal mechanism, :meth:" "`__getattr__` is not called. (This is an intentional asymmetry between :" @@ -2329,7 +2563,7 @@ msgid "" "actually get total control over attribute access." msgstr "" -#: ../../reference/datamodel.rst:2036 +#: ../../reference/datamodel.rst:2229 msgid "" "Called unconditionally to implement attribute accesses for instances of the " "class. If the class also defines :meth:`__getattr__`, the latter will not be " @@ -2341,64 +2575,64 @@ msgid "" "example, ``object.__getattribute__(self, name)``." msgstr "" -#: ../../reference/datamodel.rst:2047 +#: ../../reference/datamodel.rst:2240 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:2052 ../../reference/datamodel.rst:2054 +#: ../../reference/datamodel.rst:2245 ../../reference/datamodel.rst:2247 msgid "" "For certain sensitive attribute accesses, raises an :ref:`auditing event " "` ``object.__getattr__`` with arguments ``obj`` and ``name``." msgstr "" -#: ../../reference/datamodel.rst:2061 +#: ../../reference/datamodel.rst:2254 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:2065 +#: ../../reference/datamodel.rst:2258 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:2069 ../../reference/datamodel.rst:2071 +#: ../../reference/datamodel.rst:2262 ../../reference/datamodel.rst:2264 msgid "" "For certain sensitive attribute assignments, raises an :ref:`auditing event " "` ``object.__setattr__`` with arguments ``obj``, ``name``, " "``value``." msgstr "" -#: ../../reference/datamodel.rst:2078 +#: ../../reference/datamodel.rst:2271 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:2081 ../../reference/datamodel.rst:2083 +#: ../../reference/datamodel.rst:2274 ../../reference/datamodel.rst:2276 msgid "" "For certain sensitive attribute deletions, raises an :ref:`auditing event " "` ``object.__delattr__`` with arguments ``obj`` and ``name``." msgstr "" -#: ../../reference/datamodel.rst:2090 +#: ../../reference/datamodel.rst:2283 msgid "" "Called when :func:`dir` is called on the object. An iterable must be " "returned. :func:`dir` converts the returned iterable to a list and sorts it." msgstr "" -#: ../../reference/datamodel.rst:2095 +#: ../../reference/datamodel.rst:2288 msgid "Customizing module attribute access" msgstr "" -#: ../../reference/datamodel.rst:2102 +#: ../../reference/datamodel.rst:2295 msgid "" "Special names ``__getattr__`` and ``__dir__`` can be also used to customize " "access to module attributes. The ``__getattr__`` function at the module " @@ -2410,21 +2644,21 @@ msgid "" "with the attribute name and the result is returned." msgstr "" -#: ../../reference/datamodel.rst:2111 +#: ../../reference/datamodel.rst:2304 msgid "" "The ``__dir__`` function should accept no arguments, and return an iterable " "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:2115 +#: ../../reference/datamodel.rst:2308 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:2119 +#: ../../reference/datamodel.rst:2312 msgid "" "import sys\n" "from types import ModuleType\n" @@ -2452,7 +2686,7 @@ msgstr "" "\n" "sys.modules[__name__].__class__ = VerboseModule" -#: ../../reference/datamodel.rst:2133 +#: ../../reference/datamodel.rst:2326 msgid "" "Defining module ``__getattr__`` and setting module ``__class__`` only affect " "lookups made using the attribute access syntax -- directly accessing the " @@ -2460,27 +2694,27 @@ msgid "" "module's globals dictionary) is unaffected." msgstr "" -#: ../../reference/datamodel.rst:2138 +#: ../../reference/datamodel.rst:2331 msgid "``__class__`` module attribute is now writable." msgstr "" -#: ../../reference/datamodel.rst:2141 +#: ../../reference/datamodel.rst:2334 msgid "``__getattr__`` and ``__dir__`` module attributes." msgstr "" -#: ../../reference/datamodel.rst:2146 +#: ../../reference/datamodel.rst:2339 msgid ":pep:`562` - Module __getattr__ and __dir__" msgstr ":pep:`562` - 模組 __getattr__ 和 __dir__" -#: ../../reference/datamodel.rst:2147 +#: ../../reference/datamodel.rst:2340 msgid "Describes the ``__getattr__`` and ``__dir__`` functions on modules." msgstr "" -#: ../../reference/datamodel.rst:2153 +#: ../../reference/datamodel.rst:2346 msgid "Implementing Descriptors" msgstr "" -#: ../../reference/datamodel.rst:2155 +#: ../../reference/datamodel.rst:2348 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 " @@ -2490,7 +2724,7 @@ msgid "" "the owner class' :attr:`~object.__dict__`." msgstr "" -#: ../../reference/datamodel.rst:2165 +#: ../../reference/datamodel.rst:2358 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 " @@ -2499,13 +2733,13 @@ msgid "" "accessed through the *owner*." msgstr "" -#: ../../reference/datamodel.rst:2171 +#: ../../reference/datamodel.rst:2364 msgid "" "This method should return the computed attribute value or raise an :exc:" "`AttributeError` exception." msgstr "" -#: ../../reference/datamodel.rst:2174 +#: ../../reference/datamodel.rst:2367 msgid "" ":PEP:`252` specifies that :meth:`__get__` is callable with one or two " "arguments. Python's own built-in descriptors support this specification; " @@ -2515,31 +2749,31 @@ msgid "" "not." msgstr "" -#: ../../reference/datamodel.rst:2183 +#: ../../reference/datamodel.rst:2376 msgid "" "Called to set the attribute on an instance *instance* of the owner class to " "a new value, *value*." msgstr "" -#: ../../reference/datamodel.rst:2186 +#: ../../reference/datamodel.rst:2379 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:2192 +#: ../../reference/datamodel.rst:2385 msgid "" "Called to delete the attribute on an instance *instance* of the owner class." msgstr "" -#: ../../reference/datamodel.rst:2194 +#: ../../reference/datamodel.rst:2387 msgid "" "Instances of descriptors may also have the :attr:`!__objclass__` attribute " "present:" msgstr "" -#: ../../reference/datamodel.rst:2199 +#: ../../reference/datamodel.rst:2392 msgid "" "The attribute :attr:`!__objclass__` is interpreted by the :mod:`inspect` " "module as specifying the class where this object was defined (setting this " @@ -2550,11 +2784,11 @@ msgid "" "are implemented in C)." msgstr "" -#: ../../reference/datamodel.rst:2210 +#: ../../reference/datamodel.rst:2403 msgid "Invoking Descriptors" msgstr "" -#: ../../reference/datamodel.rst:2212 +#: ../../reference/datamodel.rst:2405 msgid "" "In general, a descriptor is an object attribute with \"binding behavior\", " "one whose attribute access has been overridden by methods in the descriptor " @@ -2563,7 +2797,7 @@ msgid "" "is said to be a descriptor." msgstr "" -#: ../../reference/datamodel.rst:2218 +#: ../../reference/datamodel.rst:2411 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 " @@ -2571,7 +2805,7 @@ msgid "" "continuing through the base classes of ``type(a)`` excluding metaclasses." msgstr "" -#: ../../reference/datamodel.rst:2223 +#: ../../reference/datamodel.rst:2416 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 " @@ -2579,54 +2813,54 @@ msgid "" "depends on which descriptor methods were defined and how they were called." msgstr "" -#: ../../reference/datamodel.rst:2228 +#: ../../reference/datamodel.rst:2421 msgid "" "The starting point for descriptor invocation is a binding, ``a.x``. How the " "arguments are assembled depends on ``a``:" msgstr "" -#: ../../reference/datamodel.rst:2231 +#: ../../reference/datamodel.rst:2424 msgid "Direct Call" msgstr "" -#: ../../reference/datamodel.rst:2232 +#: ../../reference/datamodel.rst:2425 msgid "" "The simplest and least common call is when user code directly invokes a " "descriptor method: ``x.__get__(a)``." msgstr "" -#: ../../reference/datamodel.rst:2235 +#: ../../reference/datamodel.rst:2428 msgid "Instance Binding" msgstr "" -#: ../../reference/datamodel.rst:2236 +#: ../../reference/datamodel.rst:2429 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:2239 +#: ../../reference/datamodel.rst:2432 msgid "Class Binding" msgstr "" -#: ../../reference/datamodel.rst:2240 +#: ../../reference/datamodel.rst:2433 msgid "" "If binding to a class, ``A.x`` is transformed into the call: ``A." "__dict__['x'].__get__(None, A)``." msgstr "" -#: ../../reference/datamodel.rst:2243 +#: ../../reference/datamodel.rst:2436 msgid "Super Binding" msgstr "" -#: ../../reference/datamodel.rst:2244 +#: ../../reference/datamodel.rst:2437 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:2281 +#: ../../reference/datamodel.rst:2474 msgid "" "For instance bindings, the precedence of descriptor invocation depends on " "which descriptor methods are defined. A descriptor can define any " @@ -2644,7 +2878,7 @@ msgid "" "instances." msgstr "" -#: ../../reference/datamodel.rst:2296 +#: ../../reference/datamodel.rst:2489 msgid "" "Python methods (including those decorated with :func:`@staticmethod " "` and :func:`@classmethod `) are implemented as " @@ -2653,30 +2887,30 @@ msgid "" "from other instances of the same class." msgstr "" -#: ../../reference/datamodel.rst:2302 +#: ../../reference/datamodel.rst:2495 msgid "" "The :func:`property` function is implemented as a data descriptor. " "Accordingly, instances cannot override the behavior of a property." msgstr "" -#: ../../reference/datamodel.rst:2309 +#: ../../reference/datamodel.rst:2502 msgid "__slots__" msgstr "__slots__" -#: ../../reference/datamodel.rst:2311 +#: ../../reference/datamodel.rst:2504 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:2315 +#: ../../reference/datamodel.rst:2508 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:2320 +#: ../../reference/datamodel.rst:2513 msgid "" "This class variable can be assigned a string, iterable, or sequence of " "strings with variable names used by instances. *__slots__* reserves space " @@ -2684,18 +2918,18 @@ msgid "" "`~object.__dict__` and *__weakref__* for each instance." msgstr "" -#: ../../reference/datamodel.rst:2329 +#: ../../reference/datamodel.rst:2522 msgid "Notes on using *__slots__*:" msgstr "" -#: ../../reference/datamodel.rst:2331 +#: ../../reference/datamodel.rst:2524 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:2335 +#: ../../reference/datamodel.rst:2528 msgid "" "Without a :attr:`~object.__dict__` variable, instances cannot be assigned " "new variables not listed in the *__slots__* definition. Attempts to assign " @@ -2704,7 +2938,7 @@ msgid "" "sequence of strings in the *__slots__* declaration." msgstr "" -#: ../../reference/datamodel.rst:2342 +#: ../../reference/datamodel.rst:2535 msgid "" "Without a *__weakref__* variable for each instance, classes defining " "*__slots__* do not support :mod:`weak references ` to its " @@ -2712,7 +2946,7 @@ msgid "" "to the sequence of strings in the *__slots__* declaration." msgstr "" -#: ../../reference/datamodel.rst:2348 +#: ../../reference/datamodel.rst:2541 msgid "" "*__slots__* are implemented at the class level by creating :ref:`descriptors " "` for each variable name. As a result, class attributes cannot " @@ -2720,7 +2954,7 @@ msgid "" "otherwise, the class attribute would overwrite the descriptor assignment." msgstr "" -#: ../../reference/datamodel.rst:2354 +#: ../../reference/datamodel.rst:2547 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. " @@ -2729,7 +2963,7 @@ msgid "" "only contain names of any *additional* slots)." msgstr "" -#: ../../reference/datamodel.rst:2360 +#: ../../reference/datamodel.rst:2553 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 " @@ -2738,7 +2972,7 @@ msgid "" "prevent this." msgstr "" -#: ../../reference/datamodel.rst:2365 +#: ../../reference/datamodel.rst:2558 msgid "" ":exc:`TypeError` will be raised if nonempty *__slots__* are defined for a " "class derived from a :c:member:`\"variable-length\" built-in type " @@ -2746,11 +2980,11 @@ msgid "" "`tuple`." msgstr "" -#: ../../reference/datamodel.rst:2370 +#: ../../reference/datamodel.rst:2563 msgid "Any non-string :term:`iterable` may be assigned to *__slots__*." msgstr "" -#: ../../reference/datamodel.rst:2372 +#: ../../reference/datamodel.rst:2565 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 " @@ -2758,13 +2992,13 @@ msgid "" "func:`inspect.getdoc` and displayed in the output of :func:`help`." msgstr "" -#: ../../reference/datamodel.rst:2377 +#: ../../reference/datamodel.rst:2570 msgid "" ":attr:`~object.__class__` assignment works only if both classes have the " "same *__slots__*." msgstr "" -#: ../../reference/datamodel.rst:2380 +#: ../../reference/datamodel.rst:2573 msgid "" ":ref:`Multiple inheritance ` with multiple slotted parent " "classes can be used, but only one parent is allowed to have attributes " @@ -2772,18 +3006,18 @@ msgid "" "raise :exc:`TypeError`." msgstr "" -#: ../../reference/datamodel.rst:2386 +#: ../../reference/datamodel.rst:2579 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:2394 +#: ../../reference/datamodel.rst:2587 msgid "Customizing class creation" msgstr "" -#: ../../reference/datamodel.rst:2396 +#: ../../reference/datamodel.rst:2589 msgid "" "Whenever a class inherits from another class, :meth:`~object." "__init_subclass__` is called on the parent class. This way, it is possible " @@ -2793,14 +3027,14 @@ msgid "" "future subclasses of the class defining the method." msgstr "" -#: ../../reference/datamodel.rst:2405 +#: ../../reference/datamodel.rst:2598 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:2409 +#: ../../reference/datamodel.rst:2602 msgid "" "Keyword arguments which are given to a new class are passed to the parent " "class's ``__init_subclass__``. For compatibility with other classes using " @@ -2808,7 +3042,7 @@ msgid "" "pass the others over to the base class, as in::" msgstr "" -#: ../../reference/datamodel.rst:2415 +#: ../../reference/datamodel.rst:2608 msgid "" "class Philosopher:\n" " def __init_subclass__(cls, /, default_name, **kwargs):\n" @@ -2826,13 +3060,13 @@ msgstr "" "class AustralianPhilosopher(Philosopher, default_name=\"Bruce\"):\n" " pass" -#: ../../reference/datamodel.rst:2423 +#: ../../reference/datamodel.rst:2616 msgid "" "The default implementation ``object.__init_subclass__`` does nothing, but " "raises an error if it is called with any arguments." msgstr "" -#: ../../reference/datamodel.rst:2428 +#: ../../reference/datamodel.rst:2621 msgid "" "The metaclass hint ``metaclass`` is consumed by the rest of the type " "machinery, and is never passed to ``__init_subclass__`` implementations. The " @@ -2840,19 +3074,19 @@ msgid "" "``type(cls)``." msgstr "" -#: ../../reference/datamodel.rst:2436 +#: ../../reference/datamodel.rst:2629 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:2441 +#: ../../reference/datamodel.rst:2634 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:2444 +#: ../../reference/datamodel.rst:2637 msgid "" "class A:\n" " x = C() # Automatically calls: x.__set_name__(A, 'x')" @@ -2860,14 +3094,14 @@ msgstr "" "class A:\n" " x = C() # 自動呼叫:x.__set_name__(A, 'x')" -#: ../../reference/datamodel.rst:2447 +#: ../../reference/datamodel.rst:2640 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:2451 +#: ../../reference/datamodel.rst:2644 msgid "" "class A:\n" " pass\n" @@ -2877,22 +3111,22 @@ msgid "" "c.__set_name__(A, 'x') # Manually invoke the hook" msgstr "" -#: ../../reference/datamodel.rst:2458 +#: ../../reference/datamodel.rst:2651 msgid "See :ref:`class-object-creation` for more details." msgstr "更多細節請見 :ref:`class-object-creation`。" -#: ../../reference/datamodel.rst:2466 +#: ../../reference/datamodel.rst:2659 msgid "Metaclasses" msgstr "" -#: ../../reference/datamodel.rst:2473 +#: ../../reference/datamodel.rst:2666 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:2477 +#: ../../reference/datamodel.rst:2670 msgid "" "The class creation process can be customized by passing the ``metaclass`` " "keyword argument in the class definition line, or by inheriting from an " @@ -2900,7 +3134,7 @@ msgid "" "both ``MyClass`` and ``MySubclass`` are instances of ``Meta``::" msgstr "" -#: ../../reference/datamodel.rst:2482 +#: ../../reference/datamodel.rst:2675 msgid "" "class Meta(type):\n" " pass\n" @@ -2920,41 +3154,41 @@ msgstr "" "class MySubclass(MyClass):\n" " pass" -#: ../../reference/datamodel.rst:2491 +#: ../../reference/datamodel.rst:2684 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:2494 +#: ../../reference/datamodel.rst:2687 msgid "When a class definition is executed, the following steps occur:" msgstr "" -#: ../../reference/datamodel.rst:2496 +#: ../../reference/datamodel.rst:2689 msgid "MRO entries are resolved;" msgstr "" -#: ../../reference/datamodel.rst:2497 +#: ../../reference/datamodel.rst:2690 msgid "the appropriate metaclass is determined;" msgstr "" -#: ../../reference/datamodel.rst:2498 +#: ../../reference/datamodel.rst:2691 msgid "the class namespace is prepared;" msgstr "" -#: ../../reference/datamodel.rst:2499 +#: ../../reference/datamodel.rst:2692 msgid "the class body is executed;" msgstr "" -#: ../../reference/datamodel.rst:2500 +#: ../../reference/datamodel.rst:2693 msgid "the class object is created." msgstr "" -#: ../../reference/datamodel.rst:2504 +#: ../../reference/datamodel.rst:2697 msgid "Resolving MRO entries" msgstr "" -#: ../../reference/datamodel.rst:2508 +#: ../../reference/datamodel.rst:2701 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 " @@ -2966,59 +3200,59 @@ msgid "" "is ignored." msgstr "" -#: ../../reference/datamodel.rst:2519 +#: ../../reference/datamodel.rst:2712 msgid ":func:`types.resolve_bases`" msgstr ":func:`types.resolve_bases`" -#: ../../reference/datamodel.rst:2520 +#: ../../reference/datamodel.rst:2713 msgid "Dynamically resolve bases that are not instances of :class:`type`." msgstr "" -#: ../../reference/datamodel.rst:2522 +#: ../../reference/datamodel.rst:2715 msgid ":func:`types.get_original_bases`" msgstr ":func:`types.get_original_bases`" -#: ../../reference/datamodel.rst:2523 +#: ../../reference/datamodel.rst:2716 msgid "" "Retrieve a class's \"original bases\" prior to modifications by :meth:" "`~object.__mro_entries__`." msgstr "" -#: ../../reference/datamodel.rst:2526 +#: ../../reference/datamodel.rst:2719 msgid ":pep:`560`" msgstr ":pep:`560`" -#: ../../reference/datamodel.rst:2527 +#: ../../reference/datamodel.rst:2720 msgid "Core support for typing module and generic types." msgstr "" -#: ../../reference/datamodel.rst:2531 +#: ../../reference/datamodel.rst:2724 msgid "Determining the appropriate metaclass" msgstr "" -#: ../../reference/datamodel.rst:2535 +#: ../../reference/datamodel.rst:2728 msgid "" "The appropriate metaclass for a class definition is determined as follows:" msgstr "" -#: ../../reference/datamodel.rst:2537 +#: ../../reference/datamodel.rst:2730 msgid "" "if no bases and no explicit metaclass are given, then :func:`type` is used;" msgstr "" -#: ../../reference/datamodel.rst:2538 +#: ../../reference/datamodel.rst:2731 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:2540 +#: ../../reference/datamodel.rst:2733 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:2543 +#: ../../reference/datamodel.rst:2736 msgid "" "The most derived metaclass is selected from the explicitly specified " "metaclass (if any) and the metaclasses (i.e. ``type(cls)``) of all specified " @@ -3027,11 +3261,11 @@ msgid "" "that criterion, then the class definition will fail with ``TypeError``." msgstr "" -#: ../../reference/datamodel.rst:2553 +#: ../../reference/datamodel.rst:2746 msgid "Preparing the class namespace" msgstr "" -#: ../../reference/datamodel.rst:2558 +#: ../../reference/datamodel.rst:2751 msgid "" "Once the appropriate metaclass has been identified, then the class namespace " "is prepared. If the metaclass has a ``__prepare__`` attribute, it is called " @@ -3043,25 +3277,25 @@ msgid "" "copied into a new ``dict``." msgstr "" -#: ../../reference/datamodel.rst:2567 +#: ../../reference/datamodel.rst:2760 msgid "" "If the metaclass has no ``__prepare__`` attribute, then the class namespace " "is initialised as an empty ordered mapping." msgstr "" -#: ../../reference/datamodel.rst:2572 +#: ../../reference/datamodel.rst:2765 msgid ":pep:`3115` - Metaclasses in Python 3000" msgstr "" -#: ../../reference/datamodel.rst:2573 +#: ../../reference/datamodel.rst:2766 msgid "Introduced the ``__prepare__`` namespace hook" msgstr "" -#: ../../reference/datamodel.rst:2577 +#: ../../reference/datamodel.rst:2770 msgid "Executing the class body" msgstr "" -#: ../../reference/datamodel.rst:2582 +#: ../../reference/datamodel.rst:2775 msgid "" "The class body is executed (approximately) as ``exec(body, globals(), " "namespace)``. The key difference from a normal call to :func:`exec` is that " @@ -3070,7 +3304,7 @@ msgid "" "inside a function." msgstr "" -#: ../../reference/datamodel.rst:2588 +#: ../../reference/datamodel.rst:2781 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. " @@ -3079,11 +3313,11 @@ msgid "" "reference described in the next section." msgstr "" -#: ../../reference/datamodel.rst:2597 +#: ../../reference/datamodel.rst:2790 msgid "Creating the class object" msgstr "" -#: ../../reference/datamodel.rst:2604 +#: ../../reference/datamodel.rst:2797 msgid "" "Once the class namespace has been populated by executing the class body, the " "class object is created by calling ``metaclass(name, bases, namespace, " @@ -3091,7 +3325,7 @@ msgid "" "to ``__prepare__``)." msgstr "" -#: ../../reference/datamodel.rst:2609 +#: ../../reference/datamodel.rst:2802 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 " @@ -3102,7 +3336,7 @@ msgid "" "is identified based on the first argument passed to the method." msgstr "" -#: ../../reference/datamodel.rst:2619 +#: ../../reference/datamodel.rst:2812 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 " @@ -3111,39 +3345,39 @@ msgid "" "in Python 3.8." msgstr "" -#: ../../reference/datamodel.rst:2625 +#: ../../reference/datamodel.rst:2818 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:2629 +#: ../../reference/datamodel.rst:2822 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:2631 +#: ../../reference/datamodel.rst:2824 msgid "" "Those ``__set_name__`` methods are called with the class being defined and " "the assigned name of that particular attribute;" msgstr "" -#: ../../reference/datamodel.rst:2633 +#: ../../reference/datamodel.rst:2826 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:2636 +#: ../../reference/datamodel.rst:2829 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:2640 +#: ../../reference/datamodel.rst:2833 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 " @@ -3151,19 +3385,19 @@ msgid "" "becomes the :attr:`~type.__dict__` attribute of the class object." msgstr "" -#: ../../reference/datamodel.rst:2647 +#: ../../reference/datamodel.rst:2840 msgid ":pep:`3135` - New super" msgstr "" -#: ../../reference/datamodel.rst:2648 +#: ../../reference/datamodel.rst:2841 msgid "Describes the implicit ``__class__`` closure reference" msgstr "" -#: ../../reference/datamodel.rst:2652 +#: ../../reference/datamodel.rst:2845 msgid "Uses for metaclasses" msgstr "" -#: ../../reference/datamodel.rst:2654 +#: ../../reference/datamodel.rst:2847 msgid "" "The potential uses for metaclasses are boundless. Some ideas that have been " "explored include enum, logging, interface checking, automatic delegation, " @@ -3171,17 +3405,17 @@ msgid "" "locking/synchronization." msgstr "" -#: ../../reference/datamodel.rst:2661 +#: ../../reference/datamodel.rst:2854 msgid "Customizing instance and subclass checks" msgstr "" -#: ../../reference/datamodel.rst:2663 +#: ../../reference/datamodel.rst:2856 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:2666 +#: ../../reference/datamodel.rst:2859 msgid "" "In particular, the metaclass :class:`abc.ABCMeta` implements these methods " "in order to allow the addition of Abstract Base Classes (ABCs) as \"virtual " @@ -3189,21 +3423,21 @@ msgid "" "other ABCs." msgstr "" -#: ../../reference/datamodel.rst:2673 +#: ../../reference/datamodel.rst:2866 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:2680 +#: ../../reference/datamodel.rst:2873 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:2685 +#: ../../reference/datamodel.rst:2878 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 " @@ -3211,11 +3445,11 @@ msgid "" "only in this case the instance is itself a class." msgstr "" -#: ../../reference/datamodel.rst:2692 +#: ../../reference/datamodel.rst:2885 msgid ":pep:`3119` - Introducing Abstract Base Classes" msgstr "" -#: ../../reference/datamodel.rst:2693 +#: ../../reference/datamodel.rst:2886 msgid "" "Includes the specification for customizing :func:`isinstance` and :func:" "`issubclass` behavior through :meth:`~type.__instancecheck__` and :meth:" @@ -3224,11 +3458,11 @@ msgid "" "language." msgstr "" -#: ../../reference/datamodel.rst:2701 +#: ../../reference/datamodel.rst:2894 msgid "Emulating generic types" msgstr "" -#: ../../reference/datamodel.rst:2703 +#: ../../reference/datamodel.rst:2896 msgid "" "When using :term:`type annotations`, it is often useful to " "*parameterize* a :term:`generic type` using Python's square-brackets " @@ -3236,65 +3470,65 @@ msgid "" "a :class:`list` in which all the elements are of type :class:`int`." msgstr "" -#: ../../reference/datamodel.rst:2710 +#: ../../reference/datamodel.rst:2903 msgid ":pep:`484` - Type Hints" msgstr "" -#: ../../reference/datamodel.rst:2711 +#: ../../reference/datamodel.rst:2904 msgid "Introducing Python's framework for type annotations" msgstr "" -#: ../../reference/datamodel.rst:2713 +#: ../../reference/datamodel.rst:2906 msgid ":ref:`Generic Alias Types`" msgstr ":ref:`泛型別名型別 `" -#: ../../reference/datamodel.rst:2714 +#: ../../reference/datamodel.rst:2907 msgid "Documentation for objects representing parameterized generic classes" msgstr "" -#: ../../reference/datamodel.rst:2716 +#: ../../reference/datamodel.rst:2909 msgid "" ":ref:`Generics`, :ref:`user-defined generics` and :" "class:`typing.Generic`" msgstr "" -#: ../../reference/datamodel.rst:2717 +#: ../../reference/datamodel.rst:2910 msgid "" "Documentation on how to implement generic classes that can be parameterized " "at runtime and understood by static type-checkers." msgstr "" -#: ../../reference/datamodel.rst:2720 +#: ../../reference/datamodel.rst:2913 msgid "" "A class can *generally* only be parameterized if it defines the special " "class method ``__class_getitem__()``." msgstr "" -#: ../../reference/datamodel.rst:2725 +#: ../../reference/datamodel.rst:2918 msgid "" "Return an object representing the specialization of a generic class by type " "arguments found in *key*." msgstr "" -#: ../../reference/datamodel.rst:2728 +#: ../../reference/datamodel.rst:2921 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:2734 +#: ../../reference/datamodel.rst:2927 msgid "The purpose of *__class_getitem__*" msgstr "" -#: ../../reference/datamodel.rst:2736 +#: ../../reference/datamodel.rst:2929 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:2740 +#: ../../reference/datamodel.rst:2933 msgid "" "To implement custom generic classes that can be parameterized at runtime and " "understood by static type-checkers, users should either inherit from a " @@ -3303,7 +3537,7 @@ msgid "" "own implementation of ``__class_getitem__()``." msgstr "" -#: ../../reference/datamodel.rst:2746 +#: ../../reference/datamodel.rst:2939 msgid "" "Custom implementations of :meth:`~object.__class_getitem__` on classes " "defined outside of the standard library may not be understood by third-party " @@ -3311,11 +3545,11 @@ msgid "" "purposes other than type hinting is discouraged." msgstr "" -#: ../../reference/datamodel.rst:2756 +#: ../../reference/datamodel.rst:2949 msgid "*__class_getitem__* versus *__getitem__*" msgstr "" -#: ../../reference/datamodel.rst:2758 +#: ../../reference/datamodel.rst:2951 msgid "" "Usually, the :ref:`subscription` of an object using square " "brackets will call the :meth:`~object.__getitem__` instance method defined " @@ -3325,14 +3559,14 @@ msgid "" "genericalias>` object if it is properly defined." msgstr "" -#: ../../reference/datamodel.rst:2765 +#: ../../reference/datamodel.rst:2958 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:2770 +#: ../../reference/datamodel.rst:2963 msgid "" "from inspect import isclass\n" "\n" @@ -3358,7 +3592,7 @@ msgid "" " )" msgstr "" -#: ../../reference/datamodel.rst:2793 +#: ../../reference/datamodel.rst:2986 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 " @@ -3368,7 +3602,7 @@ msgid "" "__class_getitem__` being called::" msgstr "" -#: ../../reference/datamodel.rst:2800 +#: ../../reference/datamodel.rst:2993 msgid "" ">>> # list has class \"type\" as its metaclass, like most classes:\n" ">>> type(list)\n" @@ -3383,14 +3617,14 @@ msgid "" "" msgstr "" -#: ../../reference/datamodel.rst:2812 +#: ../../reference/datamodel.rst:3005 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:2816 +#: ../../reference/datamodel.rst:3009 msgid "" ">>> from enum import Enum\n" ">>> class Menu(Enum):\n" @@ -3410,33 +3644,33 @@ msgid "" "" msgstr "" -#: ../../reference/datamodel.rst:2835 +#: ../../reference/datamodel.rst:3028 msgid ":pep:`560` - Core Support for typing module and generic types" msgstr "" -#: ../../reference/datamodel.rst:2836 +#: ../../reference/datamodel.rst:3029 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:2844 +#: ../../reference/datamodel.rst:3037 msgid "Emulating callable objects" msgstr "" -#: ../../reference/datamodel.rst:2851 +#: ../../reference/datamodel.rst:3044 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:2858 +#: ../../reference/datamodel.rst:3051 msgid "Emulating container types" msgstr "" -#: ../../reference/datamodel.rst:2860 +#: ../../reference/datamodel.rst:3053 msgid "" "The following methods can be defined to implement container objects. " "Containers usually are :term:`sequences ` (such as :class:`lists " @@ -3472,7 +3706,7 @@ msgid "" "should iterate through the values." msgstr "" -#: ../../reference/datamodel.rst:2901 +#: ../../reference/datamodel.rst:3094 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 " @@ -3480,7 +3714,7 @@ msgid "" "returns zero is considered to be false in a Boolean context." msgstr "" -#: ../../reference/datamodel.rst:2908 +#: ../../reference/datamodel.rst:3101 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:" @@ -3489,7 +3723,7 @@ msgid "" "`~object.__bool__` method." msgstr "" -#: ../../reference/datamodel.rst:2917 +#: ../../reference/datamodel.rst:3110 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). " @@ -3499,28 +3733,28 @@ msgid "" "never required for correctness." msgstr "" -#: ../../reference/datamodel.rst:2931 +#: ../../reference/datamodel.rst:3124 msgid "" "Slicing is done exclusively with the following three methods. A call like ::" msgstr "" -#: ../../reference/datamodel.rst:2933 +#: ../../reference/datamodel.rst:3126 msgid "a[1:2] = b" msgstr "a[1:2] = b" -#: ../../reference/datamodel.rst:2935 +#: ../../reference/datamodel.rst:3128 msgid "is translated to ::" msgstr "" -#: ../../reference/datamodel.rst:2937 +#: ../../reference/datamodel.rst:3130 msgid "a[slice(1, 2, None)] = b" msgstr "a[slice(1, 2, None)] = b" -#: ../../reference/datamodel.rst:2939 +#: ../../reference/datamodel.rst:3132 msgid "and so forth. Missing slice items are always filled in with ``None``." msgstr "" -#: ../../reference/datamodel.rst:2944 +#: ../../reference/datamodel.rst:3137 msgid "" "Called to implement evaluation of ``self[key]``. For :term:`sequence` types, " "the accepted keys should be integers. Optionally, they may support :class:" @@ -3532,20 +3766,20 @@ msgid "" "`KeyError` should be raised." msgstr "" -#: ../../reference/datamodel.rst:2956 +#: ../../reference/datamodel.rst:3149 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:2961 +#: ../../reference/datamodel.rst:3154 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:2969 +#: ../../reference/datamodel.rst:3162 msgid "" "Called to implement assignment to ``self[key]``. Same note as for :meth:" "`__getitem__`. This should only be implemented for mappings if the objects " @@ -3554,7 +3788,7 @@ msgid "" "for improper *key* values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:2978 +#: ../../reference/datamodel.rst:3171 msgid "" "Called to implement deletion of ``self[key]``. Same note as for :meth:" "`__getitem__`. This should only be implemented for mappings if the objects " @@ -3563,13 +3797,13 @@ msgid "" "values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:2987 +#: ../../reference/datamodel.rst:3180 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:2993 +#: ../../reference/datamodel.rst:3186 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 " @@ -3577,14 +3811,14 @@ msgid "" "of the container." msgstr "" -#: ../../reference/datamodel.rst:3001 +#: ../../reference/datamodel.rst:3194 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:3005 +#: ../../reference/datamodel.rst:3198 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 :" @@ -3593,7 +3827,7 @@ msgid "" "more efficient than the one provided by :func:`reversed`." msgstr "" -#: ../../reference/datamodel.rst:3012 +#: ../../reference/datamodel.rst:3205 msgid "" "The membership test operators (:keyword:`in` and :keyword:`not in`) are " "normally implemented as an iteration through a container. However, container " @@ -3601,14 +3835,14 @@ msgid "" "implementation, which also does not require the object be iterable." msgstr "" -#: ../../reference/datamodel.rst:3019 +#: ../../reference/datamodel.rst:3212 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:3023 +#: ../../reference/datamodel.rst:3216 msgid "" "For objects that don't define :meth:`__contains__`, the membership test " "first tries iteration via :meth:`__iter__`, then the old sequence iteration " @@ -3616,11 +3850,11 @@ msgid "" "reference `." msgstr "" -#: ../../reference/datamodel.rst:3032 +#: ../../reference/datamodel.rst:3225 msgid "Emulating numeric types" msgstr "" -#: ../../reference/datamodel.rst:3034 +#: ../../reference/datamodel.rst:3227 msgid "" "The following methods can be defined to emulate numeric objects. Methods " "corresponding to operations that are not supported by the particular kind of " @@ -3628,7 +3862,7 @@ msgid "" "should be left undefined." msgstr "" -#: ../../reference/datamodel.rst:3060 +#: ../../reference/datamodel.rst:3253 msgid "" "These methods are called to implement the binary arithmetic operations " "(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" @@ -3642,13 +3876,13 @@ msgid "" "function is to be supported." msgstr "" -#: ../../reference/datamodel.rst:3071 +#: ../../reference/datamodel.rst:3264 msgid "" "If one of those methods does not support the operation with the supplied " "arguments, it should return :data:`NotImplemented`." msgstr "" -#: ../../reference/datamodel.rst:3094 +#: ../../reference/datamodel.rst:3287 msgid "" "These methods are called to implement the binary arithmetic operations " "(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" @@ -3661,13 +3895,13 @@ msgid "" "`NotImplemented`." msgstr "" -#: ../../reference/datamodel.rst:3106 +#: ../../reference/datamodel.rst:3299 msgid "" "Note that ternary :func:`pow` will not try calling :meth:`__rpow__` (the " "coercion rules would become too complicated)." msgstr "" -#: ../../reference/datamodel.rst:3111 +#: ../../reference/datamodel.rst:3304 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 " @@ -3676,7 +3910,7 @@ msgid "" "ancestors' operations." msgstr "" -#: ../../reference/datamodel.rst:3132 +#: ../../reference/datamodel.rst:3325 msgid "" "These methods are called to implement the augmented arithmetic assignments " "(``+=``, ``-=``, ``*=``, ``@=``, ``/=``, ``//=``, ``%=``, ``**=``, ``<<=``, " @@ -3694,19 +3928,19 @@ msgid "" "data model." msgstr "" -#: ../../reference/datamodel.rst:3155 +#: ../../reference/datamodel.rst:3348 msgid "" "Called to implement the unary arithmetic operations (``-``, ``+``, :func:" "`abs` and ``~``)." msgstr "" -#: ../../reference/datamodel.rst:3168 +#: ../../reference/datamodel.rst:3361 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:3175 +#: ../../reference/datamodel.rst:3368 msgid "" "Called to implement :func:`operator.index`, and whenever Python needs to " "losslessly convert the numeric object to an integer object (such as in " @@ -3715,14 +3949,14 @@ msgid "" "integer type. Must return an integer." msgstr "" -#: ../../reference/datamodel.rst:3181 +#: ../../reference/datamodel.rst:3374 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:3193 +#: ../../reference/datamodel.rst:3386 msgid "" "Called to implement the built-in function :func:`round` and :mod:`math` " "functions :func:`~math.trunc`, :func:`~math.floor` and :func:`~math.ceil`. " @@ -3731,21 +3965,21 @@ msgid "" "(typically an :class:`int`)." msgstr "" -#: ../../reference/datamodel.rst:3199 +#: ../../reference/datamodel.rst:3392 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:3202 +#: ../../reference/datamodel.rst:3395 msgid "The delegation of :func:`int` to :meth:`__trunc__` is deprecated." msgstr "" -#: ../../reference/datamodel.rst:3209 +#: ../../reference/datamodel.rst:3402 msgid "With Statement Context Managers" msgstr "With 陳述式的情境管理器" -#: ../../reference/datamodel.rst:3211 +#: ../../reference/datamodel.rst:3404 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 " @@ -3755,32 +3989,32 @@ msgid "" "can also be used by directly invoking their methods." msgstr "" -#: ../../reference/datamodel.rst:3222 +#: ../../reference/datamodel.rst:3415 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:3225 +#: ../../reference/datamodel.rst:3418 msgid "" "For more information on context managers, see :ref:`typecontextmanager`." msgstr "" -#: ../../reference/datamodel.rst:3230 +#: ../../reference/datamodel.rst:3423 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:3237 +#: ../../reference/datamodel.rst:3430 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:3241 +#: ../../reference/datamodel.rst:3434 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. " @@ -3788,27 +4022,27 @@ msgid "" "method." msgstr "" -#: ../../reference/datamodel.rst:3245 +#: ../../reference/datamodel.rst:3438 msgid "" "Note that :meth:`~object.__exit__` methods should not reraise the passed-in " "exception; this is the caller's responsibility." msgstr "" -#: ../../reference/datamodel.rst:3251 +#: ../../reference/datamodel.rst:3444 msgid ":pep:`343` - The \"with\" statement" msgstr ":pep:`343` - \"with\" 陳述式" -#: ../../reference/datamodel.rst:3252 +#: ../../reference/datamodel.rst:3445 msgid "" "The specification, background, and examples for the Python :keyword:`with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:3259 +#: ../../reference/datamodel.rst:3452 msgid "Customizing positional arguments in class pattern matching" msgstr "" -#: ../../reference/datamodel.rst:3261 +#: ../../reference/datamodel.rst:3454 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 " @@ -3816,7 +4050,7 @@ msgid "" "pattern, the class needs to define a *__match_args__* attribute." msgstr "" -#: ../../reference/datamodel.rst:3268 +#: ../../reference/datamodel.rst:3461 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 " @@ -3825,7 +4059,7 @@ msgid "" "to setting it to ``()``." msgstr "" -#: ../../reference/datamodel.rst:3274 +#: ../../reference/datamodel.rst:3467 msgid "" "For example, if ``MyClass.__match_args__`` is ``(\"left\", \"center\", " "\"right\")`` that means that ``case MyClass(x, y)`` is equivalent to ``case " @@ -3835,19 +4069,19 @@ msgid "" "exc:`TypeError`." msgstr "" -#: ../../reference/datamodel.rst:3284 +#: ../../reference/datamodel.rst:3477 msgid ":pep:`634` - Structural Pattern Matching" msgstr "" -#: ../../reference/datamodel.rst:3285 +#: ../../reference/datamodel.rst:3478 msgid "The specification for the Python ``match`` statement." msgstr "" -#: ../../reference/datamodel.rst:3291 +#: ../../reference/datamodel.rst:3484 msgid "Emulating buffer types" msgstr "" -#: ../../reference/datamodel.rst:3293 +#: ../../reference/datamodel.rst:3486 msgid "" "The :ref:`buffer protocol ` provides a way for Python objects " "to expose efficient access to a low-level memory array. This protocol is " @@ -3855,13 +4089,13 @@ msgid "" "and third-party libraries may define additional buffer types." msgstr "" -#: ../../reference/datamodel.rst:3298 +#: ../../reference/datamodel.rst:3491 msgid "" "While buffer types are usually implemented in C, it is also possible to " "implement the protocol in Python." msgstr "" -#: ../../reference/datamodel.rst:3303 +#: ../../reference/datamodel.rst:3496 msgid "" "Called when a buffer is requested from *self* (for example, by the :class:" "`memoryview` constructor). The *flags* argument is an integer representing " @@ -3871,7 +4105,7 @@ msgid "" "`memoryview` object." msgstr "" -#: ../../reference/datamodel.rst:3312 +#: ../../reference/datamodel.rst:3505 msgid "" "Called when a buffer is no longer needed. The *buffer* argument is a :class:" "`memoryview` object that was previously returned by :meth:`~object." @@ -3880,28 +4114,28 @@ msgid "" "to perform any cleanup are not required to implement this method." msgstr "" -#: ../../reference/datamodel.rst:3323 +#: ../../reference/datamodel.rst:3516 msgid ":pep:`688` - Making the buffer protocol accessible in Python" msgstr "" -#: ../../reference/datamodel.rst:3324 +#: ../../reference/datamodel.rst:3517 msgid "" "Introduces the Python ``__buffer__`` and ``__release_buffer__`` methods." msgstr "" -#: ../../reference/datamodel.rst:3326 +#: ../../reference/datamodel.rst:3519 msgid ":class:`collections.abc.Buffer`" msgstr ":class:`collections.abc.Buffer`" -#: ../../reference/datamodel.rst:3327 +#: ../../reference/datamodel.rst:3520 msgid "ABC for buffer types." msgstr "" -#: ../../reference/datamodel.rst:3332 +#: ../../reference/datamodel.rst:3525 msgid "Special method lookup" msgstr "" -#: ../../reference/datamodel.rst:3334 +#: ../../reference/datamodel.rst:3527 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 " @@ -3909,7 +4143,7 @@ msgid "" "following code raises an exception::" msgstr "" -#: ../../reference/datamodel.rst:3339 +#: ../../reference/datamodel.rst:3532 msgid "" ">>> class C:\n" "... pass\n" @@ -3931,7 +4165,7 @@ msgstr "" " File \"\", line 1, in \n" "TypeError: object of type 'C' has no len()" -#: ../../reference/datamodel.rst:3349 +#: ../../reference/datamodel.rst:3542 msgid "" "The rationale behind this behaviour lies with a number of special methods " "such as :meth:`~object.__hash__` and :meth:`~object.__repr__` that are " @@ -3940,7 +4174,7 @@ msgid "" "invoked on the type object itself::" msgstr "" -#: ../../reference/datamodel.rst:3356 +#: ../../reference/datamodel.rst:3549 msgid "" ">>> 1 .__hash__() == hash(1)\n" "True\n" @@ -3956,14 +4190,14 @@ msgstr "" " File \"\", line 1, in \n" "TypeError: descriptor '__hash__' of 'int' object needs an argument" -#: ../../reference/datamodel.rst:3363 +#: ../../reference/datamodel.rst:3556 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:3367 +#: ../../reference/datamodel.rst:3560 msgid "" ">>> type(1).__hash__(1) == hash(1)\n" "True\n" @@ -3975,14 +4209,14 @@ msgstr "" ">>> type(int).__hash__(int) == hash(int)\n" "True" -#: ../../reference/datamodel.rst:3372 +#: ../../reference/datamodel.rst:3565 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:3376 +#: ../../reference/datamodel.rst:3569 msgid "" ">>> class Meta(type):\n" "... def __getattribute__(*args):\n" @@ -4007,7 +4241,7 @@ msgid "" "10" msgstr "" -#: ../../reference/datamodel.rst:3398 +#: ../../reference/datamodel.rst:3591 msgid "" "Bypassing the :meth:`~object.__getattribute__` machinery in this fashion " "provides significant scope for speed optimisations within the interpreter, " @@ -4016,36 +4250,36 @@ msgid "" "consistently invoked by the interpreter)." msgstr "" -#: ../../reference/datamodel.rst:3409 +#: ../../reference/datamodel.rst:3602 msgid "Coroutines" msgstr "協程" -#: ../../reference/datamodel.rst:3413 +#: ../../reference/datamodel.rst:3606 msgid "Awaitable Objects" msgstr "" -#: ../../reference/datamodel.rst:3415 +#: ../../reference/datamodel.rst:3608 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:3421 +#: ../../reference/datamodel.rst:3614 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:3427 +#: ../../reference/datamodel.rst:3620 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:3433 +#: ../../reference/datamodel.rst:3626 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 " @@ -4053,15 +4287,15 @@ msgid "" "g. :mod:`asyncio`) that will be managing the :term:`awaitable` object." msgstr "" -#: ../../reference/datamodel.rst:3441 +#: ../../reference/datamodel.rst:3634 msgid ":pep:`492` for additional information about awaitable objects." msgstr "" -#: ../../reference/datamodel.rst:3447 +#: ../../reference/datamodel.rst:3640 msgid "Coroutine Objects" msgstr "" -#: ../../reference/datamodel.rst:3449 +#: ../../reference/datamodel.rst:3642 msgid "" ":term:`Coroutine objects ` are :term:`awaitable` objects. A " "coroutine's execution can be controlled by calling :meth:`~object.__await__` " @@ -4072,18 +4306,18 @@ msgid "" "should not directly raise unhandled :exc:`StopIteration` exceptions." msgstr "" -#: ../../reference/datamodel.rst:3457 +#: ../../reference/datamodel.rst:3650 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:3461 +#: ../../reference/datamodel.rst:3654 msgid "It is a :exc:`RuntimeError` to await on a coroutine more than once." msgstr "" -#: ../../reference/datamodel.rst:3467 +#: ../../reference/datamodel.rst:3660 msgid "" "Starts or resumes execution of the coroutine. If *value* is ``None``, this " "is equivalent to advancing the iterator returned by :meth:`~object." @@ -4094,7 +4328,7 @@ msgid "" "value, described above." msgstr "" -#: ../../reference/datamodel.rst:3478 +#: ../../reference/datamodel.rst:3671 msgid "" "Raises the specified exception in the coroutine. This method delegates to " "the :meth:`~generator.throw` method of the iterator that caused the " @@ -4105,13 +4339,13 @@ msgid "" "not caught in the coroutine, it propagates back to the caller." msgstr "" -#: ../../reference/datamodel.rst:3489 +#: ../../reference/datamodel.rst:3682 msgid "" "The second signature \\(type\\[, value\\[, traceback\\]\\]\\) is deprecated " "and may be removed in a future version of Python." msgstr "" -#: ../../reference/datamodel.rst:3494 +#: ../../reference/datamodel.rst:3687 msgid "" "Causes the coroutine to clean itself up and exit. If the coroutine is " "suspended, this method first delegates to the :meth:`~generator.close` " @@ -4121,42 +4355,42 @@ msgid "" "is marked as having finished executing, even if it was never started." msgstr "" -#: ../../reference/datamodel.rst:3502 +#: ../../reference/datamodel.rst:3695 msgid "" "Coroutine objects are automatically closed using the above process when they " "are about to be destroyed." msgstr "" -#: ../../reference/datamodel.rst:3508 +#: ../../reference/datamodel.rst:3701 msgid "Asynchronous Iterators" msgstr "" -#: ../../reference/datamodel.rst:3510 +#: ../../reference/datamodel.rst:3703 msgid "" "An *asynchronous iterator* can call asynchronous code in its ``__anext__`` " "method." msgstr "" -#: ../../reference/datamodel.rst:3513 +#: ../../reference/datamodel.rst:3706 msgid "" "Asynchronous iterators can be used in an :keyword:`async for` statement." msgstr "" -#: ../../reference/datamodel.rst:3517 +#: ../../reference/datamodel.rst:3710 msgid "Must return an *asynchronous iterator* object." msgstr "" -#: ../../reference/datamodel.rst:3521 +#: ../../reference/datamodel.rst:3714 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:3524 +#: ../../reference/datamodel.rst:3717 msgid "An example of an asynchronous iterable object::" msgstr "" -#: ../../reference/datamodel.rst:3526 +#: ../../reference/datamodel.rst:3719 msgid "" "class Reader:\n" " async def readline(self):\n" @@ -4184,53 +4418,53 @@ msgstr "" " raise StopAsyncIteration\n" " return val" -#: ../../reference/datamodel.rst:3541 +#: ../../reference/datamodel.rst:3734 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:3546 +#: ../../reference/datamodel.rst:3739 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:3554 +#: ../../reference/datamodel.rst:3747 msgid "Asynchronous Context Managers" msgstr "" -#: ../../reference/datamodel.rst:3556 +#: ../../reference/datamodel.rst:3749 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:3559 +#: ../../reference/datamodel.rst:3752 msgid "" "Asynchronous context managers can be used in an :keyword:`async with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:3563 +#: ../../reference/datamodel.rst:3756 msgid "" "Semantically similar to :meth:`~object.__enter__`, the only difference being " "that it must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3568 +#: ../../reference/datamodel.rst:3761 msgid "" "Semantically similar to :meth:`~object.__exit__`, the only difference being " "that it must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3571 +#: ../../reference/datamodel.rst:3764 msgid "An example of an asynchronous context manager class::" msgstr "" -#: ../../reference/datamodel.rst:3573 +#: ../../reference/datamodel.rst:3766 msgid "" "class AsyncContextManager:\n" " async def __aenter__(self):\n" @@ -4246,18 +4480,18 @@ msgstr "" " async def __aexit__(self, exc_type, exc, tb):\n" " await log('exiting context')" -#: ../../reference/datamodel.rst:3584 +#: ../../reference/datamodel.rst:3777 msgid "Footnotes" msgstr "註解" -#: ../../reference/datamodel.rst:3585 +#: ../../reference/datamodel.rst:3778 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:3589 +#: ../../reference/datamodel.rst:3782 msgid "" "The :meth:`~object.__hash__`, :meth:`~object.__iter__`, :meth:`~object." "__reversed__`, :meth:`~object.__contains__`, :meth:`~object." @@ -4266,7 +4500,7 @@ msgid "" "by relying on the behavior that ``None`` is not callable." msgstr "" -#: ../../reference/datamodel.rst:3596 +#: ../../reference/datamodel.rst:3789 msgid "" "\"Does not support\" here means that the class has no such method, or the " "method returns :data:`NotImplemented`. Do not set the method to ``None`` if " @@ -4274,7 +4508,7 @@ msgid "" "instead have the opposite effect of explicitly *blocking* such fallback." msgstr "" -#: ../../reference/datamodel.rst:3602 +#: ../../reference/datamodel.rst:3795 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 " @@ -4291,13 +4525,13 @@ msgstr "" #: ../../reference/datamodel.rst:427 ../../reference/datamodel.rst:447 #: ../../reference/datamodel.rst:455 ../../reference/datamodel.rst:466 #: ../../reference/datamodel.rst:483 ../../reference/datamodel.rst:519 -#: ../../reference/datamodel.rst:534 ../../reference/datamodel.rst:660 -#: ../../reference/datamodel.rst:798 ../../reference/datamodel.rst:822 -#: ../../reference/datamodel.rst:856 ../../reference/datamodel.rst:937 -#: ../../reference/datamodel.rst:1076 ../../reference/datamodel.rst:1103 -#: ../../reference/datamodel.rst:1175 ../../reference/datamodel.rst:1279 -#: ../../reference/datamodel.rst:1388 ../../reference/datamodel.rst:1498 -#: ../../reference/datamodel.rst:1912 ../../reference/datamodel.rst:2927 +#: ../../reference/datamodel.rst:534 ../../reference/datamodel.rst:661 +#: ../../reference/datamodel.rst:799 ../../reference/datamodel.rst:823 +#: ../../reference/datamodel.rst:859 ../../reference/datamodel.rst:1126 +#: ../../reference/datamodel.rst:1265 ../../reference/datamodel.rst:1292 +#: ../../reference/datamodel.rst:1364 ../../reference/datamodel.rst:1472 +#: ../../reference/datamodel.rst:1581 ../../reference/datamodel.rst:1691 +#: ../../reference/datamodel.rst:2105 ../../reference/datamodel.rst:3120 msgid "object" msgstr "object(物件)" @@ -4307,14 +4541,14 @@ msgstr "data(資料)" #: ../../reference/datamodel.rst:23 ../../reference/datamodel.rst:296 #: ../../reference/datamodel.rst:343 ../../reference/datamodel.rst:427 -#: ../../reference/datamodel.rst:466 ../../reference/datamodel.rst:798 -#: ../../reference/datamodel.rst:1132 ../../reference/datamodel.rst:1581 -#: ../../reference/datamodel.rst:1823 ../../reference/datamodel.rst:1828 -#: ../../reference/datamodel.rst:1912 ../../reference/datamodel.rst:2468 -#: ../../reference/datamodel.rst:2897 ../../reference/datamodel.rst:3055 -#: ../../reference/datamodel.rst:3090 ../../reference/datamodel.rst:3104 -#: ../../reference/datamodel.rst:3153 ../../reference/datamodel.rst:3163 -#: ../../reference/datamodel.rst:3191 +#: ../../reference/datamodel.rst:466 ../../reference/datamodel.rst:799 +#: ../../reference/datamodel.rst:1321 ../../reference/datamodel.rst:1774 +#: ../../reference/datamodel.rst:2016 ../../reference/datamodel.rst:2021 +#: ../../reference/datamodel.rst:2105 ../../reference/datamodel.rst:2661 +#: ../../reference/datamodel.rst:3090 ../../reference/datamodel.rst:3248 +#: ../../reference/datamodel.rst:3283 ../../reference/datamodel.rst:3297 +#: ../../reference/datamodel.rst:3346 ../../reference/datamodel.rst:3356 +#: ../../reference/datamodel.rst:3384 msgid "built-in function" msgstr "built-in function(內建函式)" @@ -4323,7 +4557,7 @@ msgid "id" msgstr "id" #: ../../reference/datamodel.rst:23 ../../reference/datamodel.rst:126 -#: ../../reference/datamodel.rst:2468 +#: ../../reference/datamodel.rst:2661 msgid "type" msgstr "type(型別)" @@ -4359,7 +4593,7 @@ msgstr "reference counting(參照計數)" msgid "unreachable object" msgstr "unreachable object(不可達物件)" -#: ../../reference/datamodel.rst:95 ../../reference/datamodel.rst:937 +#: ../../reference/datamodel.rst:95 ../../reference/datamodel.rst:1126 msgid "container" msgstr "container(容器)" @@ -4373,24 +4607,24 @@ msgstr "extension(擴充)" #: ../../reference/datamodel.rst:126 ../../reference/datamodel.rst:400 #: ../../reference/datamodel.rst:401 ../../reference/datamodel.rst:502 -#: ../../reference/datamodel.rst:856 ../../reference/datamodel.rst:876 -#: ../../reference/datamodel.rst:1132 +#: ../../reference/datamodel.rst:859 ../../reference/datamodel.rst:879 +#: ../../reference/datamodel.rst:1321 msgid "module" msgstr "module(模組)" #: ../../reference/datamodel.rst:126 ../../reference/datamodel.rst:265 -#: ../../reference/datamodel.rst:798 +#: ../../reference/datamodel.rst:799 msgid "C" msgstr "C" #: ../../reference/datamodel.rst:126 ../../reference/datamodel.rst:265 -#: ../../reference/datamodel.rst:798 +#: ../../reference/datamodel.rst:799 msgid "language" msgstr "language(語言)" -#: ../../reference/datamodel.rst:139 ../../reference/datamodel.rst:937 -#: ../../reference/datamodel.rst:955 ../../reference/datamodel.rst:1076 -#: ../../reference/datamodel.rst:1096 +#: ../../reference/datamodel.rst:139 ../../reference/datamodel.rst:1126 +#: ../../reference/datamodel.rst:1144 ../../reference/datamodel.rst:1265 +#: ../../reference/datamodel.rst:1285 msgid "attribute" msgstr "attribute(屬性)" @@ -4410,7 +4644,7 @@ msgstr "..." msgid "ellipsis literal" msgstr "ellipsis literal(刪節號)" -#: ../../reference/datamodel.rst:196 ../../reference/datamodel.rst:1103 +#: ../../reference/datamodel.rst:196 ../../reference/datamodel.rst:1292 msgid "numeric" msgstr "numeric(數值)" @@ -4447,16 +4681,16 @@ msgstr "number(數字)" msgid "Java" msgstr "Java" -#: ../../reference/datamodel.rst:283 ../../reference/datamodel.rst:3163 +#: ../../reference/datamodel.rst:283 ../../reference/datamodel.rst:3356 msgid "complex" msgstr "complex(複數)" #: ../../reference/datamodel.rst:296 ../../reference/datamodel.rst:427 -#: ../../reference/datamodel.rst:466 ../../reference/datamodel.rst:2897 +#: ../../reference/datamodel.rst:466 ../../reference/datamodel.rst:3090 msgid "len" msgstr "len" -#: ../../reference/datamodel.rst:296 ../../reference/datamodel.rst:1103 +#: ../../reference/datamodel.rst:296 ../../reference/datamodel.rst:1292 msgid "sequence" msgstr "sequence(序列)" @@ -4485,8 +4719,8 @@ msgstr "immutable sequence(不可變序列)" msgid "immutable" msgstr "immutable(不可變)" -#: ../../reference/datamodel.rst:339 ../../reference/datamodel.rst:1798 -#: ../../reference/datamodel.rst:1828 +#: ../../reference/datamodel.rst:339 ../../reference/datamodel.rst:1991 +#: ../../reference/datamodel.rst:2021 msgid "string" msgstr "string(字串)" @@ -4522,7 +4756,7 @@ msgstr "singleton(單例)" msgid "empty" msgstr "empty(空的)" -#: ../../reference/datamodel.rst:376 ../../reference/datamodel.rst:1823 +#: ../../reference/datamodel.rst:376 ../../reference/datamodel.rst:2016 msgid "bytes" msgstr "bytes(位元組)" @@ -4538,14 +4772,14 @@ msgstr "mutable sequence(可變序列)" msgid "mutable" msgstr "mutable(可變的)" -#: ../../reference/datamodel.rst:388 ../../reference/datamodel.rst:955 -#: ../../reference/datamodel.rst:1096 +#: ../../reference/datamodel.rst:388 ../../reference/datamodel.rst:1144 +#: ../../reference/datamodel.rst:1285 msgid "assignment" msgstr "assignment(賦值)" -#: ../../reference/datamodel.rst:388 ../../reference/datamodel.rst:856 -#: ../../reference/datamodel.rst:1535 ../../reference/datamodel.rst:1717 -#: ../../reference/datamodel.rst:3218 +#: ../../reference/datamodel.rst:388 ../../reference/datamodel.rst:859 +#: ../../reference/datamodel.rst:1728 ../../reference/datamodel.rst:1910 +#: ../../reference/datamodel.rst:3411 msgid "statement" msgstr "statement(陳述式)" @@ -4577,12 +4811,12 @@ msgstr "set(集合)" msgid "frozenset" msgstr "frozenset(凍結集合)" -#: ../../reference/datamodel.rst:466 ../../reference/datamodel.rst:1103 +#: ../../reference/datamodel.rst:466 ../../reference/datamodel.rst:1292 msgid "mapping" msgstr "mapping(對映)" -#: ../../reference/datamodel.rst:483 ../../reference/datamodel.rst:937 -#: ../../reference/datamodel.rst:1912 +#: ../../reference/datamodel.rst:483 ../../reference/datamodel.rst:1126 +#: ../../reference/datamodel.rst:2105 msgid "dictionary" msgstr "dictionary(字典)" @@ -4599,13 +4833,13 @@ msgid "callable" msgstr "callable(可呼叫物件)" #: ../../reference/datamodel.rst:519 ../../reference/datamodel.rst:534 -#: ../../reference/datamodel.rst:742 ../../reference/datamodel.rst:760 -#: ../../reference/datamodel.rst:773 ../../reference/datamodel.rst:798 +#: ../../reference/datamodel.rst:743 ../../reference/datamodel.rst:761 +#: ../../reference/datamodel.rst:774 ../../reference/datamodel.rst:799 msgid "function" msgstr "function (函式)" -#: ../../reference/datamodel.rst:519 ../../reference/datamodel.rst:937 -#: ../../reference/datamodel.rst:960 ../../reference/datamodel.rst:2849 +#: ../../reference/datamodel.rst:519 ../../reference/datamodel.rst:1126 +#: ../../reference/datamodel.rst:1149 ../../reference/datamodel.rst:3042 msgid "call" msgstr "call(呼叫)" @@ -4617,7 +4851,7 @@ msgstr "invocation(調用)" msgid "argument" msgstr "argument(引數)" -#: ../../reference/datamodel.rst:534 ../../reference/datamodel.rst:660 +#: ../../reference/datamodel.rst:534 ../../reference/datamodel.rst:661 msgid "user-defined" msgstr "user-defined(使用者定義)" @@ -4637,611 +4871,643 @@ msgstr "__globals__ (函式屬性)" msgid "global" msgstr "global(全域)" -#: ../../reference/datamodel.rst:547 ../../reference/datamodel.rst:876 +#: ../../reference/datamodel.rst:547 ../../reference/datamodel.rst:879 msgid "namespace" msgstr "namespace(命名空間)" -#: ../../reference/datamodel.rst:573 +#: ../../reference/datamodel.rst:574 msgid "__doc__ (function attribute)" msgstr "__doc__ (函式屬性)" -#: ../../reference/datamodel.rst:573 +#: ../../reference/datamodel.rst:574 msgid "__name__ (function attribute)" msgstr "__name__ (函式屬性)" -#: ../../reference/datamodel.rst:573 +#: ../../reference/datamodel.rst:574 msgid "__module__ (function attribute)" msgstr "__module__ (函式屬性)" -#: ../../reference/datamodel.rst:573 +#: ../../reference/datamodel.rst:574 msgid "__dict__ (function attribute)" msgstr "__dict__ (函式屬性)" -#: ../../reference/datamodel.rst:573 +#: ../../reference/datamodel.rst:574 msgid "__defaults__ (function attribute)" msgstr "__defaults__ (函式屬性)" -#: ../../reference/datamodel.rst:573 +#: ../../reference/datamodel.rst:574 msgid "__code__ (function attribute)" msgstr "__code__ (函式屬性)" -#: ../../reference/datamodel.rst:573 +#: ../../reference/datamodel.rst:574 msgid "__annotations__ (function attribute)" msgstr "__annotations__ (函式屬性)" -#: ../../reference/datamodel.rst:573 +#: ../../reference/datamodel.rst:574 msgid "__kwdefaults__ (function attribute)" msgstr "__kwdefaults__ (函式屬性)" -#: ../../reference/datamodel.rst:573 +#: ../../reference/datamodel.rst:574 msgid "__type_params__ (function attribute)" msgstr "__type_params__ (函式屬性)" -#: ../../reference/datamodel.rst:660 ../../reference/datamodel.rst:822 +#: ../../reference/datamodel.rst:661 ../../reference/datamodel.rst:823 msgid "method" msgstr "method(方法)" -#: ../../reference/datamodel.rst:660 +#: ../../reference/datamodel.rst:661 msgid "user-defined method" msgstr "user-defined method(使用者定義方法)" -#: ../../reference/datamodel.rst:668 +#: ../../reference/datamodel.rst:669 msgid "__func__ (method attribute)" msgstr "__func__ (方法屬性)" -#: ../../reference/datamodel.rst:668 +#: ../../reference/datamodel.rst:669 msgid "__self__ (method attribute)" msgstr "__self__ (方法屬性)" -#: ../../reference/datamodel.rst:668 +#: ../../reference/datamodel.rst:669 msgid "__doc__ (method attribute)" msgstr "__doc__ (方法屬性)" -#: ../../reference/datamodel.rst:668 +#: ../../reference/datamodel.rst:669 msgid "__name__ (method attribute)" msgstr "__name__ (方法屬性)" -#: ../../reference/datamodel.rst:668 +#: ../../reference/datamodel.rst:669 msgid "__module__ (method attribute)" msgstr "__module__ (方法屬性)" -#: ../../reference/datamodel.rst:742 ../../reference/datamodel.rst:1279 +#: ../../reference/datamodel.rst:743 ../../reference/datamodel.rst:1472 msgid "generator" msgstr "generator(產生器)" -#: ../../reference/datamodel.rst:742 +#: ../../reference/datamodel.rst:743 msgid "iterator" msgstr "itorator(疊代器)" -#: ../../reference/datamodel.rst:760 ../../reference/datamodel.rst:3405 +#: ../../reference/datamodel.rst:761 ../../reference/datamodel.rst:3598 msgid "coroutine" msgstr "coroutine(協程)" -#: ../../reference/datamodel.rst:773 +#: ../../reference/datamodel.rst:774 msgid "asynchronous generator" msgstr "asynchronous generator(非同步產生器)" -#: ../../reference/datamodel.rst:773 +#: ../../reference/datamodel.rst:774 msgid "asynchronous iterator" msgstr "asynchronous iterator(非同步疊代器)" -#: ../../reference/datamodel.rst:822 +#: ../../reference/datamodel.rst:823 msgid "built-in method" msgstr "built-in method(內建方法)" -#: ../../reference/datamodel.rst:822 +#: ../../reference/datamodel.rst:823 msgid "built-in" msgstr "built-in(內建)" -#: ../../reference/datamodel.rst:856 +#: ../../reference/datamodel.rst:859 msgid "import" msgstr "import(引入)" -#: ../../reference/datamodel.rst:876 +#: ../../reference/datamodel.rst:879 msgid "__name__ (module attribute)" msgstr "__name__ (模組屬性)" -#: ../../reference/datamodel.rst:876 -msgid "__doc__ (module attribute)" -msgstr "__doc__ (模組屬性)" +#: ../../reference/datamodel.rst:879 +msgid "__spec__ (module attribute)" +msgstr "__spec__ (模組屬性)" -#: ../../reference/datamodel.rst:876 +#: ../../reference/datamodel.rst:879 +msgid "__package__ (module attribute)" +msgstr "__package__ (模組屬性)" + +#: ../../reference/datamodel.rst:879 +msgid "__loader__ (module attribute)" +msgstr "__loader__ (模組屬性)" + +#: ../../reference/datamodel.rst:879 +msgid "__path__ (module attribute)" +msgstr "__path__ (模組屬性)" + +#: ../../reference/datamodel.rst:879 msgid "__file__ (module attribute)" msgstr "__file__ (模組屬性)" -#: ../../reference/datamodel.rst:876 +#: ../../reference/datamodel.rst:879 +msgid "__cached__ (module attribute)" +msgstr "__cached__ (模組屬性)" + +#: ../../reference/datamodel.rst:879 +msgid "__doc__ (module attribute)" +msgstr "__doc__ (模組屬性)" + +#: ../../reference/datamodel.rst:879 msgid "__annotations__ (module attribute)" msgstr "__annotations__ (模組屬性)" -#: ../../reference/datamodel.rst:907 +#: ../../reference/datamodel.rst:1094 msgid "__dict__ (module attribute)" msgstr "__dict__ (模組屬性)" -#: ../../reference/datamodel.rst:937 ../../reference/datamodel.rst:955 -#: ../../reference/datamodel.rst:1076 ../../reference/datamodel.rst:1700 -#: ../../reference/datamodel.rst:2579 +#: ../../reference/datamodel.rst:1126 ../../reference/datamodel.rst:1144 +#: ../../reference/datamodel.rst:1265 ../../reference/datamodel.rst:1893 +#: ../../reference/datamodel.rst:2772 msgid "class" msgstr "class(類別)" -#: ../../reference/datamodel.rst:937 ../../reference/datamodel.rst:1076 -#: ../../reference/datamodel.rst:1096 +#: ../../reference/datamodel.rst:1126 ../../reference/datamodel.rst:1265 +#: ../../reference/datamodel.rst:1285 msgid "class instance" msgstr "class instance(類別實例)" -#: ../../reference/datamodel.rst:937 ../../reference/datamodel.rst:1076 -#: ../../reference/datamodel.rst:2849 +#: ../../reference/datamodel.rst:1126 ../../reference/datamodel.rst:1265 +#: ../../reference/datamodel.rst:3042 msgid "instance" msgstr "instance(實例)" -#: ../../reference/datamodel.rst:937 ../../reference/datamodel.rst:960 +#: ../../reference/datamodel.rst:1126 ../../reference/datamodel.rst:1149 msgid "class object" msgstr "class object(類別物件)" -#: ../../reference/datamodel.rst:967 +#: ../../reference/datamodel.rst:1156 msgid "__name__ (class attribute)" msgstr "__name__ (類別屬性)" -#: ../../reference/datamodel.rst:967 +#: ../../reference/datamodel.rst:1156 msgid "__module__ (class attribute)" msgstr "__module__ (類別屬性)" -#: ../../reference/datamodel.rst:967 +#: ../../reference/datamodel.rst:1156 msgid "__dict__ (class attribute)" msgstr "__dict__ (類別屬性)" -#: ../../reference/datamodel.rst:967 +#: ../../reference/datamodel.rst:1156 msgid "__bases__ (class attribute)" msgstr "__bases__ (類別屬性)" -#: ../../reference/datamodel.rst:967 +#: ../../reference/datamodel.rst:1156 msgid "__doc__ (class attribute)" msgstr "__doc__ (類別屬性)" -#: ../../reference/datamodel.rst:967 +#: ../../reference/datamodel.rst:1156 msgid "__annotations__ (class attribute)" msgstr "__annotations__ (類別屬性)" -#: ../../reference/datamodel.rst:967 +#: ../../reference/datamodel.rst:1156 msgid "__type_params__ (class attribute)" msgstr "__type_params__ (類別屬性)" -#: ../../reference/datamodel.rst:967 +#: ../../reference/datamodel.rst:1156 msgid "__static_attributes__ (class attribute)" msgstr "__static_attributes__ (類別屬性)" -#: ../../reference/datamodel.rst:967 +#: ../../reference/datamodel.rst:1156 msgid "__firstlineno__ (class attribute)" msgstr "__firstlineno__ (類別屬性)" -#: ../../reference/datamodel.rst:1114 +#: ../../reference/datamodel.rst:1303 msgid "__dict__ (instance attribute)" msgstr "__dict__ (實例屬性)" -#: ../../reference/datamodel.rst:1114 +#: ../../reference/datamodel.rst:1303 msgid "__class__ (instance attribute)" msgstr "__class__ (實例屬性)" -#: ../../reference/datamodel.rst:1132 +#: ../../reference/datamodel.rst:1321 msgid "open" msgstr "open" -#: ../../reference/datamodel.rst:1132 +#: ../../reference/datamodel.rst:1321 msgid "io" msgstr "io" -#: ../../reference/datamodel.rst:1132 +#: ../../reference/datamodel.rst:1321 msgid "popen() (in module os)" msgstr "popen() (於 os 模組中)" -#: ../../reference/datamodel.rst:1132 +#: ../../reference/datamodel.rst:1321 msgid "makefile() (socket method)" msgstr "makefile() (socket 方法)" -#: ../../reference/datamodel.rst:1132 +#: ../../reference/datamodel.rst:1321 msgid "sys.stdin" msgstr "sys.stdin" -#: ../../reference/datamodel.rst:1132 +#: ../../reference/datamodel.rst:1321 msgid "sys.stdout" msgstr "sys.stdout" -#: ../../reference/datamodel.rst:1132 +#: ../../reference/datamodel.rst:1321 msgid "sys.stderr" msgstr "sys.stderr" -#: ../../reference/datamodel.rst:1132 +#: ../../reference/datamodel.rst:1321 msgid "stdio" msgstr "stdio" -#: ../../reference/datamodel.rst:1132 +#: ../../reference/datamodel.rst:1321 msgid "stdin (in module sys)" msgstr "stdin (sys 模組中)" -#: ../../reference/datamodel.rst:1132 +#: ../../reference/datamodel.rst:1321 msgid "stdout (in module sys)" msgstr "stdout (sys 模組中)" -#: ../../reference/datamodel.rst:1132 +#: ../../reference/datamodel.rst:1321 msgid "stderr (in module sys)" msgstr "stderr (sys 模組中)" -#: ../../reference/datamodel.rst:1161 +#: ../../reference/datamodel.rst:1350 msgid "internal type" msgstr "internal type(內部型別)" -#: ../../reference/datamodel.rst:1161 +#: ../../reference/datamodel.rst:1350 msgid "types, internal" msgstr "types(型別), internal(內部)" -#: ../../reference/datamodel.rst:1175 +#: ../../reference/datamodel.rst:1364 msgid "bytecode" msgstr "bytecode(位元組碼)" -#: ../../reference/datamodel.rst:1175 +#: ../../reference/datamodel.rst:1364 msgid "code" msgstr "code(程式碼)" -#: ../../reference/datamodel.rst:1175 +#: ../../reference/datamodel.rst:1364 msgid "code object" msgstr "code object(程式碼物件)" -#: ../../reference/datamodel.rst:1186 +#: ../../reference/datamodel.rst:1375 msgid "co_argcount (code object attribute)" msgstr "co_argcount (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1186 +#: ../../reference/datamodel.rst:1375 msgid "co_posonlyargcount (code object attribute)" msgstr "co_posonlyargcount (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1186 +#: ../../reference/datamodel.rst:1375 msgid "co_kwonlyargcount (code object attribute)" msgstr "co_kwonlyargcount (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1186 +#: ../../reference/datamodel.rst:1375 msgid "co_code (code object attribute)" msgstr "co_code (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1186 +#: ../../reference/datamodel.rst:1375 msgid "co_consts (code object attribute)" msgstr "co_consts (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1186 +#: ../../reference/datamodel.rst:1375 msgid "co_filename (code object attribute)" msgstr "co_filename (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1186 +#: ../../reference/datamodel.rst:1375 msgid "co_firstlineno (code object attribute)" msgstr "co_firstlineno (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1186 +#: ../../reference/datamodel.rst:1375 msgid "co_flags (code object attribute)" msgstr "co_flags (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1186 +#: ../../reference/datamodel.rst:1375 msgid "co_lnotab (code object attribute)" msgstr "co_lnotab (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1186 +#: ../../reference/datamodel.rst:1375 msgid "co_name (code object attribute)" msgstr "co_name (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1186 +#: ../../reference/datamodel.rst:1375 msgid "co_names (code object attribute)" msgstr "co_names (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1186 +#: ../../reference/datamodel.rst:1375 msgid "co_nlocals (code object attribute)" msgstr "co_nlocals (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1186 +#: ../../reference/datamodel.rst:1375 msgid "co_stacksize (code object attribute)" msgstr "co_stacksize (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1186 +#: ../../reference/datamodel.rst:1375 msgid "co_varnames (code object attribute)" msgstr "co_varnames (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1186 +#: ../../reference/datamodel.rst:1375 msgid "co_cellvars (code object attribute)" msgstr "co_cellvars (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1186 +#: ../../reference/datamodel.rst:1375 msgid "co_freevars (code object attribute)" msgstr "co_freevars (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1186 +#: ../../reference/datamodel.rst:1375 msgid "co_qualname (code object attribute)" msgstr "co_qualname (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1297 +#: ../../reference/datamodel.rst:1490 msgid "documentation string" msgstr "documentation string(文件字串)" -#: ../../reference/datamodel.rst:1388 +#: ../../reference/datamodel.rst:1581 msgid "frame" msgstr "frame" -#: ../../reference/datamodel.rst:1394 +#: ../../reference/datamodel.rst:1587 msgid "f_back (frame attribute)" msgstr "f_back (frame 屬性)" -#: ../../reference/datamodel.rst:1394 +#: ../../reference/datamodel.rst:1587 msgid "f_code (frame attribute)" msgstr "f_code (frame 屬性)" -#: ../../reference/datamodel.rst:1394 +#: ../../reference/datamodel.rst:1587 msgid "f_globals (frame attribute)" msgstr "f_globals (frame 屬性)" -#: ../../reference/datamodel.rst:1394 +#: ../../reference/datamodel.rst:1587 msgid "f_locals (frame attribute)" msgstr "f_locals (frame 屬性)" -#: ../../reference/datamodel.rst:1394 +#: ../../reference/datamodel.rst:1587 msgid "f_lasti (frame attribute)" msgstr "f_lasti (frame 屬性)" -#: ../../reference/datamodel.rst:1394 +#: ../../reference/datamodel.rst:1587 msgid "f_builtins (frame attribute)" msgstr "f_builtins (frame 屬性)" -#: ../../reference/datamodel.rst:1438 +#: ../../reference/datamodel.rst:1631 msgid "f_trace (frame attribute)" msgstr "f_trace (frame 屬性)" -#: ../../reference/datamodel.rst:1438 +#: ../../reference/datamodel.rst:1631 msgid "f_trace_lines (frame attribute)" msgstr "f_trace_lines (frame 屬性)" -#: ../../reference/datamodel.rst:1438 +#: ../../reference/datamodel.rst:1631 msgid "f_trace_opcodes (frame attribute)" msgstr "f_trace_opcodes (frame 屬性)" -#: ../../reference/datamodel.rst:1438 +#: ../../reference/datamodel.rst:1631 msgid "f_lineno (frame attribute)" msgstr "f_lineno (frame 屬性)" -#: ../../reference/datamodel.rst:1498 +#: ../../reference/datamodel.rst:1691 msgid "traceback" msgstr "traceback" -#: ../../reference/datamodel.rst:1498 +#: ../../reference/datamodel.rst:1691 msgid "stack" msgstr "stack(堆疊)" -#: ../../reference/datamodel.rst:1498 +#: ../../reference/datamodel.rst:1691 msgid "trace" msgstr "trace(追蹤)" -#: ../../reference/datamodel.rst:1498 +#: ../../reference/datamodel.rst:1691 msgid "exception" msgstr "exception(例外)" -#: ../../reference/datamodel.rst:1498 +#: ../../reference/datamodel.rst:1691 msgid "handler" msgstr "handler(處理器)" -#: ../../reference/datamodel.rst:1498 +#: ../../reference/datamodel.rst:1691 msgid "execution" msgstr "execution(執行)" -#: ../../reference/datamodel.rst:1498 +#: ../../reference/datamodel.rst:1691 msgid "exc_info (in module sys)" msgstr "exc_info (sys 模組中)" -#: ../../reference/datamodel.rst:1498 +#: ../../reference/datamodel.rst:1691 msgid "last_traceback (in module sys)" msgstr "last_traceback (sys 模組中)" -#: ../../reference/datamodel.rst:1498 +#: ../../reference/datamodel.rst:1691 msgid "sys.exc_info" msgstr "sys.exc_info" -#: ../../reference/datamodel.rst:1498 +#: ../../reference/datamodel.rst:1691 msgid "sys.exception" msgstr "sys.exception" -#: ../../reference/datamodel.rst:1498 +#: ../../reference/datamodel.rst:1691 msgid "sys.last_traceback" msgstr "sys.last_traceback" -#: ../../reference/datamodel.rst:1535 +#: ../../reference/datamodel.rst:1728 msgid "tb_frame (traceback attribute)" msgstr "tb_frame (traceback 屬性)" -#: ../../reference/datamodel.rst:1535 +#: ../../reference/datamodel.rst:1728 msgid "tb_lineno (traceback attribute)" msgstr "tb_lineno (traceback 屬性)" -#: ../../reference/datamodel.rst:1535 +#: ../../reference/datamodel.rst:1728 msgid "tb_lasti (traceback attribute)" msgstr "tb_lasti (traceback 屬性)" -#: ../../reference/datamodel.rst:1535 +#: ../../reference/datamodel.rst:1728 msgid "try" msgstr "try" -#: ../../reference/datamodel.rst:1565 +#: ../../reference/datamodel.rst:1758 msgid "tb_next (traceback attribute)" msgstr "tb_next (traceback 屬性)" -#: ../../reference/datamodel.rst:1581 ../../reference/datamodel.rst:2927 +#: ../../reference/datamodel.rst:1774 ../../reference/datamodel.rst:3120 msgid "slice" msgstr "slice(切片)" -#: ../../reference/datamodel.rst:1587 +#: ../../reference/datamodel.rst:1780 msgid "start (slice object attribute)" msgstr "start (slice 物件屬性)" -#: ../../reference/datamodel.rst:1587 +#: ../../reference/datamodel.rst:1780 msgid "stop (slice object attribute)" msgstr "stop (slice 物件屬性)" -#: ../../reference/datamodel.rst:1587 +#: ../../reference/datamodel.rst:1780 msgid "step (slice object attribute)" msgstr "step (slice 物件屬性)" -#: ../../reference/datamodel.rst:1635 +#: ../../reference/datamodel.rst:1828 msgid "operator" msgstr "operator(運算子)" -#: ../../reference/datamodel.rst:1635 +#: ../../reference/datamodel.rst:1828 msgid "overloading" msgstr "overloading(多載)" -#: ../../reference/datamodel.rst:1635 +#: ../../reference/datamodel.rst:1828 msgid "__getitem__() (mapping object method)" msgstr "__getitem__() (對映物件方法)" -#: ../../reference/datamodel.rst:1671 +#: ../../reference/datamodel.rst:1864 msgid "subclassing" msgstr "subclassing(子類別化)" -#: ../../reference/datamodel.rst:1671 +#: ../../reference/datamodel.rst:1864 msgid "immutable types" msgstr "immutable types(不可變型別)" -#: ../../reference/datamodel.rst:1700 +#: ../../reference/datamodel.rst:1893 msgid "constructor" msgstr "constructor(建構函式)" -#: ../../reference/datamodel.rst:1717 +#: ../../reference/datamodel.rst:1910 msgid "destructor" msgstr "destructor(解構函式)" -#: ../../reference/datamodel.rst:1717 +#: ../../reference/datamodel.rst:1910 msgid "finalizer" msgstr "finalizer(終結函式)" -#: ../../reference/datamodel.rst:1717 +#: ../../reference/datamodel.rst:1910 msgid "del" msgstr "del" -#: ../../reference/datamodel.rst:1781 +#: ../../reference/datamodel.rst:1974 msgid "repr() (built-in function)" msgstr "repr() (內建函式)" -#: ../../reference/datamodel.rst:1781 +#: ../../reference/datamodel.rst:1974 msgid "__repr__() (object method)" msgstr "__repr__() (物件方法)" -#: ../../reference/datamodel.rst:1798 +#: ../../reference/datamodel.rst:1991 msgid "__str__() (object method)" msgstr "__str__() (物件方法)" -#: ../../reference/datamodel.rst:1798 +#: ../../reference/datamodel.rst:1991 msgid "format() (built-in function)" msgstr "format() (內建函式)" -#: ../../reference/datamodel.rst:1798 +#: ../../reference/datamodel.rst:1991 msgid "print() (built-in function)" msgstr "print() (內建函式)" -#: ../../reference/datamodel.rst:1828 +#: ../../reference/datamodel.rst:2021 msgid "__format__() (object method)" msgstr "__format__() (物件方法)" -#: ../../reference/datamodel.rst:1828 +#: ../../reference/datamodel.rst:2021 msgid "conversion" msgstr "conversion" -#: ../../reference/datamodel.rst:1828 +#: ../../reference/datamodel.rst:2021 msgid "print" msgstr "print" -#: ../../reference/datamodel.rst:1867 +#: ../../reference/datamodel.rst:2060 msgid "comparisons" msgstr "comparison(比較)" -#: ../../reference/datamodel.rst:1912 +#: ../../reference/datamodel.rst:2105 msgid "hash" msgstr "hash(雜湊)" -#: ../../reference/datamodel.rst:1993 +#: ../../reference/datamodel.rst:2186 msgid "__len__() (mapping object method)" msgstr "__len__() (對映物件方法)" -#: ../../reference/datamodel.rst:2097 +#: ../../reference/datamodel.rst:2290 msgid "__getattr__ (module attribute)" msgstr "__getattr__ (模組屬性)" -#: ../../reference/datamodel.rst:2097 +#: ../../reference/datamodel.rst:2290 msgid "__dir__ (module attribute)" msgstr "__dir__ (模組屬性)" -#: ../../reference/datamodel.rst:2097 +#: ../../reference/datamodel.rst:2290 msgid "__class__ (module attribute)" msgstr "__class__ (模組屬性)" -#: ../../reference/datamodel.rst:2468 +#: ../../reference/datamodel.rst:2661 msgid "metaclass" msgstr "metaclass(元類別)" -#: ../../reference/datamodel.rst:2468 +#: ../../reference/datamodel.rst:2661 msgid "= (equals)" msgstr "= (等於)" -#: ../../reference/datamodel.rst:2468 +#: ../../reference/datamodel.rst:2661 msgid "class definition" msgstr "class definition(類別定義)" -#: ../../reference/datamodel.rst:2532 +#: ../../reference/datamodel.rst:2725 msgid "metaclass hint" msgstr "metaclass hint(元類別提示)" -#: ../../reference/datamodel.rst:2555 +#: ../../reference/datamodel.rst:2748 msgid "__prepare__ (metaclass method)" msgstr "__prepare__ (元類別方法)" -#: ../../reference/datamodel.rst:2579 +#: ../../reference/datamodel.rst:2772 msgid "body" msgstr "body" -#: ../../reference/datamodel.rst:2599 +#: ../../reference/datamodel.rst:2792 msgid "__class__ (method cell)" msgstr "__class__ (方法 cell)" -#: ../../reference/datamodel.rst:2599 +#: ../../reference/datamodel.rst:2792 msgid "__classcell__ (class namespace entry)" msgstr "__classcell__ (類別命名空間項目)" -#: ../../reference/datamodel.rst:2897 +#: ../../reference/datamodel.rst:3090 msgid "__bool__() (object method)" msgstr "__bool__() (物件方法)" -#: ../../reference/datamodel.rst:3055 ../../reference/datamodel.rst:3090 +#: ../../reference/datamodel.rst:3248 ../../reference/datamodel.rst:3283 msgid "divmod" msgstr "divmod" -#: ../../reference/datamodel.rst:3055 ../../reference/datamodel.rst:3090 -#: ../../reference/datamodel.rst:3104 +#: ../../reference/datamodel.rst:3248 ../../reference/datamodel.rst:3283 +#: ../../reference/datamodel.rst:3297 msgid "pow" msgstr "pow" -#: ../../reference/datamodel.rst:3153 +#: ../../reference/datamodel.rst:3346 msgid "abs" msgstr "abs" -#: ../../reference/datamodel.rst:3163 +#: ../../reference/datamodel.rst:3356 msgid "int" msgstr "int" -#: ../../reference/datamodel.rst:3163 +#: ../../reference/datamodel.rst:3356 msgid "float" msgstr "float" -#: ../../reference/datamodel.rst:3191 +#: ../../reference/datamodel.rst:3384 msgid "round" msgstr "round" -#: ../../reference/datamodel.rst:3218 +#: ../../reference/datamodel.rst:3411 msgid "with" msgstr "with" -#: ../../reference/datamodel.rst:3218 +#: ../../reference/datamodel.rst:3411 msgid "context manager" msgstr "context manager(情境管理器)" +#~ msgid ":attr:`__name__`" +#~ msgstr ":attr:`__name__`" + +#~ msgid ":attr:`__doc__`" +#~ msgstr ":attr:`__doc__`" + +#~ msgid ":attr:`__file__`" +#~ msgstr ":attr:`__file__`" + +#~ msgid ":attr:`__annotations__`" +#~ msgstr ":attr:`__annotations__`" + #~ msgid ":attr:`~definition.__name__`" #~ msgstr ":attr:`~definition.__name__`" diff --git a/reference/executionmodel.po b/reference/executionmodel.po index 4dabdcd7f3..b2d942dbdd 100644 --- a/reference/executionmodel.po +++ b/reference/executionmodel.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-27 00:14+0000\n" +"POT-Creation-Date: 2024-10-09 00:13+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-" @@ -138,7 +138,7 @@ msgid "" "declared as :keyword:`nonlocal` or :keyword:`global`. If a name is bound at " "the module level, it is a global variable. (The variables of the module " "code block are local and global.) If a variable is used in a code block but " -"not defined there, it is a :dfn:`free variable`." +"not defined there, it is a :term:`free variable`." msgstr "" #: ../../reference/executionmodel.rst:95 @@ -269,7 +269,7 @@ msgstr "" #: ../../reference/executionmodel.rst:191 msgid "Annotation scopes" -msgstr "" +msgstr "註釋作用域 (annotation scopes)" #: ../../reference/executionmodel.rst:193 msgid "" @@ -498,11 +498,11 @@ msgid "" "for both." msgstr "" -#: ../../reference/executionmodel.rst:337 +#: ../../reference/executionmodel.rst:340 msgid "Exceptions" msgstr "例外" -#: ../../reference/executionmodel.rst:348 +#: ../../reference/executionmodel.rst:351 msgid "" "Exceptions are a means of breaking out of the normal flow of control of a " "code block in order to handle errors or other exceptional conditions. An " @@ -511,7 +511,7 @@ msgid "" "or indirectly invoked the code block where the error occurred." msgstr "" -#: ../../reference/executionmodel.rst:354 +#: ../../reference/executionmodel.rst:357 msgid "" "The Python interpreter raises an exception when it detects a run-time error " "(such as division by zero). A Python program can also explicitly raise an " @@ -522,7 +522,7 @@ msgid "" "exception occurred or not in the preceding code." msgstr "" -#: ../../reference/executionmodel.rst:364 +#: ../../reference/executionmodel.rst:367 msgid "" "Python uses the \"termination\" model of error handling: an exception " "handler can find out what happened and continue execution at an outer level, " @@ -530,7 +530,7 @@ msgid "" "(except by re-entering the offending piece of code from the top)." msgstr "" -#: ../../reference/executionmodel.rst:371 +#: ../../reference/executionmodel.rst:374 msgid "" "When an exception is not handled at all, the interpreter terminates " "execution of the program, or returns to its interactive main loop. In " @@ -538,7 +538,7 @@ msgid "" "`SystemExit`." msgstr "" -#: ../../reference/executionmodel.rst:375 +#: ../../reference/executionmodel.rst:378 msgid "" "Exceptions are identified by class instances. The :keyword:`except` clause " "is selected depending on the class of the instance: it must reference the " @@ -547,7 +547,7 @@ msgid "" "additional information about the exceptional condition." msgstr "" -#: ../../reference/executionmodel.rst:383 +#: ../../reference/executionmodel.rst:386 msgid "" "Exception messages are not part of the Python API. Their contents may " "change from one version of Python to the next without warning and should not " @@ -555,17 +555,17 @@ msgid "" "interpreter." msgstr "" -#: ../../reference/executionmodel.rst:387 +#: ../../reference/executionmodel.rst:390 msgid "" "See also the description of the :keyword:`try` statement in section :ref:" "`try` and :keyword:`raise` statement in section :ref:`raise`." msgstr "" -#: ../../reference/executionmodel.rst:392 +#: ../../reference/executionmodel.rst:395 msgid "Footnotes" msgstr "註解" -#: ../../reference/executionmodel.rst:393 +#: ../../reference/executionmodel.rst:396 msgid "" "This limitation occurs because the code that is executed by these operations " "is not available at the time the module is compiled." @@ -647,34 +647,34 @@ msgstr "__main__" msgid "restricted" msgstr "restricted(受限)" -#: ../../reference/executionmodel.rst:339 +#: ../../reference/executionmodel.rst:342 msgid "exception" msgstr "exception(例外)" -#: ../../reference/executionmodel.rst:341 +#: ../../reference/executionmodel.rst:344 msgid "raise an exception" msgstr "raise an exception(引發例外)" -#: ../../reference/executionmodel.rst:341 +#: ../../reference/executionmodel.rst:344 msgid "handle an exception" msgstr "handle an exception(處理例外)" -#: ../../reference/executionmodel.rst:341 +#: ../../reference/executionmodel.rst:344 msgid "exception handler" msgstr "exception handler(例外處理器)" -#: ../../reference/executionmodel.rst:341 +#: ../../reference/executionmodel.rst:344 msgid "errors" msgstr "errors(錯誤)" -#: ../../reference/executionmodel.rst:341 +#: ../../reference/executionmodel.rst:344 msgid "error handling" msgstr "error handling(錯誤處理)" -#: ../../reference/executionmodel.rst:362 +#: ../../reference/executionmodel.rst:365 msgid "termination model" msgstr "termination model(終止模型)" -#: ../../reference/executionmodel.rst:369 +#: ../../reference/executionmodel.rst:372 msgid "SystemExit (built-in exception)" msgstr "SystemExit(內建例外)" diff --git a/reference/expressions.po b/reference/expressions.po index 959ecdaa17..48e8693491 100644 --- a/reference/expressions.po +++ b/reference/expressions.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-28 00:13+0000\n" +"POT-Creation-Date: 2024-10-08 03:35+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-" @@ -1322,7 +1322,7 @@ msgid "" "the same as if that method was called." msgstr "" -#: ../../reference/expressions.rst:1205 ../../reference/expressions.rst:2004 +#: ../../reference/expressions.rst:1205 ../../reference/expressions.rst:2006 msgid "Await expression" msgstr "" @@ -2022,11 +2022,11 @@ msgid "" "argument (for example, ``not 'foo'`` produces ``False`` rather than ``''``.)" msgstr "" -#: ../../reference/expressions.rst:1813 +#: ../../reference/expressions.rst:1815 msgid "Assignment expressions" msgstr "" -#: ../../reference/expressions.rst:1818 +#: ../../reference/expressions.rst:1820 msgid "" "An assignment expression (sometimes also called a \"named expression\" or " "\"walrus\") assigns an :token:`~python-grammar:expression` to an :token:" @@ -2034,11 +2034,11 @@ msgid "" "`~python-grammar:expression`." msgstr "" -#: ../../reference/expressions.rst:1823 +#: ../../reference/expressions.rst:1825 msgid "One common use case is when handling matched regular expressions:" msgstr "" -#: ../../reference/expressions.rst:1825 +#: ../../reference/expressions.rst:1827 msgid "" "if matching := pattern.search(data):\n" " do_something(matching)" @@ -2046,11 +2046,11 @@ msgstr "" "if matching := pattern.search(data):\n" " do_something(matching)" -#: ../../reference/expressions.rst:1830 +#: ../../reference/expressions.rst:1832 msgid "Or, when processing a file stream in chunks:" msgstr "" -#: ../../reference/expressions.rst:1832 +#: ../../reference/expressions.rst:1834 msgid "" "while chunk := file.read(9000):\n" " process(chunk)" @@ -2058,7 +2058,7 @@ msgstr "" "while chunk := file.read(9000):\n" " process(chunk)" -#: ../../reference/expressions.rst:1837 +#: ../../reference/expressions.rst:1839 msgid "" "Assignment expressions must be surrounded by parentheses when used as " "expression statements and when used as sub-expressions in slicing, " @@ -2068,36 +2068,36 @@ msgid "" "and ``while`` statements." msgstr "" -#: ../../reference/expressions.rst:1845 +#: ../../reference/expressions.rst:1847 msgid "See :pep:`572` for more details about assignment expressions." msgstr "" -#: ../../reference/expressions.rst:1852 +#: ../../reference/expressions.rst:1854 msgid "Conditional expressions" msgstr "" -#: ../../reference/expressions.rst:1864 +#: ../../reference/expressions.rst:1866 msgid "" "Conditional expressions (sometimes called a \"ternary operator\") have the " "lowest priority of all Python operations." msgstr "" -#: ../../reference/expressions.rst:1867 +#: ../../reference/expressions.rst:1869 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:1871 +#: ../../reference/expressions.rst:1873 msgid "See :pep:`308` for more details about conditional expressions." msgstr "" -#: ../../reference/expressions.rst:1878 +#: ../../reference/expressions.rst:1880 msgid "Lambdas" msgstr "" -#: ../../reference/expressions.rst:1889 +#: ../../reference/expressions.rst:1891 msgid "" "Lambda expressions (sometimes called lambda forms) are used to create " "anonymous functions. The expression ``lambda parameters: expression`` yields " @@ -2105,7 +2105,7 @@ msgid "" "defined with:" msgstr "" -#: ../../reference/expressions.rst:1893 +#: ../../reference/expressions.rst:1895 msgid "" "def (parameters):\n" " return expression" @@ -2113,25 +2113,25 @@ msgstr "" "def (parameters):\n" " return expression" -#: ../../reference/expressions.rst:1898 +#: ../../reference/expressions.rst:1900 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:1906 +#: ../../reference/expressions.rst:1908 msgid "Expression lists" msgstr "" -#: ../../reference/expressions.rst:1922 +#: ../../reference/expressions.rst:1924 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:1931 +#: ../../reference/expressions.rst:1933 msgid "" "An asterisk ``*`` denotes :dfn:`iterable unpacking`. Its operand must be " "an :term:`iterable`. The iterable is expanded into a sequence of items, " @@ -2139,16 +2139,16 @@ msgid "" "unpacking." msgstr "" -#: ../../reference/expressions.rst:1936 +#: ../../reference/expressions.rst:1938 msgid "" "Iterable unpacking in expression lists, originally proposed by :pep:`448`." msgstr "" -#: ../../reference/expressions.rst:1939 +#: ../../reference/expressions.rst:1941 msgid "Any item in an expression list may be starred. See :pep:`646`." msgstr "" -#: ../../reference/expressions.rst:1944 +#: ../../reference/expressions.rst:1946 msgid "" "A trailing comma is required only to create a one-item tuple, such as ``1," "``; it is optional in all other cases. A single expression without a " @@ -2157,24 +2157,24 @@ msgid "" "``()``.)" msgstr "" -#: ../../reference/expressions.rst:1955 +#: ../../reference/expressions.rst:1957 msgid "Evaluation order" msgstr "" -#: ../../reference/expressions.rst:1959 +#: ../../reference/expressions.rst:1961 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:1962 +#: ../../reference/expressions.rst:1964 msgid "" "In the following lines, expressions will be evaluated in the arithmetic " "order of their suffixes::" msgstr "" -#: ../../reference/expressions.rst:1965 +#: ../../reference/expressions.rst:1967 msgid "" "expr1, expr2, expr3, expr4\n" "(expr1, expr2, expr3, expr4)\n" @@ -2190,11 +2190,11 @@ msgstr "" "expr1(expr2, expr3, *expr4, **expr5)\n" "expr3, expr4 = expr1, expr2" -#: ../../reference/expressions.rst:1976 +#: ../../reference/expressions.rst:1978 msgid "Operator precedence" msgstr "" -#: ../../reference/expressions.rst:1981 +#: ../../reference/expressions.rst:1983 msgid "" "The following table summarizes the operator precedence in Python, from " "highest precedence (most binding) to lowest precedence (least binding). " @@ -2204,176 +2204,176 @@ msgid "" "group from right to left)." msgstr "" -#: ../../reference/expressions.rst:1987 +#: ../../reference/expressions.rst:1989 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:1993 +#: ../../reference/expressions.rst:1995 msgid "Operator" msgstr "" -#: ../../reference/expressions.rst:1993 +#: ../../reference/expressions.rst:1995 msgid "Description" msgstr "描述" -#: ../../reference/expressions.rst:1995 +#: ../../reference/expressions.rst:1997 msgid "``(expressions...)``," msgstr "``(expressions...)``," -#: ../../reference/expressions.rst:1997 +#: ../../reference/expressions.rst:1999 msgid "``[expressions...]``, ``{key: value...}``, ``{expressions...}``" msgstr "``[expressions...]``, ``{key: value...}``, ``{expressions...}``" -#: ../../reference/expressions.rst:1995 +#: ../../reference/expressions.rst:1997 msgid "" "Binding or parenthesized expression, list display, dictionary display, set " "display" msgstr "" -#: ../../reference/expressions.rst:2001 +#: ../../reference/expressions.rst:2003 msgid "``x[index]``, ``x[index:index]``, ``x(arguments...)``, ``x.attribute``" msgstr "``x[index]``, ``x[index:index]``, ``x(arguments...)``, ``x.attribute``" -#: ../../reference/expressions.rst:2001 +#: ../../reference/expressions.rst:2003 msgid "Subscription, slicing, call, attribute reference" msgstr "" -#: ../../reference/expressions.rst:2004 +#: ../../reference/expressions.rst:2006 msgid ":keyword:`await x `" msgstr ":keyword:`await x `" -#: ../../reference/expressions.rst:2006 +#: ../../reference/expressions.rst:2008 msgid "``**``" msgstr "``**``" -#: ../../reference/expressions.rst:2006 +#: ../../reference/expressions.rst:2008 msgid "Exponentiation [#]_" msgstr "" -#: ../../reference/expressions.rst:2008 +#: ../../reference/expressions.rst:2010 msgid "``+x``, ``-x``, ``~x``" msgstr "``+x``, ``-x``, ``~x``" -#: ../../reference/expressions.rst:2008 +#: ../../reference/expressions.rst:2010 msgid "Positive, negative, bitwise NOT" msgstr "" -#: ../../reference/expressions.rst:2010 +#: ../../reference/expressions.rst:2012 msgid "``*``, ``@``, ``/``, ``//``, ``%``" msgstr "``*``, ``@``, ``/``, ``//``, ``%``" -#: ../../reference/expressions.rst:2010 +#: ../../reference/expressions.rst:2012 msgid "" "Multiplication, matrix multiplication, division, floor division, remainder " "[#]_" msgstr "" -#: ../../reference/expressions.rst:2014 +#: ../../reference/expressions.rst:2016 msgid "``+``, ``-``" msgstr "``+``, ``-``" -#: ../../reference/expressions.rst:2014 +#: ../../reference/expressions.rst:2016 msgid "Addition and subtraction" msgstr "" -#: ../../reference/expressions.rst:2016 +#: ../../reference/expressions.rst:2018 msgid "``<<``, ``>>``" msgstr "``<<``, ``>>``" -#: ../../reference/expressions.rst:2016 +#: ../../reference/expressions.rst:2018 msgid "Shifts" msgstr "" -#: ../../reference/expressions.rst:2018 +#: ../../reference/expressions.rst:2020 msgid "``&``" msgstr "``&``" -#: ../../reference/expressions.rst:2018 +#: ../../reference/expressions.rst:2020 msgid "Bitwise AND" msgstr "" -#: ../../reference/expressions.rst:2020 +#: ../../reference/expressions.rst:2022 msgid "``^``" msgstr "``^``" -#: ../../reference/expressions.rst:2020 +#: ../../reference/expressions.rst:2022 msgid "Bitwise XOR" msgstr "" -#: ../../reference/expressions.rst:2022 +#: ../../reference/expressions.rst:2024 msgid "``|``" msgstr "``|``" -#: ../../reference/expressions.rst:2022 +#: ../../reference/expressions.rst:2024 msgid "Bitwise OR" msgstr "" -#: ../../reference/expressions.rst:2024 +#: ../../reference/expressions.rst:2026 msgid "" ":keyword:`in`, :keyword:`not in`, :keyword:`is`, :keyword:`is not`, ``<``, " "``<=``, ``>``, ``>=``, ``!=``, ``==``" msgstr "" -#: ../../reference/expressions.rst:2024 +#: ../../reference/expressions.rst:2026 msgid "Comparisons, including membership tests and identity tests" msgstr "" -#: ../../reference/expressions.rst:2028 +#: ../../reference/expressions.rst:2030 msgid ":keyword:`not x `" msgstr ":keyword:`not x `" -#: ../../reference/expressions.rst:2028 +#: ../../reference/expressions.rst:2030 msgid "Boolean NOT" msgstr "" -#: ../../reference/expressions.rst:2030 +#: ../../reference/expressions.rst:2032 msgid ":keyword:`and`" msgstr ":keyword:`and`" -#: ../../reference/expressions.rst:2030 +#: ../../reference/expressions.rst:2032 msgid "Boolean AND" msgstr "" -#: ../../reference/expressions.rst:2032 +#: ../../reference/expressions.rst:2034 msgid ":keyword:`or`" msgstr ":keyword:`or`" -#: ../../reference/expressions.rst:2032 +#: ../../reference/expressions.rst:2034 msgid "Boolean OR" msgstr "" -#: ../../reference/expressions.rst:2034 +#: ../../reference/expressions.rst:2036 msgid ":keyword:`if ` -- :keyword:`!else`" msgstr ":keyword:`if ` -- :keyword:`!else`" -#: ../../reference/expressions.rst:2034 +#: ../../reference/expressions.rst:2036 msgid "Conditional expression" msgstr "" -#: ../../reference/expressions.rst:2036 +#: ../../reference/expressions.rst:2038 msgid ":keyword:`lambda`" msgstr ":keyword:`lambda`" -#: ../../reference/expressions.rst:2036 +#: ../../reference/expressions.rst:2038 msgid "Lambda expression" msgstr "" -#: ../../reference/expressions.rst:2038 +#: ../../reference/expressions.rst:2040 msgid "``:=``" msgstr "``:=``" -#: ../../reference/expressions.rst:2038 +#: ../../reference/expressions.rst:2040 msgid "Assignment expression" msgstr "" -#: ../../reference/expressions.rst:2043 +#: ../../reference/expressions.rst:2045 msgid "Footnotes" msgstr "註解" -#: ../../reference/expressions.rst:2044 +#: ../../reference/expressions.rst:2046 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 " @@ -2385,7 +2385,7 @@ msgid "" "approach is more appropriate depends on the application." msgstr "" -#: ../../reference/expressions.rst:2053 +#: ../../reference/expressions.rst:2055 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, " @@ -2393,7 +2393,7 @@ msgid "" "* y + x % y`` be very close to ``x``." msgstr "" -#: ../../reference/expressions.rst:2058 +#: ../../reference/expressions.rst:2060 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 " @@ -2407,7 +2407,7 @@ msgid "" "(COMBINING CEDILLA)." msgstr "" -#: ../../reference/expressions.rst:2069 +#: ../../reference/expressions.rst:2071 msgid "" "The comparison operators on strings compare at the level of Unicode code " "points. This may be counter-intuitive to humans. For example, ``\"\\u00C7\" " @@ -2415,13 +2415,13 @@ msgid "" "same abstract character \"LATIN CAPITAL LETTER C WITH CEDILLA\"." msgstr "" -#: ../../reference/expressions.rst:2074 +#: ../../reference/expressions.rst:2076 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:2077 +#: ../../reference/expressions.rst:2079 msgid "" "Due to automatic garbage-collection, free lists, and the dynamic nature of " "descriptors, you may notice seemingly unusual behaviour in certain uses of " @@ -2429,13 +2429,13 @@ msgid "" "instance methods, or constants. Check their documentation for more info." msgstr "" -#: ../../reference/expressions.rst:2082 +#: ../../reference/expressions.rst:2084 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:2085 +#: ../../reference/expressions.rst:2087 msgid "" "The ``%`` operator is also used for string formatting; the same precedence " "applies." @@ -2443,8 +2443,8 @@ msgstr "" #: ../../reference/expressions.rst:8 ../../reference/expressions.rst:393 #: ../../reference/expressions.rst:448 ../../reference/expressions.rst:1765 -#: ../../reference/expressions.rst:1805 ../../reference/expressions.rst:1854 -#: ../../reference/expressions.rst:1880 ../../reference/expressions.rst:1908 +#: ../../reference/expressions.rst:1805 ../../reference/expressions.rst:1856 +#: ../../reference/expressions.rst:1882 ../../reference/expressions.rst:1910 msgid "expression" msgstr "" @@ -2521,7 +2521,7 @@ msgstr "type(型別)" #: ../../reference/expressions.rst:957 ../../reference/expressions.rst:1001 #: ../../reference/expressions.rst:1149 ../../reference/expressions.rst:1162 #: ../../reference/expressions.rst:1176 ../../reference/expressions.rst:1183 -#: ../../reference/expressions.rst:1730 ../../reference/expressions.rst:1920 +#: ../../reference/expressions.rst:1730 ../../reference/expressions.rst:1922 msgid "object" msgstr "object(物件)" @@ -2543,18 +2543,18 @@ msgid "empty" msgstr "" #: ../../reference/expressions.rst:175 ../../reference/expressions.rst:880 -#: ../../reference/expressions.rst:957 ../../reference/expressions.rst:1920 +#: ../../reference/expressions.rst:957 ../../reference/expressions.rst:1922 msgid "tuple" msgstr "" -#: ../../reference/expressions.rst:181 ../../reference/expressions.rst:1942 +#: ../../reference/expressions.rst:181 ../../reference/expressions.rst:1944 msgid "comma" msgstr "" #: ../../reference/expressions.rst:181 ../../reference/expressions.rst:275 #: ../../reference/expressions.rst:301 ../../reference/expressions.rst:329 #: ../../reference/expressions.rst:951 ../../reference/expressions.rst:1001 -#: ../../reference/expressions.rst:1908 +#: ../../reference/expressions.rst:1910 msgid ", (comma)" msgstr ", (逗號)" @@ -2571,7 +2571,7 @@ msgstr "for" msgid "in comprehensions" msgstr "於 comprehensions(綜合運算)" -#: ../../reference/expressions.rst:206 ../../reference/expressions.rst:1854 +#: ../../reference/expressions.rst:206 ../../reference/expressions.rst:1856 msgid "if" msgstr "if" @@ -2585,7 +2585,7 @@ msgstr "await" #: ../../reference/expressions.rst:275 ../../reference/expressions.rst:851 #: ../../reference/expressions.rst:880 ../../reference/expressions.rst:957 -#: ../../reference/expressions.rst:1908 +#: ../../reference/expressions.rst:1910 msgid "list" msgstr "list(串列)" @@ -2603,7 +2603,7 @@ msgid "list expression" msgstr "list expression(串列運算式)" #: ../../reference/expressions.rst:275 ../../reference/expressions.rst:301 -#: ../../reference/expressions.rst:1908 +#: ../../reference/expressions.rst:1910 msgid "expression list" msgstr "expression list(運算式串列)" @@ -2641,7 +2641,7 @@ msgid "dictionary expression" msgstr "dictionary expression(字典運算式)" #: ../../reference/expressions.rst:329 ../../reference/expressions.rst:951 -#: ../../reference/expressions.rst:1880 +#: ../../reference/expressions.rst:1882 msgid ": (colon)" msgstr ": (冒號)" @@ -2654,7 +2654,7 @@ msgid "in dictionary displays" msgstr "於字典顯示" #: ../../reference/expressions.rst:355 ../../reference/expressions.rst:1084 -#: ../../reference/expressions.rst:1927 +#: ../../reference/expressions.rst:1929 msgid "unpacking" msgstr "unpacking(解包)" @@ -2689,7 +2689,7 @@ msgid "from" msgstr "from" #: ../../reference/expressions.rst:448 ../../reference/expressions.rst:1149 -#: ../../reference/expressions.rst:1162 ../../reference/expressions.rst:1880 +#: ../../reference/expressions.rst:1162 ../../reference/expressions.rst:1882 msgid "function" msgstr "function (函式)" @@ -2831,7 +2831,7 @@ msgid "parameter" msgstr "parameter(參數)" #: ../../reference/expressions.rst:1084 ../../reference/expressions.rst:1318 -#: ../../reference/expressions.rst:1927 +#: ../../reference/expressions.rst:1929 msgid "* (asterisk)" msgstr "* (星號)" @@ -2895,7 +2895,7 @@ msgstr "operation(操作)" #: ../../reference/expressions.rst:1491 ../../reference/expressions.rst:1730 #: ../../reference/expressions.rst:1739 ../../reference/expressions.rst:1781 #: ../../reference/expressions.rst:1786 ../../reference/expressions.rst:1791 -#: ../../reference/expressions.rst:1854 ../../reference/expressions.rst:1978 +#: ../../reference/expressions.rst:1856 ../../reference/expressions.rst:1980 msgid "operator" msgstr "operator(運算子)" @@ -3150,59 +3150,59 @@ msgstr "named expression(附名運算式)" msgid "assignment" msgstr "assignment(賦值)" -#: ../../reference/expressions.rst:1854 +#: ../../reference/expressions.rst:1856 msgid "conditional" msgstr "conditional(條件式)" -#: ../../reference/expressions.rst:1854 +#: ../../reference/expressions.rst:1856 msgid "ternary" msgstr "ternary(三元)" -#: ../../reference/expressions.rst:1854 +#: ../../reference/expressions.rst:1856 msgid "conditional expression" msgstr "conditional expression(條件運算式)" -#: ../../reference/expressions.rst:1854 +#: ../../reference/expressions.rst:1856 msgid "else" msgstr "else" -#: ../../reference/expressions.rst:1880 +#: ../../reference/expressions.rst:1882 msgid "lambda" msgstr "lambda" -#: ../../reference/expressions.rst:1880 +#: ../../reference/expressions.rst:1882 msgid "form" msgstr "form" -#: ../../reference/expressions.rst:1880 +#: ../../reference/expressions.rst:1882 msgid "anonymous" msgstr "anonymous(匿名)" -#: ../../reference/expressions.rst:1880 +#: ../../reference/expressions.rst:1882 msgid "lambda expression" msgstr "lambda expression(lambda 運算式)" -#: ../../reference/expressions.rst:1927 +#: ../../reference/expressions.rst:1929 msgid "iterable" msgstr "iterable(可疊代)" -#: ../../reference/expressions.rst:1927 +#: ../../reference/expressions.rst:1929 msgid "in expression lists" msgstr "於 expression list(運算式串列)" -#: ../../reference/expressions.rst:1942 +#: ../../reference/expressions.rst:1944 msgid "trailing" msgstr "trailing" -#: ../../reference/expressions.rst:1957 +#: ../../reference/expressions.rst:1959 msgid "evaluation" msgstr "evaluation" -#: ../../reference/expressions.rst:1957 +#: ../../reference/expressions.rst:1959 msgid "order" msgstr "order(順序)" -#: ../../reference/expressions.rst:1978 +#: ../../reference/expressions.rst:1980 msgid "precedence" msgstr "precedence(優先順序)" diff --git a/reference/import.po b/reference/import.po index 5dd27d0187..9e13d37747 100644 --- a/reference/import.po +++ b/reference/import.po @@ -868,11 +868,11 @@ msgid "" "``foo`` attribute of the former." msgstr "" -#: ../../reference/import.rst:517 -msgid "Module spec" +#: ../../reference/import.rst:519 +msgid "Module specs" msgstr "" -#: ../../reference/import.rst:519 +#: ../../reference/import.rst:521 msgid "" "The import machinery uses a variety of information about each module during " "import, especially before loading. Most of the information is common to all " @@ -880,7 +880,7 @@ msgid "" "related information on a per-module basis." msgstr "" -#: ../../reference/import.rst:524 +#: ../../reference/import.rst:526 msgid "" "Using a spec during import allows state to be transferred between import " "system components, e.g. between the finder that creates the module spec and " @@ -889,220 +889,70 @@ msgid "" "a module spec the loader had that responsibility." msgstr "" -#: ../../reference/import.rst:530 -msgid "" -"The module's spec is exposed as the ``__spec__`` attribute on a module " -"object. See :class:`~importlib.machinery.ModuleSpec` for details on the " -"contents of the module spec." -msgstr "" - -#: ../../reference/import.rst:539 -msgid "Import-related module attributes" -msgstr "" - -#: ../../reference/import.rst:541 -msgid "" -"The import machinery fills in these attributes on each module object during " -"loading, based on the module's spec, before the loader executes the module." -msgstr "" - -#: ../../reference/import.rst:545 -msgid "" -"It is **strongly** recommended that you rely on :attr:`__spec__` and its " -"attributes instead of any of the other individual attributes listed below." -msgstr "" - -#: ../../reference/import.rst:551 -msgid "" -"The ``__name__`` attribute must be set to the fully qualified name of the " -"module. This name is used to uniquely identify the module in the import " -"system." -msgstr "" - -#: ../../reference/import.rst:557 -msgid "" -"The ``__loader__`` attribute must be set to the loader object that the " -"import machinery used when loading the module. This is mostly for " -"introspection, but can be used for additional loader-specific functionality, " -"for example getting data associated with a loader." -msgstr "" - -#: ../../reference/import.rst:562 ../../reference/import.rst:583 -msgid "" -"It is **strongly** recommended that you rely on :attr:`__spec__` instead of " -"this attribute." -msgstr "" - -#: ../../reference/import.rst:565 -msgid "" -"The value of ``__loader__`` is expected to be the same as ``__spec__." -"loader``. The use of ``__loader__`` is deprecated and slated for removal in " -"Python 3.14." -msgstr "" - -#: ../../reference/import.rst:572 -msgid "" -"The module's ``__package__`` attribute may be set. Its value must be a " -"string, but it can be the same value as its ``__name__``. When the module " -"is a package, its ``__package__`` value should be set to its ``__name__``. " -"When the module is not a package, ``__package__`` should be set to the empty " -"string for top-level modules, or for submodules, to the parent package's " -"name. See :pep:`366` for further details." -msgstr "" - -#: ../../reference/import.rst:580 -msgid "" -"This attribute is used instead of ``__name__`` to calculate explicit " -"relative imports for main modules, as defined in :pep:`366`." -msgstr "" - -#: ../../reference/import.rst:586 -msgid "" -"The value of ``__package__`` is expected to be the same as ``__spec__." -"parent``." -msgstr "" - -#: ../../reference/import.rst:590 -msgid "" -":exc:`ImportWarning` is raised if import falls back to ``__package__`` " -"instead of :attr:`~importlib.machinery.ModuleSpec.parent`." -msgstr "" - -#: ../../reference/import.rst:595 -msgid "" -"Raise :exc:`DeprecationWarning` instead of :exc:`ImportWarning` when falling " -"back to ``__package__``." -msgstr "" - -#: ../../reference/import.rst:599 -msgid "" -"``__package__`` will cease to be set or taken into consideration by the " -"import system or standard library." -msgstr "" - -#: ../../reference/import.rst:606 -msgid "" -"The ``__spec__`` attribute must be set to the module spec that was used when " -"importing the module. Setting ``__spec__`` appropriately applies equally to :" -"ref:`modules initialized during interpreter startup `. The one " -"exception is ``__main__``, where ``__spec__`` is :ref:`set to None in some " -"cases `." -msgstr "" - -#: ../../reference/import.rst:612 -msgid "" -"When ``__spec__.parent`` is not set, ``__package__`` is used as a fallback." -msgstr "" - -#: ../../reference/import.rst:617 -msgid "" -"``__spec__.parent`` is used as a fallback when ``__package__`` is not " -"defined." -msgstr "" - -#: ../../reference/import.rst:623 -msgid "" -"If the module is a package (either regular or namespace), the module " -"object's ``__path__`` attribute must be set. The value must be iterable, " -"but may be empty if ``__path__`` has no further significance. If " -"``__path__`` is not empty, it must produce strings when iterated over. More " -"details on the semantics of ``__path__`` are given :ref:`below `." -msgstr "" - -#: ../../reference/import.rst:630 -msgid "Non-package modules should not have a ``__path__`` attribute." -msgstr "" - -#: ../../reference/import.rst:635 -msgid "" -"``__file__`` is optional (if set, value must be a string). It indicates the " -"pathname of the file from which the module was loaded (if loaded from a " -"file), or the pathname of the shared library file for extension modules " -"loaded dynamically from a shared library. It might be missing for certain " -"types of modules, such as C modules that are statically linked into the " -"interpreter, and the import system may opt to leave it unset if it has no " -"semantic meaning (e.g. a module loaded from a database)." -msgstr "" - -#: ../../reference/import.rst:644 -msgid "" -"If ``__file__`` is set then the ``__cached__`` attribute might also be set, " -"which is the path to any compiled version of the code (e.g. byte-compiled " -"file). The file does not need to exist to set this attribute; the path can " -"simply point to where the compiled file would exist (see :pep:`3147`)." -msgstr "" - -#: ../../reference/import.rst:650 +#: ../../reference/import.rst:532 msgid "" -"Note that ``__cached__`` may be set even if ``__file__`` is not set. " -"However, that scenario is quite atypical. Ultimately, the loader is what " -"makes use of the module spec provided by the finder (from which ``__file__`` " -"and ``__cached__`` are derived). So if a loader can load from a cached " -"module but otherwise does not load from a file, that atypical scenario may " -"be appropriate." +"The module's spec is exposed as :attr:`module.__spec__`. Setting :attr:`!" +"__spec__` appropriately applies equally to :ref:`modules initialized during " +"interpreter startup `. The one exception is ``__main__``, where :" +"attr:`!__spec__` is :ref:`set to None in some cases `." msgstr "" -#: ../../reference/import.rst:657 +#: ../../reference/import.rst:538 msgid "" -"It is **strongly** recommended that you rely on :attr:`__spec__` instead of " -"``__cached__``." +"See :class:`~importlib.machinery.ModuleSpec` for details on the contents of " +"the module spec." msgstr "" -#: ../../reference/import.rst:660 -msgid "" -"``__cached__`` will cease to be set or taken into consideration by the " -"import system or standard library." +#: ../../reference/import.rst:546 +msgid "__path__ attributes on modules" msgstr "" -#: ../../reference/import.rst:667 -msgid "module.__path__" -msgstr "module.__path__" - -#: ../../reference/import.rst:669 +#: ../../reference/import.rst:548 msgid "" -"By definition, if a module has a ``__path__`` attribute, it is a package." +"The :attr:`~module.__path__` attribute should be a (possibly empty) :term:" +"`sequence` of strings enumerating the locations where the package's " +"submodules will be found. By definition, if a module has a :attr:`!__path__` " +"attribute, it is a :term:`package`." msgstr "" -#: ../../reference/import.rst:671 +#: ../../reference/import.rst:553 msgid "" -"A package's ``__path__`` attribute is used during imports of its " +"A package's :attr:`~module.__path__` attribute is used during imports of its " "subpackages. Within the import machinery, it functions much the same as :" "data:`sys.path`, i.e. providing a list of locations to search for modules " -"during import. However, ``__path__`` is typically much more constrained " -"than :data:`sys.path`." +"during import. However, :attr:`!__path__` is typically much more constrained " +"than :data:`!sys.path`." msgstr "" -#: ../../reference/import.rst:677 +#: ../../reference/import.rst:560 msgid "" -"``__path__`` must be an iterable of strings, but it may be empty. The same " -"rules used for :data:`sys.path` also apply to a package's ``__path__``, and :" -"data:`sys.path_hooks` (described below) are consulted when traversing a " -"package's ``__path__``." +"The same rules used for :data:`sys.path` also apply to a package's :attr:`!" +"__path__`. :data:`sys.path_hooks` (described below) are consulted when " +"traversing a package's :attr:`!__path__`." msgstr "" -#: ../../reference/import.rst:682 +#: ../../reference/import.rst:564 msgid "" -"A package's ``__init__.py`` file may set or alter the package's ``__path__`` " -"attribute, and this was typically the way namespace packages were " -"implemented prior to :pep:`420`. With the adoption of :pep:`420`, namespace " -"packages no longer need to supply ``__init__.py`` files containing only " -"``__path__`` manipulation code; the import machinery automatically sets " -"``__path__`` correctly for the namespace package." +"A package's ``__init__.py`` file may set or alter the package's :attr:" +"`~module.__path__` attribute, and this was typically the way namespace " +"packages were implemented prior to :pep:`420`. With the adoption of :pep:" +"`420`, namespace packages no longer need to supply ``__init__.py`` files " +"containing only :attr:`!__path__` manipulation code; the import machinery " +"automatically sets :attr:`!__path__` correctly for the namespace package." msgstr "" -#: ../../reference/import.rst:690 +#: ../../reference/import.rst:573 msgid "Module reprs" msgstr "" -#: ../../reference/import.rst:692 +#: ../../reference/import.rst:575 msgid "" "By default, all modules have a usable repr, however depending on the " "attributes set above, and in the module's spec, you can more explicitly " "control the repr of module objects." msgstr "" -#: ../../reference/import.rst:696 +#: ../../reference/import.rst:579 msgid "" "If the module has a spec (``__spec__``), the import machinery will try to " "generate a repr from it. If that fails or there is no spec, the import " @@ -1112,45 +962,45 @@ msgid "" "for whatever information is missing." msgstr "" -#: ../../reference/import.rst:703 +#: ../../reference/import.rst:586 msgid "Here are the exact rules used:" msgstr "" -#: ../../reference/import.rst:705 +#: ../../reference/import.rst:588 msgid "" "If the module has a ``__spec__`` attribute, the information in the spec is " "used to generate the repr. The \"name\", \"loader\", \"origin\", and " "\"has_location\" attributes are consulted." msgstr "" -#: ../../reference/import.rst:709 +#: ../../reference/import.rst:592 msgid "" "If the module has a ``__file__`` attribute, this is used as part of the " "module's repr." msgstr "" -#: ../../reference/import.rst:712 +#: ../../reference/import.rst:595 msgid "" "If the module has no ``__file__`` but does have a ``__loader__`` that is not " "``None``, then the loader's repr is used as part of the module's repr." msgstr "" -#: ../../reference/import.rst:715 +#: ../../reference/import.rst:598 msgid "Otherwise, just use the module's ``__name__`` in the repr." msgstr "" -#: ../../reference/import.rst:717 +#: ../../reference/import.rst:600 msgid "" "Use of :meth:`!module_repr`, having been deprecated since Python 3.4, was " "removed in Python 3.12 and is no longer called during the resolution of a " "module's repr." msgstr "" -#: ../../reference/import.rst:725 +#: ../../reference/import.rst:608 msgid "Cached bytecode invalidation" msgstr "" -#: ../../reference/import.rst:727 +#: ../../reference/import.rst:610 msgid "" "Before Python loads cached bytecode from a ``.pyc`` file, it checks whether " "the cache is up-to-date with the source ``.py`` file. By default, Python " @@ -1160,7 +1010,7 @@ msgid "" "source's metadata." msgstr "" -#: ../../reference/import.rst:734 +#: ../../reference/import.rst:617 msgid "" "Python also supports \"hash-based\" cache files, which store a hash of the " "source file's contents rather than its metadata. There are two variants of " @@ -1174,17 +1024,17 @@ msgid "" "option:`--check-hash-based-pycs` flag." msgstr "" -#: ../../reference/import.rst:745 +#: ../../reference/import.rst:628 msgid "" "Added hash-based ``.pyc`` files. Previously, Python only supported timestamp-" "based invalidation of bytecode caches." msgstr "" -#: ../../reference/import.rst:751 +#: ../../reference/import.rst:634 msgid "The Path Based Finder" msgstr "" -#: ../../reference/import.rst:756 +#: ../../reference/import.rst:639 msgid "" "As mentioned previously, Python comes with several default meta path " "finders. One of these, called the :term:`path based finder` (:class:" @@ -1193,14 +1043,14 @@ msgid "" "a location to search for modules." msgstr "" -#: ../../reference/import.rst:762 +#: ../../reference/import.rst:645 msgid "" "The path based finder itself doesn't know how to import anything. Instead, " "it traverses the individual path entries, associating each of them with a " "path entry finder that knows how to handle that particular kind of path." msgstr "" -#: ../../reference/import.rst:766 +#: ../../reference/import.rst:649 msgid "" "The default set of path entry finders implement all the semantics for " "finding modules on the file system, handling special file types such as " @@ -1211,14 +1061,14 @@ msgid "" "from zipfiles." msgstr "" -#: ../../reference/import.rst:773 +#: ../../reference/import.rst:656 msgid "" "Path entries need not be limited to file system locations. They can refer " "to URLs, database queries, or any other location that can be specified as a " "string." msgstr "" -#: ../../reference/import.rst:777 +#: ../../reference/import.rst:660 msgid "" "The path based finder provides additional hooks and protocols so that you " "can extend and customize the types of searchable path entries. For example, " @@ -1229,7 +1079,7 @@ msgid "" "from the web." msgstr "" -#: ../../reference/import.rst:785 +#: ../../reference/import.rst:668 msgid "" "A word of warning: this section and the previous both use the term *finder*, " "distinguishing between them by using the terms :term:`meta path finder` and :" @@ -1240,7 +1090,7 @@ msgid "" "process, as keyed off the :data:`sys.meta_path` traversal." msgstr "" -#: ../../reference/import.rst:793 +#: ../../reference/import.rst:676 msgid "" "By contrast, path entry finders are in a sense an implementation detail of " "the path based finder, and in fact, if the path based finder were to be " @@ -1248,11 +1098,11 @@ msgid "" "would be invoked." msgstr "" -#: ../../reference/import.rst:800 +#: ../../reference/import.rst:683 msgid "Path entry finders" msgstr "" -#: ../../reference/import.rst:808 +#: ../../reference/import.rst:691 msgid "" "The :term:`path based finder` is responsible for finding and loading Python " "modules and packages whose location is specified with a string :term:`path " @@ -1260,7 +1110,7 @@ msgid "" "not be limited to this." msgstr "" -#: ../../reference/import.rst:813 +#: ../../reference/import.rst:696 msgid "" "As a meta path finder, the :term:`path based finder` implements the :meth:" "`~importlib.abc.MetaPathFinder.find_spec` protocol previously described, " @@ -1268,7 +1118,7 @@ msgid "" "modules are found and loaded from the :term:`import path`." msgstr "" -#: ../../reference/import.rst:818 +#: ../../reference/import.rst:701 msgid "" "Three variables are used by the :term:`path based finder`, :data:`sys." "path`, :data:`sys.path_hooks` and :data:`sys.path_importer_cache`. The " @@ -1276,7 +1126,7 @@ msgid "" "additional ways that the import machinery can be customized." msgstr "" -#: ../../reference/import.rst:823 +#: ../../reference/import.rst:706 msgid "" ":data:`sys.path` contains a list of strings providing search locations for " "modules and packages. It is initialized from the :envvar:`PYTHONPATH` " @@ -1288,7 +1138,7 @@ msgid "" "other data types are ignored." msgstr "" -#: ../../reference/import.rst:832 +#: ../../reference/import.rst:715 msgid "" "The :term:`path based finder` is a :term:`meta path finder`, so the import " "machinery begins the :term:`import path` search by calling the path based " @@ -1300,7 +1150,7 @@ msgid "" "top level import and :data:`sys.path` is used." msgstr "" -#: ../../reference/import.rst:841 +#: ../../reference/import.rst:724 msgid "" "The path based finder iterates over every entry in the search path, and for " "each of these, looks for an appropriate :term:`path entry finder` (:class:" @@ -1316,7 +1166,7 @@ msgid "" "finder to perform the path entry search again." msgstr "" -#: ../../reference/import.rst:854 +#: ../../reference/import.rst:737 msgid "" "If the path entry is not present in the cache, the path based finder " "iterates over every callable in :data:`sys.path_hooks`. Each of the :term:" @@ -1332,7 +1182,7 @@ msgid "" "decode the argument, it should raise :exc:`ImportError`." msgstr "" -#: ../../reference/import.rst:868 +#: ../../reference/import.rst:751 msgid "" "If :data:`sys.path_hooks` iteration ends with no :term:`path entry finder` " "being returned, then the path based finder's :meth:`~importlib.machinery." @@ -1342,7 +1192,7 @@ msgid "" "could not find the module." msgstr "" -#: ../../reference/import.rst:875 +#: ../../reference/import.rst:758 msgid "" "If a :term:`path entry finder` *is* returned by one of the :term:`path entry " "hook` callables on :data:`sys.path_hooks`, then the following protocol is " @@ -1350,7 +1200,7 @@ msgid "" "the module." msgstr "" -#: ../../reference/import.rst:880 +#: ../../reference/import.rst:763 msgid "" "The current working directory -- denoted by an empty string -- is handled " "slightly differently from other entries on :data:`sys.path`. First, if the " @@ -1362,18 +1212,18 @@ msgid "" "and not the empty string." msgstr "" -#: ../../reference/import.rst:890 +#: ../../reference/import.rst:773 msgid "Path entry finder protocol" msgstr "" -#: ../../reference/import.rst:892 +#: ../../reference/import.rst:775 msgid "" "In order to support imports of modules and initialized packages and also to " "contribute portions to namespace packages, path entry finders must implement " "the :meth:`~importlib.abc.PathEntryFinder.find_spec` method." msgstr "" -#: ../../reference/import.rst:896 +#: ../../reference/import.rst:779 msgid "" ":meth:`~importlib.abc.PathEntryFinder.find_spec` takes two arguments: the " "fully qualified name of the module being imported, and the (optional) target " @@ -1381,21 +1231,21 @@ msgid "" "spec will always have \"loader\" set (with one exception)." msgstr "" -#: ../../reference/import.rst:901 +#: ../../reference/import.rst:784 msgid "" "To indicate to the import machinery that the spec represents a namespace :" "term:`portion`, the path entry finder sets ``submodule_search_locations`` to " "a list containing the portion." msgstr "" -#: ../../reference/import.rst:905 +#: ../../reference/import.rst:788 msgid "" ":meth:`~importlib.abc.PathEntryFinder.find_spec` replaced :meth:`!" "find_loader` and :meth:`!find_module`, both of which are now deprecated, but " "will be used if ``find_spec()`` is not defined." msgstr "" -#: ../../reference/import.rst:911 +#: ../../reference/import.rst:794 msgid "" "Older path entry finders may implement one of these two deprecated methods " "instead of ``find_spec()``. The methods are still respected for the sake of " @@ -1403,14 +1253,14 @@ msgid "" "path entry finder, the legacy methods are ignored." msgstr "" -#: ../../reference/import.rst:916 +#: ../../reference/import.rst:799 msgid "" ":meth:`!find_loader` takes one argument, the fully qualified name of the " "module being imported. ``find_loader()`` returns a 2-tuple where the first " "item is the loader and the second item is a namespace :term:`portion`." msgstr "" -#: ../../reference/import.rst:921 +#: ../../reference/import.rst:804 msgid "" "For backwards compatibility with other implementations of the import " "protocol, many path entry finders also support the same, traditional " @@ -1420,7 +1270,7 @@ msgid "" "initial call to the path hook)." msgstr "" -#: ../../reference/import.rst:928 +#: ../../reference/import.rst:811 msgid "" "The ``find_module()`` method on path entry finders is deprecated, as it does " "not allow the path entry finder to contribute portions to namespace " @@ -1429,28 +1279,28 @@ msgid "" "preference to ``find_module()``." msgstr "" -#: ../../reference/import.rst:934 +#: ../../reference/import.rst:817 msgid "" "Calls to :meth:`!find_module` and :meth:`!find_loader` by the import system " "will raise :exc:`ImportWarning`." msgstr "" -#: ../../reference/import.rst:939 +#: ../../reference/import.rst:822 msgid "``find_module()`` and ``find_loader()`` have been removed." msgstr "" -#: ../../reference/import.rst:944 +#: ../../reference/import.rst:827 msgid "Replacing the standard import system" msgstr "" -#: ../../reference/import.rst:946 +#: ../../reference/import.rst:829 msgid "" "The most reliable mechanism for replacing the entire import system is to " "delete the default contents of :data:`sys.meta_path`, replacing them " "entirely with a custom meta path hook." msgstr "" -#: ../../reference/import.rst:950 +#: ../../reference/import.rst:833 msgid "" "If it is acceptable to only alter the behaviour of import statements without " "affecting other APIs that access the import system, then replacing the " @@ -1459,7 +1309,7 @@ msgid "" "statements within that module." msgstr "" -#: ../../reference/import.rst:956 +#: ../../reference/import.rst:839 msgid "" "To selectively prevent the import of some modules from a hook early on the " "meta path (rather than disabling the standard import system entirely), it is " @@ -1469,11 +1319,11 @@ msgid "" "exception terminates it immediately." msgstr "" -#: ../../reference/import.rst:966 +#: ../../reference/import.rst:849 msgid "Package Relative Imports" msgstr "" -#: ../../reference/import.rst:968 +#: ../../reference/import.rst:851 msgid "" "Relative imports use leading dots. A single leading dot indicates a relative " "import, starting with the current package. Two or more leading dots indicate " @@ -1481,7 +1331,7 @@ msgid "" "after the first. For example, given the following package layout::" msgstr "" -#: ../../reference/import.rst:973 +#: ../../reference/import.rst:856 msgid "" "package/\n" " __init__.py\n" @@ -1505,13 +1355,13 @@ msgstr "" " moduleZ.py\n" " moduleA.py" -#: ../../reference/import.rst:984 +#: ../../reference/import.rst:867 msgid "" "In either ``subpackage1/moduleX.py`` or ``subpackage1/__init__.py``, the " "following are valid relative imports::" msgstr "" -#: ../../reference/import.rst:987 +#: ../../reference/import.rst:870 msgid "" "from .moduleY import spam\n" "from .moduleY import spam as ham\n" @@ -1527,28 +1377,28 @@ msgstr "" "from ..subpackage2.moduleZ import eggs\n" "from ..moduleA import foo" -#: ../../reference/import.rst:994 +#: ../../reference/import.rst:877 msgid "" "Absolute imports may use either the ``import <>`` or ``from <> import <>`` " "syntax, but relative imports may only use the second form; the reason for " "this is that::" msgstr "" -#: ../../reference/import.rst:998 +#: ../../reference/import.rst:881 msgid "import XXX.YYY.ZZZ" msgstr "import XXX.YYY.ZZZ" -#: ../../reference/import.rst:1000 +#: ../../reference/import.rst:883 msgid "" "should expose ``XXX.YYY.ZZZ`` as a usable expression, but .moduleY is not a " "valid expression." msgstr "" -#: ../../reference/import.rst:1007 +#: ../../reference/import.rst:890 msgid "Special considerations for __main__" msgstr "" -#: ../../reference/import.rst:1009 +#: ../../reference/import.rst:892 msgid "" "The :mod:`__main__` module is a special case relative to Python's import " "system. As noted :ref:`elsewhere `, the ``__main__`` module is " @@ -1559,17 +1409,17 @@ msgid "" "interpreter is invoked." msgstr "" -#: ../../reference/import.rst:1020 +#: ../../reference/import.rst:903 msgid "__main__.__spec__" msgstr "__main__.__spec__" -#: ../../reference/import.rst:1022 +#: ../../reference/import.rst:905 msgid "" "Depending on how :mod:`__main__` is initialized, ``__main__.__spec__`` gets " "set appropriately or to ``None``." msgstr "" -#: ../../reference/import.rst:1025 +#: ../../reference/import.rst:908 msgid "" "When Python is started with the :option:`-m` option, ``__spec__`` is set to " "the module spec of the corresponding module or package. ``__spec__`` is also " @@ -1577,30 +1427,30 @@ msgid "" "directory, zipfile or other :data:`sys.path` entry." msgstr "" -#: ../../reference/import.rst:1030 +#: ../../reference/import.rst:913 msgid "" "In :ref:`the remaining cases ` ``__main__." "__spec__`` is set to ``None``, as the code used to populate the :mod:" "`__main__` does not correspond directly with an importable module:" msgstr "" -#: ../../reference/import.rst:1034 +#: ../../reference/import.rst:917 msgid "interactive prompt" msgstr "" -#: ../../reference/import.rst:1035 +#: ../../reference/import.rst:918 msgid ":option:`-c` option" msgstr ":option:`-c` 選項" -#: ../../reference/import.rst:1036 +#: ../../reference/import.rst:919 msgid "running from stdin" msgstr "" -#: ../../reference/import.rst:1037 +#: ../../reference/import.rst:920 msgid "running directly from a source or bytecode file" msgstr "" -#: ../../reference/import.rst:1039 +#: ../../reference/import.rst:922 msgid "" "Note that ``__main__.__spec__`` is always ``None`` in the last case, *even " "if* the file could technically be imported directly as a module instead. Use " @@ -1608,7 +1458,7 @@ msgid "" "`__main__`." msgstr "" -#: ../../reference/import.rst:1044 +#: ../../reference/import.rst:927 msgid "" "Note also that even when ``__main__`` corresponds with an importable module " "and ``__main__.__spec__`` is set accordingly, they're still considered " @@ -1617,11 +1467,11 @@ msgid "" "populate the ``__main__`` namespace, and not during normal import." msgstr "" -#: ../../reference/import.rst:1052 +#: ../../reference/import.rst:935 msgid "References" msgstr "" -#: ../../reference/import.rst:1054 +#: ../../reference/import.rst:937 msgid "" "The import machinery has evolved considerably since Python's early days. " "The original `specification for packages ` for " "Python 3.3. :pep:`420` also introduced the :meth:`!find_loader` protocol as " "an alternative to :meth:`!find_module`." msgstr "" -#: ../../reference/import.rst:1066 +#: ../../reference/import.rst:949 msgid "" ":pep:`366` describes the addition of the ``__package__`` attribute for " "explicit relative imports in main modules." msgstr "" -#: ../../reference/import.rst:1069 +#: ../../reference/import.rst:952 msgid "" ":pep:`328` introduced absolute and explicit relative imports and initially " "proposed ``__name__`` for semantics :pep:`366` would eventually specify for " "``__package__``." msgstr "" -#: ../../reference/import.rst:1073 +#: ../../reference/import.rst:956 msgid ":pep:`338` defines executing modules as scripts." msgstr "" -#: ../../reference/import.rst:1075 +#: ../../reference/import.rst:958 msgid "" ":pep:`451` adds the encapsulation of per-module import state in spec " "objects. It also off-loads most of the boilerplate responsibilities of " @@ -1668,15 +1518,15 @@ msgid "" "finders and loaders." msgstr "" -#: ../../reference/import.rst:1082 +#: ../../reference/import.rst:965 msgid "Footnotes" msgstr "註解" -#: ../../reference/import.rst:1083 +#: ../../reference/import.rst:966 msgid "See :class:`types.ModuleType`." msgstr "參閱 :class:`types.ModuleType`。" -#: ../../reference/import.rst:1085 +#: ../../reference/import.rst:968 msgid "" "The importlib implementation avoids using the return value directly. " "Instead, it gets the module object by looking the module name up in :data:" @@ -1758,22 +1608,25 @@ msgstr "sys.meta_path" msgid "find_spec" msgstr "find_spec" -#: ../../reference/import.rst:753 +#: ../../reference/import.rst:636 msgid "path based finder" msgstr "path based finder(基於路徑的搜尋器)" -#: ../../reference/import.rst:802 +#: ../../reference/import.rst:685 msgid "sys.path" msgstr "sys.path" -#: ../../reference/import.rst:802 +#: ../../reference/import.rst:685 msgid "sys.path_hooks" msgstr "sys.path_hooks" -#: ../../reference/import.rst:802 +#: ../../reference/import.rst:685 msgid "sys.path_importer_cache" msgstr "sys.path_importer_cache" -#: ../../reference/import.rst:802 +#: ../../reference/import.rst:685 msgid "PYTHONPATH" msgstr "PYTHONPATH" + +#~ msgid "module.__path__" +#~ msgstr "module.__path__" diff --git a/reference/lexical_analysis.po b/reference/lexical_analysis.po index 00ed2f6f6f..fd5a4fbd89 100644 --- a/reference/lexical_analysis.po +++ b/reference/lexical_analysis.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-15 00:14+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-" @@ -366,103 +366,98 @@ msgstr "" #: ../../reference/lexical_analysis.rst:286 msgid "" "Within the ASCII range (U+0001..U+007F), the valid characters for " -"identifiers are the same as in Python 2.x: the uppercase and lowercase " -"letters ``A`` through ``Z``, the underscore ``_`` and, except for the first " -"character, the digits ``0`` through ``9``." -msgstr "" - -#: ../../reference/lexical_analysis.rst:291 -msgid "" -"Python 3.0 introduces additional characters from outside the ASCII range " -"(see :pep:`3131`). For these characters, the classification uses the " -"version of the Unicode Character Database as included in the :mod:" +"identifiers include the uppercase and lowercase letters ``A`` through ``Z``, " +"the underscore ``_`` and, except for the first character, the digits ``0`` " +"through ``9``. Python 3.0 introduced additional characters from outside the " +"ASCII range (see :pep:`3131`). For these characters, the classification " +"uses the version of the Unicode Character Database as included in the :mod:" "`unicodedata` module." msgstr "" -#: ../../reference/lexical_analysis.rst:295 +#: ../../reference/lexical_analysis.rst:294 msgid "Identifiers are unlimited in length. Case is significant." msgstr "" -#: ../../reference/lexical_analysis.rst:304 +#: ../../reference/lexical_analysis.rst:303 msgid "The Unicode category codes mentioned above stand for:" msgstr "" -#: ../../reference/lexical_analysis.rst:306 +#: ../../reference/lexical_analysis.rst:305 msgid "*Lu* - uppercase letters" msgstr "*Lu* - 大寫字母" -#: ../../reference/lexical_analysis.rst:307 +#: ../../reference/lexical_analysis.rst:306 msgid "*Ll* - lowercase letters" msgstr "*Ll* - 小寫字母" -#: ../../reference/lexical_analysis.rst:308 +#: ../../reference/lexical_analysis.rst:307 msgid "*Lt* - titlecase letters" msgstr "" -#: ../../reference/lexical_analysis.rst:309 +#: ../../reference/lexical_analysis.rst:308 msgid "*Lm* - modifier letters" msgstr "" -#: ../../reference/lexical_analysis.rst:310 +#: ../../reference/lexical_analysis.rst:309 msgid "*Lo* - other letters" msgstr "*Lo* - 其他字母" -#: ../../reference/lexical_analysis.rst:311 +#: ../../reference/lexical_analysis.rst:310 msgid "*Nl* - letter numbers" msgstr "" -#: ../../reference/lexical_analysis.rst:312 +#: ../../reference/lexical_analysis.rst:311 msgid "*Mn* - nonspacing marks" msgstr "" -#: ../../reference/lexical_analysis.rst:313 +#: ../../reference/lexical_analysis.rst:312 msgid "*Mc* - spacing combining marks" msgstr "" -#: ../../reference/lexical_analysis.rst:314 +#: ../../reference/lexical_analysis.rst:313 msgid "*Nd* - decimal numbers" msgstr "*Nd* - 十進位數字" -#: ../../reference/lexical_analysis.rst:315 +#: ../../reference/lexical_analysis.rst:314 msgid "*Pc* - connector punctuations" msgstr "" -#: ../../reference/lexical_analysis.rst:316 +#: ../../reference/lexical_analysis.rst:315 msgid "" "*Other_ID_Start* - explicit list of characters in `PropList.txt `_ to support backwards " "compatibility" msgstr "" -#: ../../reference/lexical_analysis.rst:319 +#: ../../reference/lexical_analysis.rst:318 msgid "*Other_ID_Continue* - likewise" msgstr "" -#: ../../reference/lexical_analysis.rst:321 +#: ../../reference/lexical_analysis.rst:320 msgid "" "All identifiers are converted into the normal form NFKC while parsing; " "comparison of identifiers is based on NFKC." msgstr "" -#: ../../reference/lexical_analysis.rst:324 +#: ../../reference/lexical_analysis.rst:323 msgid "" "A non-normative HTML file listing all valid identifier characters for " "Unicode 15.1.0 can be found at https://www.unicode.org/Public/15.1.0/ucd/" "DerivedCoreProperties.txt" msgstr "" -#: ../../reference/lexical_analysis.rst:332 +#: ../../reference/lexical_analysis.rst:331 msgid "Keywords" msgstr "關鍵字" -#: ../../reference/lexical_analysis.rst:338 +#: ../../reference/lexical_analysis.rst:337 msgid "" "The following identifiers are used as reserved words, or *keywords* of the " "language, and cannot be used as ordinary identifiers. They must be spelled " "exactly as written here:" msgstr "" -#: ../../reference/lexical_analysis.rst:342 +#: ../../reference/lexical_analysis.rst:341 msgid "" "False await else import pass\n" "None break except in raise\n" @@ -480,11 +475,11 @@ msgstr "" "assert del global not with\n" "async elif if or yield" -#: ../../reference/lexical_analysis.rst:356 +#: ../../reference/lexical_analysis.rst:355 msgid "Soft Keywords" msgstr "軟關鍵字" -#: ../../reference/lexical_analysis.rst:362 +#: ../../reference/lexical_analysis.rst:361 msgid "" "Some identifiers are only reserved under specific contexts. These are known " "as *soft keywords*. The identifiers ``match``, ``case``, ``type`` and ``_`` " @@ -492,82 +487,82 @@ msgid "" "is done at the parser level, not when tokenizing." msgstr "" -#: ../../reference/lexical_analysis.rst:367 +#: ../../reference/lexical_analysis.rst:366 msgid "" "As soft keywords, their use in the grammar is possible while still " "preserving compatibility with existing code that uses these names as " "identifier names." msgstr "" -#: ../../reference/lexical_analysis.rst:371 +#: ../../reference/lexical_analysis.rst:370 msgid "" "``match``, ``case``, and ``_`` are used in the :keyword:`match` statement. " "``type`` is used in the :keyword:`type` statement." msgstr "" -#: ../../reference/lexical_analysis.rst:374 +#: ../../reference/lexical_analysis.rst:373 msgid "``type`` is now a soft keyword." msgstr "``type`` 現在是軟關鍵字。" -#: ../../reference/lexical_analysis.rst:383 +#: ../../reference/lexical_analysis.rst:382 msgid "Reserved classes of identifiers" msgstr "" -#: ../../reference/lexical_analysis.rst:385 +#: ../../reference/lexical_analysis.rst:384 msgid "" "Certain classes of identifiers (besides keywords) have special meanings. " "These classes are identified by the patterns of leading and trailing " "underscore characters:" msgstr "" -#: ../../reference/lexical_analysis.rst:389 +#: ../../reference/lexical_analysis.rst:388 msgid "``_*``" msgstr "``_*``" -#: ../../reference/lexical_analysis.rst:390 +#: ../../reference/lexical_analysis.rst:389 msgid "Not imported by ``from module import *``." msgstr "" -#: ../../reference/lexical_analysis.rst:392 +#: ../../reference/lexical_analysis.rst:391 msgid "``_``" msgstr "``_``" -#: ../../reference/lexical_analysis.rst:393 +#: ../../reference/lexical_analysis.rst:392 msgid "" "In a ``case`` pattern within a :keyword:`match` statement, ``_`` is a :ref:" "`soft keyword ` that denotes a :ref:`wildcard `." msgstr "" -#: ../../reference/lexical_analysis.rst:397 +#: ../../reference/lexical_analysis.rst:396 msgid "" "Separately, the interactive interpreter makes the result of the last " "evaluation available in the variable ``_``. (It is stored in the :mod:" "`builtins` module, alongside built-in functions like ``print``.)" msgstr "" -#: ../../reference/lexical_analysis.rst:402 +#: ../../reference/lexical_analysis.rst:401 msgid "" "Elsewhere, ``_`` is a regular identifier. It is often used to name " "\"special\" items, but it is not special to Python itself." msgstr "" -#: ../../reference/lexical_analysis.rst:407 +#: ../../reference/lexical_analysis.rst:406 msgid "" "The name ``_`` is often used in conjunction with internationalization; refer " "to the documentation for the :mod:`gettext` module for more information on " "this convention." msgstr "" -#: ../../reference/lexical_analysis.rst:411 +#: ../../reference/lexical_analysis.rst:410 msgid "It is also commonly used for unused variables." msgstr "" -#: ../../reference/lexical_analysis.rst:413 +#: ../../reference/lexical_analysis.rst:412 msgid "``__*__``" msgstr "``__*__``" -#: ../../reference/lexical_analysis.rst:414 +#: ../../reference/lexical_analysis.rst:413 msgid "" "System-defined names, informally known as \"dunder\" names. These names are " "defined by the interpreter and its implementation (including the standard " @@ -577,11 +572,11 @@ msgid "" "explicitly documented use, is subject to breakage without warning." msgstr "" -#: ../../reference/lexical_analysis.rst:421 +#: ../../reference/lexical_analysis.rst:420 msgid "``__*``" msgstr "``__*``" -#: ../../reference/lexical_analysis.rst:422 +#: ../../reference/lexical_analysis.rst:421 msgid "" "Class-private names. Names in this category, when used within the context " "of a class definition, are re-written to use a mangled form to help avoid " @@ -589,23 +584,23 @@ msgid "" "section :ref:`atom-identifiers`." msgstr "" -#: ../../reference/lexical_analysis.rst:431 +#: ../../reference/lexical_analysis.rst:430 msgid "Literals" msgstr "" -#: ../../reference/lexical_analysis.rst:435 +#: ../../reference/lexical_analysis.rst:434 msgid "Literals are notations for constant values of some built-in types." msgstr "" -#: ../../reference/lexical_analysis.rst:446 +#: ../../reference/lexical_analysis.rst:445 msgid "String and Bytes literals" msgstr "" -#: ../../reference/lexical_analysis.rst:448 +#: ../../reference/lexical_analysis.rst:447 msgid "String literals are described by the following lexical definitions:" msgstr "" -#: ../../reference/lexical_analysis.rst:473 +#: ../../reference/lexical_analysis.rst:472 msgid "" "One syntactic restriction not indicated by these productions is that " "whitespace is not allowed between the :token:`~python-grammar:stringprefix` " @@ -615,7 +610,7 @@ msgid "" "`encodings`." msgstr "" -#: ../../reference/lexical_analysis.rst:483 +#: ../../reference/lexical_analysis.rst:482 msgid "" "In plain English: Both types of literals can be enclosed in matching single " "quotes (``'``) or double quotes (``\"``). They can also be enclosed in " @@ -628,7 +623,7 @@ msgid "" "sequences>` below for examples." msgstr "" -#: ../../reference/lexical_analysis.rst:496 +#: ../../reference/lexical_analysis.rst:495 msgid "" "Bytes literals are always prefixed with ``'b'`` or ``'B'``; they produce an " "instance of the :class:`bytes` type instead of the :class:`str` type. They " @@ -636,7 +631,7 @@ msgid "" "greater must be expressed with escapes." msgstr "" -#: ../../reference/lexical_analysis.rst:505 +#: ../../reference/lexical_analysis.rst:504 msgid "" "Both string and bytes literals may optionally be prefixed with a letter " "``'r'`` or ``'R'``; such constructs are called :dfn:`raw string literals` " @@ -645,20 +640,20 @@ msgid "" "escapes are not treated specially." msgstr "" -#: ../../reference/lexical_analysis.rst:511 +#: ../../reference/lexical_analysis.rst:510 msgid "" "The ``'rb'`` prefix of raw bytes literals has been added as a synonym of " "``'br'``." msgstr "" -#: ../../reference/lexical_analysis.rst:515 +#: ../../reference/lexical_analysis.rst:514 msgid "" "Support for the unicode legacy literal (``u'value'``) was reintroduced to " "simplify the maintenance of dual Python 2.x and 3.x codebases. See :pep:" "`414` for more information." msgstr "" -#: ../../reference/lexical_analysis.rst:523 +#: ../../reference/lexical_analysis.rst:522 msgid "" "A string literal with ``'f'`` or ``'F'`` in its prefix is a :dfn:`formatted " "string literal`; see :ref:`f-strings`. The ``'f'`` may be combined with " @@ -666,7 +661,7 @@ msgid "" "are possible, but formatted bytes literals are not." msgstr "" -#: ../../reference/lexical_analysis.rst:528 +#: ../../reference/lexical_analysis.rst:527 msgid "" "In triple-quoted literals, unescaped newlines and quotes are allowed (and " "are retained), except that three unescaped quotes in a row terminate the " @@ -674,253 +669,253 @@ msgid "" "either ``'`` or ``\"``.)" msgstr "" -#: ../../reference/lexical_analysis.rst:551 +#: ../../reference/lexical_analysis.rst:550 msgid "Escape sequences" msgstr "跳脫序列" -#: ../../reference/lexical_analysis.rst:553 +#: ../../reference/lexical_analysis.rst:552 msgid "" "Unless an ``'r'`` or ``'R'`` prefix is present, escape sequences in string " "and bytes literals are interpreted according to rules similar to those used " "by Standard C. The recognized escape sequences are:" msgstr "" -#: ../../reference/lexical_analysis.rst:558 -#: ../../reference/lexical_analysis.rst:591 +#: ../../reference/lexical_analysis.rst:557 +#: ../../reference/lexical_analysis.rst:590 msgid "Escape Sequence" msgstr "" -#: ../../reference/lexical_analysis.rst:558 -#: ../../reference/lexical_analysis.rst:591 +#: ../../reference/lexical_analysis.rst:557 +#: ../../reference/lexical_analysis.rst:590 msgid "Meaning" msgstr "含義" -#: ../../reference/lexical_analysis.rst:558 -#: ../../reference/lexical_analysis.rst:591 +#: ../../reference/lexical_analysis.rst:557 +#: ../../reference/lexical_analysis.rst:590 msgid "Notes" msgstr "註解" -#: ../../reference/lexical_analysis.rst:560 +#: ../../reference/lexical_analysis.rst:559 msgid "``\\``\\ " msgstr "``\\``\\ " -#: ../../reference/lexical_analysis.rst:560 +#: ../../reference/lexical_analysis.rst:559 msgid "Backslash and newline ignored" msgstr "" -#: ../../reference/lexical_analysis.rst:560 +#: ../../reference/lexical_analysis.rst:559 msgid "\\(1)" msgstr "\\(1)" -#: ../../reference/lexical_analysis.rst:562 +#: ../../reference/lexical_analysis.rst:561 msgid "``\\\\``" msgstr "``\\\\``" -#: ../../reference/lexical_analysis.rst:562 +#: ../../reference/lexical_analysis.rst:561 msgid "Backslash (``\\``)" msgstr "" -#: ../../reference/lexical_analysis.rst:564 +#: ../../reference/lexical_analysis.rst:563 msgid "``\\'``" msgstr "``\\'``" -#: ../../reference/lexical_analysis.rst:564 +#: ../../reference/lexical_analysis.rst:563 msgid "Single quote (``'``)" msgstr "單引號 (``'``)" -#: ../../reference/lexical_analysis.rst:566 +#: ../../reference/lexical_analysis.rst:565 msgid "``\\\"``" msgstr "``\\\"``" -#: ../../reference/lexical_analysis.rst:566 +#: ../../reference/lexical_analysis.rst:565 msgid "Double quote (``\"``)" msgstr "雙引號 (``\"``)" -#: ../../reference/lexical_analysis.rst:568 +#: ../../reference/lexical_analysis.rst:567 msgid "``\\a``" msgstr "``\\a``" -#: ../../reference/lexical_analysis.rst:568 +#: ../../reference/lexical_analysis.rst:567 msgid "ASCII Bell (BEL)" msgstr "" -#: ../../reference/lexical_analysis.rst:570 +#: ../../reference/lexical_analysis.rst:569 msgid "``\\b``" msgstr "``\\b``" -#: ../../reference/lexical_analysis.rst:570 +#: ../../reference/lexical_analysis.rst:569 msgid "ASCII Backspace (BS)" msgstr "" -#: ../../reference/lexical_analysis.rst:572 +#: ../../reference/lexical_analysis.rst:571 msgid "``\\f``" msgstr "``\\f``" -#: ../../reference/lexical_analysis.rst:572 +#: ../../reference/lexical_analysis.rst:571 msgid "ASCII Formfeed (FF)" msgstr "" -#: ../../reference/lexical_analysis.rst:574 +#: ../../reference/lexical_analysis.rst:573 msgid "``\\n``" msgstr "``\\n``" -#: ../../reference/lexical_analysis.rst:574 +#: ../../reference/lexical_analysis.rst:573 msgid "ASCII Linefeed (LF)" msgstr "" -#: ../../reference/lexical_analysis.rst:576 +#: ../../reference/lexical_analysis.rst:575 msgid "``\\r``" msgstr "``\\r``" -#: ../../reference/lexical_analysis.rst:576 +#: ../../reference/lexical_analysis.rst:575 msgid "ASCII Carriage Return (CR)" msgstr "" -#: ../../reference/lexical_analysis.rst:578 +#: ../../reference/lexical_analysis.rst:577 msgid "``\\t``" msgstr "``\\t``" -#: ../../reference/lexical_analysis.rst:578 +#: ../../reference/lexical_analysis.rst:577 msgid "ASCII Horizontal Tab (TAB)" msgstr "" -#: ../../reference/lexical_analysis.rst:580 +#: ../../reference/lexical_analysis.rst:579 msgid "``\\v``" msgstr "``\\v``" -#: ../../reference/lexical_analysis.rst:580 +#: ../../reference/lexical_analysis.rst:579 msgid "ASCII Vertical Tab (VT)" msgstr "" -#: ../../reference/lexical_analysis.rst:582 +#: ../../reference/lexical_analysis.rst:581 msgid ":samp:`\\\\\\\\{ooo}`" msgstr ":samp:`\\\\\\\\{ooo}`" -#: ../../reference/lexical_analysis.rst:582 +#: ../../reference/lexical_analysis.rst:581 msgid "Character with octal value *ooo*" msgstr "" -#: ../../reference/lexical_analysis.rst:582 +#: ../../reference/lexical_analysis.rst:581 msgid "(2,4)" msgstr "(2,4)" -#: ../../reference/lexical_analysis.rst:585 +#: ../../reference/lexical_analysis.rst:584 msgid ":samp:`\\\\x{hh}`" msgstr ":samp:`\\\\x{hh}`" -#: ../../reference/lexical_analysis.rst:585 +#: ../../reference/lexical_analysis.rst:584 msgid "Character with hex value *hh*" msgstr "" -#: ../../reference/lexical_analysis.rst:585 +#: ../../reference/lexical_analysis.rst:584 msgid "(3,4)" msgstr "(3,4)" -#: ../../reference/lexical_analysis.rst:588 +#: ../../reference/lexical_analysis.rst:587 msgid "Escape sequences only recognized in string literals are:" msgstr "" -#: ../../reference/lexical_analysis.rst:593 +#: ../../reference/lexical_analysis.rst:592 msgid ":samp:`\\\\N\\\\{{name}\\\\}`" msgstr ":samp:`\\\\N\\\\{{name}\\\\}`" -#: ../../reference/lexical_analysis.rst:593 +#: ../../reference/lexical_analysis.rst:592 msgid "Character named *name* in the Unicode database" msgstr "" -#: ../../reference/lexical_analysis.rst:593 +#: ../../reference/lexical_analysis.rst:592 msgid "\\(5)" msgstr "\\(5)" -#: ../../reference/lexical_analysis.rst:596 +#: ../../reference/lexical_analysis.rst:595 msgid ":samp:`\\\\u{xxxx}`" msgstr ":samp:`\\\\u{xxxx}`" -#: ../../reference/lexical_analysis.rst:596 +#: ../../reference/lexical_analysis.rst:595 msgid "Character with 16-bit hex value *xxxx*" msgstr "" -#: ../../reference/lexical_analysis.rst:596 +#: ../../reference/lexical_analysis.rst:595 msgid "\\(6)" msgstr "\\(6)" -#: ../../reference/lexical_analysis.rst:599 +#: ../../reference/lexical_analysis.rst:598 msgid ":samp:`\\\\U{xxxxxxxx}`" msgstr ":samp:`\\\\U{xxxxxxxx}`" -#: ../../reference/lexical_analysis.rst:599 +#: ../../reference/lexical_analysis.rst:598 msgid "Character with 32-bit hex value *xxxxxxxx*" msgstr "" -#: ../../reference/lexical_analysis.rst:599 +#: ../../reference/lexical_analysis.rst:598 msgid "\\(7)" msgstr "\\(7)" -#: ../../reference/lexical_analysis.rst:603 +#: ../../reference/lexical_analysis.rst:602 msgid "Notes:" msgstr "註解:" -#: ../../reference/lexical_analysis.rst:606 +#: ../../reference/lexical_analysis.rst:605 msgid "A backslash can be added at the end of a line to ignore the newline::" msgstr "" -#: ../../reference/lexical_analysis.rst:608 +#: ../../reference/lexical_analysis.rst:607 msgid "" ">>> 'This string will not include \\\n" "... backslashes or newline characters.'\n" "'This string will not include backslashes or newline characters.'" msgstr "" -#: ../../reference/lexical_analysis.rst:612 +#: ../../reference/lexical_analysis.rst:611 msgid "" "The same result can be achieved using :ref:`triple-quoted strings " "`, or parentheses and :ref:`string literal concatenation `." msgstr "" -#: ../../reference/lexical_analysis.rst:617 +#: ../../reference/lexical_analysis.rst:616 msgid "As in Standard C, up to three octal digits are accepted." msgstr "" -#: ../../reference/lexical_analysis.rst:619 +#: ../../reference/lexical_analysis.rst:618 msgid "" "Octal escapes with value larger than ``0o377`` produce a :exc:" "`DeprecationWarning`." msgstr "" -#: ../../reference/lexical_analysis.rst:623 +#: ../../reference/lexical_analysis.rst:622 msgid "" "Octal escapes with value larger than ``0o377`` produce a :exc:" "`SyntaxWarning`. In a future Python version they will be eventually a :exc:" "`SyntaxError`." msgstr "" -#: ../../reference/lexical_analysis.rst:629 +#: ../../reference/lexical_analysis.rst:628 msgid "Unlike in Standard C, exactly two hex digits are required." msgstr "" -#: ../../reference/lexical_analysis.rst:632 +#: ../../reference/lexical_analysis.rst:631 msgid "" "In a bytes literal, hexadecimal and octal escapes denote the byte with the " "given value. In a string literal, these escapes denote a Unicode character " "with the given value." msgstr "" -#: ../../reference/lexical_analysis.rst:637 +#: ../../reference/lexical_analysis.rst:636 msgid "Support for name aliases [#]_ has been added." msgstr "" -#: ../../reference/lexical_analysis.rst:641 +#: ../../reference/lexical_analysis.rst:640 msgid "Exactly four hex digits are required." msgstr "" -#: ../../reference/lexical_analysis.rst:644 +#: ../../reference/lexical_analysis.rst:643 msgid "" "Any Unicode character can be encoded this way. Exactly eight hex digits are " "required." msgstr "" -#: ../../reference/lexical_analysis.rst:650 +#: ../../reference/lexical_analysis.rst:649 msgid "" "Unlike Standard C, all unrecognized escape sequences are left in the string " "unchanged, i.e., *the backslash is left in the result*. (This behavior is " @@ -930,17 +925,17 @@ msgid "" "category of unrecognized escapes for bytes literals." msgstr "" -#: ../../reference/lexical_analysis.rst:657 +#: ../../reference/lexical_analysis.rst:656 msgid "Unrecognized escape sequences produce a :exc:`DeprecationWarning`." msgstr "" -#: ../../reference/lexical_analysis.rst:660 +#: ../../reference/lexical_analysis.rst:659 msgid "" "Unrecognized escape sequences produce a :exc:`SyntaxWarning`. In a future " "Python version they will be eventually a :exc:`SyntaxError`." msgstr "" -#: ../../reference/lexical_analysis.rst:664 +#: ../../reference/lexical_analysis.rst:663 msgid "" "Even in a raw literal, quotes can be escaped with a backslash, but the " "backslash remains in the result; for example, ``r\"\\\"\"`` is a valid " @@ -953,11 +948,11 @@ msgid "" "continuation." msgstr "" -#: ../../reference/lexical_analysis.rst:677 +#: ../../reference/lexical_analysis.rst:676 msgid "String literal concatenation" msgstr "" -#: ../../reference/lexical_analysis.rst:679 +#: ../../reference/lexical_analysis.rst:678 msgid "" "Multiple adjacent string or bytes literals (delimited by whitespace), " "possibly using different quoting conventions, are allowed, and their meaning " @@ -967,14 +962,14 @@ msgid "" "lines, or even to add comments to parts of strings, for example::" msgstr "" -#: ../../reference/lexical_analysis.rst:686 +#: ../../reference/lexical_analysis.rst:685 msgid "" "re.compile(\"[A-Za-z_]\" # letter or underscore\n" " \"[A-Za-z0-9_]*\" # letter, digit or underscore\n" " )" msgstr "" -#: ../../reference/lexical_analysis.rst:690 +#: ../../reference/lexical_analysis.rst:689 msgid "" "Note that this feature is defined at the syntactical level, but implemented " "at compile time. The '+' operator must be used to concatenate string " @@ -984,11 +979,11 @@ msgid "" "with plain string literals." msgstr "" -#: ../../reference/lexical_analysis.rst:713 +#: ../../reference/lexical_analysis.rst:712 msgid "f-strings" msgstr "f-string(f 字串)" -#: ../../reference/lexical_analysis.rst:717 +#: ../../reference/lexical_analysis.rst:716 msgid "" "A :dfn:`formatted string literal` or :dfn:`f-string` is a string literal " "that is prefixed with ``'f'`` or ``'F'``. These strings may contain " @@ -997,14 +992,14 @@ msgid "" "are really expressions evaluated at run time." msgstr "" -#: ../../reference/lexical_analysis.rst:723 +#: ../../reference/lexical_analysis.rst:722 msgid "" "Escape sequences are decoded like in ordinary string literals (except when a " "literal is also marked as a raw string). After decoding, the grammar for " "the contents of the string is:" msgstr "" -#: ../../reference/lexical_analysis.rst:737 +#: ../../reference/lexical_analysis.rst:736 msgid "" "The parts of the string outside curly braces are treated literally, except " "that any doubled curly braces ``'{{'`` or ``'}}'`` are replaced with the " @@ -1017,7 +1012,7 @@ msgid "" "replacement field ends with a closing curly bracket ``'}'``." msgstr "" -#: ../../reference/lexical_analysis.rst:747 +#: ../../reference/lexical_analysis.rst:746 msgid "" "Expressions in formatted string literals are treated like regular Python " "expressions surrounded by parentheses, with a few exceptions. An empty " @@ -1031,27 +1026,27 @@ msgid "" "replacement fields must be closed in a different line." msgstr "" -#: ../../reference/lexical_analysis.rst:758 +#: ../../reference/lexical_analysis.rst:757 msgid "" ">>> f\"abc{a # This is a comment }\"\n" "... + 3}\"\n" "'abc5'" msgstr "" -#: ../../reference/lexical_analysis.rst:764 +#: ../../reference/lexical_analysis.rst:763 msgid "" "Prior to Python 3.7, an :keyword:`await` expression and comprehensions " "containing an :keyword:`async for` clause were illegal in the expressions in " "formatted string literals due to a problem with the implementation." msgstr "" -#: ../../reference/lexical_analysis.rst:769 +#: ../../reference/lexical_analysis.rst:768 msgid "" "Prior to Python 3.12, comments were not allowed inside f-string replacement " "fields." msgstr "" -#: ../../reference/lexical_analysis.rst:773 +#: ../../reference/lexical_analysis.rst:772 msgid "" "When the equal sign ``'='`` is provided, the output will have the expression " "text, the ``'='`` and the evaluated value. Spaces after the opening brace " @@ -1062,18 +1057,18 @@ msgid "" "r'`` is declared." msgstr "" -#: ../../reference/lexical_analysis.rst:781 +#: ../../reference/lexical_analysis.rst:780 msgid "The equal sign ``'='``." msgstr "等號 ``'='``。" -#: ../../reference/lexical_analysis.rst:784 +#: ../../reference/lexical_analysis.rst:783 msgid "" "If a conversion is specified, the result of evaluating the expression is " "converted before formatting. Conversion ``'!s'`` calls :func:`str` on the " "result, ``'!r'`` calls :func:`repr`, and ``'!a'`` calls :func:`ascii`." msgstr "" -#: ../../reference/lexical_analysis.rst:788 +#: ../../reference/lexical_analysis.rst:787 msgid "" "The result is then formatted using the :func:`format` protocol. The format " "specifier is passed to the :meth:`~object.__format__` method of the " @@ -1082,7 +1077,7 @@ msgid "" "value of the whole string." msgstr "" -#: ../../reference/lexical_analysis.rst:794 +#: ../../reference/lexical_analysis.rst:793 msgid "" "Top-level format specifiers may include nested replacement fields. These " "nested fields may include their own conversion fields and :ref:`format " @@ -1091,17 +1086,17 @@ msgid "" "as that used by the :meth:`str.format` method." msgstr "" -#: ../../reference/lexical_analysis.rst:800 +#: ../../reference/lexical_analysis.rst:799 msgid "" "Formatted string literals may be concatenated, but replacement fields cannot " "be split across literals." msgstr "" -#: ../../reference/lexical_analysis.rst:803 +#: ../../reference/lexical_analysis.rst:802 msgid "Some examples of formatted string literals::" msgstr "" -#: ../../reference/lexical_analysis.rst:805 +#: ../../reference/lexical_analysis.rst:804 msgid "" ">>> name = \"Fred\"\n" ">>> f\"He said his name is {name!r}.\"\n" @@ -1133,13 +1128,13 @@ msgid "" "'line = \"The mill\\'s closed\" '" msgstr "" -#: ../../reference/lexical_analysis.rst:835 +#: ../../reference/lexical_analysis.rst:834 msgid "" "Reusing the outer f-string quoting type inside a replacement field is " "permitted::" msgstr "" -#: ../../reference/lexical_analysis.rst:838 +#: ../../reference/lexical_analysis.rst:837 msgid "" ">>> a = dict(x=2)\n" ">>> f\"abc {a[\"x\"]} def\"\n" @@ -1149,19 +1144,19 @@ msgstr "" ">>> f\"abc {a[\"x\"]} def\"\n" "'abc 2 def'" -#: ../../reference/lexical_analysis.rst:842 +#: ../../reference/lexical_analysis.rst:841 msgid "" "Prior to Python 3.12, reuse of the same quoting type of the outer f-string " "inside a replacement field was not possible." msgstr "" -#: ../../reference/lexical_analysis.rst:846 +#: ../../reference/lexical_analysis.rst:845 msgid "" "Backslashes are also allowed in replacement fields and are evaluated the " "same way as in any other context::" msgstr "" -#: ../../reference/lexical_analysis.rst:849 +#: ../../reference/lexical_analysis.rst:848 msgid "" ">>> a = [\"a\", \"b\", \"c\"]\n" ">>> print(f\"List a contains:\\n{\"\\n\".join(a)}\")\n" @@ -1177,19 +1172,19 @@ msgstr "" "b\n" "c" -#: ../../reference/lexical_analysis.rst:856 +#: ../../reference/lexical_analysis.rst:855 msgid "" "Prior to Python 3.12, backslashes were not permitted inside an f-string " "replacement field." msgstr "" -#: ../../reference/lexical_analysis.rst:860 +#: ../../reference/lexical_analysis.rst:859 msgid "" "Formatted string literals cannot be used as docstrings, even if they do not " "include expressions." msgstr "" -#: ../../reference/lexical_analysis.rst:865 +#: ../../reference/lexical_analysis.rst:864 msgid "" ">>> def foo():\n" "... f\"Not a docstring\"\n" @@ -1198,63 +1193,63 @@ msgid "" "True" msgstr "" -#: ../../reference/lexical_analysis.rst:871 +#: ../../reference/lexical_analysis.rst:870 msgid "" "See also :pep:`498` for the proposal that added formatted string literals, " "and :meth:`str.format`, which uses a related format string mechanism." msgstr "" -#: ../../reference/lexical_analysis.rst:878 +#: ../../reference/lexical_analysis.rst:877 msgid "Numeric literals" msgstr "" -#: ../../reference/lexical_analysis.rst:884 +#: ../../reference/lexical_analysis.rst:883 msgid "" "There are three types of numeric literals: integers, floating-point numbers, " "and imaginary numbers. There are no complex literals (complex numbers can " "be formed by adding a real number and an imaginary number)." msgstr "" -#: ../../reference/lexical_analysis.rst:888 +#: ../../reference/lexical_analysis.rst:887 msgid "" "Note that numeric literals do not include a sign; a phrase like ``-1`` is " "actually an expression composed of the unary operator '``-``' and the " "literal ``1``." msgstr "" -#: ../../reference/lexical_analysis.rst:902 +#: ../../reference/lexical_analysis.rst:901 msgid "Integer literals" msgstr "" -#: ../../reference/lexical_analysis.rst:904 +#: ../../reference/lexical_analysis.rst:903 msgid "Integer literals are described by the following lexical definitions:" msgstr "" -#: ../../reference/lexical_analysis.rst:918 +#: ../../reference/lexical_analysis.rst:917 msgid "" "There is no limit for the length of integer literals apart from what can be " "stored in available memory." msgstr "" -#: ../../reference/lexical_analysis.rst:921 +#: ../../reference/lexical_analysis.rst:920 msgid "" "Underscores are ignored for determining the numeric value of the literal. " "They can be used to group digits for enhanced readability. One underscore " "can occur between digits, and after base specifiers like ``0x``." msgstr "" -#: ../../reference/lexical_analysis.rst:925 +#: ../../reference/lexical_analysis.rst:924 msgid "" "Note that leading zeros in a non-zero decimal number are not allowed. This " "is for disambiguation with C-style octal literals, which Python used before " "version 3.0." msgstr "" -#: ../../reference/lexical_analysis.rst:929 +#: ../../reference/lexical_analysis.rst:928 msgid "Some examples of integer literals::" msgstr "" -#: ../../reference/lexical_analysis.rst:931 +#: ../../reference/lexical_analysis.rst:930 msgid "" "7 2147483647 0o177 0b100110111\n" "3 79228162514264337593543950336 0o377 0xdeadbeef\n" @@ -1264,21 +1259,21 @@ msgstr "" "3 79228162514264337593543950336 0o377 0xdeadbeef\n" " 100_000_000_000 0b_1110_0101" -#: ../../reference/lexical_analysis.rst:935 -#: ../../reference/lexical_analysis.rst:967 +#: ../../reference/lexical_analysis.rst:934 +#: ../../reference/lexical_analysis.rst:966 msgid "Underscores are now allowed for grouping purposes in literals." msgstr "" -#: ../../reference/lexical_analysis.rst:946 +#: ../../reference/lexical_analysis.rst:945 msgid "Floating-point literals" msgstr "浮點數常數 (Floating-point literals)" -#: ../../reference/lexical_analysis.rst:948 +#: ../../reference/lexical_analysis.rst:947 msgid "" "Floating-point literals are described by the following lexical definitions:" msgstr "" -#: ../../reference/lexical_analysis.rst:958 +#: ../../reference/lexical_analysis.rst:957 msgid "" "Note that the integer and exponent parts are always interpreted using radix " "10. For example, ``077e010`` is legal, and denotes the same number as " @@ -1287,23 +1282,23 @@ msgid "" "grouping." msgstr "" -#: ../../reference/lexical_analysis.rst:963 +#: ../../reference/lexical_analysis.rst:962 msgid "Some examples of floating-point literals::" msgstr "一些浮點數常數的範例: ::" -#: ../../reference/lexical_analysis.rst:965 +#: ../../reference/lexical_analysis.rst:964 msgid "3.14 10. .001 1e100 3.14e-10 0e0 3.14_15_93" msgstr "3.14 10. .001 1e100 3.14e-10 0e0 3.14_15_93" -#: ../../reference/lexical_analysis.rst:976 +#: ../../reference/lexical_analysis.rst:975 msgid "Imaginary literals" msgstr "" -#: ../../reference/lexical_analysis.rst:978 +#: ../../reference/lexical_analysis.rst:977 msgid "Imaginary literals are described by the following lexical definitions:" msgstr "" -#: ../../reference/lexical_analysis.rst:983 +#: ../../reference/lexical_analysis.rst:982 msgid "" "An imaginary literal yields a complex number with a real part of 0.0. " "Complex numbers are represented as a pair of floating-point numbers and have " @@ -1312,19 +1307,19 @@ msgid "" "Some examples of imaginary literals::" msgstr "" -#: ../../reference/lexical_analysis.rst:989 +#: ../../reference/lexical_analysis.rst:988 msgid "3.14j 10.j 10j .001j 1e100j 3.14e-10j 3.14_15_93j" msgstr "3.14j 10.j 10j .001j 1e100j 3.14e-10j 3.14_15_93j" -#: ../../reference/lexical_analysis.rst:995 +#: ../../reference/lexical_analysis.rst:994 msgid "Operators" msgstr "" -#: ../../reference/lexical_analysis.rst:999 +#: ../../reference/lexical_analysis.rst:998 msgid "The following tokens are operators:" msgstr "" -#: ../../reference/lexical_analysis.rst:1001 +#: ../../reference/lexical_analysis.rst:1000 msgid "" "+ - * ** / // % @\n" "<< >> & | ^ ~ :=\n" @@ -1334,15 +1329,15 @@ msgstr "" "<< >> & | ^ ~ :=\n" "< > <= >= == !=" -#: ../../reference/lexical_analysis.rst:1012 +#: ../../reference/lexical_analysis.rst:1011 msgid "Delimiters" msgstr "" -#: ../../reference/lexical_analysis.rst:1016 +#: ../../reference/lexical_analysis.rst:1015 msgid "The following tokens serve as delimiters in the grammar:" msgstr "" -#: ../../reference/lexical_analysis.rst:1018 +#: ../../reference/lexical_analysis.rst:1017 msgid "" "( ) [ ] { }\n" ", : ! . ; @ =\n" @@ -1354,7 +1349,7 @@ msgstr "" "-> += -= *= /= //= %=\n" "@= &= |= ^= >>= <<= **=" -#: ../../reference/lexical_analysis.rst:1025 +#: ../../reference/lexical_analysis.rst:1024 msgid "" "The period can also occur in floating-point and imaginary literals. A " "sequence of three periods has a special meaning as an ellipsis literal. The " @@ -1362,34 +1357,33 @@ msgid "" "as delimiters, but also perform an operation." msgstr "" -#: ../../reference/lexical_analysis.rst:1030 +#: ../../reference/lexical_analysis.rst:1029 msgid "" "The following printing ASCII characters have special meaning as part of " "other tokens or are otherwise significant to the lexical analyzer:" msgstr "" -#: ../../reference/lexical_analysis.rst:1033 +#: ../../reference/lexical_analysis.rst:1032 msgid "' \" # \\" msgstr "' \" # \\" -#: ../../reference/lexical_analysis.rst:1037 +#: ../../reference/lexical_analysis.rst:1036 msgid "" "The following printing ASCII characters are not used in Python. Their " "occurrence outside string literals and comments is an unconditional error:" msgstr "" -#: ../../reference/lexical_analysis.rst:1040 +#: ../../reference/lexical_analysis.rst:1039 msgid "$ ? `" msgstr "$ ? `" -#: ../../reference/lexical_analysis.rst:1046 +#: ../../reference/lexical_analysis.rst:1045 msgid "Footnotes" msgstr "註解" -#: ../../reference/lexical_analysis.rst:1047 -#, fuzzy +#: ../../reference/lexical_analysis.rst:1046 msgid "https://www.unicode.org/Public/15.1.0/ucd/NameAliases.txt" -msgstr "https://www.unicode.org/Public/15.0.0/ucd/NameAliases.txt" +msgstr "https://www.unicode.org/Public/15.1.0/ucd/NameAliases.txt" #: ../../reference/lexical_analysis.rst:8 msgid "lexical analysis" @@ -1413,7 +1407,7 @@ msgstr "logical line(邏輯列)" #: ../../reference/lexical_analysis.rst:35 #: ../../reference/lexical_analysis.rst:114 -#: ../../reference/lexical_analysis.rst:532 +#: ../../reference/lexical_analysis.rst:531 msgid "physical line" msgstr "physical line(物理列)" @@ -1503,315 +1497,315 @@ msgstr "identifier(識別器)" msgid "name" msgstr "name(名稱)" -#: ../../reference/lexical_analysis.rst:334 -#: ../../reference/lexical_analysis.rst:358 +#: ../../reference/lexical_analysis.rst:333 +#: ../../reference/lexical_analysis.rst:357 msgid "keyword" msgstr "keyword(關鍵字)" -#: ../../reference/lexical_analysis.rst:334 +#: ../../reference/lexical_analysis.rst:333 msgid "reserved word" msgstr "reserved word(保留字)" -#: ../../reference/lexical_analysis.rst:358 +#: ../../reference/lexical_analysis.rst:357 msgid "soft keyword" msgstr "soft keyword(軟關鍵字)" -#: ../../reference/lexical_analysis.rst:377 +#: ../../reference/lexical_analysis.rst:376 msgid "_, identifiers" msgstr "_, identifiers(識別器)" -#: ../../reference/lexical_analysis.rst:377 +#: ../../reference/lexical_analysis.rst:376 msgid "__, identifiers" msgstr "__, identifiers(識別器)" -#: ../../reference/lexical_analysis.rst:433 +#: ../../reference/lexical_analysis.rst:432 msgid "literal" msgstr "literal(常數)" -#: ../../reference/lexical_analysis.rst:433 +#: ../../reference/lexical_analysis.rst:432 msgid "constant" msgstr "constant(常數)" -#: ../../reference/lexical_analysis.rst:438 -#: ../../reference/lexical_analysis.rst:479 +#: ../../reference/lexical_analysis.rst:437 +#: ../../reference/lexical_analysis.rst:478 msgid "string literal" msgstr "string literal(字串常數)" -#: ../../reference/lexical_analysis.rst:438 -#: ../../reference/lexical_analysis.rst:492 +#: ../../reference/lexical_analysis.rst:437 +#: ../../reference/lexical_analysis.rst:491 msgid "bytes literal" msgstr "bytes literal(位元組常數)" -#: ../../reference/lexical_analysis.rst:438 +#: ../../reference/lexical_analysis.rst:437 msgid "ASCII" msgstr "ASCII" -#: ../../reference/lexical_analysis.rst:438 +#: ../../reference/lexical_analysis.rst:437 msgid "' (single quote)" msgstr "' (單引號)" -#: ../../reference/lexical_analysis.rst:438 +#: ../../reference/lexical_analysis.rst:437 msgid "\" (double quote)" msgstr "\" (雙引號)" -#: ../../reference/lexical_analysis.rst:438 +#: ../../reference/lexical_analysis.rst:437 msgid "u'" msgstr "u'" -#: ../../reference/lexical_analysis.rst:438 +#: ../../reference/lexical_analysis.rst:437 msgid "u\"" msgstr "u\"" -#: ../../reference/lexical_analysis.rst:479 +#: ../../reference/lexical_analysis.rst:478 msgid "triple-quoted string" msgstr "triple-quoted string(三引號字串)" -#: ../../reference/lexical_analysis.rst:479 +#: ../../reference/lexical_analysis.rst:478 msgid "Unicode Consortium" msgstr "Unicode Consortium" -#: ../../reference/lexical_analysis.rst:479 +#: ../../reference/lexical_analysis.rst:478 msgid "raw string" msgstr "raw string(原始字串)" -#: ../../reference/lexical_analysis.rst:479 +#: ../../reference/lexical_analysis.rst:478 msgid "\"\"\"" msgstr "\"\"\"" -#: ../../reference/lexical_analysis.rst:479 +#: ../../reference/lexical_analysis.rst:478 msgid "'''" msgstr "'''" -#: ../../reference/lexical_analysis.rst:492 +#: ../../reference/lexical_analysis.rst:491 msgid "b'" msgstr "b'" -#: ../../reference/lexical_analysis.rst:492 +#: ../../reference/lexical_analysis.rst:491 msgid "b\"" msgstr "b\"" -#: ../../reference/lexical_analysis.rst:501 +#: ../../reference/lexical_analysis.rst:500 msgid "r'" msgstr "r'" -#: ../../reference/lexical_analysis.rst:501 +#: ../../reference/lexical_analysis.rst:500 msgid "raw string literal" msgstr "raw string literal(原始字串常數)" -#: ../../reference/lexical_analysis.rst:501 +#: ../../reference/lexical_analysis.rst:500 msgid "r\"" msgstr "r\"" -#: ../../reference/lexical_analysis.rst:519 +#: ../../reference/lexical_analysis.rst:518 msgid "f'" msgstr "f'" -#: ../../reference/lexical_analysis.rst:519 -#: ../../reference/lexical_analysis.rst:697 +#: ../../reference/lexical_analysis.rst:518 +#: ../../reference/lexical_analysis.rst:696 msgid "formatted string literal" msgstr "formatted string literal(格式化字串常數)" -#: ../../reference/lexical_analysis.rst:519 +#: ../../reference/lexical_analysis.rst:518 msgid "f\"" msgstr "f\"" -#: ../../reference/lexical_analysis.rst:532 +#: ../../reference/lexical_analysis.rst:531 msgid "escape sequence" msgstr "escape sequence(跳脫序列)" -#: ../../reference/lexical_analysis.rst:532 +#: ../../reference/lexical_analysis.rst:531 msgid "Standard C" msgstr "Standard C(標準 C)" -#: ../../reference/lexical_analysis.rst:532 +#: ../../reference/lexical_analysis.rst:531 msgid "C" msgstr "C" -#: ../../reference/lexical_analysis.rst:532 +#: ../../reference/lexical_analysis.rst:531 msgid "\\ (backslash)" msgstr "\\ (反斜線)" -#: ../../reference/lexical_analysis.rst:532 +#: ../../reference/lexical_analysis.rst:531 msgid "\\\\" msgstr "\\\\" -#: ../../reference/lexical_analysis.rst:532 +#: ../../reference/lexical_analysis.rst:531 msgid "\\a" msgstr "\\a" -#: ../../reference/lexical_analysis.rst:532 +#: ../../reference/lexical_analysis.rst:531 msgid "\\b" msgstr "\\b" -#: ../../reference/lexical_analysis.rst:532 +#: ../../reference/lexical_analysis.rst:531 msgid "\\f" msgstr "\\f" -#: ../../reference/lexical_analysis.rst:532 +#: ../../reference/lexical_analysis.rst:531 msgid "\\n" msgstr "\\n" -#: ../../reference/lexical_analysis.rst:532 +#: ../../reference/lexical_analysis.rst:531 msgid "\\r" msgstr "\\r" -#: ../../reference/lexical_analysis.rst:532 +#: ../../reference/lexical_analysis.rst:531 msgid "\\t" msgstr "\\t" -#: ../../reference/lexical_analysis.rst:532 +#: ../../reference/lexical_analysis.rst:531 msgid "\\v" msgstr "\\v" -#: ../../reference/lexical_analysis.rst:532 +#: ../../reference/lexical_analysis.rst:531 msgid "\\x" msgstr "\\x" -#: ../../reference/lexical_analysis.rst:532 +#: ../../reference/lexical_analysis.rst:531 msgid "\\N" msgstr "\\N" -#: ../../reference/lexical_analysis.rst:532 +#: ../../reference/lexical_analysis.rst:531 msgid "\\u" msgstr "\\u" -#: ../../reference/lexical_analysis.rst:532 +#: ../../reference/lexical_analysis.rst:531 msgid "\\U" msgstr "\\U" -#: ../../reference/lexical_analysis.rst:648 +#: ../../reference/lexical_analysis.rst:647 msgid "unrecognized escape sequence" msgstr "unrecognized escape sequence(無法辨識的跳脫序列)" -#: ../../reference/lexical_analysis.rst:697 +#: ../../reference/lexical_analysis.rst:696 msgid "interpolated string literal" msgstr "interpolated string literal(插值字串常數)" -#: ../../reference/lexical_analysis.rst:697 +#: ../../reference/lexical_analysis.rst:696 msgid "string" msgstr "string(字串)" -#: ../../reference/lexical_analysis.rst:697 +#: ../../reference/lexical_analysis.rst:696 msgid "formatted literal" msgstr "formatted literal(格式化常數)" -#: ../../reference/lexical_analysis.rst:697 +#: ../../reference/lexical_analysis.rst:696 msgid "interpolated literal" msgstr "interpolated literal(插值常數)" -#: ../../reference/lexical_analysis.rst:697 +#: ../../reference/lexical_analysis.rst:696 msgid "f-string" msgstr "f-string(f 字串)" -#: ../../reference/lexical_analysis.rst:697 +#: ../../reference/lexical_analysis.rst:696 msgid "fstring" msgstr "fstring(f 字串)" -#: ../../reference/lexical_analysis.rst:697 +#: ../../reference/lexical_analysis.rst:696 msgid "{} (curly brackets)" msgstr "{} (花括號)" -#: ../../reference/lexical_analysis.rst:697 +#: ../../reference/lexical_analysis.rst:696 msgid "in formatted string literal" msgstr "於格式化字串常數中" -#: ../../reference/lexical_analysis.rst:697 +#: ../../reference/lexical_analysis.rst:696 msgid "! (exclamation)" msgstr "! (驚嘆號)" -#: ../../reference/lexical_analysis.rst:697 +#: ../../reference/lexical_analysis.rst:696 msgid ": (colon)" msgstr ": (冒號)" -#: ../../reference/lexical_analysis.rst:697 +#: ../../reference/lexical_analysis.rst:696 msgid "= (equals)" msgstr "= (等於)" -#: ../../reference/lexical_analysis.rst:697 +#: ../../reference/lexical_analysis.rst:696 msgid "for help in debugging using string literals" msgstr "for help in debugging using string literals(使用字串常數進行除錯)" -#: ../../reference/lexical_analysis.rst:880 +#: ../../reference/lexical_analysis.rst:879 msgid "number" msgstr "number(數字)" -#: ../../reference/lexical_analysis.rst:880 +#: ../../reference/lexical_analysis.rst:879 msgid "numeric literal" msgstr "numeric literal(數值常數)" -#: ../../reference/lexical_analysis.rst:880 -#: ../../reference/lexical_analysis.rst:893 +#: ../../reference/lexical_analysis.rst:879 +#: ../../reference/lexical_analysis.rst:892 msgid "integer literal" msgstr "integer literal(整數常數)" -#: ../../reference/lexical_analysis.rst:880 +#: ../../reference/lexical_analysis.rst:879 msgid "floating-point literal" msgstr "floating-point literal(浮點數常數)" -#: ../../reference/lexical_analysis.rst:880 +#: ../../reference/lexical_analysis.rst:879 msgid "hexadecimal literal" msgstr "hexadecimal literal(十六進位常數)" -#: ../../reference/lexical_analysis.rst:880 +#: ../../reference/lexical_analysis.rst:879 msgid "octal literal" msgstr "octal literal(八進位常數)" -#: ../../reference/lexical_analysis.rst:880 +#: ../../reference/lexical_analysis.rst:879 msgid "binary literal" msgstr "binary literal(二進位常數)" -#: ../../reference/lexical_analysis.rst:880 +#: ../../reference/lexical_analysis.rst:879 msgid "decimal literal" msgstr "decimal literal(十進位常數)" -#: ../../reference/lexical_analysis.rst:880 +#: ../../reference/lexical_analysis.rst:879 msgid "imaginary literal" msgstr "imaginary literal(虛數常數)" -#: ../../reference/lexical_analysis.rst:880 +#: ../../reference/lexical_analysis.rst:879 msgid "complex literal" msgstr "complex literal(複數常數)" -#: ../../reference/lexical_analysis.rst:893 +#: ../../reference/lexical_analysis.rst:892 msgid "0b" msgstr "0b" -#: ../../reference/lexical_analysis.rst:893 +#: ../../reference/lexical_analysis.rst:892 msgid "0o" msgstr "0o" -#: ../../reference/lexical_analysis.rst:893 +#: ../../reference/lexical_analysis.rst:892 msgid "0x" msgstr "0x" -#: ../../reference/lexical_analysis.rst:893 -#: ../../reference/lexical_analysis.rst:939 +#: ../../reference/lexical_analysis.rst:892 +#: ../../reference/lexical_analysis.rst:938 msgid "_ (underscore)" msgstr "_ (底線)" -#: ../../reference/lexical_analysis.rst:893 -#: ../../reference/lexical_analysis.rst:939 -#: ../../reference/lexical_analysis.rst:971 +#: ../../reference/lexical_analysis.rst:892 +#: ../../reference/lexical_analysis.rst:938 +#: ../../reference/lexical_analysis.rst:970 msgid "in numeric literal" msgstr "於數值常數中" -#: ../../reference/lexical_analysis.rst:939 +#: ../../reference/lexical_analysis.rst:938 msgid ". (dot)" msgstr ". (點)" -#: ../../reference/lexical_analysis.rst:939 +#: ../../reference/lexical_analysis.rst:938 msgid "e" msgstr "e" -#: ../../reference/lexical_analysis.rst:971 +#: ../../reference/lexical_analysis.rst:970 msgid "j" msgstr "j" -#: ../../reference/lexical_analysis.rst:997 +#: ../../reference/lexical_analysis.rst:996 msgid "operators" msgstr "operators(運算子)" -#: ../../reference/lexical_analysis.rst:1014 +#: ../../reference/lexical_analysis.rst:1013 msgid "delimiters" msgstr "delimiters(分隔符號)" diff --git a/tutorial/appendix.po b/tutorial/appendix.po index 703dc079b8..e96743c902 100644 --- a/tutorial/appendix.po +++ b/tutorial/appendix.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-17 00:13+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-" @@ -42,8 +42,8 @@ msgid "" "editing, history browsing, and paste mode. To disable color, see :ref:" "`using-on-controlling-color` for details. Function keys provide some " "additional functionality. :kbd:`F1` enters the interactive help browser :mod:" -"`pydoc`. :kbd:`F2` allows for browsing command-line history without output " -"nor the :term:`>>>` and :term:`...` prompts. :kbd:`F3` enters \"paste " +"`pydoc`. :kbd:`F2` allows for browsing command-line history with neither " +"output nor the :term:`>>>` and :term:`...` prompts. :kbd:`F3` enters \"paste " "mode\", which makes pasting larger blocks of code easier. Press :kbd:`F3` to " "return to the regular prompt." msgstr "" diff --git a/tutorial/controlflow.po b/tutorial/controlflow.po index c0a2f46f22..13344d6ba7 100644 --- a/tutorial/controlflow.po +++ b/tutorial/controlflow.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-28 00:13+0000\n" +"POT-Creation-Date: 2024-10-14 00:14+0000\n" "PO-Revision-Date: 2022-07-24 14:52+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -901,8 +901,8 @@ msgstr "我們可以建立一個函式來產生費式數列到任何一個上界 #: ../../tutorial/controlflow.rst:464 msgid "" -">>> def fib(n): # write Fibonacci series up to n\n" -"... \"\"\"Print a Fibonacci series up to n.\"\"\"\n" +">>> def fib(n): # write Fibonacci series less than n\n" +"... \"\"\"Print a Fibonacci series less than n.\"\"\"\n" "... a, b = 0, 1\n" "... while a < n:\n" "... print(a, end=' ')\n" @@ -1618,10 +1618,10 @@ msgstr "" #: ../../tutorial/controlflow.rst:835 msgid "" -"The third function ``kwd_only_args`` only allows keyword arguments as " +"The third function ``kwd_only_arg`` only allows keyword arguments as " "indicated by a ``*`` in the function definition::" msgstr "" -"第三個函式 ``kwd_only_args`` 的函式定義透過 ``*`` 表明僅限關鍵字引數: ::" +"第三個函式 ``kwd_only_arg`` 的函式定義透過 ``*`` 表明僅限關鍵字引數: ::" #: ../../tutorial/controlflow.rst:838 msgid "" diff --git a/tutorial/introduction.po b/tutorial/introduction.po index 436e18af6b..4db1924d3e 100644 --- a/tutorial/introduction.po +++ b/tutorial/introduction.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2024-10-08 03:35+0000\n" "PO-Revision-Date: 2022-10-16 03:20+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -359,49 +359,42 @@ msgid "" "String literals can span multiple lines. One way is using triple-quotes: " "``\"\"\"...\"\"\"`` or ``'''...'''``. End of lines are automatically " "included in the string, but it's possible to prevent this by adding a ``\\`` " -"at the end of the line. The following example::" +"at the end of the line. In the following example, the initial newline is " +"not included::" msgstr "" "字串文本可以跨越數行。其中一方式是使用三個重覆引號:``\"\"\"...\"\"\"`` 或 " "``'''...'''``。此時換行會被自動加入字串值中,但也可以在換行前加入 ``\\`` 來取" -"消這個行為。在以下的例子中: ::" +"消這個行為。在以下的例子中,最初的換行符不會被包含: ::" -#: ../../tutorial/introduction.rst:202 +#: ../../tutorial/introduction.rst:203 msgid "" -"print(\"\"\"\\\n" +">>> print(\"\"\"\\\n" +"... Usage: thingy [OPTIONS]\n" +"... -h Display this usage message\n" +"... -H hostname Hostname to connect to\n" +"... \"\"\")\n" "Usage: thingy [OPTIONS]\n" " -h Display this usage message\n" " -H hostname Hostname to connect to\n" -"\"\"\")" +"\n" +">>>" msgstr "" -#: ../../tutorial/introduction.rst:208 -msgid "" -"produces the following output (note that the initial newline is not " -"included):" -msgstr "會產生以下的輸出(注意第一個換行並沒有被包含進字串值中):" - -#: ../../tutorial/introduction.rst:210 -msgid "" -"Usage: thingy [OPTIONS]\n" -" -h Display this usage message\n" -" -H hostname Hostname to connect to" -msgstr "" - -#: ../../tutorial/introduction.rst:216 +#: ../../tutorial/introduction.rst:214 msgid "" "Strings can be concatenated (glued together) with the ``+`` operator, and " "repeated with ``*``::" msgstr "" "字串可以使用 ``+`` 運算子連接 (concatenate),並用 ``*`` 重覆該字串的內容: ::" -#: ../../tutorial/introduction.rst:219 +#: ../../tutorial/introduction.rst:217 msgid "" ">>> # 3 times 'un', followed by 'ium'\n" ">>> 3 * 'un' + 'ium'\n" "'unununium'" msgstr "" -#: ../../tutorial/introduction.rst:223 +#: ../../tutorial/introduction.rst:221 msgid "" "Two or more *string literals* (i.e. the ones enclosed between quotes) next " "to each other are automatically concatenated. ::" @@ -409,7 +402,7 @@ msgstr "" "兩個以上相鄰的字串文本(*string literal*,即被引號包圍的字串)會被自動連接起" "來: ::" -#: ../../tutorial/introduction.rst:226 +#: ../../tutorial/introduction.rst:224 msgid "" ">>> 'Py' 'thon'\n" "'Python'" @@ -417,13 +410,13 @@ msgstr "" ">>> 'Py' 'thon'\n" "'Python'" -#: ../../tutorial/introduction.rst:229 +#: ../../tutorial/introduction.rst:227 msgid "" "This feature is particularly useful when you want to break long strings::" msgstr "" "當你想要分段一個非常長的字串時,兩相鄰字串值自動連接的特性十分有用: ::" -#: ../../tutorial/introduction.rst:231 +#: ../../tutorial/introduction.rst:229 msgid "" ">>> text = ('Put several strings within parentheses '\n" "... 'to have them joined together.')\n" @@ -431,12 +424,12 @@ msgid "" "'Put several strings within parentheses to have them joined together.'" msgstr "" -#: ../../tutorial/introduction.rst:236 +#: ../../tutorial/introduction.rst:234 msgid "" "This only works with two literals though, not with variables or expressions::" msgstr "但這特性只限於兩相鄰的字串值間,而非兩相鄰變數或表達式: ::" -#: ../../tutorial/introduction.rst:238 +#: ../../tutorial/introduction.rst:236 msgid "" ">>> prefix = 'Py'\n" ">>> prefix 'thon' # can't concatenate a variable and a string literal\n" @@ -451,12 +444,12 @@ msgid "" "SyntaxError: invalid syntax" msgstr "" -#: ../../tutorial/introduction.rst:250 +#: ../../tutorial/introduction.rst:248 msgid "" "If you want to concatenate variables or a variable and a literal, use ``+``::" msgstr "如果要連接變數們或一個變數與一個字串值,使用 ``+``: ::" -#: ../../tutorial/introduction.rst:252 +#: ../../tutorial/introduction.rst:250 msgid "" ">>> prefix + 'thon'\n" "'Python'" @@ -464,7 +457,7 @@ msgstr "" ">>> prefix + 'thon'\n" "'Python'" -#: ../../tutorial/introduction.rst:255 +#: ../../tutorial/introduction.rst:253 msgid "" "Strings can be *indexed* (subscripted), with the first character having " "index 0. There is no separate character type; a character is simply a string " @@ -473,7 +466,7 @@ msgstr "" "字串可以被「索引 *indexed*」(下標,即 subscripted),第一個字元的索引值為 0。" "沒有獨立表示字元的型別;一個字元就是一個大小為 1 的字串: ::" -#: ../../tutorial/introduction.rst:259 +#: ../../tutorial/introduction.rst:257 msgid "" ">>> word = 'Python'\n" ">>> word[0] # character in position 0\n" @@ -482,12 +475,12 @@ msgid "" "'n'" msgstr "" -#: ../../tutorial/introduction.rst:265 +#: ../../tutorial/introduction.rst:263 msgid "" "Indices may also be negative numbers, to start counting from the right::" msgstr "索引值可以是負的,此時改成從右開始計數: ::" -#: ../../tutorial/introduction.rst:267 +#: ../../tutorial/introduction.rst:265 msgid "" ">>> word[-1] # last character\n" "'n'\n" @@ -497,11 +490,11 @@ msgid "" "'P'" msgstr "" -#: ../../tutorial/introduction.rst:274 +#: ../../tutorial/introduction.rst:272 msgid "Note that since -0 is the same as 0, negative indices start from -1." msgstr "注意到因為 -0 等同於 0,負的索引值由 -1 開始。" -#: ../../tutorial/introduction.rst:276 +#: ../../tutorial/introduction.rst:274 msgid "" "In addition to indexing, *slicing* is also supported. While indexing is " "used to obtain individual characters, *slicing* allows you to obtain a " @@ -510,7 +503,7 @@ msgstr "" "除了索引外,字串亦支援「切片 *slicing*」。索引用來拿到單獨的字元,而切片則可" "以讓你拿到一個子字串 (substring): ::" -#: ../../tutorial/introduction.rst:279 +#: ../../tutorial/introduction.rst:277 msgid "" ">>> word[0:2] # characters from position 0 (included) to 2 (excluded)\n" "'Py'\n" @@ -518,7 +511,7 @@ msgid "" "'tho'" msgstr "" -#: ../../tutorial/introduction.rst:284 +#: ../../tutorial/introduction.rst:282 msgid "" "Slice indices have useful defaults; an omitted first index defaults to zero, " "an omitted second index defaults to the size of the string being sliced. ::" @@ -526,7 +519,7 @@ msgstr "" "切片索引 (slice indices) 有很常用的預設值,省略起點索引值時預設為 0,而省略第" "二個索引值時預設整個字串被包含在 slice 中: ::" -#: ../../tutorial/introduction.rst:287 +#: ../../tutorial/introduction.rst:285 msgid "" ">>> word[:2] # character from the beginning to position 2 (excluded)\n" "'Py'\n" @@ -536,7 +529,7 @@ msgid "" "'on'" msgstr "" -#: ../../tutorial/introduction.rst:294 +#: ../../tutorial/introduction.rst:292 msgid "" "Note how the start is always included, and the end always excluded. This " "makes sure that ``s[:i] + s[i:]`` is always equal to ``s``::" @@ -544,7 +537,7 @@ msgstr "" "注意到起點永遠被包含,而結尾永遠不被包含。這確保了 ``s[:i] + s[i:]`` 永遠等" "於 ``s``: ::" -#: ../../tutorial/introduction.rst:297 +#: ../../tutorial/introduction.rst:295 msgid "" ">>> word[:2] + word[2:]\n" "'Python'\n" @@ -556,7 +549,7 @@ msgstr "" ">>> word[:4] + word[4:]\n" "'Python'" -#: ../../tutorial/introduction.rst:302 +#: ../../tutorial/introduction.rst:300 msgid "" "One way to remember how slices work is to think of the indices as pointing " "*between* characters, with the left edge of the first character numbered 0. " @@ -567,7 +560,7 @@ msgstr "" "其中第一個字元的左側邊緣由 0 計數。則 *n* 個字元的字串中最後一個字元的右側邊" "緣會有索引值 *n*,例如: ::" -#: ../../tutorial/introduction.rst:307 +#: ../../tutorial/introduction.rst:305 msgid "" " +---+---+---+---+---+---+\n" " | P | y | t | h | o | n |\n" @@ -581,7 +574,7 @@ msgstr "" " 0 1 2 3 4 5 6\n" "-6 -5 -4 -3 -2 -1" -#: ../../tutorial/introduction.rst:313 +#: ../../tutorial/introduction.rst:311 msgid "" "The first row of numbers gives the position of the indices 0...6 in the " "string; the second row gives the corresponding negative indices. The slice " @@ -591,7 +584,7 @@ msgstr "" "第一行數字給定字串索引值為 0...6 的位置;第二行則標示了負索引值的位置。由 " "*i* 至 *j* 的 slice 包含了標示 *i* 和 *j* 邊緣間的所有字元。" -#: ../../tutorial/introduction.rst:318 +#: ../../tutorial/introduction.rst:316 msgid "" "For non-negative indices, the length of a slice is the difference of the " "indices, if both are within bounds. For example, the length of " @@ -600,11 +593,11 @@ msgstr "" "對非負數的索引值而言,一個 slice 的長度等於其索引值之差,如果索引值落在字串邊" "界內。例如,``word[1:3]`` 的長度是 2。" -#: ../../tutorial/introduction.rst:322 +#: ../../tutorial/introduction.rst:320 msgid "Attempting to use an index that is too large will result in an error::" msgstr "嘗試使用一個過大的索引值會造成錯誤: ::" -#: ../../tutorial/introduction.rst:324 +#: ../../tutorial/introduction.rst:322 msgid "" ">>> word[42] # the word only has 6 characters\n" "Traceback (most recent call last):\n" @@ -612,13 +605,13 @@ msgid "" "IndexError: string index out of range" msgstr "" -#: ../../tutorial/introduction.rst:329 +#: ../../tutorial/introduction.rst:327 msgid "" "However, out of range slice indexes are handled gracefully when used for " "slicing::" msgstr "然而,超出範圍的索引值在 slice 中會被妥善的處理: ::" -#: ../../tutorial/introduction.rst:332 +#: ../../tutorial/introduction.rst:330 msgid "" ">>> word[4:42]\n" "'on'\n" @@ -630,7 +623,7 @@ msgstr "" ">>> word[42:]\n" "''" -#: ../../tutorial/introduction.rst:337 +#: ../../tutorial/introduction.rst:335 msgid "" "Python strings cannot be changed --- they are :term:`immutable`. Therefore, " "assigning to an indexed position in the string results in an error::" @@ -638,7 +631,7 @@ msgstr "" "Python 字串無法被改變 --- 它們是 :term:`immutable`。因此,嘗試對字串中某個索" "引位置賦值會產生錯誤: ::" -#: ../../tutorial/introduction.rst:340 +#: ../../tutorial/introduction.rst:338 msgid "" ">>> word[0] = 'J'\n" "Traceback (most recent call last):\n" @@ -650,11 +643,11 @@ msgid "" "TypeError: 'str' object does not support item assignment" msgstr "" -#: ../../tutorial/introduction.rst:349 +#: ../../tutorial/introduction.rst:347 msgid "If you need a different string, you should create a new one::" msgstr "如果你需要一個不一樣的字串,你必須建立一個新的: ::" -#: ../../tutorial/introduction.rst:351 +#: ../../tutorial/introduction.rst:349 msgid "" ">>> 'J' + word[1:]\n" "'Jython'\n" @@ -666,11 +659,11 @@ msgstr "" ">>> word[:2] + 'py'\n" "'Pypy'" -#: ../../tutorial/introduction.rst:356 +#: ../../tutorial/introduction.rst:354 msgid "The built-in function :func:`len` returns the length of a string::" msgstr "內建的函式 :func:`len` 回傳一個字串的長度: ::" -#: ../../tutorial/introduction.rst:358 +#: ../../tutorial/introduction.rst:356 msgid "" ">>> s = 'supercalifragilisticexpialidocious'\n" ">>> len(s)\n" @@ -680,47 +673,47 @@ msgstr "" ">>> len(s)\n" "34" -#: ../../tutorial/introduction.rst:365 +#: ../../tutorial/introduction.rst:363 msgid ":ref:`textseq`" msgstr ":ref:`textseq`" -#: ../../tutorial/introduction.rst:366 +#: ../../tutorial/introduction.rst:364 msgid "" "Strings are examples of *sequence types*, and support the common operations " "supported by such types." msgstr "字串是 *sequence 型別*\\ 的範例之一,並支援該型別常用的操作。" -#: ../../tutorial/introduction.rst:369 +#: ../../tutorial/introduction.rst:367 msgid ":ref:`string-methods`" msgstr ":ref:`string-methods`" -#: ../../tutorial/introduction.rst:370 +#: ../../tutorial/introduction.rst:368 msgid "" "Strings support a large number of methods for basic transformations and " "searching." msgstr "字串支援非常多種基本轉換和搜尋的 method(方法)。" -#: ../../tutorial/introduction.rst:373 +#: ../../tutorial/introduction.rst:371 msgid ":ref:`f-strings`" msgstr ":ref:`f-strings`" -#: ../../tutorial/introduction.rst:374 +#: ../../tutorial/introduction.rst:372 msgid "String literals that have embedded expressions." msgstr "包含有運算式的字串文本。" -#: ../../tutorial/introduction.rst:376 +#: ../../tutorial/introduction.rst:374 msgid ":ref:`formatstrings`" msgstr ":ref:`formatstrings`" -#: ../../tutorial/introduction.rst:377 +#: ../../tutorial/introduction.rst:375 msgid "Information about string formatting with :meth:`str.format`." msgstr "關於透過 :meth:`str.format` 字串格式化 (string formatting) 的資訊。" -#: ../../tutorial/introduction.rst:379 +#: ../../tutorial/introduction.rst:377 msgid ":ref:`old-string-formatting`" msgstr ":ref:`old-string-formatting`" -#: ../../tutorial/introduction.rst:380 +#: ../../tutorial/introduction.rst:378 msgid "" "The old formatting operations invoked when strings are the left operand of " "the ``%`` operator are described in more detail here." @@ -728,11 +721,11 @@ msgstr "" "在字串為 ``%`` 運算子的左運算元時,將觸發舊的字串格式化操作,更多的細節在本連" "結中介紹。" -#: ../../tutorial/introduction.rst:387 +#: ../../tutorial/introduction.rst:385 msgid "Lists" msgstr "List(串列)" -#: ../../tutorial/introduction.rst:389 +#: ../../tutorial/introduction.rst:387 msgid "" "Python knows a number of *compound* data types, used to group together other " "values. The most versatile is the *list*, which can be written as a list of " @@ -743,7 +736,7 @@ msgstr "" "*list*,可以寫成一系列以逗號分隔的數值(稱之元素,即 item),包含在方括號之" "中。List 可以包合不同型別的元素,但通常這些元素會有相同的型別: ::" -#: ../../tutorial/introduction.rst:394 +#: ../../tutorial/introduction.rst:392 msgid "" ">>> squares = [1, 4, 9, 16, 25]\n" ">>> squares\n" @@ -753,7 +746,7 @@ msgstr "" ">>> squares\n" "[1, 4, 9, 16, 25]" -#: ../../tutorial/introduction.rst:398 +#: ../../tutorial/introduction.rst:396 msgid "" "Like strings (and all other built-in :term:`sequence` types), lists can be " "indexed and sliced::" @@ -761,7 +754,7 @@ msgstr "" "如同字串(以及其他內建的 :term:`sequence` 型別),list 可以被索引和切片 " "(slice): ::" -#: ../../tutorial/introduction.rst:401 +#: ../../tutorial/introduction.rst:399 msgid "" ">>> squares[0] # indexing returns the item\n" "1\n" @@ -771,11 +764,11 @@ msgid "" "[9, 16, 25]" msgstr "" -#: ../../tutorial/introduction.rst:408 +#: ../../tutorial/introduction.rst:406 msgid "Lists also support operations like concatenation::" msgstr "List 對支援如接合 (concatenation) 等操作: ::" -#: ../../tutorial/introduction.rst:410 +#: ../../tutorial/introduction.rst:408 msgid "" ">>> squares + [36, 49, 64, 81, 100]\n" "[1, 4, 9, 16, 25, 36, 49, 64, 81, 100]" @@ -783,7 +776,7 @@ msgstr "" ">>> squares + [36, 49, 64, 81, 100]\n" "[1, 4, 9, 16, 25, 36, 49, 64, 81, 100]" -#: ../../tutorial/introduction.rst:413 +#: ../../tutorial/introduction.rst:411 msgid "" "Unlike strings, which are :term:`immutable`, lists are a :term:`mutable` " "type, i.e. it is possible to change their content::" @@ -791,7 +784,7 @@ msgstr "" "不同於字串是 :term:`immutable`,list 是 :term:`mutable` 型別,即改變 list 的" "內容是可能的: ::" -#: ../../tutorial/introduction.rst:416 +#: ../../tutorial/introduction.rst:414 msgid "" ">>> cubes = [1, 8, 27, 65, 125] # something's wrong here\n" ">>> 4 ** 3 # the cube of 4 is 64, not 65!\n" @@ -801,7 +794,7 @@ msgid "" "[1, 8, 27, 64, 125]" msgstr "" -#: ../../tutorial/introduction.rst:423 +#: ../../tutorial/introduction.rst:421 msgid "" "You can also add new items at the end of the list, by using the :meth:`!list." "append` *method* (we will see more about methods later)::" @@ -809,7 +802,7 @@ msgstr "" "你也可以在 list 的最後加入新元素,透過使用 :meth:`!list.append` *方法* " "(method)(我們稍後會看到更多方法的說明): ::" -#: ../../tutorial/introduction.rst:426 +#: ../../tutorial/introduction.rst:424 msgid "" ">>> cubes.append(216) # add the cube of 6\n" ">>> cubes.append(7 ** 3) # and the cube of 7\n" @@ -817,7 +810,7 @@ msgid "" "[1, 8, 27, 64, 125, 216, 343]" msgstr "" -#: ../../tutorial/introduction.rst:431 +#: ../../tutorial/introduction.rst:429 msgid "" "Simple assignment in Python never copies data. When you assign a list to a " "variable, the variable refers to the *existing list*. Any changes you make " @@ -828,7 +821,7 @@ msgstr "" "\\ *現有 list*。任何透過一個變數對 list 所做的更改都將能夠透過參照該變數的所" "有其他變數看到。 ::" -#: ../../tutorial/introduction.rst:436 +#: ../../tutorial/introduction.rst:434 msgid "" ">>> rgb = [\"Red\", \"Green\", \"Blue\"]\n" ">>> rgba = rgb\n" @@ -839,7 +832,7 @@ msgid "" "[\"Red\", \"Green\", \"Blue\", \"Alph\"]" msgstr "" -#: ../../tutorial/introduction.rst:444 +#: ../../tutorial/introduction.rst:442 msgid "" "All slice operations return a new list containing the requested elements. " "This means that the following slice returns a :ref:`shallow copy " @@ -848,7 +841,7 @@ msgstr "" "所有切片操作都會回傳一個新的 list ,包含要求的元素。這意謂著以下這個切片回傳" "了原本 list 的\\ :ref:`淺複製 `: ::" -#: ../../tutorial/introduction.rst:448 +#: ../../tutorial/introduction.rst:446 msgid "" ">>> correct_rgba = rgba[:]\n" ">>> correct_rgba[-1] = \"Alpha\"\n" @@ -864,13 +857,13 @@ msgstr "" ">>> rgba\n" "[\"Red\", \"Green\", \"Blue\", \"Alph\"]" -#: ../../tutorial/introduction.rst:455 +#: ../../tutorial/introduction.rst:453 msgid "" "Assignment to slices is also possible, and this can even change the size of " "the list or clear it entirely::" msgstr "也可以對 slice 賦值,這能改變 list 的大小,甚至是清空一個 list: ::" -#: ../../tutorial/introduction.rst:458 +#: ../../tutorial/introduction.rst:456 msgid "" ">>> letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g']\n" ">>> letters\n" @@ -889,11 +882,11 @@ msgid "" "[]" msgstr "" -#: ../../tutorial/introduction.rst:474 +#: ../../tutorial/introduction.rst:472 msgid "The built-in function :func:`len` also applies to lists::" msgstr "內建的函式 :func:`len` 亦可以作用在 list 上: ::" -#: ../../tutorial/introduction.rst:476 +#: ../../tutorial/introduction.rst:474 msgid "" ">>> letters = ['a', 'b', 'c', 'd']\n" ">>> len(letters)\n" @@ -903,13 +896,13 @@ msgstr "" ">>> len(letters)\n" "4" -#: ../../tutorial/introduction.rst:480 +#: ../../tutorial/introduction.rst:478 msgid "" "It is possible to nest lists (create lists containing other lists), for " "example::" msgstr "也可以嵌套多層 list (建立 list 包含其他 list),例如: ::" -#: ../../tutorial/introduction.rst:483 +#: ../../tutorial/introduction.rst:481 msgid "" ">>> a = ['a', 'b', 'c']\n" ">>> n = [1, 2, 3]\n" @@ -931,11 +924,11 @@ msgstr "" ">>> x[0][1]\n" "'b'" -#: ../../tutorial/introduction.rst:496 +#: ../../tutorial/introduction.rst:494 msgid "First Steps Towards Programming" msgstr "初探程式設計的前幾步" -#: ../../tutorial/introduction.rst:498 +#: ../../tutorial/introduction.rst:496 msgid "" "Of course, we can use Python for more complicated tasks than adding two and " "two together. For instance, we can write an initial sub-sequence of the " @@ -946,7 +939,7 @@ msgstr "" "費氏數列 `_\\ 的首幾項序列: ::" -#: ../../tutorial/introduction.rst:503 +#: ../../tutorial/introduction.rst:501 msgid "" ">>> # Fibonacci series:\n" ">>> # the sum of two elements defines the next\n" @@ -964,11 +957,11 @@ msgid "" "8" msgstr "" -#: ../../tutorial/introduction.rst:518 +#: ../../tutorial/introduction.rst:516 msgid "This example introduces several new features." msgstr "這例子引入了許多新的特性。" -#: ../../tutorial/introduction.rst:520 +#: ../../tutorial/introduction.rst:518 msgid "" "The first line contains a *multiple assignment*: the variables ``a`` and " "``b`` simultaneously get the new values 0 and 1. On the last line this is " @@ -980,7 +973,7 @@ msgstr "" "同樣的賦值再被使用了一次,示範了等號的右項運算 (expression) 會先被計算 " "(evaluate),賦值再發生。右項的運算式由左至右依序被計算。" -#: ../../tutorial/introduction.rst:526 +#: ../../tutorial/introduction.rst:524 msgid "" "The :keyword:`while` loop executes as long as the condition (here: ``a < " "10``) remains true. In Python, like in C, any non-zero integer value is " @@ -998,7 +991,7 @@ msgstr "" "使用如同 C 語言一樣的符號:``<``\\ (小於)、``>``\\ (大於)、``==``\\ (等" "於)、``<=``\\ (小於等於)、``>=``\\ (大於等於)以及 ``!=``\\ (不等於)。" -#: ../../tutorial/introduction.rst:535 +#: ../../tutorial/introduction.rst:533 msgid "" "The *body* of the loop is *indented*: indentation is Python's way of " "grouping statements. At the interactive prompt, you have to type a tab or " @@ -1016,7 +1009,7 @@ msgstr "" "析器無法判斷你何時輸入複合陳述的最後一行)。注意在一個縮排段落內的縮排方式與" "數量必須維持一致。" -#: ../../tutorial/introduction.rst:544 +#: ../../tutorial/introduction.rst:542 msgid "" "The :func:`print` function writes the value of the argument(s) it is given. " "It differs from just writing the expression you want to write (as we did " @@ -1030,7 +1023,7 @@ msgstr "" "將不帶有引號,並且不同項目間會插入一個空白,因此可以讓你容易格式化輸出,例" "如: ::" -#: ../../tutorial/introduction.rst:551 +#: ../../tutorial/introduction.rst:549 msgid "" ">>> i = 256*256\n" ">>> print('The value of i is', i)\n" @@ -1040,7 +1033,7 @@ msgstr "" ">>> print('The value of i is', i)\n" "The value of i is 65536" -#: ../../tutorial/introduction.rst:555 +#: ../../tutorial/introduction.rst:553 msgid "" "The keyword argument *end* can be used to avoid the newline after the " "output, or end the output with a different string::" @@ -1048,7 +1041,7 @@ msgstr "" "關鍵字引數 *end* 可以被用來避免額外的換行符加入到輸出中,或者以不同的字串結束" "輸出: ::" -#: ../../tutorial/introduction.rst:558 +#: ../../tutorial/introduction.rst:556 msgid "" ">>> a, b = 0, 1\n" ">>> while a < 1000:\n" @@ -1064,11 +1057,11 @@ msgstr "" "...\n" "0,1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987," -#: ../../tutorial/introduction.rst:567 +#: ../../tutorial/introduction.rst:565 msgid "Footnotes" msgstr "註解" -#: ../../tutorial/introduction.rst:568 +#: ../../tutorial/introduction.rst:566 msgid "" "Since ``**`` has higher precedence than ``-``, ``-3**2`` will be interpreted " "as ``-(3**2)`` and thus result in ``-9``. To avoid this and get ``9``, you " @@ -1077,7 +1070,7 @@ msgstr "" "因為 ``**`` 擁有較 ``-`` 高的優先次序,``-3**2`` 會被解釋為 ``-(3**2)`` 並得" "到 ``-9``。如果要避免這樣的優先順序以得到 ``9``,你可以使用 ``(-3)**2``。" -#: ../../tutorial/introduction.rst:572 +#: ../../tutorial/introduction.rst:570 msgid "" "Unlike other languages, special characters such as ``\\n`` have the same " "meaning with both single (``'...'``) and double (``\"...\"``) quotes. The " diff --git a/tutorial/modules.po b/tutorial/modules.po index 02d752fd55..9a828e3f5e 100644 --- a/tutorial/modules.po +++ b/tutorial/modules.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2024-10-10 00:13+0000\n" "PO-Revision-Date: 2022-10-23 20:30+0800\n" "Last-Translator: Phil Lin \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1157,27 +1157,28 @@ msgstr "多目錄中的套件" #: ../../tutorial/modules.rst:588 msgid "" -"Packages support one more special attribute, :attr:`__path__`. This is " -"initialized to be a list containing the name of the directory holding the " -"package's :file:`__init__.py` before the code in that file is executed. " -"This variable can be modified; doing so affects future searches for modules " -"and subpackages contained in the package." +"Packages support one more special attribute, :attr:`~module.__path__`. This " +"is initialized to be a :term:`sequence` of strings containing the name of " +"the directory holding the package's :file:`__init__.py` before the code in " +"that file is executed. This variable can be modified; doing so affects " +"future searches for modules and subpackages contained in the package." msgstr "" -"套件也支援一個特殊屬性 :attr:`__path__`。它在初始化時是一個 list,包含該套件" -"的 :file:`__init__.py` 檔案所在的目錄名稱,初始化時機是在這個檔案的程式碼被執" -"行之前。這個變數可以被修改,但這樣做會影響將來對套件內的模組和子套件的搜尋。" +"套件也支援一個特殊屬性 :attr:`~module.__path__`。它在初始化時是一個字串的\\ :" +"term:`序列 `\\ 的 :file:`__init__.py` 檔案所在的目錄名稱,初始化時" +"機是在這個檔案的程式碼被執行之前。這個變數可以被修改,但這樣做會影響將來對套" +"件內的模組和子套件的搜尋。" -#: ../../tutorial/modules.rst:594 +#: ../../tutorial/modules.rst:595 msgid "" "While this feature is not often needed, it can be used to extend the set of " "modules found in a package." msgstr "雖然這個特色不太常被需要,但它可用於擴充套件中的模組集合。" -#: ../../tutorial/modules.rst:599 +#: ../../tutorial/modules.rst:600 msgid "Footnotes" msgstr "註解" -#: ../../tutorial/modules.rst:600 +#: ../../tutorial/modules.rst:601 msgid "" "In fact function definitions are also 'statements' that are 'executed'; the " "execution of a module-level function definition adds the function name to " diff --git a/using/cmdline.po b/using/cmdline.po index fdee4c513d..83a4704e76 100644 --- a/using/cmdline.po +++ b/using/cmdline.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-11 00:13+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-" @@ -1293,8 +1293,9 @@ msgid "" msgstr "" #: ../../using/cmdline.rst:1030 ../../using/cmdline.rst:1044 -msgid ":ref:`Availability `: Windows." -msgstr ":ref:`適用 `:Windows。" +#: ../../using/cmdline.rst:1095 +msgid "Availability" +msgstr "" #: ../../using/cmdline.rst:1032 msgid "See :pep:`529` for more details." @@ -1383,10 +1384,6 @@ msgid "" "system interfaces." msgstr "" -#: ../../using/cmdline.rst:1095 -msgid ":ref:`Availability `: Unix." -msgstr ":ref:`適用 `:Unix。" - #: ../../using/cmdline.rst:1097 msgid "See :pep:`538` for more details." msgstr "更多細節請見 :pep:`538`。" diff --git a/using/configure.po b/using/configure.po index 1b0328f205..a3a919df74 100644 --- a/using/configure.po +++ b/using/configure.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-15 00:14+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-" @@ -70,7 +70,7 @@ msgstr "" #: ../../using/configure.rst:32 msgid "" -"Autoconf 2.71 and aclocal 1.16.4 are required to regenerate the :file:" +"Autoconf 2.71 and aclocal 1.16.5 are required to regenerate the :file:" "`configure` script." msgstr "" @@ -109,7 +109,7 @@ msgid "" msgstr "" #: ../../using/configure.rst:58 -msgid "Autoconf 2.71, aclocal 1.16.4 and SQLite 3.15.2 are now required." +msgid "Autoconf 2.71, aclocal 1.16.5 and SQLite 3.15.2 are now required." msgstr "" #: ../../using/configure.rst:61 diff --git a/whatsnew/2.6.po b/whatsnew/2.6.po index de308f3fc6..c5606c2af5 100644 --- a/whatsnew/2.6.po +++ b/whatsnew/2.6.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-10 00:13+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-" @@ -688,17 +688,17 @@ msgstr "" #: ../../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." +"The fix for Python 2.6 adds a :attr:`module.__package__` attribute. When " +"this attribute is present, relative imports will be relative to the value of " +"this attribute instead of the :attr:`~module.__name__` attribute." msgstr "" #: ../../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 " -"relative imports will now work correctly in scripts running from inside a " -"package." +"PEP 302-style importers can then set :attr:`~module.__package__` as " +"necessary. The :mod:`runpy` module that implements the :option:`-m` switch " +"now does this, so relative imports will now work correctly in scripts " +"running from inside a package." msgstr "" #: ../../whatsnew/2.6.rst:520 diff --git a/whatsnew/3.0.po b/whatsnew/3.0.po index 3c93e678fd..029b569e43 100644 --- a/whatsnew/3.0.po +++ b/whatsnew/3.0.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2024-10-10 00:13+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-" @@ -443,9 +443,9 @@ msgid "" ":pep:`3107`: Function argument and return value annotations. This provides " "a standardized way of annotating a function's parameters and return value. " "There are no semantics attached to such annotations except that they can be " -"introspected at runtime using the :attr:`__annotations__` attribute. The " -"intent is to encourage experimentation through metaclasses, decorators or " -"frameworks." +"introspected at runtime using the :attr:`~object.__annotations__` " +"attribute. The intent is to encourage experimentation through metaclasses, " +"decorators or frameworks." msgstr "" #: ../../whatsnew/3.0.rst:363 diff --git a/whatsnew/3.12.po b/whatsnew/3.12.po index 227841ae3a..829ac57ea5 100644 --- a/whatsnew/3.12.po +++ b/whatsnew/3.12.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-28 00:13+0000\n" +"POT-Creation-Date: 2024-10-10 00:13+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-" @@ -35,7 +35,7 @@ msgid "" "`changelog `." msgstr "" "本文介紹了 Python 3.12 與 3.11 相比多了哪些新功能。 Python 3.12 於 2023 年 " -"10 月 2 日發布。完整詳請請見 :ref:`changelog `。" +"10 月 2 日發布。完整詳情請見 :ref:`changelog `。" #: ../../whatsnew/3.12.rst:54 msgid ":pep:`693` -- Python 3.12 Release Schedule" @@ -47,12 +47,12 @@ msgstr "發布重點摘要" #: ../../whatsnew/3.12.rst:62 msgid "" -"Python 3.12 is the latest stable release of the Python programming language, " -"with a mix of changes to the language and the standard library. The library " -"changes focus on cleaning up deprecated APIs, usability, and correctness. Of " -"note, the :mod:`!distutils` package has been removed from the standard " -"library. Filesystem support in :mod:`os` and :mod:`pathlib` has seen a " -"number of improvements, and several modules have better performance." +"Python 3.12 is a stable release of the Python programming language, with a " +"mix of changes to the language and the standard library. The library changes " +"focus on cleaning up deprecated APIs, usability, and correctness. Of note, " +"the :mod:`!distutils` package has been removed from the standard library. " +"Filesystem support in :mod:`os` and :mod:`pathlib` has seen a number of " +"improvements, and several modules have better performance." msgstr "" #: ../../whatsnew/3.12.rst:69 @@ -265,7 +265,7 @@ msgstr "" "`unittest.TestCase` 的\\ `方法別名 `_\\ " "已被刪除。" -#: ../../whatsnew/3.12.rst:176 ../../whatsnew/3.12.rst:1825 +#: ../../whatsnew/3.12.rst:176 ../../whatsnew/3.12.rst:1826 msgid "New Features" msgstr "新增功能" @@ -1251,7 +1251,7 @@ msgid "" "Windows. (Contributed by Charles Machalow in :gh:`103179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:861 ../../whatsnew/3.12.rst:1529 +#: ../../whatsnew/3.12.rst:861 ../../whatsnew/3.12.rst:1530 msgid "sqlite3" msgstr "sqlite3" @@ -1326,7 +1326,7 @@ msgid "" "Katriel in :gh:`102778`.)" msgstr "" -#: ../../whatsnew/3.12.rst:912 ../../whatsnew/3.12.rst:1724 +#: ../../whatsnew/3.12.rst:912 ../../whatsnew/3.12.rst:1725 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 " @@ -1498,7 +1498,7 @@ msgid "" "Benjamin Peterson in :gh:`96734`)." msgstr "" -#: ../../whatsnew/3.12.rst:1026 ../../whatsnew/3.12.rst:1569 +#: ../../whatsnew/3.12.rst:1026 ../../whatsnew/3.12.rst:1570 msgid "unittest" msgstr "unittest" @@ -1706,12 +1706,12 @@ msgid "" "demos>`_. (Contributed by Victor Stinner in :gh:`97669`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1143 ../../whatsnew/3.12.rst:2127 +#: ../../whatsnew/3.12.rst:1143 ../../whatsnew/3.12.rst:2128 msgid "Deprecated" msgstr "已棄用" #: ../../whatsnew/3.12.rst:1145 -#: ../../deprecations/pending-removal-in-3.14.rst:4 +#: ../../deprecations/pending-removal-in-3.14.rst:11 msgid "" ":mod:`argparse`: The *type*, *choices*, and *metavar* parameters of :class:`!" "argparse.BooleanOptionalAction` are deprecated and will be removed in 3.14. " @@ -1730,32 +1730,32 @@ msgid "" msgstr "" #: ../../whatsnew/3.12.rst:1154 -#: ../../deprecations/pending-removal-in-3.14.rst:13 +#: ../../deprecations/pending-removal-in-3.14.rst:20 msgid ":class:`!ast.Num`" msgstr ":class:`!ast.Num`" #: ../../whatsnew/3.12.rst:1155 -#: ../../deprecations/pending-removal-in-3.14.rst:14 +#: ../../deprecations/pending-removal-in-3.14.rst:21 msgid ":class:`!ast.Str`" msgstr ":class:`!ast.Str`" #: ../../whatsnew/3.12.rst:1156 -#: ../../deprecations/pending-removal-in-3.14.rst:15 +#: ../../deprecations/pending-removal-in-3.14.rst:22 msgid ":class:`!ast.Bytes`" msgstr ":class:`!ast.Bytes`" #: ../../whatsnew/3.12.rst:1157 -#: ../../deprecations/pending-removal-in-3.14.rst:16 +#: ../../deprecations/pending-removal-in-3.14.rst:23 msgid ":class:`!ast.NameConstant`" msgstr ":class:`!ast.NameConstant`" #: ../../whatsnew/3.12.rst:1158 -#: ../../deprecations/pending-removal-in-3.14.rst:17 +#: ../../deprecations/pending-removal-in-3.14.rst:24 msgid ":class:`!ast.Ellipsis`" msgstr ":class:`!ast.Ellipsis`" #: ../../whatsnew/3.12.rst:1160 -#: ../../deprecations/pending-removal-in-3.14.rst:19 +#: ../../deprecations/pending-removal-in-3.14.rst:26 msgid "" "Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka in :gh:" "`90953`.)" @@ -1763,7 +1763,7 @@ msgstr "" "請改用 :class:`ast.Constant`。(由 Serhiy Storchaka 於 :gh:`90953` 貢獻。)" #: ../../whatsnew/3.12.rst:1163 -#: ../../deprecations/pending-removal-in-3.14.rst:22 +#: ../../deprecations/pending-removal-in-3.14.rst:29 msgid ":mod:`asyncio`:" msgstr ":mod:`asyncio`:" @@ -1776,7 +1776,7 @@ msgid "" msgstr "" #: ../../whatsnew/3.12.rst:1171 -#: ../../deprecations/pending-removal-in-3.14.rst:30 +#: ../../deprecations/pending-removal-in-3.14.rst:37 msgid "" ":func:`asyncio.set_child_watcher`, :func:`asyncio.get_child_watcher`, :meth:" "`asyncio.AbstractEventLoopPolicy.set_child_watcher` and :meth:`asyncio." @@ -1789,7 +1789,7 @@ msgstr "" "除。(由 Kumar Aditya 於 :gh:`94597` 貢獻。)" #: ../../whatsnew/3.12.rst:1177 -#: ../../deprecations/pending-removal-in-3.14.rst:36 +#: ../../deprecations/pending-removal-in-3.14.rst:43 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 " @@ -1844,37 +1844,37 @@ msgid "" msgstr ":mod:`importlib.abc`:棄用下列類別,預定於 Python 3.14 中移除:" #: ../../whatsnew/3.12.rst:1205 -#: ../../deprecations/pending-removal-in-3.14.rst:52 +#: ../../deprecations/pending-removal-in-3.14.rst:59 msgid ":class:`!importlib.abc.ResourceReader`" msgstr ":class:`!importlib.abc.ResourceReader`" #: ../../whatsnew/3.12.rst:1206 -#: ../../deprecations/pending-removal-in-3.14.rst:53 +#: ../../deprecations/pending-removal-in-3.14.rst:60 msgid ":class:`!importlib.abc.Traversable`" msgstr ":class:`!importlib.abc.Traversable`" #: ../../whatsnew/3.12.rst:1207 -#: ../../deprecations/pending-removal-in-3.14.rst:54 +#: ../../deprecations/pending-removal-in-3.14.rst:61 msgid ":class:`!importlib.abc.TraversableResources`" msgstr ":class:`!importlib.abc.TraversableResources`" #: ../../whatsnew/3.12.rst:1209 -#: ../../deprecations/pending-removal-in-3.14.rst:56 +#: ../../deprecations/pending-removal-in-3.14.rst:63 msgid "Use :mod:`importlib.resources.abc` classes instead:" msgstr "請改用 :mod:`importlib.resources.abc` 類別:" #: ../../whatsnew/3.12.rst:1211 -#: ../../deprecations/pending-removal-in-3.14.rst:58 +#: ../../deprecations/pending-removal-in-3.14.rst:65 msgid ":class:`importlib.resources.abc.Traversable`" msgstr ":class:`importlib.resources.abc.Traversable`" #: ../../whatsnew/3.12.rst:1212 -#: ../../deprecations/pending-removal-in-3.14.rst:59 +#: ../../deprecations/pending-removal-in-3.14.rst:66 msgid ":class:`importlib.resources.abc.TraversableResources`" msgstr ":class:`importlib.resources.abc.TraversableResources`" #: ../../whatsnew/3.12.rst:1214 -#: ../../deprecations/pending-removal-in-3.14.rst:61 +#: ../../deprecations/pending-removal-in-3.14.rst:68 msgid "(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)" msgstr "(由 Jason R. Coombs 和 Hugo van Kemenade 貢獻於 :gh:`93963`。)" @@ -1958,7 +1958,7 @@ msgstr "" "*onexc*。(由 Irit Katriel 於 :gh:`102828` 中貢獻。)" #: ../../whatsnew/3.12.rst:1267 -#: ../../deprecations/pending-removal-in-3.14.rst:91 +#: ../../deprecations/pending-removal-in-3.14.rst:98 msgid ":mod:`sqlite3`:" msgstr ":mod:`sqlite3`:" @@ -1994,7 +1994,7 @@ msgid "" msgstr "" #: ../../whatsnew/3.12.rst:1290 -#: ../../deprecations/pending-removal-in-3.15.rst:53 +#: ../../deprecations/pending-removal-in-3.15.rst:62 msgid ":mod:`typing`:" msgstr ":mod:`typing`:" @@ -2031,19 +2031,21 @@ msgstr "" #: ../../whatsnew/3.12.rst:1312 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`.)" +":exc:`DeprecationWarning` is now raised when :attr:`~module.__package__` on " +"a module differs from :attr:`__spec__.parent ` (previously it was :exc:`ImportWarning`). (Contributed by Brett " +"Cannon in :gh:`65961`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1317 +#: ../../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`.)" +"Setting :attr:`~module.__package__` or :attr:`~module.__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:1321 +#: ../../whatsnew/3.12.rst:1322 msgid "" "The bitwise inversion operator (``~``) on bool is deprecated. It will throw " "an error in Python 3.16. Use ``not`` for logical negation of bools instead. " @@ -2052,7 +2054,7 @@ msgid "" "Tim Hoffmann in :gh:`103487`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1327 +#: ../../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:" @@ -2239,7 +2241,23 @@ msgstr "" msgid "Pending Removal in Python 3.14" msgstr "Python 3.14 中待移除的項目" -#: ../../deprecations/pending-removal-in-3.14.rst:9 +#: ../../deprecations/pending-removal-in-3.14.rst:4 +#: ../../deprecations/pending-removal-in-3.15.rst:4 +msgid "The import system:" +msgstr "引入系統 (import system):" + +#: ../../deprecations/pending-removal-in-3.14.rst:6 +msgid "" +"Setting :attr:`~module.__loader__` on a module while failing to set :attr:" +"`__spec__.loader ` is deprecated. In " +"Python 3.14, :attr:`!__loader__` will cease to be set or taken into " +"consideration by the import system or the standard library." +msgstr "" +"在模組上設定 :attr:`~module.__loader__` 而沒有設定 :attr:`__spec__.loader " +"` 的做法已被棄用。在 Python 3.14 中," +"引入系統或標準函式庫將不再設定或考慮 :attr:`!__loader__` 。" + +#: ../../deprecations/pending-removal-in-3.14.rst:16 msgid "" ":mod:`ast`: The following features have been deprecated in documentation " "since Python 3.8, now cause a :exc:`DeprecationWarning` to be emitted at " @@ -2248,7 +2266,7 @@ msgstr "" ":mod:`ast`:自 Python 3.8 起,下列功能已在文件中被棄用,現在在存取或使用時會" "於 runtime 發出 :exc:`DeprecationWarning`,並將在 Python 3.14 中移除:" -#: ../../deprecations/pending-removal-in-3.14.rst:24 +#: ../../deprecations/pending-removal-in-3.14.rst:31 msgid "" "The child watcher classes :class:`~asyncio.MultiLoopChildWatcher`, :class:" "`~asyncio.FastChildWatcher`, :class:`~asyncio.AbstractChildWatcher` and :" @@ -2260,7 +2278,7 @@ msgstr "" "AbstractChildWatcher` 和 :class:`~asyncio.SafeChildWatcher`。 (由 Kumar " "Aditya 於 :gh:`94597` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:41 +#: ../../deprecations/pending-removal-in-3.14.rst:48 msgid "" ":mod:`collections.abc`: Deprecated :class:`~collections.abc.ByteString`. " "Prefer :class:`!Sequence` or :class:`~collections.abc.Buffer`. For use in " @@ -2272,7 +2290,7 @@ msgstr "" "改用聯集,如 ``bytes | bytearray``,或 :class:`collections.abc.Buffer`。(由 " "Shantanu Jain 於 :gh:`91896` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:47 +#: ../../deprecations/pending-removal-in-3.14.rst:54 msgid "" ":mod:`email`: Deprecated the *isdst* parameter in :func:`email.utils." "localtime`. (Contributed by Alan Williams in :gh:`72346`.)" @@ -2280,11 +2298,11 @@ msgstr "" ":mod:`email`:已棄用 :func:`email.utils.localtime` 中的 *isdst* 參數。(由 " "Alan Williams 於 :gh:`72346` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:50 +#: ../../deprecations/pending-removal-in-3.14.rst:57 msgid ":mod:`importlib.abc` deprecated classes:" msgstr ":mod:`importlib.abc` 的已棄用類別:" -#: ../../deprecations/pending-removal-in-3.14.rst:63 +#: ../../deprecations/pending-removal-in-3.14.rst:70 msgid "" ":mod:`itertools` had undocumented, inefficient, historically buggy, and " "inconsistent support for copy, deepcopy, and pickle operations. This will be " @@ -2295,7 +2313,7 @@ msgstr "" "deepcopy 和 pickle 操作支援。將在 3.14 中移除以大幅減少程式碼量和維護負擔。 " "(由 Raymond Hettinger 於 :gh:`101588` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:69 +#: ../../deprecations/pending-removal-in-3.14.rst:76 msgid "" ":mod:`multiprocessing`: The default start method will change to a safer one " "on Linux, BSDs, and other non-macOS POSIX platforms where ``'fork'`` is " @@ -2312,7 +2330,7 @@ msgstr "" "API 來明確指定你的程式碼何時\\ *需要* ``'fork'``。請參閱 :ref:" "`multiprocessing-start-methods`。" -#: ../../deprecations/pending-removal-in-3.14.rst:77 +#: ../../deprecations/pending-removal-in-3.14.rst:84 msgid "" ":mod:`pathlib`: :meth:`~pathlib.PurePath.is_relative_to` and :meth:`~pathlib." "PurePath.relative_to`: passing additional arguments is deprecated." @@ -2320,7 +2338,7 @@ msgstr "" ":mod:`pathlib`:已棄用 :meth:`~pathlib.PurePath.is_relative_to` 和 :meth:" "`~pathlib.PurePath.relative_to`:額外引數的傳遞已被棄用。" -#: ../../deprecations/pending-removal-in-3.14.rst:81 +#: ../../deprecations/pending-removal-in-3.14.rst:88 msgid "" ":mod:`pkgutil`: :func:`~pkgutil.find_loader` and :func:`~pkgutil.get_loader` " "now raise :exc:`DeprecationWarning`; use :func:`importlib.util.find_spec` " @@ -2330,23 +2348,23 @@ msgstr "" "現在會引發 :exc:`DeprecationWarning`;請改用 :func:`importlib.util." "find_spec`。 (由 Nikita Sobolev 於 :gh:`97850` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:86 +#: ../../deprecations/pending-removal-in-3.14.rst:93 msgid ":mod:`pty`:" msgstr ":mod:`pty`:" -#: ../../deprecations/pending-removal-in-3.14.rst:88 +#: ../../deprecations/pending-removal-in-3.14.rst:95 msgid "``master_open()``: use :func:`pty.openpty`." msgstr "``master_open()``:請用 :func:`pty.openpty`。" -#: ../../deprecations/pending-removal-in-3.14.rst:89 +#: ../../deprecations/pending-removal-in-3.14.rst:96 msgid "``slave_open()``: use :func:`pty.openpty`." msgstr "``slave_open()``:請用 :func:`pty.openpty`。" -#: ../../deprecations/pending-removal-in-3.14.rst:93 +#: ../../deprecations/pending-removal-in-3.14.rst:100 msgid ":data:`~sqlite3.version` and :data:`~sqlite3.version_info`." msgstr ":data:`~sqlite3.version` 和 :data:`~sqlite3.version_info`。" -#: ../../deprecations/pending-removal-in-3.14.rst:95 +#: ../../deprecations/pending-removal-in-3.14.rst:102 msgid "" ":meth:`~sqlite3.Cursor.execute` and :meth:`~sqlite3.Cursor.executemany` if :" "ref:`named placeholders ` are used and *parameters* is " @@ -2356,7 +2374,7 @@ msgstr "" "使用 :ref:`named placeholders ` 且 *parameters* 是序列" "而不是 :class:`dict`。" -#: ../../deprecations/pending-removal-in-3.14.rst:99 +#: ../../deprecations/pending-removal-in-3.14.rst:106 msgid "" "date and datetime adapter, date and timestamp converter: see the :mod:" "`sqlite3` documentation for suggested replacement recipes." @@ -2364,7 +2382,7 @@ msgstr "" "date 和 datetime 的適配器 (adapter)、date 和 timestamp 轉換器 (converter):請" "參閱 :mod:`sqlite3` 文件以獲得建議的替代方案。" -#: ../../deprecations/pending-removal-in-3.14.rst:102 +#: ../../deprecations/pending-removal-in-3.14.rst:109 msgid "" ":class:`types.CodeType`: Accessing :attr:`~codeobject.co_lnotab` was " "deprecated in :pep:`626` since 3.10 and was planned to be removed in 3.12, " @@ -2376,7 +2394,7 @@ msgstr "" "exc:`DeprecationWarning`。可能在 3.14 中移除。(由 Nikita Sobolev 於 :gh:" "`101866` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:109 +#: ../../deprecations/pending-removal-in-3.14.rst:116 msgid "" ":mod:`typing`: :class:`~typing.ByteString`, deprecated since Python 3.9, now " "causes a :exc:`DeprecationWarning` to be emitted when it is used." @@ -2384,7 +2402,7 @@ msgstr "" ":mod:`typing`:自 Python 3.9 起已被棄用的 :class:`~typing.ByteString` 現在在" "使用時會發出 :exc:`DeprecationWarning`。" -#: ../../deprecations/pending-removal-in-3.14.rst:112 +#: ../../deprecations/pending-removal-in-3.14.rst:119 msgid "" ":mod:`urllib`: :class:`!urllib.parse.Quoter` is deprecated: it was not " "intended to be a public API. (Contributed by Gregory P. Smith in :gh:" @@ -2398,22 +2416,44 @@ msgstr "" msgid "Pending Removal in Python 3.15" msgstr "Python 3.15 中待移除的項目" -#: ../../deprecations/pending-removal-in-3.15.rst:4 +#: ../../deprecations/pending-removal-in-3.15.rst:6 +msgid "" +"Setting :attr:`~module.__cached__` on a module while failing to set :attr:" +"`__spec__.cached ` is deprecated. In " +"Python 3.15, :attr:`!__cached__` will cease to be set or take into " +"consideration by the import system or standard library. (:gh:`97879`)" +msgstr "" +"在模組上設定 :attr:`~module.__cached__` 而沒有設定 :attr:`__spec__.cached " +"` 的做法已被棄用。在 Python 3.15 中," +"引入系統或標準函式庫將不再設定或考慮 :attr:`!__cached__`。(:gh:`97879`)" + +#: ../../deprecations/pending-removal-in-3.15.rst:11 +msgid "" +"Setting :attr:`~module.__package__` on a module while failing to set :attr:" +"`__spec__.parent ` is deprecated. In " +"Python 3.15, :attr:`!__package__` will cease to be set or take into " +"consideration by the import system or standard library. (:gh:`97879`)" +msgstr "" +"在模組上設定 :attr:`~module.__package__` 而沒有設定 :attr:`__spec__.parent " +"` 的做法已被棄用。在 Python 3.15 中," +"引入系統或標準函式庫將不再設定或考慮 :attr:`!__package__`。(:gh:`97879`)" + +#: ../../deprecations/pending-removal-in-3.15.rst:16 msgid ":mod:`ctypes`:" msgstr ":mod:`ctypes`:" -#: ../../deprecations/pending-removal-in-3.15.rst:6 +#: ../../deprecations/pending-removal-in-3.15.rst:18 msgid "" "The undocumented :func:`!ctypes.SetPointerType` function has been deprecated " "since Python 3.13." msgstr "" "自 Python 3.13 起,未記錄的 :func:`!ctypes.SetPointerType` 函式已被棄用。" -#: ../../deprecations/pending-removal-in-3.15.rst:9 +#: ../../deprecations/pending-removal-in-3.15.rst:21 msgid ":mod:`http.server`:" msgstr ":mod:`http.server`:" -#: ../../deprecations/pending-removal-in-3.15.rst:11 +#: ../../deprecations/pending-removal-in-3.15.rst:23 msgid "" "The obsolete and rarely used :class:`~http.server.CGIHTTPRequestHandler` has " "been deprecated since Python 3.13. No direct replacement exists. *Anything* " @@ -2423,7 +2463,7 @@ msgstr "" "起已被棄用。不存在直接的替代。*任何東西*\\ 都比 CGI 更好地將 Web 伺服器與請求" "處理程序介接起來。" -#: ../../deprecations/pending-removal-in-3.15.rst:17 +#: ../../deprecations/pending-removal-in-3.15.rst:29 msgid "" "The :option:`!--cgi` flag to the :program:`python -m http.server` command-" "line interface has been deprecated since Python 3.13." @@ -2431,19 +2471,11 @@ msgstr "" "自 Python 3.13 起,:program:`python -m http.server` 命令列介面的 :option:`!--" "cgi` 旗標已被棄用。" -#: ../../deprecations/pending-removal-in-3.15.rst:20 -msgid "" -":mod:`importlib`: ``__package__`` and ``__cached__`` will cease to be set or " -"taken into consideration by the import system (:gh:`97879`)." -msgstr "" -":mod:`importlib`:``__package__`` 和 ``__cached__`` 將不再被設定或被 import " -"系統考慮。 (:gh:`97879`)" - -#: ../../deprecations/pending-removal-in-3.15.rst:23 +#: ../../deprecations/pending-removal-in-3.15.rst:32 msgid ":class:`locale`:" msgstr ":class:`locale`:" -#: ../../deprecations/pending-removal-in-3.15.rst:25 +#: ../../deprecations/pending-removal-in-3.15.rst:34 msgid "" "The :func:`~locale.getdefaultlocale` function has been deprecated since " "Python 3.11. Its removal was originally planned for Python 3.13 (:gh:" @@ -2456,11 +2488,11 @@ msgstr "" "`~locale.getlocale`、:func:`~locale.setlocale` 和 :func:`~locale." "getencoding`。 (由 Hugo van Kemenade 於 :gh:`111187` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.15.rst:33 +#: ../../deprecations/pending-removal-in-3.15.rst:42 msgid ":mod:`pathlib`:" msgstr ":mod:`pathlib`:" -#: ../../deprecations/pending-removal-in-3.15.rst:35 +#: ../../deprecations/pending-removal-in-3.15.rst:44 msgid "" ":meth:`.PurePath.is_reserved` has been deprecated since Python 3.13. Use :" "func:`os.path.isreserved` to detect reserved paths on Windows." @@ -2468,11 +2500,11 @@ msgstr "" ":meth:`.PurePath.is_reserved` 已自 Python 3.13 被棄用。請用 :func:`os.path." "isreserved` 來偵測 Windows 上的保留路徑。" -#: ../../deprecations/pending-removal-in-3.15.rst:39 +#: ../../deprecations/pending-removal-in-3.15.rst:48 msgid ":mod:`platform`:" msgstr ":mod:`platform`:" -#: ../../deprecations/pending-removal-in-3.15.rst:41 +#: ../../deprecations/pending-removal-in-3.15.rst:50 msgid "" ":func:`~platform.java_ver` has been deprecated since Python 3.13. This " "function is only useful for Jython support, has a confusing API, and is " @@ -2481,11 +2513,11 @@ msgstr "" "自 Python 3.13 起,:func:`~platform.java_ver` 已被棄用。此函式僅對 Jython 支" "援有用,具有令人困惑的 API,基本上未經測試。" -#: ../../deprecations/pending-removal-in-3.15.rst:45 +#: ../../deprecations/pending-removal-in-3.15.rst:54 msgid ":mod:`threading`:" msgstr ":mod:`threading`:" -#: ../../deprecations/pending-removal-in-3.15.rst:47 +#: ../../deprecations/pending-removal-in-3.15.rst:56 msgid "" ":func:`~threading.RLock` will take no arguments in Python 3.15. Passing any " "arguments has been deprecated since Python 3.14, as the Python version does " @@ -2496,7 +2528,7 @@ msgstr "" "起,傳遞任何引數的用法已被棄用,因為 Python 版本不允許任何引數,但 C 版本允許" "任意數量的位置或關鍵字引數,並忽略每個引數。" -#: ../../deprecations/pending-removal-in-3.15.rst:55 +#: ../../deprecations/pending-removal-in-3.15.rst:64 msgid "" "The undocumented keyword argument syntax for creating :class:`~typing." "NamedTuple` classes (e.g. ``Point = NamedTuple(\"Point\", x=int, y=int)``) " @@ -2507,7 +2539,7 @@ msgstr "" "(``Point = NamedTuple(\"Point\", x=int, y=int)``) 已自 Python 3.13 棄用。請改" "用基於類別的語法或函式語法 (functional syntax)。" -#: ../../deprecations/pending-removal-in-3.15.rst:61 +#: ../../deprecations/pending-removal-in-3.15.rst:70 msgid "" "The :func:`typing.no_type_check_decorator` decorator function has been " "deprecated since Python 3.13. After eight years in the :mod:`typing` module, " @@ -2517,11 +2549,11 @@ msgstr "" "用。在 :mod:`typing` 模組中使用了八年之後,它尚未得到任何主要型別檢查器的支" "援。" -#: ../../deprecations/pending-removal-in-3.15.rst:66 +#: ../../deprecations/pending-removal-in-3.15.rst:75 msgid ":mod:`wave`:" msgstr ":mod:`wave`:" -#: ../../deprecations/pending-removal-in-3.15.rst:68 +#: ../../deprecations/pending-removal-in-3.15.rst:77 msgid "" "The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:`~wave." "Wave_read.getmarkers` methods of the :class:`~wave.Wave_read` and :class:" @@ -2774,6 +2806,8 @@ msgid "" ":mod:`logging`: the ``warn()`` method has been deprecated since Python 3.3, " "use :meth:`~logging.warning` instead." msgstr "" +":mod:`logging`:自 Python 3.3 起,``warn()`` 方法已被棄用,請改用 :meth:" +"`~logging.warning`。" #: ../../deprecations/pending-removal-in-future.rst:72 msgid "" @@ -3022,32 +3056,32 @@ msgstr "" ":meth:`zipimport.zipimporter.load_module` 已被棄用:請改用 :meth:`~zipimport." "zipimporter.exec_module`。" -#: ../../whatsnew/3.12.rst:1344 ../../whatsnew/3.12.rst:2222 +#: ../../whatsnew/3.12.rst:1345 ../../whatsnew/3.12.rst:2223 msgid "Removed" msgstr "已移除" -#: ../../whatsnew/3.12.rst:1347 +#: ../../whatsnew/3.12.rst:1348 msgid "asynchat and asyncore" msgstr "asynchat 和 asyncore" -#: ../../whatsnew/3.12.rst:1349 +#: ../../whatsnew/3.12.rst:1350 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:1356 +#: ../../whatsnew/3.12.rst:1357 msgid "configparser" msgstr "configparser" -#: ../../whatsnew/3.12.rst:1358 +#: ../../whatsnew/3.12.rst:1359 msgid "" "Several names deprecated in the :mod:`configparser` way back in 3.2 have " "been removed per :gh:`89336`:" msgstr "" -#: ../../whatsnew/3.12.rst:1361 +#: ../../whatsnew/3.12.rst:1362 msgid "" ":class:`configparser.ParsingError` no longer has a ``filename`` attribute or " "argument. Use the ``source`` attribute and argument instead." @@ -3055,23 +3089,23 @@ msgstr "" ":class:`configparser.ParsingError` 不再具有 ``filename`` 屬性或引數。請改用 " "``source`` 屬性和引數。" -#: ../../whatsnew/3.12.rst:1363 +#: ../../whatsnew/3.12.rst:1364 msgid "" ":mod:`configparser` no longer has a ``SafeConfigParser`` class. Use the " "shorter :class:`~configparser.ConfigParser` name instead." msgstr "" -#: ../../whatsnew/3.12.rst:1365 +#: ../../whatsnew/3.12.rst:1366 msgid "" ":class:`configparser.ConfigParser` no longer has a ``readfp`` method. Use :" "meth:`~configparser.ConfigParser.read_file` instead." msgstr "" -#: ../../whatsnew/3.12.rst:1369 +#: ../../whatsnew/3.12.rst:1370 msgid "distutils" msgstr "distutils" -#: ../../whatsnew/3.12.rst:1371 +#: ../../whatsnew/3.12.rst:1372 msgid "" "Remove the :py:mod:`!distutils` package. It was deprecated in Python 3.10 " "by :pep:`632` \"Deprecate distutils module\". For projects still using " @@ -3080,17 +3114,17 @@ msgid "" "Victor Stinner in :gh:`92584`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1378 +#: ../../whatsnew/3.12.rst:1379 msgid "ensurepip" msgstr "ensurepip" -#: ../../whatsnew/3.12.rst:1380 +#: ../../whatsnew/3.12.rst:1381 msgid "" "Remove the bundled setuptools wheel from :mod:`ensurepip`, and stop " "installing setuptools in environments created by :mod:`venv`." msgstr "" -#: ../../whatsnew/3.12.rst:1383 +#: ../../whatsnew/3.12.rst:1384 msgid "" "``pip (>= 22.1)`` does not require setuptools to be installed in the " "environment. ``setuptools``-based (and ``distutils``-based) packages can " @@ -3098,7 +3132,7 @@ msgid "" "the build environment it uses for building a package." msgstr "" -#: ../../whatsnew/3.12.rst:1389 +#: ../../whatsnew/3.12.rst:1390 msgid "" "``easy_install``, ``pkg_resources``, ``setuptools`` and ``distutils`` are no " "longer provided by default in environments created with ``venv`` or " @@ -3108,25 +3142,25 @@ msgid "" "(typically, using pip)." msgstr "" -#: ../../whatsnew/3.12.rst:1396 +#: ../../whatsnew/3.12.rst:1397 msgid "(Contributed by Pradyun Gedam in :gh:`95299`.)" msgstr "(由 Pradyun Gedam 於 :gh:`95299` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1399 +#: ../../whatsnew/3.12.rst:1400 msgid "enum" msgstr "enum" -#: ../../whatsnew/3.12.rst:1401 +#: ../../whatsnew/3.12.rst:1402 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:1406 +#: ../../whatsnew/3.12.rst:1407 msgid "ftplib" msgstr "ftplib" -#: ../../whatsnew/3.12.rst:1408 +#: ../../whatsnew/3.12.rst:1409 msgid "" "Remove :mod:`ftplib`'s ``FTP_TLS.ssl_version`` class attribute: use the " "*context* parameter instead. (Contributed by Victor Stinner in :gh:`94172`.)" @@ -3134,11 +3168,11 @@ msgstr "" "移除 :mod:`ftplib` 的 ``FTP_TLS.ssl_version`` 類別屬性:請改用 *context* 參" "數。(由 Victor Stinner 於 :gh:`94172` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1413 +#: ../../whatsnew/3.12.rst:1414 msgid "gzip" msgstr "gzip" -#: ../../whatsnew/3.12.rst:1415 +#: ../../whatsnew/3.12.rst:1416 msgid "" "Remove the ``filename`` attribute of :mod:`gzip`'s :class:`gzip.GzipFile`, " "deprecated since Python 2.6, use the :attr:`~gzip.GzipFile.name` attribute " @@ -3147,11 +3181,11 @@ msgid "" "`94196`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1422 +#: ../../whatsnew/3.12.rst:1423 msgid "hashlib" msgstr "hashlib" -#: ../../whatsnew/3.12.rst:1424 +#: ../../whatsnew/3.12.rst:1425 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 " @@ -3160,17 +3194,17 @@ msgid "" "Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1431 ../../whatsnew/3.12.rst:1458 +#: ../../whatsnew/3.12.rst:1432 ../../whatsnew/3.12.rst:1459 msgid "importlib" msgstr "importlib" -#: ../../whatsnew/3.12.rst:1433 +#: ../../whatsnew/3.12.rst:1434 msgid "" "Many previously deprecated cleanups in :mod:`importlib` have now been " "completed:" msgstr "現已完成清理 :mod:`importlib` 中許多過去已經棄用的東西:" -#: ../../whatsnew/3.12.rst:1436 +#: ../../whatsnew/3.12.rst:1437 msgid "" "References to, and support for :meth:`!module_repr` has been removed. " "(Contributed by Barry Warsaw in :gh:`97850`.)" @@ -3178,134 +3212,134 @@ msgstr "" "對 :meth:`!module_repr` 的參照和支援已刪除。(由 Barry Warsaw 在 :gh:`97850` " "中貢獻。)" -#: ../../whatsnew/3.12.rst:1439 +#: ../../whatsnew/3.12.rst:1440 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:1443 +#: ../../whatsnew/3.12.rst:1444 msgid "" "Support for ``find_loader()`` and ``find_module()`` APIs have been removed. " "(Contributed by Barry Warsaw in :gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1446 +#: ../../whatsnew/3.12.rst:1447 msgid "" "``importlib.abc.Finder``, ``pkgutil.ImpImporter``, and ``pkgutil.ImpLoader`` " "have been removed. (Contributed by Barry Warsaw in :gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1450 ../../whatsnew/3.12.rst:1458 +#: ../../whatsnew/3.12.rst:1451 ../../whatsnew/3.12.rst:1459 msgid "imp" msgstr "imp" -#: ../../whatsnew/3.12.rst:1452 +#: ../../whatsnew/3.12.rst:1453 msgid "" "The :mod:`!imp` module has been removed. (Contributed by Barry Warsaw in :" "gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1455 +#: ../../whatsnew/3.12.rst:1456 msgid "To migrate, consult the following correspondence table:" msgstr "" -#: ../../whatsnew/3.12.rst:1460 +#: ../../whatsnew/3.12.rst:1461 msgid "``imp.NullImporter``" msgstr "``imp.NullImporter``" -#: ../../whatsnew/3.12.rst:1460 +#: ../../whatsnew/3.12.rst:1461 msgid "Insert ``None`` into ``sys.path_importer_cache``" msgstr "將 ``None`` 插入 ``sys.path_importer_cache``" -#: ../../whatsnew/3.12.rst:1461 +#: ../../whatsnew/3.12.rst:1462 msgid "``imp.cache_from_source()``" msgstr "``imp.cache_from_source()``" -#: ../../whatsnew/3.12.rst:1461 +#: ../../whatsnew/3.12.rst:1462 msgid ":func:`importlib.util.cache_from_source`" msgstr ":func:`importlib.util.cache_from_source`" -#: ../../whatsnew/3.12.rst:1462 +#: ../../whatsnew/3.12.rst:1463 msgid "``imp.find_module()``" msgstr "``imp.find_module()``" -#: ../../whatsnew/3.12.rst:1462 +#: ../../whatsnew/3.12.rst:1463 msgid ":func:`importlib.util.find_spec`" msgstr ":func:`importlib.util.find_spec`" -#: ../../whatsnew/3.12.rst:1463 +#: ../../whatsnew/3.12.rst:1464 msgid "``imp.get_magic()``" msgstr "``imp.get_magic()``" -#: ../../whatsnew/3.12.rst:1463 +#: ../../whatsnew/3.12.rst:1464 msgid ":attr:`importlib.util.MAGIC_NUMBER`" msgstr ":attr:`importlib.util.MAGIC_NUMBER`" -#: ../../whatsnew/3.12.rst:1464 +#: ../../whatsnew/3.12.rst:1465 msgid "``imp.get_suffixes()``" msgstr "``imp.get_suffixes()``" -#: ../../whatsnew/3.12.rst:1464 +#: ../../whatsnew/3.12.rst:1465 msgid "" ":attr:`importlib.machinery.SOURCE_SUFFIXES`, :attr:`importlib.machinery." "EXTENSION_SUFFIXES`, and :attr:`importlib.machinery.BYTECODE_SUFFIXES`" msgstr "" -#: ../../whatsnew/3.12.rst:1465 +#: ../../whatsnew/3.12.rst:1466 msgid "``imp.get_tag()``" msgstr "``imp.get_tag()``" -#: ../../whatsnew/3.12.rst:1465 +#: ../../whatsnew/3.12.rst:1466 msgid ":attr:`sys.implementation.cache_tag `" msgstr ":attr:`sys.implementation.cache_tag `" -#: ../../whatsnew/3.12.rst:1466 +#: ../../whatsnew/3.12.rst:1467 msgid "``imp.load_module()``" msgstr "``imp.load_module()``" -#: ../../whatsnew/3.12.rst:1466 +#: ../../whatsnew/3.12.rst:1467 msgid ":func:`importlib.import_module`" msgstr ":func:`importlib.import_module`" -#: ../../whatsnew/3.12.rst:1467 +#: ../../whatsnew/3.12.rst:1468 msgid "``imp.new_module(name)``" msgstr "``imp.new_module(name)``" -#: ../../whatsnew/3.12.rst:1467 +#: ../../whatsnew/3.12.rst:1468 msgid "``types.ModuleType(name)``" msgstr "``types.ModuleType(name)``" -#: ../../whatsnew/3.12.rst:1468 +#: ../../whatsnew/3.12.rst:1469 msgid "``imp.reload()``" msgstr "``imp.reload()``" -#: ../../whatsnew/3.12.rst:1468 +#: ../../whatsnew/3.12.rst:1469 msgid ":func:`importlib.reload`" msgstr ":func:`importlib.reload`" -#: ../../whatsnew/3.12.rst:1469 +#: ../../whatsnew/3.12.rst:1470 msgid "``imp.source_from_cache()``" msgstr "``imp.source_from_cache()``" -#: ../../whatsnew/3.12.rst:1469 +#: ../../whatsnew/3.12.rst:1470 msgid ":func:`importlib.util.source_from_cache`" msgstr ":func:`importlib.util.source_from_cache`" -#: ../../whatsnew/3.12.rst:1470 +#: ../../whatsnew/3.12.rst:1471 msgid "``imp.load_source()``" msgstr "``imp.load_source()``" -#: ../../whatsnew/3.12.rst:1470 +#: ../../whatsnew/3.12.rst:1471 msgid "*See below*" msgstr "*見下文*" -#: ../../whatsnew/3.12.rst:1473 +#: ../../whatsnew/3.12.rst:1474 msgid "Replace ``imp.load_source()`` with::" msgstr "用以下取代 ``imp.load_source()``: ::" -#: ../../whatsnew/3.12.rst:1475 +#: ../../whatsnew/3.12.rst:1476 msgid "" "import importlib.util\n" "import importlib.machinery\n" @@ -3322,37 +3356,37 @@ msgid "" " return module" msgstr "" -#: ../../whatsnew/3.12.rst:1488 +#: ../../whatsnew/3.12.rst:1489 msgid "Remove :mod:`!imp` functions and attributes with no replacements:" msgstr "移除 :mod:`!imp` 函式和屬性、沒有替代方案:" -#: ../../whatsnew/3.12.rst:1490 +#: ../../whatsnew/3.12.rst:1491 msgid "Undocumented functions:" msgstr "未以文件記錄的函式:" -#: ../../whatsnew/3.12.rst:1492 +#: ../../whatsnew/3.12.rst:1493 msgid "``imp.init_builtin()``" msgstr "``imp.init_builtin()``" -#: ../../whatsnew/3.12.rst:1493 +#: ../../whatsnew/3.12.rst:1494 msgid "``imp.load_compiled()``" msgstr "``imp.load_compiled()``" -#: ../../whatsnew/3.12.rst:1494 +#: ../../whatsnew/3.12.rst:1495 msgid "``imp.load_dynamic()``" msgstr "``imp.load_dynamic()``" -#: ../../whatsnew/3.12.rst:1495 +#: ../../whatsnew/3.12.rst:1496 msgid "``imp.load_package()``" msgstr "``imp.load_package()``" -#: ../../whatsnew/3.12.rst:1497 +#: ../../whatsnew/3.12.rst:1498 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:1499 +#: ../../whatsnew/3.12.rst:1500 msgid "" "``imp.find_module()`` constants: ``SEARCH_ERROR``, ``PY_SOURCE``, " "``PY_COMPILED``, ``C_EXTENSION``, ``PY_RESOURCE``, ``PKG_DIRECTORY``, " @@ -3362,11 +3396,11 @@ msgstr "" "``PY_COMPILED``、``C_EXTENSION``、``PY_RESOURCE``、``PKG_DIRECTORY``、" "``C_BUILTIN``、``PY_FROZEN``、``PY_CODERESOURCE``、``IMP_HOOK``。" -#: ../../whatsnew/3.12.rst:1504 +#: ../../whatsnew/3.12.rst:1505 msgid "io" msgstr "io" -#: ../../whatsnew/3.12.rst:1506 +#: ../../whatsnew/3.12.rst:1507 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." @@ -3375,22 +3409,22 @@ msgid "" "`94169`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1513 +#: ../../whatsnew/3.12.rst:1514 msgid "locale" msgstr "locale" -#: ../../whatsnew/3.12.rst:1515 +#: ../../whatsnew/3.12.rst:1516 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:1520 +#: ../../whatsnew/3.12.rst:1521 msgid "smtpd" msgstr "smtpd" -#: ../../whatsnew/3.12.rst:1522 +#: ../../whatsnew/3.12.rst:1523 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 the :pypi:" @@ -3398,27 +3432,27 @@ msgid "" "(Contributed by Oleg Iarygin in :gh:`93243`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1531 +#: ../../whatsnew/3.12.rst:1532 msgid "" "The following undocumented :mod:`sqlite3` features, deprecated in Python " "3.10, are now removed:" msgstr "" -#: ../../whatsnew/3.12.rst:1534 +#: ../../whatsnew/3.12.rst:1535 msgid "``sqlite3.enable_shared_cache()``" msgstr "``sqlite3.enable_shared_cache()``" -#: ../../whatsnew/3.12.rst:1535 +#: ../../whatsnew/3.12.rst:1536 msgid "``sqlite3.OptimizedUnicode``" msgstr "``sqlite3.OptimizedUnicode``" -#: ../../whatsnew/3.12.rst:1537 +#: ../../whatsnew/3.12.rst:1538 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:1540 +#: ../../whatsnew/3.12.rst:1541 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 " @@ -3426,22 +3460,22 @@ msgid "" "default value which is also ``str``." msgstr "" -#: ../../whatsnew/3.12.rst:1545 +#: ../../whatsnew/3.12.rst:1546 msgid "(Contributed by Erlend E. Aasland in :gh:`92548`.)" msgstr "(由 Erlend E. Aasland 於 :gh:`92548` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1548 +#: ../../whatsnew/3.12.rst:1549 msgid "ssl" msgstr "ssl" -#: ../../whatsnew/3.12.rst:1550 +#: ../../whatsnew/3.12.rst:1551 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:1554 +#: ../../whatsnew/3.12.rst:1555 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 " @@ -3449,7 +3483,7 @@ msgid "" "Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1560 +#: ../../whatsnew/3.12.rst:1561 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." @@ -3460,189 +3494,189 @@ msgid "" "`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1571 +#: ../../whatsnew/3.12.rst:1572 msgid "Remove many long-deprecated :mod:`unittest` features:" msgstr "移除許多 :mod:`unittest` 中被棄用已久的功能:" -#: ../../whatsnew/3.12.rst:1575 +#: ../../whatsnew/3.12.rst:1576 msgid "A number of :class:`~unittest.TestCase` method aliases:" msgstr "許多 :class:`~unittest.TestCase` 方法別名:" -#: ../../whatsnew/3.12.rst:1578 +#: ../../whatsnew/3.12.rst:1579 msgid "Deprecated alias" msgstr "已棄用的別名" -#: ../../whatsnew/3.12.rst:1578 +#: ../../whatsnew/3.12.rst:1579 msgid "Method Name" msgstr "方法名稱" -#: ../../whatsnew/3.12.rst:1578 +#: ../../whatsnew/3.12.rst:1579 msgid "Deprecated in" msgstr "已棄用於" -#: ../../whatsnew/3.12.rst:1580 +#: ../../whatsnew/3.12.rst:1581 msgid "``failUnless``" msgstr "``failUnless``" -#: ../../whatsnew/3.12.rst:1580 ../../whatsnew/3.12.rst:1587 +#: ../../whatsnew/3.12.rst:1581 ../../whatsnew/3.12.rst:1588 msgid ":meth:`.assertTrue`" msgstr ":meth:`.assertTrue`" -#: ../../whatsnew/3.12.rst:1580 ../../whatsnew/3.12.rst:1581 -#: ../../whatsnew/3.12.rst:1582 ../../whatsnew/3.12.rst:1583 -#: ../../whatsnew/3.12.rst:1584 ../../whatsnew/3.12.rst:1585 -#: ../../whatsnew/3.12.rst:1586 +#: ../../whatsnew/3.12.rst:1581 ../../whatsnew/3.12.rst:1582 +#: ../../whatsnew/3.12.rst:1583 ../../whatsnew/3.12.rst:1584 +#: ../../whatsnew/3.12.rst:1585 ../../whatsnew/3.12.rst:1586 +#: ../../whatsnew/3.12.rst:1587 msgid "3.1" msgstr "3.1" -#: ../../whatsnew/3.12.rst:1581 +#: ../../whatsnew/3.12.rst:1582 msgid "``failIf``" msgstr "``failIf``" -#: ../../whatsnew/3.12.rst:1581 +#: ../../whatsnew/3.12.rst:1582 msgid ":meth:`.assertFalse`" msgstr ":meth:`.assertFalse`" -#: ../../whatsnew/3.12.rst:1582 +#: ../../whatsnew/3.12.rst:1583 msgid "``failUnlessEqual``" msgstr "``failUnlessEqual``" -#: ../../whatsnew/3.12.rst:1582 ../../whatsnew/3.12.rst:1588 +#: ../../whatsnew/3.12.rst:1583 ../../whatsnew/3.12.rst:1589 msgid ":meth:`.assertEqual`" msgstr ":meth:`.assertEqual`" -#: ../../whatsnew/3.12.rst:1583 +#: ../../whatsnew/3.12.rst:1584 msgid "``failIfEqual``" msgstr "``failIfEqual``" -#: ../../whatsnew/3.12.rst:1583 ../../whatsnew/3.12.rst:1589 +#: ../../whatsnew/3.12.rst:1584 ../../whatsnew/3.12.rst:1590 msgid ":meth:`.assertNotEqual`" msgstr ":meth:`.assertNotEqual`" -#: ../../whatsnew/3.12.rst:1584 +#: ../../whatsnew/3.12.rst:1585 msgid "``failUnlessAlmostEqual``" msgstr "``failUnlessAlmostEqual``" -#: ../../whatsnew/3.12.rst:1584 ../../whatsnew/3.12.rst:1590 +#: ../../whatsnew/3.12.rst:1585 ../../whatsnew/3.12.rst:1591 msgid ":meth:`.assertAlmostEqual`" msgstr ":meth:`.assertAlmostEqual`" -#: ../../whatsnew/3.12.rst:1585 +#: ../../whatsnew/3.12.rst:1586 msgid "``failIfAlmostEqual``" msgstr "``failIfAlmostEqual``" -#: ../../whatsnew/3.12.rst:1585 ../../whatsnew/3.12.rst:1591 +#: ../../whatsnew/3.12.rst:1586 ../../whatsnew/3.12.rst:1592 msgid ":meth:`.assertNotAlmostEqual`" msgstr ":meth:`.assertNotAlmostEqual`" -#: ../../whatsnew/3.12.rst:1586 +#: ../../whatsnew/3.12.rst:1587 msgid "``failUnlessRaises``" msgstr "``failUnlessRaises``" -#: ../../whatsnew/3.12.rst:1586 +#: ../../whatsnew/3.12.rst:1587 msgid ":meth:`.assertRaises`" msgstr ":meth:`.assertRaises`" -#: ../../whatsnew/3.12.rst:1587 +#: ../../whatsnew/3.12.rst:1588 msgid "``assert_``" msgstr "``assert_``" -#: ../../whatsnew/3.12.rst:1587 ../../whatsnew/3.12.rst:1588 -#: ../../whatsnew/3.12.rst:1589 ../../whatsnew/3.12.rst:1590 -#: ../../whatsnew/3.12.rst:1591 ../../whatsnew/3.12.rst:1592 -#: ../../whatsnew/3.12.rst:1593 +#: ../../whatsnew/3.12.rst:1588 ../../whatsnew/3.12.rst:1589 +#: ../../whatsnew/3.12.rst:1590 ../../whatsnew/3.12.rst:1591 +#: ../../whatsnew/3.12.rst:1592 ../../whatsnew/3.12.rst:1593 +#: ../../whatsnew/3.12.rst:1594 msgid "3.2" msgstr "3.2" -#: ../../whatsnew/3.12.rst:1588 +#: ../../whatsnew/3.12.rst:1589 msgid "``assertEquals``" msgstr "``assertEquals``" -#: ../../whatsnew/3.12.rst:1589 +#: ../../whatsnew/3.12.rst:1590 msgid "``assertNotEquals``" msgstr "``assertNotEquals``" -#: ../../whatsnew/3.12.rst:1590 +#: ../../whatsnew/3.12.rst:1591 msgid "``assertAlmostEquals``" msgstr "``assertAlmostEquals``" -#: ../../whatsnew/3.12.rst:1591 +#: ../../whatsnew/3.12.rst:1592 msgid "``assertNotAlmostEquals``" msgstr "``assertNotAlmostEquals``" -#: ../../whatsnew/3.12.rst:1592 +#: ../../whatsnew/3.12.rst:1593 msgid "``assertRegexpMatches``" msgstr "``assertRegexpMatches``" -#: ../../whatsnew/3.12.rst:1592 +#: ../../whatsnew/3.12.rst:1593 msgid ":meth:`.assertRegex`" msgstr ":meth:`.assertRegex`" -#: ../../whatsnew/3.12.rst:1593 +#: ../../whatsnew/3.12.rst:1594 msgid "``assertRaisesRegexp``" msgstr "``assertRaisesRegexp``" -#: ../../whatsnew/3.12.rst:1593 +#: ../../whatsnew/3.12.rst:1594 msgid ":meth:`.assertRaisesRegex`" msgstr ":meth:`.assertRaisesRegex`" -#: ../../whatsnew/3.12.rst:1594 +#: ../../whatsnew/3.12.rst:1595 msgid "``assertNotRegexpMatches``" msgstr "``assertNotRegexpMatches``" -#: ../../whatsnew/3.12.rst:1594 +#: ../../whatsnew/3.12.rst:1595 msgid ":meth:`.assertNotRegex`" msgstr ":meth:`.assertNotRegex`" -#: ../../whatsnew/3.12.rst:1594 +#: ../../whatsnew/3.12.rst:1595 msgid "3.5" msgstr "3.5" -#: ../../whatsnew/3.12.rst:1597 +#: ../../whatsnew/3.12.rst:1598 msgid "" "You can use https://github.com/isidentical/teyit to automatically modernise " "your unit tests." msgstr "" -#: ../../whatsnew/3.12.rst:1600 +#: ../../whatsnew/3.12.rst:1601 msgid "" "Undocumented and broken :class:`~unittest.TestCase` method " "``assertDictContainsSubset`` (deprecated in Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1603 +#: ../../whatsnew/3.12.rst:1604 msgid "" "Undocumented :meth:`TestLoader.loadTestsFromModule ` parameter *use_load_tests* (deprecated and ignored " "since Python 3.5)." msgstr "" -#: ../../whatsnew/3.12.rst:1607 +#: ../../whatsnew/3.12.rst:1608 msgid "" "An alias of the :class:`~unittest.TextTestResult` class: ``_TextTestResult`` " "(deprecated in Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1610 +#: ../../whatsnew/3.12.rst:1611 msgid "(Contributed by Serhiy Storchaka in :gh:`89325`.)" msgstr "(由 Serhiy Storchaka 於 :gh:`89325` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1613 +#: ../../whatsnew/3.12.rst:1614 msgid "webbrowser" msgstr "webbrowser" -#: ../../whatsnew/3.12.rst:1615 +#: ../../whatsnew/3.12.rst:1616 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:1620 +#: ../../whatsnew/3.12.rst:1621 msgid "xml.etree.ElementTree" msgstr "xml.etree.ElementTree" -#: ../../whatsnew/3.12.rst:1622 +#: ../../whatsnew/3.12.rst:1623 msgid "" "Remove the ``ElementTree.Element.copy()`` method of the pure Python " "implementation, deprecated in Python 3.10, use the :func:`copy.copy` " @@ -3651,22 +3685,22 @@ msgid "" "Stinner in :gh:`94383`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1629 +#: ../../whatsnew/3.12.rst:1630 msgid "zipimport" msgstr "zipimport" -#: ../../whatsnew/3.12.rst:1631 +#: ../../whatsnew/3.12.rst:1632 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:1637 +#: ../../whatsnew/3.12.rst:1638 msgid "Others" msgstr "其他" -#: ../../whatsnew/3.12.rst:1639 +#: ../../whatsnew/3.12.rst:1640 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 " @@ -3966,15 +4000,15 @@ msgid "" "contents are marked by the ``PyUnstable_`` prefix in names." msgstr "" -#: ../../whatsnew/3.12.rst:1835 +#: ../../whatsnew/3.12.rst:1836 msgid "Code object constructors:" msgstr "程式碼物件建構函式:" -#: ../../whatsnew/3.12.rst:1837 +#: ../../whatsnew/3.12.rst:1838 msgid "``PyUnstable_Code_New()`` (renamed from ``PyCode_New``)" msgstr "``PyUnstable_Code_New()``\\ (自 ``PyCode_New`` 重新命名)" -#: ../../whatsnew/3.12.rst:1838 +#: ../../whatsnew/3.12.rst:1839 msgid "" "``PyUnstable_Code_NewWithPosOnlyArgs()`` (renamed from " "``PyCode_NewWithPosOnlyArgs``)" @@ -3982,11 +4016,11 @@ msgstr "" "``PyUnstable_Code_NewWithPosOnlyArgs()``\\ (自 " "``PyCode_NewWithPosOnlyArgs`` 重新命名)" -#: ../../whatsnew/3.12.rst:1840 +#: ../../whatsnew/3.12.rst:1841 msgid "Extra storage for code objects (:pep:`523`):" msgstr "程式碼物件的額外儲存 (:pep:`523`):" -#: ../../whatsnew/3.12.rst:1842 +#: ../../whatsnew/3.12.rst:1843 msgid "" "``PyUnstable_Eval_RequestCodeExtraIndex()`` (renamed from " "``_PyEval_RequestCodeExtraIndex``)" @@ -3994,31 +4028,31 @@ msgstr "" "``PyUnstable_Eval_RequestCodeExtraIndex()``\\ (自 " "``_PyEval_RequestCodeExtraIndex`` 重新命名)" -#: ../../whatsnew/3.12.rst:1843 +#: ../../whatsnew/3.12.rst:1844 msgid "``PyUnstable_Code_GetExtra()`` (renamed from ``_PyCode_GetExtra``)" msgstr "``PyUnstable_Code_GetExtra()``\\ (自 ``_PyCode_GetExtra`` 重新命名)" -#: ../../whatsnew/3.12.rst:1844 +#: ../../whatsnew/3.12.rst:1845 msgid "``PyUnstable_Code_SetExtra()`` (renamed from ``_PyCode_SetExtra``)" msgstr "``PyUnstable_Code_SetExtra()``\\ (自 ``_PyCode_SetExtra`` 重新命名)" -#: ../../whatsnew/3.12.rst:1846 +#: ../../whatsnew/3.12.rst:1847 msgid "" "The original names will continue to be available until the respective API " "changes." msgstr "原始名稱將可繼續使用,直到相應的 API 發生變更。" -#: ../../whatsnew/3.12.rst:1849 +#: ../../whatsnew/3.12.rst:1850 msgid "(Contributed by Petr Viktorin in :gh:`101101`.)" msgstr "(由 Petr Viktorin 於 :gh:`101101` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1851 +#: ../../whatsnew/3.12.rst:1852 msgid "" ":pep:`697`: Add an API for extending types whose instance memory layout is " "opaque:" msgstr "" -#: ../../whatsnew/3.12.rst:1854 +#: ../../whatsnew/3.12.rst:1855 msgid "" ":c:member:`PyType_Spec.basicsize` can be zero or negative to specify " "inheriting or extending the base class size." @@ -4026,30 +4060,30 @@ msgstr "" ":c:member:`PyType_Spec.basicsize` 可以為零或負數來指定繼承或擴充基底類別大" "小。" -#: ../../whatsnew/3.12.rst:1856 +#: ../../whatsnew/3.12.rst:1857 msgid "" ":c:func:`PyObject_GetTypeData` and :c:func:`PyType_GetTypeDataSize` added to " "allow access to subclass-specific instance data." msgstr "" -#: ../../whatsnew/3.12.rst:1858 +#: ../../whatsnew/3.12.rst:1859 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:1861 +#: ../../whatsnew/3.12.rst:1862 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:1864 +#: ../../whatsnew/3.12.rst:1865 msgid "(Contributed by Petr Viktorin in :gh:`103509`.)" msgstr "(由 Petr Viktorin 於 :gh:`103509` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1866 +#: ../../whatsnew/3.12.rst:1867 msgid "" "Add the new :ref:`limited C API ` function :c:func:" "`PyType_FromMetaclass`, which generalizes the existing :c:func:" @@ -4057,29 +4091,29 @@ msgid "" "(Contributed by Wenzel Jakob in :gh:`93012`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1871 +#: ../../whatsnew/3.12.rst:1872 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:1875 +#: ../../whatsnew/3.12.rst:1876 msgid ":c:macro:`Py_TPFLAGS_HAVE_VECTORCALL`" msgstr ":c:macro:`Py_TPFLAGS_HAVE_VECTORCALL`" -#: ../../whatsnew/3.12.rst:1876 +#: ../../whatsnew/3.12.rst:1877 msgid ":c:func:`PyVectorcall_NARGS`" msgstr ":c:func:`PyVectorcall_NARGS`" -#: ../../whatsnew/3.12.rst:1877 +#: ../../whatsnew/3.12.rst:1878 msgid ":c:func:`PyVectorcall_Call`" msgstr ":c:func:`PyVectorcall_Call`" -#: ../../whatsnew/3.12.rst:1878 +#: ../../whatsnew/3.12.rst:1879 msgid ":c:type:`vectorcallfunc`" msgstr ":c:type:`vectorcallfunc`" -#: ../../whatsnew/3.12.rst:1880 +#: ../../whatsnew/3.12.rst:1881 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 " @@ -4090,7 +4124,7 @@ msgid "" "`93274`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1888 +#: ../../whatsnew/3.12.rst:1889 msgid "" "The :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" "`Py_TPFLAGS_MANAGED_WEAKREF` flags have been added. This allows extensions " @@ -4098,32 +4132,32 @@ msgid "" "bookkeeping, using less memory and with faster access." msgstr "" -#: ../../whatsnew/3.12.rst:1893 +#: ../../whatsnew/3.12.rst:1894 msgid "" "API for performing calls using :ref:`the vectorcall protocol ` " "was added to the :ref:`Limited API `:" msgstr "" -#: ../../whatsnew/3.12.rst:1897 +#: ../../whatsnew/3.12.rst:1898 msgid ":c:func:`PyObject_Vectorcall`" msgstr ":c:func:`PyObject_Vectorcall`" -#: ../../whatsnew/3.12.rst:1898 +#: ../../whatsnew/3.12.rst:1899 msgid ":c:func:`PyObject_VectorcallMethod`" msgstr ":c:func:`PyObject_VectorcallMethod`" -#: ../../whatsnew/3.12.rst:1899 +#: ../../whatsnew/3.12.rst:1900 msgid ":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`" msgstr ":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`" -#: ../../whatsnew/3.12.rst:1901 +#: ../../whatsnew/3.12.rst:1902 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:1905 +#: ../../whatsnew/3.12.rst:1906 msgid "" "Add two new public functions, :c:func:`PyEval_SetProfileAllThreads` and :c:" "func:`PyEval_SetTraceAllThreads`, that allow to set tracing and profiling " @@ -4131,14 +4165,14 @@ msgid "" "(Contributed by Pablo Galindo in :gh:`93503`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1911 +#: ../../whatsnew/3.12.rst:1912 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:1915 +#: ../../whatsnew/3.12.rst:1916 msgid "" "The C API now permits registering callbacks via :c:func:" "`PyDict_AddWatcher`, :c:func:`PyDict_Watch` and related APIs to be called " @@ -4147,28 +4181,28 @@ msgid "" "`91052`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1921 +#: ../../whatsnew/3.12.rst:1922 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:1925 +#: ../../whatsnew/3.12.rst:1926 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:1930 +#: ../../whatsnew/3.12.rst:1931 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:1934 +#: ../../whatsnew/3.12.rst:1935 msgid "" "Add :c:func:`PyErr_GetRaisedException` and :c:func:" "`PyErr_SetRaisedException` for saving and restoring the current exception. " @@ -4178,14 +4212,14 @@ msgid "" "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1942 +#: ../../whatsnew/3.12.rst:1943 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:1946 +#: ../../whatsnew/3.12.rst:1947 msgid "" "Add :c:func:`PyException_GetArgs` and :c:func:`PyException_SetArgs` as " "convenience functions for retrieving and modifying the :attr:`~BaseException." @@ -4193,71 +4227,71 @@ msgid "" "in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1951 +#: ../../whatsnew/3.12.rst:1952 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:1957 +#: ../../whatsnew/3.12.rst:1958 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:1960 +#: ../../whatsnew/3.12.rst:1961 msgid "``_Py_IMMORTAL_REFCNT``: The reference count that defines an object" msgstr "``_Py_IMMORTAL_REFCNT``:定義物件的參照計數" -#: ../../whatsnew/3.12.rst:1961 +#: ../../whatsnew/3.12.rst:1962 msgid "as immortal." msgstr "" -#: ../../whatsnew/3.12.rst:1962 +#: ../../whatsnew/3.12.rst:1963 msgid "" "``_Py_IsImmortal`` Checks if an object has the immortal reference count." msgstr "" -#: ../../whatsnew/3.12.rst:1963 +#: ../../whatsnew/3.12.rst:1964 msgid "``PyObject_HEAD_INIT`` This will now initialize reference count to" msgstr "``PyObject_HEAD_INIT`` 這現在將初始化參照計數" -#: ../../whatsnew/3.12.rst:1964 +#: ../../whatsnew/3.12.rst:1965 msgid "``_Py_IMMORTAL_REFCNT`` when used with ``Py_BUILD_CORE``." msgstr "``_Py_IMMORTAL_REFCNT``\\ (與 ``Py_BUILD_CORE`` 一起使用時)。" -#: ../../whatsnew/3.12.rst:1965 +#: ../../whatsnew/3.12.rst:1966 msgid "``SSTATE_INTERNED_IMMORTAL`` An identifier for interned unicode objects" msgstr "" -#: ../../whatsnew/3.12.rst:1966 +#: ../../whatsnew/3.12.rst:1967 msgid "that are immortal." msgstr "" -#: ../../whatsnew/3.12.rst:1967 +#: ../../whatsnew/3.12.rst:1968 msgid "``SSTATE_INTERNED_IMMORTAL_STATIC`` An identifier for interned unicode" msgstr "" -#: ../../whatsnew/3.12.rst:1968 +#: ../../whatsnew/3.12.rst:1969 msgid "objects that are immortal and static" msgstr "" -#: ../../whatsnew/3.12.rst:1969 +#: ../../whatsnew/3.12.rst:1970 msgid "``sys.getunicodeinternedsize`` This returns the total number of unicode" msgstr "" -#: ../../whatsnew/3.12.rst:1970 +#: ../../whatsnew/3.12.rst:1971 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:1973 +#: ../../whatsnew/3.12.rst:1974 msgid "(Contributed by Eddie Elizondo in :gh:`84436`.)" msgstr "(由 Eddie Elizondo 於 :gh:`84436` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1975 +#: ../../whatsnew/3.12.rst:1976 msgid "" ":pep:`684`: Add the new :c:func:`Py_NewInterpreterFromConfig` function and :" "c:type:`PyInterpreterConfig`, which may be used to create sub-interpreters " @@ -4265,27 +4299,27 @@ msgid "" "(Contributed by Eric Snow in :gh:`104110`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1981 +#: ../../whatsnew/3.12.rst:1982 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:1989 +#: ../../whatsnew/3.12.rst:1990 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:1992 +#: ../../whatsnew/3.12.rst:1993 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:1996 +#: ../../whatsnew/3.12.rst:1997 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 " @@ -4294,7 +4328,7 @@ msgid "" "necessary, the (internal-only) ``_PyObject_GET_WEAKREFS_LISTPTR()`` macro." msgstr "" -#: ../../whatsnew/3.12.rst:2003 +#: ../../whatsnew/3.12.rst:2004 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 " @@ -4302,13 +4336,13 @@ msgid "" "only field directly." msgstr "" -#: ../../whatsnew/3.12.rst:2008 +#: ../../whatsnew/3.12.rst:2009 msgid "" "To get a list of subclasses, call the Python method :py:meth:`~type." "__subclasses__` (using :c:func:`PyObject_CallMethod`, for example)." msgstr "" -#: ../../whatsnew/3.12.rst:2012 +#: ../../whatsnew/3.12.rst:2013 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 " @@ -4317,7 +4351,7 @@ msgid "" "`98836`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2018 +#: ../../whatsnew/3.12.rst:2019 msgid "" "An unrecognized format character in :c:func:`PyUnicode_FromFormat` and :c:" "func:`PyUnicode_FromFormatV` now sets a :exc:`SystemError`. In previous " @@ -4326,13 +4360,13 @@ msgid "" "Storchaka in :gh:`95781`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2024 +#: ../../whatsnew/3.12.rst:2025 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:2028 +#: ../../whatsnew/3.12.rst:2029 msgid "" "Extension classes wanting to add a :attr:`~object.__dict__` or weak " "reference slot should use :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" @@ -4346,7 +4380,7 @@ msgid "" "func:`PyObject_ClearWeakRefs`, as before." msgstr "" -#: ../../whatsnew/3.12.rst:2040 +#: ../../whatsnew/3.12.rst:2041 msgid "" "The :c:func:`PyUnicode_FSDecoder` function no longer accepts bytes-like " "paths, like :class:`bytearray` and :class:`memoryview` types: only the " @@ -4354,7 +4388,7 @@ msgid "" "Victor Stinner in :gh:`98393`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2045 +#: ../../whatsnew/3.12.rst:2046 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 " @@ -4362,7 +4396,7 @@ msgid "" "Stinner in :gh:`98724`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2050 +#: ../../whatsnew/3.12.rst:2051 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 " @@ -4370,7 +4404,7 @@ msgid "" "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2055 +#: ../../whatsnew/3.12.rst:2056 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 " @@ -4378,25 +4412,25 @@ msgid "" "``_Py_GetGlobalRefTotal()``." msgstr "" -#: ../../whatsnew/3.12.rst:2060 +#: ../../whatsnew/3.12.rst:2061 msgid "" "The following functions now select an appropriate metaclass for the newly " "created type:" msgstr "" -#: ../../whatsnew/3.12.rst:2063 +#: ../../whatsnew/3.12.rst:2064 msgid ":c:func:`PyType_FromSpec`" msgstr ":c:func:`PyType_FromSpec`" -#: ../../whatsnew/3.12.rst:2064 +#: ../../whatsnew/3.12.rst:2065 msgid ":c:func:`PyType_FromSpecWithBases`" msgstr ":c:func:`PyType_FromSpecWithBases`" -#: ../../whatsnew/3.12.rst:2065 +#: ../../whatsnew/3.12.rst:2066 msgid ":c:func:`PyType_FromModuleAndSpec`" msgstr ":c:func:`PyType_FromModuleAndSpec`" -#: ../../whatsnew/3.12.rst:2067 +#: ../../whatsnew/3.12.rst:2068 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 " @@ -4404,14 +4438,14 @@ msgid "" "initialization." msgstr "" -#: ../../whatsnew/3.12.rst:2072 +#: ../../whatsnew/3.12.rst:2073 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:2076 +#: ../../whatsnew/3.12.rst:2077 msgid "" "Since ``tp_new`` overrides almost everything ``PyType_From*`` functions do, " "the two are incompatible with each other. The existing behavior -- ignoring " @@ -4420,17 +4454,17 @@ msgid "" "general workaround. One of the following may work for you:" msgstr "" -#: ../../whatsnew/3.12.rst:2083 +#: ../../whatsnew/3.12.rst:2084 msgid "If you control the metaclass, avoid using ``tp_new`` in it:" msgstr "" -#: ../../whatsnew/3.12.rst:2085 +#: ../../whatsnew/3.12.rst:2086 msgid "" "If initialization can be skipped, it can be done in :c:member:`~PyTypeObject." "tp_init` instead." msgstr "" -#: ../../whatsnew/3.12.rst:2087 +#: ../../whatsnew/3.12.rst:2088 msgid "" "If the metaclass doesn't need to be instantiated from Python, set its " "``tp_new`` to ``NULL`` using the :c:macro:" @@ -4438,20 +4472,20 @@ msgid "" "``PyType_From*`` functions." msgstr "" -#: ../../whatsnew/3.12.rst:2092 +#: ../../whatsnew/3.12.rst:2093 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:2096 +#: ../../whatsnew/3.12.rst:2097 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:2099 +#: ../../whatsnew/3.12.rst:2100 msgid "" ":c:var:`PyOS_InputHook` and :c:var:`PyOS_ReadlineFunctionPointer` are no " "longer called in :ref:`subinterpreters `. This is " @@ -4459,14 +4493,14 @@ msgid "" "callbacks have no way of recovering extension module state)." msgstr "" -#: ../../whatsnew/3.12.rst:2104 +#: ../../whatsnew/3.12.rst:2105 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:2108 +#: ../../whatsnew/3.12.rst:2109 msgid "" ":c:struct:`PyLongObject` has had its internals changed for better " "performance. Although the internals of :c:struct:`PyLongObject` are private, " @@ -4477,15 +4511,15 @@ msgid "" "a single machine word:" msgstr "" -#: ../../whatsnew/3.12.rst:2116 +#: ../../whatsnew/3.12.rst:2117 msgid ":c:func:`PyUnstable_Long_IsCompact`" msgstr ":c:func:`PyUnstable_Long_IsCompact`" -#: ../../whatsnew/3.12.rst:2117 +#: ../../whatsnew/3.12.rst:2118 msgid ":c:func:`PyUnstable_Long_CompactValue`" msgstr ":c:func:`PyUnstable_Long_CompactValue`" -#: ../../whatsnew/3.12.rst:2119 +#: ../../whatsnew/3.12.rst:2120 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 " @@ -4494,7 +4528,7 @@ msgid "" "create a new GitHub issue and CC ``@ericsnowcurrently``." msgstr "" -#: ../../whatsnew/3.12.rst:2129 +#: ../../whatsnew/3.12.rst:2130 msgid "" "In accordance with :pep:`699`, the ``ma_version_tag`` field in :c:type:" "`PyDictObject` is deprecated for extension modules. Accessing this field " @@ -4503,76 +4537,76 @@ msgid "" "PEP by Ken Jin.)" msgstr "" -#: ../../whatsnew/3.12.rst:2134 +#: ../../whatsnew/3.12.rst:2135 msgid "Deprecate global configuration variable:" msgstr "棄用全域配置變數:" -#: ../../whatsnew/3.12.rst:2136 +#: ../../whatsnew/3.12.rst:2137 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:2137 +#: ../../whatsnew/3.12.rst:2138 msgid ":c:var:`Py_VerboseFlag`: use :c:member:`PyConfig.verbose`" msgstr ":c:var:`Py_VerboseFlag`: 請改用 :c:member:`PyConfig.verbose`" -#: ../../whatsnew/3.12.rst:2138 +#: ../../whatsnew/3.12.rst:2139 msgid ":c:var:`Py_QuietFlag`: use :c:member:`PyConfig.quiet`" msgstr ":c:var:`Py_QuietFlag`: 請改用 :c:member:`PyConfig.quiet`" -#: ../../whatsnew/3.12.rst:2139 +#: ../../whatsnew/3.12.rst:2140 msgid ":c:var:`Py_InteractiveFlag`: use :c:member:`PyConfig.interactive`" msgstr ":c:var:`Py_InteractiveFlag`: 請改用 :c:member:`PyConfig.interactive`" -#: ../../whatsnew/3.12.rst:2140 +#: ../../whatsnew/3.12.rst:2141 msgid ":c:var:`Py_InspectFlag`: use :c:member:`PyConfig.inspect`" msgstr ":c:var:`Py_InspectFlag`: 請改用 :c:member:`PyConfig.inspect`" -#: ../../whatsnew/3.12.rst:2141 +#: ../../whatsnew/3.12.rst:2142 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:2142 +#: ../../whatsnew/3.12.rst:2143 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:2143 +#: ../../whatsnew/3.12.rst:2144 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:2144 +#: ../../whatsnew/3.12.rst:2145 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:2145 +#: ../../whatsnew/3.12.rst:2146 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:2146 +#: ../../whatsnew/3.12.rst:2147 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:2147 +#: ../../whatsnew/3.12.rst:2148 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:2148 +#: ../../whatsnew/3.12.rst:2149 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:2149 +#: ../../whatsnew/3.12.rst:2150 msgid "" ":c:var:`Py_HashRandomizationFlag`: use :c:member:`PyConfig.use_hash_seed` " "and :c:member:`PyConfig.hash_seed`" @@ -4580,11 +4614,11 @@ msgstr "" ":c:var:`Py_HashRandomizationFlag`: 請改用 :c:member:`PyConfig.use_hash_seed` " "和 :c:member:`PyConfig.hash_seed`" -#: ../../whatsnew/3.12.rst:2151 +#: ../../whatsnew/3.12.rst:2152 msgid ":c:var:`Py_IsolatedFlag`: use :c:member:`PyConfig.isolated`" msgstr ":c:var:`Py_IsolatedFlag`: 請改用 :c:member:`PyConfig.isolated`" -#: ../../whatsnew/3.12.rst:2152 +#: ../../whatsnew/3.12.rst:2153 msgid "" ":c:var:`Py_LegacyWindowsFSEncodingFlag`: use :c:member:`PyPreConfig." "legacy_windows_fs_encoding`" @@ -4592,7 +4626,7 @@ msgstr "" ":c:var:`Py_LegacyWindowsFSEncodingFlag`: 請改用 :c:member:`PyPreConfig." "legacy_windows_fs_encoding`" -#: ../../whatsnew/3.12.rst:2153 +#: ../../whatsnew/3.12.rst:2154 msgid "" ":c:var:`Py_LegacyWindowsStdioFlag`: use :c:member:`PyConfig." "legacy_windows_stdio`" @@ -4600,7 +4634,7 @@ msgstr "" ":c:var:`Py_LegacyWindowsStdioFlag`: 請改用 :c:member:`PyConfig." "legacy_windows_stdio`" -#: ../../whatsnew/3.12.rst:2154 +#: ../../whatsnew/3.12.rst:2155 msgid "" ":c:var:`!Py_FileSystemDefaultEncoding`: use :c:member:`PyConfig." "filesystem_encoding`" @@ -4608,7 +4642,7 @@ msgstr "" ":c:var:`!Py_FileSystemDefaultEncoding`: 請改用 :c:member:`PyConfig." "filesystem_encoding`" -#: ../../whatsnew/3.12.rst:2155 +#: ../../whatsnew/3.12.rst:2156 msgid "" ":c:var:`!Py_HasFileSystemDefaultEncoding`: use :c:member:`PyConfig." "filesystem_encoding`" @@ -4616,7 +4650,7 @@ msgstr "" ":c:var:`!Py_HasFileSystemDefaultEncoding`: 請改用 :c:member:`PyConfig." "filesystem_encoding`" -#: ../../whatsnew/3.12.rst:2156 +#: ../../whatsnew/3.12.rst:2157 msgid "" ":c:var:`!Py_FileSystemDefaultEncodeErrors`: use :c:member:`PyConfig." "filesystem_errors`" @@ -4624,7 +4658,7 @@ msgstr "" ":c:var:`!Py_FileSystemDefaultEncodeErrors`: 請改用 :c:member:`PyConfig." "filesystem_errors`" -#: ../../whatsnew/3.12.rst:2157 +#: ../../whatsnew/3.12.rst:2158 msgid "" ":c:var:`!Py_UTF8Mode`: use :c:member:`PyPreConfig.utf8_mode` (see :c:func:" "`Py_PreInitialize`)" @@ -4632,7 +4666,7 @@ msgstr "" ":c:var:`!Py_UTF8Mode`: 請改用 :c:member:`PyPreConfig.utf8_mode`\\ (參見 :c:" "func:`Py_PreInitialize`)" -#: ../../whatsnew/3.12.rst:2159 +#: ../../whatsnew/3.12.rst:2160 msgid "" "The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" "`PyConfig` instead. (Contributed by Victor Stinner in :gh:`77782`.)" @@ -4640,25 +4674,25 @@ msgstr "" ":c:func:`Py_InitializeFromConfig` API 應改為與 :c:type:`PyConfig` 一起使用。" "(由 Victor Stinner 於 :gh:`77782` 中貢獻。)" -#: ../../whatsnew/3.12.rst:2163 +#: ../../whatsnew/3.12.rst:2164 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:2166 +#: ../../whatsnew/3.12.rst:2167 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:2169 +#: ../../whatsnew/3.12.rst:2170 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:2172 +#: ../../whatsnew/3.12.rst:2173 msgid "" ":c:struct:`PyMemberDef`, :c:func:`PyMember_GetOne` and :c:func:" "`PyMember_SetOne`" @@ -4666,13 +4700,13 @@ msgstr "" ":c:struct:`PyMemberDef`、:c:func:`PyMember_GetOne` 和 :c:func:" "`PyMember_SetOne`" -#: ../../whatsnew/3.12.rst:2174 +#: ../../whatsnew/3.12.rst:2175 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:2176 +#: ../../whatsnew/3.12.rst:2177 msgid "" "The flags :c:macro:`Py_READONLY` (previously ``READONLY``) and :c:macro:" "`Py_AUDIT_READ` (previously all uppercase)" @@ -4680,23 +4714,23 @@ msgstr "" ":c:macro:`Py_READONLY`\\ (先前為 ``READONLY``)和 :c:macro:" "`Py_AUDIT_READ`\\ (先前全大寫)旗標" -#: ../../whatsnew/3.12.rst:2179 +#: ../../whatsnew/3.12.rst:2180 msgid "Several items are not exposed from :file:`Python.h`:" msgstr "數個項目不再從 :file:`Python.h` 中公開:" -#: ../../whatsnew/3.12.rst:2181 +#: ../../whatsnew/3.12.rst:2182 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:2182 +#: ../../whatsnew/3.12.rst:2183 msgid ":c:macro:`T_NONE` (previously undocumented, and pretty quirky)" msgstr ":c:macro:`T_NONE`\\ (先前未記錄於文件上,且相當古怪)" -#: ../../whatsnew/3.12.rst:2183 +#: ../../whatsnew/3.12.rst:2184 msgid "The macro ``WRITE_RESTRICTED`` which does nothing." msgstr "不做任何事的巨集 ``WRITE_RESTRICTED``。" -#: ../../whatsnew/3.12.rst:2184 +#: ../../whatsnew/3.12.rst:2185 msgid "" "The macros ``RESTRICTED`` and ``READ_RESTRICTED``, equivalents of :c:macro:" "`Py_AUDIT_READ`." @@ -4704,33 +4738,33 @@ msgstr "" "``RESTRICTED`` 和 ``READ_RESTRICTED`` 這兩個巨集,相當於 :c:macro:" "`Py_AUDIT_READ`。" -#: ../../whatsnew/3.12.rst:2186 +#: ../../whatsnew/3.12.rst:2187 msgid "" "In some configurations, ```` is not included from :file:`Python." "h`. It should be included manually when using ``offsetof()``." msgstr "" -#: ../../whatsnew/3.12.rst:2189 +#: ../../whatsnew/3.12.rst:2190 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:2194 +#: ../../whatsnew/3.12.rst:2195 msgid "" "(Contributed in :gh:`47146` by Petr Viktorin, based on earlier work by " "Alexander Belopolsky and Matthias Braun.)" msgstr "" -#: ../../whatsnew/3.12.rst:2197 +#: ../../whatsnew/3.12.rst:2198 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:2202 +#: ../../whatsnew/3.12.rst:2203 msgid "" ":c:func:`!PyErr_Display` is deprecated. Use :c:func:`PyErr_DisplayException` " "instead. (Contributed by Irit Katriel in :gh:`102755`)." @@ -4738,7 +4772,7 @@ msgstr "" ":c:func:`!PyErr_Display` 已棄用,請改用 :c:func:`PyErr_DisplayException`。" "(由 Irit Katriel 於 :gh:`102755` 中貢獻。)" -#: ../../whatsnew/3.12.rst:2205 +#: ../../whatsnew/3.12.rst:2206 msgid "" "``_PyErr_ChainExceptions`` is deprecated. Use ``_PyErr_ChainExceptions1`` " "instead. (Contributed by Irit Katriel in :gh:`102192`.)" @@ -4746,7 +4780,7 @@ msgstr "" "``_PyErr_ChainExceptions`` 已棄用,請改用 ``_PyErr_ChainExceptions1``。(由 " "Irit Katriel 於 :gh:`102192` 中貢獻。)" -#: ../../whatsnew/3.12.rst:2208 +#: ../../whatsnew/3.12.rst:2209 msgid "" "Using :c:func:`PyType_FromSpec`, :c:func:`PyType_FromSpecWithBases` or :c:" "func:`PyType_FromModuleAndSpec` to create a class whose metaclass overrides :" @@ -5140,54 +5174,54 @@ msgstr "" msgid ":c:func:`PyThread_ReInitTLS`: Unneeded since Python 3.7." msgstr ":c:func:`PyThread_ReInitTLS`:自 Python 3.7 起不再需要。" -#: ../../whatsnew/3.12.rst:2224 +#: ../../whatsnew/3.12.rst:2225 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:2229 +#: ../../whatsnew/3.12.rst:2230 msgid "Legacy Unicode APIs have been removed. See :pep:`623` for detail." msgstr "" -#: ../../whatsnew/3.12.rst:2231 +#: ../../whatsnew/3.12.rst:2232 msgid ":c:macro:`!PyUnicode_WCHAR_KIND`" msgstr ":c:macro:`!PyUnicode_WCHAR_KIND`" -#: ../../whatsnew/3.12.rst:2232 +#: ../../whatsnew/3.12.rst:2233 msgid ":c:func:`!PyUnicode_AS_UNICODE`" msgstr ":c:func:`!PyUnicode_AS_UNICODE`" -#: ../../whatsnew/3.12.rst:2233 +#: ../../whatsnew/3.12.rst:2234 msgid ":c:func:`!PyUnicode_AsUnicode`" msgstr ":c:func:`!PyUnicode_AsUnicode`" -#: ../../whatsnew/3.12.rst:2234 +#: ../../whatsnew/3.12.rst:2235 msgid ":c:func:`!PyUnicode_AsUnicodeAndSize`" msgstr ":c:func:`!PyUnicode_AsUnicodeAndSize`" -#: ../../whatsnew/3.12.rst:2235 +#: ../../whatsnew/3.12.rst:2236 msgid ":c:func:`!PyUnicode_AS_DATA`" msgstr ":c:func:`!PyUnicode_AS_DATA`" -#: ../../whatsnew/3.12.rst:2236 +#: ../../whatsnew/3.12.rst:2237 msgid ":c:func:`!PyUnicode_FromUnicode`" msgstr ":c:func:`!PyUnicode_FromUnicode`" -#: ../../whatsnew/3.12.rst:2237 +#: ../../whatsnew/3.12.rst:2238 msgid ":c:func:`!PyUnicode_GET_SIZE`" msgstr ":c:func:`!PyUnicode_GET_SIZE`" -#: ../../whatsnew/3.12.rst:2238 +#: ../../whatsnew/3.12.rst:2239 msgid ":c:func:`!PyUnicode_GetSize`" msgstr ":c:func:`!PyUnicode_GetSize`" -#: ../../whatsnew/3.12.rst:2239 +#: ../../whatsnew/3.12.rst:2240 msgid ":c:func:`!PyUnicode_GET_DATA_SIZE`" msgstr ":c:func:`!PyUnicode_GET_DATA_SIZE`" -#: ../../whatsnew/3.12.rst:2241 +#: ../../whatsnew/3.12.rst:2242 msgid "" "Remove the ``PyUnicode_InternImmortal()`` function macro. (Contributed by " "Victor Stinner in :gh:`85858`.)" diff --git a/whatsnew/3.13.po b/whatsnew/3.13.po index 48215f745d..f41fa1d4c1 100644 --- a/whatsnew/3.13.po +++ b/whatsnew/3.13.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-05 00:13+0000\n" +"POT-Creation-Date: 2024-10-15 00:14+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-" @@ -31,11 +31,11 @@ msgstr "Adam Turner 和 Thomas Wouters" #: ../../whatsnew/3.13.rst:48 msgid "" "This article explains the new features in Python 3.13, compared to 3.12. " -"Python 3.13 will be released on October 7, 2024. For full details, see the :" -"ref:`changelog `." +"Python 3.13 was released on October 7, 2024. For full details, see the :ref:" +"`changelog `." msgstr "" -"本文介紹了 Python 3.13 與 3.12 相比多了哪些新功能。Python 3.13 將於 2024 年 " -"10 月 7 日發布。完整詳請請見 :ref:`changelog `。" +"本文介紹了 Python 3.13 與 3.12 相比多了哪些新功能。Python 3.13 已於 2024 年 " +"10 月 7 日發布。完整詳情請見 :ref:`changelog `。" #: ../../whatsnew/3.13.rst:54 msgid ":pep:`719` -- Python 3.13 Release Schedule" @@ -47,9 +47,9 @@ msgstr "發布重點摘要" #: ../../whatsnew/3.13.rst:63 msgid "" -"Python 3.13 will be the latest stable release of the Python programming " -"language, with a mix of changes to the language, the implementation and the " -"standard library. The biggest changes include a new `interactive interpreter " +"Python 3.13 is the latest stable release of the Python programming language, " +"with a mix of changes to the language, the implementation and the standard " +"library. The biggest changes include a new `interactive interpreter " "`_, experimental support for " "running in a `free-threaded mode `_ (:" "pep:`703`), and a `Just-In-Time compiler `_ (:pep:" @@ -294,7 +294,7 @@ msgid "" "mod:`!sunau`, :mod:`!telnetlib`, :mod:`!uu` and :mod:`!xdrlib`." msgstr "" ":ref:`PEP 594 `: 剩下的 19 個 \"dead batteries\" (遺留標" -"準函式庫模組)以字標準函式庫中移除::mod:`!aifc`、:mod:`!audioop`、:mod:`!" +"準函式庫模組)已自標準函式庫中移除::mod:`!aifc`、:mod:`!audioop`、:mod:`!" "cgi`、:mod:`!cgitb`、:mod:`!chunk`、:mod:`!crypt`、:mod:`!imghdr`、:mod:`!" "mailcap`、:mod:`!msilib`、:mod:`!nis`、:mod:`!nntplib`、:mod:`!" "ossaudiodev`、:mod:`!pipes`、:mod:`!sndhdr`、:mod:`!spwd`、:mod:`!sunau`、:" @@ -345,7 +345,7 @@ msgid "" "years of security fixes." msgstr "" -#: ../../whatsnew/3.13.rst:208 ../../whatsnew/3.13.rst:1964 +#: ../../whatsnew/3.13.rst:208 ../../whatsnew/3.13.rst:1968 msgid "New Features" msgstr "新增功能" @@ -1160,7 +1160,7 @@ msgid "compileall" msgstr "compileall" #: ../../whatsnew/3.13.rst:757 ../../whatsnew/3.13.rst:765 -#: ../../whatsnew/3.13.rst:1013 +#: ../../whatsnew/3.13.rst:1017 msgid "" "The default number of worker threads and processes is now selected using :" "func:`os.process_cpu_count` instead of :func:`os.cpu_count`. (Contributed by " @@ -1171,7 +1171,7 @@ msgstr "" msgid "concurrent.futures" msgstr "concurrent.futures" -#: ../../whatsnew/3.13.rst:771 ../../whatsnew/3.13.rst:1608 +#: ../../whatsnew/3.13.rst:771 ../../whatsnew/3.13.rst:1612 msgid "configparser" msgstr "configparser" @@ -1259,29 +1259,37 @@ msgid "" "projects." msgstr "" -#: ../../whatsnew/3.13.rst:819 +#: ../../whatsnew/3.13.rst:817 +msgid "" +":class:`ctypes.Structure` objects have a new :attr:`~ctypes.Structure." +"_align_` attribute which allows the alignment of the structure being packed " +"to/from memory to be specified explicitly. (Contributed by Matt Sanderson " +"in :gh:`112433`)" +msgstr "" + +#: ../../whatsnew/3.13.rst:823 msgid "dbm" msgstr "dbm" -#: ../../whatsnew/3.13.rst:821 +#: ../../whatsnew/3.13.rst:825 msgid "" "Add :mod:`dbm.sqlite3`, a new module which implements an SQLite backend, and " "make it the default :mod:`!dbm` backend. (Contributed by Raymond Hettinger " "and Erlend E. Aasland in :gh:`100414`.)" msgstr "" -#: ../../whatsnew/3.13.rst:825 +#: ../../whatsnew/3.13.rst:829 msgid "" "Allow removing all items from the database through the new :meth:`.gdbm." "clear` and :meth:`.ndbm.clear` methods. (Contributed by Donghee Na in :gh:" "`107122`.)" msgstr "" -#: ../../whatsnew/3.13.rst:831 +#: ../../whatsnew/3.13.rst:835 msgid "dis" msgstr "dis" -#: ../../whatsnew/3.13.rst:833 +#: ../../whatsnew/3.13.rst:837 msgid "" "Change the output of :mod:`dis` module functions to show logical labels for " "jump targets and exception handlers, rather than offsets. The offsets can be " @@ -1289,7 +1297,7 @@ msgid "" "the *show_offsets* argument. (Contributed by Irit Katriel in :gh:`112137`.)" msgstr "" -#: ../../whatsnew/3.13.rst:840 +#: ../../whatsnew/3.13.rst:844 msgid "" ":meth:`~dis.get_instructions` no longer represents cache entries as separate " "instructions. Instead, it returns them as part of the :class:`~dis." @@ -1298,11 +1306,11 @@ msgid "" "(Contributed by Irit Katriel in :gh:`112962`.)" msgstr "" -#: ../../whatsnew/3.13.rst:852 +#: ../../whatsnew/3.13.rst:856 msgid "doctest" msgstr "doctest" -#: ../../whatsnew/3.13.rst:854 +#: ../../whatsnew/3.13.rst:858 msgid "" ":mod:`doctest` output is now colored by default. This can be controlled via " "the new :envvar:`PYTHON_COLORS` environment variable as well as the " @@ -1311,18 +1319,18 @@ msgid "" "`117225`.)" msgstr "" -#: ../../whatsnew/3.13.rst:861 +#: ../../whatsnew/3.13.rst:865 msgid "" "The :meth:`.DocTestRunner.run` method now counts the number of skipped " "tests. Add the :attr:`.DocTestRunner.skips` and :attr:`.TestResults.skipped` " "attributes. (Contributed by Victor Stinner in :gh:`108794`.)" msgstr "" -#: ../../whatsnew/3.13.rst:867 +#: ../../whatsnew/3.13.rst:871 msgid "email" msgstr "email" -#: ../../whatsnew/3.13.rst:869 +#: ../../whatsnew/3.13.rst:873 msgid "" "Headers with embedded newlines are now quoted on output. The :mod:`~email." "generator` will now refuse to serialize (write) headers that are improperly " @@ -1332,7 +1340,7 @@ msgid "" "Bloemsaat and Petr Viktorin in :gh:`121650`.)" msgstr "" -#: ../../whatsnew/3.13.rst:877 +#: ../../whatsnew/3.13.rst:881 msgid "" ":func:`~email.utils.getaddresses` and :func:`~email.utils.parseaddr` now " "return ``('', '')`` pairs in more situations where invalid email addresses " @@ -1344,11 +1352,11 @@ msgid "" "Stinner for :gh:`102988` to improve the :cve:`2023-27043` fix.)" msgstr "" -#: ../../whatsnew/3.13.rst:889 +#: ../../whatsnew/3.13.rst:893 msgid "fractions" msgstr "fractions" -#: ../../whatsnew/3.13.rst:891 +#: ../../whatsnew/3.13.rst:895 msgid "" ":class:`~fractions.Fraction` objects now support the standard :ref:`format " "specification mini-language ` rules for fill, alignment, sign " @@ -1356,22 +1364,22 @@ msgid "" "`111320`.)" msgstr "" -#: ../../whatsnew/3.13.rst:898 +#: ../../whatsnew/3.13.rst:902 msgid "glob" msgstr "glob" -#: ../../whatsnew/3.13.rst:900 +#: ../../whatsnew/3.13.rst:904 msgid "" "Add :func:`~glob.translate`, a function to convert a path specification with " "shell-style wildcards to a regular expression. (Contributed by Barney Gale " "in :gh:`72904`.)" msgstr "" -#: ../../whatsnew/3.13.rst:906 +#: ../../whatsnew/3.13.rst:910 msgid "importlib" msgstr "importlib" -#: ../../whatsnew/3.13.rst:908 +#: ../../whatsnew/3.13.rst:912 msgid "" "The following functions in :mod:`importlib.resources` now allow accessing a " "directory (or tree) of resources, using multiple positional arguments (the " @@ -1379,49 +1387,49 @@ msgid "" "keyword-only):" msgstr "" -#: ../../whatsnew/3.13.rst:913 +#: ../../whatsnew/3.13.rst:917 msgid ":func:`~importlib.resources.is_resource`" msgstr ":func:`~importlib.resources.is_resource`" -#: ../../whatsnew/3.13.rst:914 +#: ../../whatsnew/3.13.rst:918 msgid ":func:`~importlib.resources.open_binary`" msgstr ":func:`~importlib.resources.open_binary`" -#: ../../whatsnew/3.13.rst:915 +#: ../../whatsnew/3.13.rst:919 msgid ":func:`~importlib.resources.open_text`" msgstr ":func:`~importlib.resources.open_text`" -#: ../../whatsnew/3.13.rst:916 +#: ../../whatsnew/3.13.rst:920 msgid ":func:`~importlib.resources.path`" msgstr ":func:`~importlib.resources.path`" -#: ../../whatsnew/3.13.rst:917 +#: ../../whatsnew/3.13.rst:921 msgid ":func:`~importlib.resources.read_binary`" msgstr ":func:`~importlib.resources.read_binary`" -#: ../../whatsnew/3.13.rst:918 +#: ../../whatsnew/3.13.rst:922 msgid ":func:`~importlib.resources.read_text`" msgstr ":func:`~importlib.resources.read_text`" -#: ../../whatsnew/3.13.rst:920 +#: ../../whatsnew/3.13.rst:924 msgid "" "These functions are no longer deprecated and are not scheduled for removal. " -"(Contributed by Petr Viktorin in :gh:`106532`.)" +"(Contributed by Petr Viktorin in :gh:`116608`.)" msgstr "" -#: ../../whatsnew/3.13.rst:923 +#: ../../whatsnew/3.13.rst:927 msgid "" ":func:`~importlib.resources.contents` remains deprecated in favor of the " "fully-featured :class:`~importlib.resources.abc.Traversable` API. However, " "there is now no plan to remove it. (Contributed by Petr Viktorin in :gh:" -"`106532`.)" +"`116608`.)" msgstr "" -#: ../../whatsnew/3.13.rst:930 +#: ../../whatsnew/3.13.rst:934 msgid "io" msgstr "io" -#: ../../whatsnew/3.13.rst:932 +#: ../../whatsnew/3.13.rst:936 msgid "" "The :class:`~io.IOBase` finalizer now logs any errors raised by the :meth:" "`~io.IOBase.close` method with :data:`sys.unraisablehook`. Previously, " @@ -1430,17 +1438,17 @@ msgid "" "build>`. (Contributed by Victor Stinner in :gh:`62948`.)" msgstr "" -#: ../../whatsnew/3.13.rst:941 +#: ../../whatsnew/3.13.rst:945 msgid "ipaddress" msgstr "ipaddress" -#: ../../whatsnew/3.13.rst:943 +#: ../../whatsnew/3.13.rst:947 msgid "" "Add the :attr:`.IPv4Address.ipv6_mapped` property, which returns the IPv4-" "mapped IPv6 address. (Contributed by Charles Machalow in :gh:`109466`.)" msgstr "" -#: ../../whatsnew/3.13.rst:947 +#: ../../whatsnew/3.13.rst:951 msgid "" "Fix ``is_global`` and ``is_private`` behavior in :class:`~ipaddress." "IPv4Address`, :class:`~ipaddress.IPv6Address`, :class:`~ipaddress." @@ -1448,22 +1456,22 @@ msgid "" "Stasiak in :gh:`113171`.)" msgstr "" -#: ../../whatsnew/3.13.rst:954 +#: ../../whatsnew/3.13.rst:958 msgid "itertools" msgstr "itertools" -#: ../../whatsnew/3.13.rst:956 +#: ../../whatsnew/3.13.rst:960 msgid "" ":func:`~itertools.batched` has a new *strict* parameter, which raises a :exc:" "`ValueError` if the final batch is shorter than the specified batch size. " "(Contributed by Raymond Hettinger in :gh:`113202`.)" msgstr "" -#: ../../whatsnew/3.13.rst:963 +#: ../../whatsnew/3.13.rst:967 msgid "marshal" msgstr "marshal" -#: ../../whatsnew/3.13.rst:965 +#: ../../whatsnew/3.13.rst:969 msgid "" "Add the *allow_code* parameter in module functions. Passing " "``allow_code=False`` prevents serialization and de-serialization of code " @@ -1471,11 +1479,11 @@ msgid "" "Serhiy Storchaka in :gh:`113626`.)" msgstr "" -#: ../../whatsnew/3.13.rst:972 +#: ../../whatsnew/3.13.rst:976 msgid "math" msgstr "math" -#: ../../whatsnew/3.13.rst:974 +#: ../../whatsnew/3.13.rst:978 msgid "" "The new function :func:`~math.fma` performs fused multiply-add operations. " "This computes ``x * y + z`` with only a single round, and so avoids any " @@ -1485,11 +1493,11 @@ msgid "" "Stinner in :gh:`73468`.)" msgstr "" -#: ../../whatsnew/3.13.rst:984 +#: ../../whatsnew/3.13.rst:988 msgid "mimetypes" msgstr "mimetypes" -#: ../../whatsnew/3.13.rst:986 +#: ../../whatsnew/3.13.rst:990 msgid "" "Add the :func:`~mimetypes.guess_file_type` function to guess a MIME type " "from a filesystem path. Using paths with :func:`~mimetypes.guess_type` is " @@ -1497,18 +1505,18 @@ msgid "" "`66543`.)" msgstr "" -#: ../../whatsnew/3.13.rst:993 +#: ../../whatsnew/3.13.rst:997 msgid "mmap" msgstr "mmap" -#: ../../whatsnew/3.13.rst:995 +#: ../../whatsnew/3.13.rst:999 msgid "" ":class:`~mmap.mmap` is now protected from crashing on Windows when the " "mapped memory is inaccessible due to file system errors or access " "violations. (Contributed by Jannis Weigend in :gh:`118209`.)" msgstr "" -#: ../../whatsnew/3.13.rst:999 +#: ../../whatsnew/3.13.rst:1003 msgid "" ":class:`~mmap.mmap` has a new :meth:`~mmap.mmap.seekable` method that can be " "used when a seekable file-like object is required. The :meth:`~mmap.mmap." @@ -1516,7 +1524,7 @@ msgid "" "Na and Sylvie Liberman in :gh:`111835`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1004 +#: ../../whatsnew/3.13.rst:1008 msgid "" "The new UNIX-only *trackfd* parameter for :class:`~mmap.mmap` controls file " "descriptor duplication; if false, the file descriptor specified by *fileno* " @@ -1524,22 +1532,22 @@ msgid "" "gh:`78502`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1011 +#: ../../whatsnew/3.13.rst:1015 msgid "multiprocessing" msgstr "multiprocessing" -#: ../../whatsnew/3.13.rst:1019 +#: ../../whatsnew/3.13.rst:1023 msgid "os" msgstr "os" -#: ../../whatsnew/3.13.rst:1021 +#: ../../whatsnew/3.13.rst:1025 msgid "" "Add :func:`~os.process_cpu_count` function to get the number of logical CPU " "cores usable by the calling thread of the current process. (Contributed by " "Victor Stinner in :gh:`109649`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1025 +#: ../../whatsnew/3.13.rst:1029 msgid "" ":func:`~os.cpu_count` and :func:`~os.process_cpu_count` can be overridden " "through the new environment variable :envvar:`PYTHON_CPU_COUNT` or the new " @@ -1549,7 +1557,7 @@ msgid "" "Na in :gh:`109595`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1033 +#: ../../whatsnew/3.13.rst:1037 msgid "" "Add a :ref:`low level interface ` to Linux's :manpage:`timer " "file descriptors ` via :func:`~os.timerfd_create`, :func:" @@ -1560,7 +1568,7 @@ msgid "" "in :gh:`108277`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1042 +#: ../../whatsnew/3.13.rst:1046 msgid "" ":func:`~os.lchmod` and the *follow_symlinks* argument of :func:`~os.chmod` " "are both now available on Windows. Note that the default value of " @@ -1568,14 +1576,14 @@ msgid "" "by Serhiy Storchaka in :gh:`59616`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1048 +#: ../../whatsnew/3.13.rst:1052 msgid "" ":func:`~os.fchmod` and support for file descriptors in :func:`~os.chmod` are " "both now available on Windows. (Contributed by Serhiy Storchaka in :gh:" "`113191`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1052 +#: ../../whatsnew/3.13.rst:1056 msgid "" "On Windows, :func:`~os.mkdir` and :func:`~os.makedirs` now support passing a " "*mode* value of ``0o700`` to apply access control to the new directory. This " @@ -1584,14 +1592,14 @@ msgid "" "Steve Dower in :gh:`118486`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1059 +#: ../../whatsnew/3.13.rst:1063 msgid "" ":func:`~os.posix_spawn` now accepts ``None`` for the *env* argument, which " "makes the newly spawned process use the current process environment. " "(Contributed by Jakub Kulik in :gh:`113119`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1063 +#: ../../whatsnew/3.13.rst:1067 msgid "" ":func:`~os.posix_spawn` can now use the :attr:`~os.POSIX_SPAWN_CLOSEFROM` " "attribute in the *file_actions* parameter on platforms that support :c:func:" @@ -1599,76 +1607,76 @@ msgid "" "gh:`113117`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1070 +#: ../../whatsnew/3.13.rst:1074 msgid "os.path" msgstr "os.path" -#: ../../whatsnew/3.13.rst:1072 +#: ../../whatsnew/3.13.rst:1076 msgid "" "Add :func:`~os.path.isreserved` to check if a path is reserved on the " "current system. This function is only available on Windows. (Contributed by " "Barney Gale in :gh:`88569`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1077 +#: ../../whatsnew/3.13.rst:1081 msgid "" "On Windows, :func:`~os.path.isabs` no longer considers paths starting with " "exactly one slash (``\\`` or ``/``) to be absolute. (Contributed by Barney " "Gale and Jon Foster in :gh:`44626`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1081 +#: ../../whatsnew/3.13.rst:1085 msgid "" ":func:`~os.path.realpath` now resolves MS-DOS style file names even if the " "file is not accessible. (Contributed by Moonsik Park in :gh:`82367`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1087 ../../whatsnew/3.13.rst:1648 +#: ../../whatsnew/3.13.rst:1091 ../../whatsnew/3.13.rst:1652 msgid "pathlib" msgstr "pathlib" -#: ../../whatsnew/3.13.rst:1089 +#: ../../whatsnew/3.13.rst:1093 msgid "" "Add :exc:`~pathlib.UnsupportedOperation`, which is raised instead of :exc:" "`NotImplementedError` when a path operation isn't supported. (Contributed by " "Barney Gale in :gh:`89812`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1093 +#: ../../whatsnew/3.13.rst:1097 msgid "" "Add a new constructor for creating :class:`~pathlib.Path` objects from " "'file' URIs (``file:///``), :meth:`.Path.from_uri`. (Contributed by Barney " "Gale in :gh:`107465`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1097 +#: ../../whatsnew/3.13.rst:1101 msgid "" "Add :meth:`.PurePath.full_match` for matching paths with shell-style " "wildcards, including the recursive wildcard \"``**``\". (Contributed by " "Barney Gale in :gh:`73435`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1101 +#: ../../whatsnew/3.13.rst:1105 msgid "" "Add the :attr:`.PurePath.parser` class attribute to store the implementation " "of :mod:`os.path` used for low-level path parsing and joining. This will be " "either :mod:`!posixpath` or :mod:`!ntpath`." msgstr "" -#: ../../whatsnew/3.13.rst:1106 +#: ../../whatsnew/3.13.rst:1110 msgid "" "Add *recurse_symlinks* keyword-only argument to :meth:`.Path.glob` and :meth:" "`~pathlib.Path.rglob`. (Contributed by Barney Gale in :gh:`77609`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1110 +#: ../../whatsnew/3.13.rst:1114 msgid "" ":meth:`.Path.glob` and :meth:`~pathlib.Path.rglob` now return files and " "directories when given a pattern that ends with \"``**``\". Previously, only " "directories were returned. (Contributed by Barney Gale in :gh:`70303`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1115 +#: ../../whatsnew/3.13.rst:1119 msgid "" "Add the *follow_symlinks* keyword-only argument to :meth:`Path.is_file " "`, :meth:`Path.is_dir `, :meth:`." @@ -1676,11 +1684,11 @@ msgid "" "`105793` and Kamil Turek in :gh:`107962`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1123 +#: ../../whatsnew/3.13.rst:1127 msgid "pdb" msgstr "pdb" -#: ../../whatsnew/3.13.rst:1125 +#: ../../whatsnew/3.13.rst:1129 msgid "" ":func:`breakpoint` and :func:`~pdb.set_trace` now enter the debugger " "immediately rather than on the next line of code to be executed. This change " @@ -1689,20 +1697,20 @@ msgid "" "Gao in :gh:`118579`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1131 +#: ../../whatsnew/3.13.rst:1135 msgid "" "``sys.path[0]`` is no longer replaced by the directory of the script being " "debugged when :attr:`sys.flags.safe_path` is set. (Contributed by Tian Gao " "and Christian Walther in :gh:`111762`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1135 +#: ../../whatsnew/3.13.rst:1139 msgid "" ":mod:`zipapp` is now supported as a debugging target. (Contributed by Tian " "Gao in :gh:`118501`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1138 +#: ../../whatsnew/3.13.rst:1142 msgid "" "Add ability to move between chained exceptions during post-mortem debugging " "in :func:`~pdb.pm` using the new :pdbcmd:`exceptions [exc_number] " @@ -1710,101 +1718,101 @@ msgid "" "`106676`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1143 +#: ../../whatsnew/3.13.rst:1147 msgid "" "Expressions and statements whose prefix is a pdb command are now correctly " "identified and executed. (Contributed by Tian Gao in :gh:`108464`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1149 +#: ../../whatsnew/3.13.rst:1153 msgid "queue" msgstr "queue" -#: ../../whatsnew/3.13.rst:1151 +#: ../../whatsnew/3.13.rst:1155 msgid "" "Add :meth:`Queue.shutdown ` and :exc:`~queue.ShutDown` " "to manage queue termination. (Contributed by Laurie Opperman and Yves Duprat " "in :gh:`104750`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1157 +#: ../../whatsnew/3.13.rst:1161 msgid "random" msgstr "random" -#: ../../whatsnew/3.13.rst:1159 +#: ../../whatsnew/3.13.rst:1163 msgid "" "Add a :ref:`command-line interface `. (Contributed by Hugo van " "Kemenade in :gh:`118131`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1164 ../../whatsnew/3.13.rst:1656 +#: ../../whatsnew/3.13.rst:1168 ../../whatsnew/3.13.rst:1660 msgid "re" msgstr "re" -#: ../../whatsnew/3.13.rst:1166 +#: ../../whatsnew/3.13.rst:1170 msgid "" "Rename :exc:`!re.error` to :exc:`~re.PatternError` for improved clarity. :" "exc:`!re.error` is kept for backward compatibility." msgstr "" -#: ../../whatsnew/3.13.rst:1171 +#: ../../whatsnew/3.13.rst:1175 msgid "shutil" msgstr "shutil" -#: ../../whatsnew/3.13.rst:1173 +#: ../../whatsnew/3.13.rst:1177 msgid "" "Support the *dir_fd* and *follow_symlinks* keyword arguments in :func:" "`~shutil.chown`. (Contributed by Berker Peksag and Tahia K in :gh:`62308`)" msgstr "" -#: ../../whatsnew/3.13.rst:1179 +#: ../../whatsnew/3.13.rst:1183 msgid "site" msgstr "site" -#: ../../whatsnew/3.13.rst:1181 +#: ../../whatsnew/3.13.rst:1185 msgid "" ":file:`.pth` files are now decoded using UTF-8 first, and then with the :" "term:`locale encoding` if UTF-8 decoding fails. (Contributed by Inada Naoki " "in :gh:`117802`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1187 +#: ../../whatsnew/3.13.rst:1191 msgid "sqlite3" msgstr "sqlite3" -#: ../../whatsnew/3.13.rst:1189 +#: ../../whatsnew/3.13.rst:1193 msgid "" "A :exc:`ResourceWarning` is now emitted if a :class:`~sqlite3.Connection` " "object is not :meth:`closed ` explicitly. " "(Contributed by Erlend E. Aasland in :gh:`105539`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1193 +#: ../../whatsnew/3.13.rst:1197 msgid "" "Add the *filter* keyword-only parameter to :meth:`.Connection.iterdump` for " "filtering database objects to dump. (Contributed by Mariusz Felisiak in :gh:" "`91602`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1199 +#: ../../whatsnew/3.13.rst:1203 msgid "ssl" msgstr "ssl" -#: ../../whatsnew/3.13.rst:1201 +#: ../../whatsnew/3.13.rst:1205 msgid "" "The :func:`~ssl.create_default_context` API now includes :data:`~ssl." "VERIFY_X509_PARTIAL_CHAIN` and :data:`~ssl.VERIFY_X509_STRICT` in its " "default flags." msgstr "" -#: ../../whatsnew/3.13.rst:1207 +#: ../../whatsnew/3.13.rst:1211 msgid "" ":data:`~ssl.VERIFY_X509_STRICT` may reject pre-:rfc:`5280` or malformed " "certificates that the underlying OpenSSL implementation might otherwise " "accept. Whilst disabling this is not recommended, you can do so using:" msgstr "" -#: ../../whatsnew/3.13.rst:1212 +#: ../../whatsnew/3.13.rst:1216 msgid "" "import ssl\n" "\n" @@ -1816,15 +1824,15 @@ msgstr "" "ctx = ssl.create_default_context()\n" "ctx.verify_flags &= ~ssl.VERIFY_X509_STRICT" -#: ../../whatsnew/3.13.rst:1219 +#: ../../whatsnew/3.13.rst:1223 msgid "(Contributed by William Woodruff in :gh:`112389`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1223 +#: ../../whatsnew/3.13.rst:1227 msgid "statistics" msgstr "statistics" -#: ../../whatsnew/3.13.rst:1225 +#: ../../whatsnew/3.13.rst:1229 msgid "" "Add :func:`~statistics.kde` for kernel density estimation. This makes it " "possible to estimate a continuous probability density function from a fixed " @@ -1832,24 +1840,24 @@ msgid "" "`115863`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1230 +#: ../../whatsnew/3.13.rst:1234 msgid "" "Add :func:`~statistics.kde_random` for sampling from an estimated " "probability density function created by :func:`~statistics.kde`. " "(Contributed by Raymond Hettinger in :gh:`115863`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1238 +#: ../../whatsnew/3.13.rst:1242 msgid "subprocess" msgstr "subprocess" -#: ../../whatsnew/3.13.rst:1240 +#: ../../whatsnew/3.13.rst:1244 msgid "" "The :mod:`subprocess` module now uses the :func:`~os.posix_spawn` function " "in more situations." msgstr "" -#: ../../whatsnew/3.13.rst:1243 +#: ../../whatsnew/3.13.rst:1247 msgid "" "Notably, when *close_fds* is ``True`` (the default), :func:`~os.posix_spawn` " "will be used when the C library provides :c:func:`!" @@ -1858,7 +1866,7 @@ msgid "" "existing Linux :c:func:`!vfork` based code." msgstr "" -#: ../../whatsnew/3.13.rst:1250 +#: ../../whatsnew/3.13.rst:1254 msgid "" "A private control knob :attr:`!subprocess._USE_POSIX_SPAWN` can be set to " "``False`` if you need to force :mod:`subprocess` to never use :func:`~os." @@ -1868,22 +1876,22 @@ msgid "" "`113117`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1260 +#: ../../whatsnew/3.13.rst:1264 msgid "sys" msgstr "sys" -#: ../../whatsnew/3.13.rst:1262 +#: ../../whatsnew/3.13.rst:1266 msgid "" "Add the :func:`~sys._is_interned` function to test if a string was interned. " "This function is not guaranteed to exist in all implementations of Python. " "(Contributed by Serhiy Storchaka in :gh:`78573`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1268 +#: ../../whatsnew/3.13.rst:1272 msgid "tempfile" msgstr "tempfile" -#: ../../whatsnew/3.13.rst:1270 +#: ../../whatsnew/3.13.rst:1274 msgid "" "On Windows, the default mode ``0o700`` used by :func:`tempfile.mkdtemp` now " "limits access to the new directory due to changes to :func:`os.mkdir`. This " @@ -1891,11 +1899,11 @@ msgid "" "`118486`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1277 +#: ../../whatsnew/3.13.rst:1281 msgid "time" msgstr "time" -#: ../../whatsnew/3.13.rst:1279 +#: ../../whatsnew/3.13.rst:1283 msgid "" "On Windows, :func:`~time.monotonic` now uses the " "``QueryPerformanceCounter()`` clock for a resolution of 1 microsecond, " @@ -1903,7 +1911,7 @@ msgid "" "milliseconds. (Contributed by Victor Stinner in :gh:`88494`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1285 +#: ../../whatsnew/3.13.rst:1289 msgid "" "On Windows, :func:`~time.time` now uses the " "``GetSystemTimePreciseAsFileTime()`` clock for a resolution of 1 " @@ -1912,11 +1920,11 @@ msgid "" "`63207`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1293 +#: ../../whatsnew/3.13.rst:1297 msgid "tkinter" msgstr "tkinter" -#: ../../whatsnew/3.13.rst:1295 +#: ../../whatsnew/3.13.rst:1299 msgid "" "Add :mod:`tkinter` widget methods: :meth:`!tk_busy_hold`, :meth:`!" "tk_busy_configure`, :meth:`!tk_busy_cget`, :meth:`!tk_busy_forget`, :meth:`!" @@ -1924,7 +1932,7 @@ msgid "" "klappnase and Serhiy Storchaka in :gh:`72684`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1301 +#: ../../whatsnew/3.13.rst:1305 msgid "" "The :mod:`tkinter` widget method :meth:`!wm_attributes` now accepts the " "attribute name without the minus prefix to get window attributes, for " @@ -1933,14 +1941,14 @@ msgid "" "wm_attributes(alpha=0.5)``. (Contributed by Serhiy Storchaka in :gh:`43457`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1308 +#: ../../whatsnew/3.13.rst:1312 msgid "" ":meth:`!wm_attributes` can now return attributes as a :class:`dict`, by " "using the new optional keyword-only parameter *return_python_dict*. " "(Contributed by Serhiy Storchaka in :gh:`43457`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1312 +#: ../../whatsnew/3.13.rst:1316 msgid "" ":meth:`!Text.count` can now return a simple :class:`int` when the new " "optional keyword-only parameter *return_ints* is used. Otherwise, the single " @@ -1948,27 +1956,27 @@ msgid "" "in :gh:`97928`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1317 +#: ../../whatsnew/3.13.rst:1321 msgid "" "Support the \"vsapi\" element type in the :meth:`~tkinter.ttk.Style." "element_create` method of :class:`tkinter.ttk.Style`. (Contributed by Serhiy " "Storchaka in :gh:`68166`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1322 +#: ../../whatsnew/3.13.rst:1326 msgid "" "Add the :meth:`!after_info` method for Tkinter widgets. (Contributed by " "Cheryl Sabella in :gh:`77020`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1325 +#: ../../whatsnew/3.13.rst:1329 msgid "" "Add a new :meth:`!copy_replace` method to :class:`!PhotoImage` to copy a " "region from one image to another, possibly with pixel zooming, subsampling, " "or both. (Contributed by Serhiy Storchaka in :gh:`118225`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1330 +#: ../../whatsnew/3.13.rst:1334 msgid "" "Add *from_coords* parameter to the :class:`!PhotoImage` methods :meth:`!" "copy`, :meth:`!zoom` and :meth:`!subsample`. Add *zoom* and *subsample* " @@ -1976,7 +1984,7 @@ msgid "" "Serhiy Storchaka in :gh:`118225`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1336 +#: ../../whatsnew/3.13.rst:1340 msgid "" "Add the :class:`!PhotoImage` methods :meth:`!read` to read an image from a " "file and :meth:`!data` to get the image data. Add *background* and " @@ -1984,11 +1992,11 @@ msgid "" "Storchaka in :gh:`118271`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1344 +#: ../../whatsnew/3.13.rst:1348 msgid "traceback" msgstr "traceback" -#: ../../whatsnew/3.13.rst:1346 +#: ../../whatsnew/3.13.rst:1350 msgid "" "Add the :attr:`~traceback.TracebackException.exc_type_str` attribute to :" "class:`~traceback.TracebackException`, which holds a string display of the " @@ -1998,7 +2006,7 @@ msgid "" "(Contributed by Irit Katriel in :gh:`112332`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1355 +#: ../../whatsnew/3.13.rst:1359 msgid "" "Add a new *show_group* keyword-only parameter to :meth:`.TracebackException." "format_exception_only` to (recursively) format the nested exceptions of a :" @@ -2006,11 +2014,11 @@ msgid "" "`105292`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1362 +#: ../../whatsnew/3.13.rst:1366 msgid "types" msgstr "types" -#: ../../whatsnew/3.13.rst:1364 +#: ../../whatsnew/3.13.rst:1368 msgid "" ":class:`~types.SimpleNamespace` can now take a single positional argument to " "initialise the namespace's arguments. This argument must either be a mapping " @@ -2018,63 +2026,63 @@ msgid "" "`108191`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1371 ../../whatsnew/3.13.rst:1681 +#: ../../whatsnew/3.13.rst:1375 ../../whatsnew/3.13.rst:1685 msgid "typing" msgstr "typing" -#: ../../whatsnew/3.13.rst:1373 +#: ../../whatsnew/3.13.rst:1377 msgid "" ":pep:`705`: Add :data:`~typing.ReadOnly`, a special typing construct to mark " "a :class:`~typing.TypedDict` item as read-only for type checkers." msgstr "" -#: ../../whatsnew/3.13.rst:1376 +#: ../../whatsnew/3.13.rst:1380 msgid "" ":pep:`742`: Add :data:`~typing.TypeIs`, a typing construct that can be used " "to instruct a type checker how to narrow a type." msgstr "" -#: ../../whatsnew/3.13.rst:1379 +#: ../../whatsnew/3.13.rst:1383 msgid "" "Add :data:`~typing.NoDefault`, a sentinel object used to represent the " "defaults of some parameters in the :mod:`typing` module. (Contributed by " "Jelle Zijlstra in :gh:`116126`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1383 +#: ../../whatsnew/3.13.rst:1387 msgid "" "Add :func:`~typing.get_protocol_members` to return the set of members " "defining a :class:`typing.Protocol`. (Contributed by Jelle Zijlstra in :gh:" "`104873`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1387 +#: ../../whatsnew/3.13.rst:1391 msgid "" "Add :func:`~typing.is_protocol` to check whether a class is a :class:" "`~typing.Protocol`. (Contributed by Jelle Zijlstra in :gh:`104873`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1391 +#: ../../whatsnew/3.13.rst:1395 msgid "" ":data:`~typing.ClassVar` can now be nested in :data:`~typing.Final`, and " "vice versa. (Contributed by Mehdi Drissi in :gh:`89547`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1397 +#: ../../whatsnew/3.13.rst:1401 msgid "unicodedata" msgstr "unicodedata" -#: ../../whatsnew/3.13.rst:1399 +#: ../../whatsnew/3.13.rst:1403 msgid "" "Update the Unicode database to `version 15.1.0`__. (Contributed by James " "Gerity in :gh:`109559`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1406 +#: ../../whatsnew/3.13.rst:1410 msgid "venv" msgstr "venv" -#: ../../whatsnew/3.13.rst:1408 +#: ../../whatsnew/3.13.rst:1412 msgid "" "Add support for creating source control management (SCM) ignore files in a " "virtual environment's directory. By default, Git is supported. This is " @@ -2084,11 +2092,11 @@ msgid "" "Cannon in :gh:`108125`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1419 +#: ../../whatsnew/3.13.rst:1423 msgid "warnings" msgstr "warnings" -#: ../../whatsnew/3.13.rst:1421 +#: ../../whatsnew/3.13.rst:1425 msgid "" ":pep:`702`: The new :func:`warnings.deprecated` decorator provides a way to " "communicate deprecations to a :term:`static type checker` and to warn on " @@ -2097,62 +2105,62 @@ msgid "" "(Contributed by Jelle Zijlstra in :gh:`104003`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1430 +#: ../../whatsnew/3.13.rst:1434 msgid "xml" msgstr "xml" -#: ../../whatsnew/3.13.rst:1432 +#: ../../whatsnew/3.13.rst:1436 msgid "" "Allow controlling Expat >=2.6.0 reparse deferral (:cve:`2023-52425`) by " "adding five new methods:" msgstr "" -#: ../../whatsnew/3.13.rst:1435 +#: ../../whatsnew/3.13.rst:1439 msgid ":meth:`xml.etree.ElementTree.XMLParser.flush`" msgstr ":meth:`xml.etree.ElementTree.XMLParser.flush`" -#: ../../whatsnew/3.13.rst:1436 +#: ../../whatsnew/3.13.rst:1440 msgid ":meth:`xml.etree.ElementTree.XMLPullParser.flush`" msgstr ":meth:`xml.etree.ElementTree.XMLPullParser.flush`" -#: ../../whatsnew/3.13.rst:1437 +#: ../../whatsnew/3.13.rst:1441 msgid ":meth:`xml.parsers.expat.xmlparser.GetReparseDeferralEnabled`" msgstr ":meth:`xml.parsers.expat.xmlparser.GetReparseDeferralEnabled`" -#: ../../whatsnew/3.13.rst:1438 +#: ../../whatsnew/3.13.rst:1442 msgid ":meth:`xml.parsers.expat.xmlparser.SetReparseDeferralEnabled`" msgstr ":meth:`xml.parsers.expat.xmlparser.SetReparseDeferralEnabled`" -#: ../../whatsnew/3.13.rst:1439 +#: ../../whatsnew/3.13.rst:1443 msgid ":meth:`!xml.sax.expatreader.ExpatParser.flush`" msgstr ":meth:`!xml.sax.expatreader.ExpatParser.flush`" -#: ../../whatsnew/3.13.rst:1441 +#: ../../whatsnew/3.13.rst:1445 msgid "(Contributed by Sebastian Pipping in :gh:`115623`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1443 +#: ../../whatsnew/3.13.rst:1447 msgid "" "Add the :meth:`!close` method for the iterator returned by :func:`~xml.etree." "ElementTree.iterparse` for explicit cleanup. (Contributed by Serhiy " "Storchaka in :gh:`69893`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1449 +#: ../../whatsnew/3.13.rst:1453 msgid "zipimport" msgstr "zipimport" -#: ../../whatsnew/3.13.rst:1451 +#: ../../whatsnew/3.13.rst:1455 msgid "" "Add support for ZIP64_ format files. Everybody loves huge data, right? " "(Contributed by Tim Hatch in :gh:`94146`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1459 +#: ../../whatsnew/3.13.rst:1463 msgid "Optimizations" msgstr "最佳化" -#: ../../whatsnew/3.13.rst:1461 +#: ../../whatsnew/3.13.rst:1465 msgid "" "Several standard library modules have had their import times significantly " "improved. For example, the import time of the :mod:`typing` module has been " @@ -2163,13 +2171,13 @@ msgid "" "Turner, Daniel Hollas, and others in :gh:`109653`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1472 +#: ../../whatsnew/3.13.rst:1476 msgid "" ":func:`textwrap.indent` is now around 30% faster than before for large " "input. (Contributed by Inada Naoki in :gh:`107369`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1475 +#: ../../whatsnew/3.13.rst:1479 msgid "" "The :mod:`subprocess` module now uses the :func:`~os.posix_spawn` function " "in more situations, including when *close_fds* is ``True`` (the default) on " @@ -2179,15 +2187,15 @@ msgid "" "Kulik in :gh:`113117`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1485 +#: ../../whatsnew/3.13.rst:1489 msgid "Removed Modules And APIs" msgstr "" -#: ../../whatsnew/3.13.rst:1491 +#: ../../whatsnew/3.13.rst:1495 msgid "PEP 594: Remove \"dead batteries\" from the standard library" msgstr "" -#: ../../whatsnew/3.13.rst:1493 +#: ../../whatsnew/3.13.rst:1497 msgid "" ":pep:`594` proposed removing 19 modules from the standard library, " "colloquially referred to as 'dead batteries' due to their historic, " @@ -2195,23 +2203,23 @@ msgid "" "in Python 3.11, and are now removed:" msgstr "" -#: ../../whatsnew/3.13.rst:1499 +#: ../../whatsnew/3.13.rst:1503 msgid ":mod:`!aifc`" msgstr ":mod:`!aifc`" -#: ../../whatsnew/3.13.rst:1500 +#: ../../whatsnew/3.13.rst:1504 msgid ":mod:`!audioop`" msgstr ":mod:`!audioop`" -#: ../../whatsnew/3.13.rst:1501 +#: ../../whatsnew/3.13.rst:1505 msgid ":mod:`!chunk`" msgstr ":mod:`!chunk`" -#: ../../whatsnew/3.13.rst:1502 +#: ../../whatsnew/3.13.rst:1506 msgid ":mod:`!cgi` and :mod:`!cgitb`" msgstr ":mod:`!cgi` 和 :mod:`!cgitb`" -#: ../../whatsnew/3.13.rst:1504 +#: ../../whatsnew/3.13.rst:1508 msgid "" ":class:`!cgi.FieldStorage` can typically be replaced with :func:`urllib." "parse.parse_qsl` for ``GET`` and ``HEAD`` requests, and the :mod:`email." @@ -2219,7 +2227,7 @@ msgid "" "requests." msgstr "" -#: ../../whatsnew/3.13.rst:1509 +#: ../../whatsnew/3.13.rst:1513 msgid "" ":func:`!cgi.parse` can be replaced by calling :func:`urllib.parse.parse_qs` " "directly on the desired query string, unless the input is ``multipart/form-" @@ -2227,14 +2235,14 @@ msgid "" "parse_multipart`." msgstr "" -#: ../../whatsnew/3.13.rst:1514 +#: ../../whatsnew/3.13.rst:1518 msgid "" ":func:`!cgi.parse_header` can be replaced with the functionality in the :mod:" "`email` package, which implements the same MIME RFCs. For example, with :" "class:`email.message.EmailMessage`:" msgstr "" -#: ../../whatsnew/3.13.rst:1518 +#: ../../whatsnew/3.13.rst:1522 msgid "" "from email.message import EmailMessage\n" "\n" @@ -2243,7 +2251,7 @@ msgid "" "main, params = msg.get_content_type(), msg['content-type'].params" msgstr "" -#: ../../whatsnew/3.13.rst:1526 +#: ../../whatsnew/3.13.rst:1530 msgid "" ":func:`!cgi.parse_multipart` can be replaced with the functionality in the :" "mod:`email` package, which implements the same MIME RFCs, or with the :pypi:" @@ -2251,41 +2259,41 @@ msgid "" "and :class:`email.message.Message` classes." msgstr "" -#: ../../whatsnew/3.13.rst:1532 +#: ../../whatsnew/3.13.rst:1536 msgid "" ":mod:`!crypt` and the private :mod:`!_crypt` extension. The :mod:`hashlib` " "module may be an appropriate replacement when simply hashing a value is " "required. Otherwise, various third-party libraries on PyPI are available:" msgstr "" -#: ../../whatsnew/3.13.rst:1537 +#: ../../whatsnew/3.13.rst:1541 msgid "" ":pypi:`bcrypt`: Modern password hashing for your software and your servers." msgstr "" -#: ../../whatsnew/3.13.rst:1539 +#: ../../whatsnew/3.13.rst:1543 msgid "" ":pypi:`passlib`: Comprehensive password hashing framework supporting over 30 " "schemes." msgstr "" -#: ../../whatsnew/3.13.rst:1541 +#: ../../whatsnew/3.13.rst:1545 msgid ":pypi:`argon2-cffi`: The secure Argon2 password hashing algorithm." msgstr "" -#: ../../whatsnew/3.13.rst:1543 +#: ../../whatsnew/3.13.rst:1547 msgid "" ":pypi:`legacycrypt`: :mod:`ctypes` wrapper to the POSIX crypt library call " "and associated functionality." msgstr "" -#: ../../whatsnew/3.13.rst:1546 +#: ../../whatsnew/3.13.rst:1550 msgid "" ":pypi:`crypt_r`: Fork of the :mod:`!crypt` module, wrapper to the :manpage:" "`crypt_r(3)` library call and associated functionality." msgstr "" -#: ../../whatsnew/3.13.rst:1551 +#: ../../whatsnew/3.13.rst:1555 msgid "" ":mod:`!imghdr`: The :pypi:`filetype`, :pypi:`puremagic`, or :pypi:`python-" "magic` libraries should be used as replacements. For example, the :func:`!" @@ -2293,83 +2301,83 @@ msgid "" "function for all file formats that were supported by :mod:`!imghdr`." msgstr "" -#: ../../whatsnew/3.13.rst:1557 +#: ../../whatsnew/3.13.rst:1561 msgid ":mod:`!mailcap`: Use the :mod:`mimetypes` module instead." msgstr "" -#: ../../whatsnew/3.13.rst:1559 +#: ../../whatsnew/3.13.rst:1563 msgid ":mod:`!msilib`" msgstr ":mod:`!msilib`" -#: ../../whatsnew/3.13.rst:1560 +#: ../../whatsnew/3.13.rst:1564 msgid ":mod:`!nis`" msgstr ":mod:`!nis`" -#: ../../whatsnew/3.13.rst:1561 +#: ../../whatsnew/3.13.rst:1565 msgid ":mod:`!nntplib`: Use the :pypi:`pynntp` library from PyPI instead." msgstr "" -#: ../../whatsnew/3.13.rst:1563 +#: ../../whatsnew/3.13.rst:1567 msgid "" ":mod:`!ossaudiodev`: For audio playback, use the :pypi:`pygame` library from " "PyPI instead." msgstr "" -#: ../../whatsnew/3.13.rst:1565 +#: ../../whatsnew/3.13.rst:1569 msgid ":mod:`!pipes`: Use the :mod:`subprocess` module instead." msgstr "" -#: ../../whatsnew/3.13.rst:1567 +#: ../../whatsnew/3.13.rst:1571 msgid "" ":mod:`!sndhdr`: The :pypi:`filetype`, :pypi:`puremagic`, or :pypi:`python-" "magic` libraries should be used as replacements." msgstr "" -#: ../../whatsnew/3.13.rst:1570 +#: ../../whatsnew/3.13.rst:1574 msgid ":mod:`!spwd`: Use the :pypi:`python-pam` library from PyPI instead." msgstr "" -#: ../../whatsnew/3.13.rst:1572 +#: ../../whatsnew/3.13.rst:1576 msgid ":mod:`!sunau`" msgstr ":mod:`!sunau`" -#: ../../whatsnew/3.13.rst:1573 +#: ../../whatsnew/3.13.rst:1577 msgid "" ":mod:`!telnetlib`, Use the :pypi:`telnetlib3` or :pypi:`Exscript` libraries " "from PyPI instead." msgstr "" -#: ../../whatsnew/3.13.rst:1575 +#: ../../whatsnew/3.13.rst:1579 msgid "" ":mod:`!uu`: Use the :mod:`base64` module instead, as a modern alternative." msgstr "" -#: ../../whatsnew/3.13.rst:1577 +#: ../../whatsnew/3.13.rst:1581 msgid ":mod:`!xdrlib`" msgstr ":mod:`!xdrlib`" -#: ../../whatsnew/3.13.rst:1579 +#: ../../whatsnew/3.13.rst:1583 msgid "" "(Contributed by Victor Stinner and Zachary Ware in :gh:`104773` and :gh:" "`104780`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1583 +#: ../../whatsnew/3.13.rst:1587 msgid "2to3" msgstr "2to3" -#: ../../whatsnew/3.13.rst:1585 +#: ../../whatsnew/3.13.rst:1589 msgid "" "Remove the :program:`2to3` program and the :mod:`!lib2to3` module, " "previously deprecated in Python 3.11. (Contributed by Victor Stinner in :gh:" "`104780`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1591 +#: ../../whatsnew/3.13.rst:1595 msgid "builtins" msgstr "builtins" -#: ../../whatsnew/3.13.rst:1593 +#: ../../whatsnew/3.13.rst:1597 msgid "" "Remove support for chained :class:`classmethod` descriptors (introduced in :" "gh:`63272`). These can no longer be used to wrap other descriptors, such as :" @@ -2379,47 +2387,47 @@ msgid "" "(Contributed by Raymond Hettinger in :gh:`89519`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1602 +#: ../../whatsnew/3.13.rst:1606 msgid "" "Raise a :exc:`RuntimeError` when calling :meth:`frame.clear` on a suspended " "frame (as has always been the case for an executing frame). (Contributed by " "Irit Katriel in :gh:`79932`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1610 +#: ../../whatsnew/3.13.rst:1614 msgid "" "Remove the undocumented :class:`!LegacyInterpolation` class, deprecated in " "the docstring since Python 3.2, and at runtime since Python 3.11. " "(Contributed by Hugo van Kemenade in :gh:`104886`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1617 +#: ../../whatsnew/3.13.rst:1621 msgid "importlib.metadata" msgstr "importlib.metadata" -#: ../../whatsnew/3.13.rst:1619 +#: ../../whatsnew/3.13.rst:1623 msgid "" "Remove deprecated subscript (:meth:`~object.__getitem__`) access for :ref:" "`EntryPoint ` objects. (Contributed by Jason R. Coombs in :gh:" "`113175`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1625 +#: ../../whatsnew/3.13.rst:1629 msgid "locale" msgstr "locale" -#: ../../whatsnew/3.13.rst:1627 +#: ../../whatsnew/3.13.rst:1631 msgid "" "Remove the :func:`!locale.resetlocale` function, deprecated in Python 3.11. " "Use ``locale.setlocale(locale.LC_ALL, \"\")`` instead. (Contributed by " "Victor Stinner in :gh:`104783`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1633 +#: ../../whatsnew/3.13.rst:1637 msgid "opcode" msgstr "opcode" -#: ../../whatsnew/3.13.rst:1635 +#: ../../whatsnew/3.13.rst:1639 msgid "" "Move :attr:`!opcode.ENABLE_SPECIALIZATION` to :attr:`!_opcode." "ENABLE_SPECIALIZATION`. This field was added in 3.12, it was never " @@ -2427,7 +2435,7 @@ msgid "" "Katriel in :gh:`105481`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1640 +#: ../../whatsnew/3.13.rst:1644 msgid "" "Remove :func:`!opcode.is_pseudo`, :attr:`!opcode.MIN_PSEUDO_OPCODE`, and :" "attr:`!opcode.MAX_PSEUDO_OPCODE`, which were added in Python 3.12, but were " @@ -2435,43 +2443,43 @@ msgid "" "be used externally. (Contributed by Irit Katriel in :gh:`105481`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1650 +#: ../../whatsnew/3.13.rst:1654 msgid "" "Remove the ability to use :class:`~pathlib.Path` objects as context " "managers. This functionality was deprecated and has had no effect since " "Python 3.9. (Contributed by Barney Gale in :gh:`83863`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1658 +#: ../../whatsnew/3.13.rst:1662 msgid "" "Remove the undocumented, deprecated, and broken :func:`!re.template` " "function and :attr:`!re.TEMPLATE` / :attr:`!re.T` flag. (Contributed by " "Serhiy Storchaka and Nikita Sobolev in :gh:`105687`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1664 +#: ../../whatsnew/3.13.rst:1668 msgid "tkinter.tix" msgstr "tkinter.tix" -#: ../../whatsnew/3.13.rst:1666 +#: ../../whatsnew/3.13.rst:1670 msgid "" "Remove the :mod:`!tkinter.tix` module, deprecated in Python 3.6. The third-" "party Tix library which the module wrapped is unmaintained. (Contributed by " "Zachary Ware in :gh:`75552`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1672 +#: ../../whatsnew/3.13.rst:1676 msgid "turtle" msgstr "turtle" -#: ../../whatsnew/3.13.rst:1674 +#: ../../whatsnew/3.13.rst:1678 msgid "" "Remove the :meth:`!RawTurtle.settiltangle` method, deprecated in the " "documentation since Python 3.1 and at runtime since Python 3.11. " "(Contributed by Hugo van Kemenade in :gh:`104876`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1683 +#: ../../whatsnew/3.13.rst:1687 msgid "" "Remove the :mod:`!typing.io` and :mod:`!typing.re` namespaces, deprecated " "since Python 3.8. The items in those namespaces can be imported directly " @@ -2479,66 +2487,66 @@ msgid "" "`92871`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1689 +#: ../../whatsnew/3.13.rst:1693 msgid "" "Remove the keyword-argument method of creating :class:`~typing.TypedDict` " "types, deprecated in Python 3.11. (Contributed by Tomas Roun in :gh:" "`104786`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1695 +#: ../../whatsnew/3.13.rst:1699 msgid "unittest" msgstr "unittest" -#: ../../whatsnew/3.13.rst:1697 +#: ../../whatsnew/3.13.rst:1701 msgid "" "Remove the following :mod:`unittest` functions, deprecated in Python 3.11:" msgstr "" -#: ../../whatsnew/3.13.rst:1699 +#: ../../whatsnew/3.13.rst:1703 msgid ":func:`!unittest.findTestCases`" msgstr ":func:`!unittest.findTestCases`" -#: ../../whatsnew/3.13.rst:1700 +#: ../../whatsnew/3.13.rst:1704 msgid ":func:`!unittest.makeSuite`" msgstr ":func:`!unittest.makeSuite`" -#: ../../whatsnew/3.13.rst:1701 +#: ../../whatsnew/3.13.rst:1705 msgid ":func:`!unittest.getTestCaseNames`" msgstr ":func:`!unittest.getTestCaseNames`" -#: ../../whatsnew/3.13.rst:1703 +#: ../../whatsnew/3.13.rst:1707 msgid "Use :class:`~unittest.TestLoader` methods instead:" msgstr "" -#: ../../whatsnew/3.13.rst:1705 +#: ../../whatsnew/3.13.rst:1709 msgid ":meth:`~unittest.TestLoader.loadTestsFromModule`" msgstr ":meth:`~unittest.TestLoader.loadTestsFromModule`" -#: ../../whatsnew/3.13.rst:1706 +#: ../../whatsnew/3.13.rst:1710 msgid ":meth:`~unittest.TestLoader.loadTestsFromTestCase`" msgstr ":meth:`~unittest.TestLoader.loadTestsFromTestCase`" -#: ../../whatsnew/3.13.rst:1707 +#: ../../whatsnew/3.13.rst:1711 msgid ":meth:`~unittest.TestLoader.getTestCaseNames`" msgstr ":meth:`~unittest.TestLoader.getTestCaseNames`" -#: ../../whatsnew/3.13.rst:1709 +#: ../../whatsnew/3.13.rst:1713 msgid "(Contributed by Hugo van Kemenade in :gh:`104835`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1711 +#: ../../whatsnew/3.13.rst:1715 msgid "" "Remove the untested and undocumented :meth:`!TestProgram.usageExit` method, " "deprecated in Python 3.11. (Contributed by Hugo van Kemenade in :gh:" "`104992`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1717 +#: ../../whatsnew/3.13.rst:1721 msgid "urllib" msgstr "urllib" -#: ../../whatsnew/3.13.rst:1719 +#: ../../whatsnew/3.13.rst:1723 msgid "" "Remove the *cafile*, *capath*, and *cadefault* parameters of the :func:" "`urllib.request.urlopen` function, deprecated in Python 3.6. Use the " @@ -2549,33 +2557,33 @@ msgid "" "Victor Stinner in :gh:`105382`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1730 +#: ../../whatsnew/3.13.rst:1734 msgid "webbrowser" msgstr "webbrowser" -#: ../../whatsnew/3.13.rst:1732 +#: ../../whatsnew/3.13.rst:1736 msgid "" "Remove the untested and undocumented :class:`!MacOSX` class, deprecated in " "Python 3.11. Use the :class:`!MacOSXOSAScript` class (introduced in Python " "3.2) instead. (Contributed by Hugo van Kemenade in :gh:`104804`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1737 +#: ../../whatsnew/3.13.rst:1741 msgid "" "Remove the deprecated :attr:`!MacOSXOSAScript._name` attribute. Use the :" "attr:`MacOSXOSAScript.name ` attribute instead. " "(Contributed by Nikita Sobolev in :gh:`105546`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1744 +#: ../../whatsnew/3.13.rst:1748 msgid "New Deprecations" msgstr "" -#: ../../whatsnew/3.13.rst:1746 +#: ../../whatsnew/3.13.rst:1750 msgid ":ref:`User-defined functions `:" msgstr "" -#: ../../whatsnew/3.13.rst:1748 +#: ../../whatsnew/3.13.rst:1752 msgid "" "Deprecate assignment to a function's :attr:`~function.__code__` attribute, " "where the new code object's type does not match the function's type. The " @@ -2583,12 +2591,12 @@ msgid "" "coroutine. (Contributed by Irit Katriel in :gh:`81137`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1754 +#: ../../whatsnew/3.13.rst:1758 #: ../../deprecations/pending-removal-in-3.16.rst:13 msgid ":mod:`array`:" msgstr ":mod:`array`:" -#: ../../whatsnew/3.13.rst:1756 +#: ../../whatsnew/3.13.rst:1760 msgid "" "Deprecate the ``'u'`` format code (:c:type:`wchar_t`) at runtime. This " "format code has been deprecated in documentation since Python 3.3, and will " @@ -2597,50 +2605,50 @@ msgid "" "`80480`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1763 -#: ../../deprecations/pending-removal-in-3.15.rst:4 +#: ../../whatsnew/3.13.rst:1767 +#: ../../deprecations/pending-removal-in-3.15.rst:16 msgid ":mod:`ctypes`:" msgstr ":mod:`ctypes`:" -#: ../../whatsnew/3.13.rst:1765 +#: ../../whatsnew/3.13.rst:1769 msgid "" "Deprecate the undocumented :func:`!SetPointerType` function, to be removed " "in Python 3.15. (Contributed by Victor Stinner in :gh:`105733`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1769 +#: ../../whatsnew/3.13.rst:1773 msgid "" ":term:`Soft-deprecate ` the :func:`~ctypes.ARRAY` function " "in favour of ``type * length`` multiplication. (Contributed by Victor " "Stinner in :gh:`105733`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1773 +#: ../../whatsnew/3.13.rst:1777 msgid ":mod:`decimal`:" msgstr ":mod:`decimal`:" -#: ../../whatsnew/3.13.rst:1775 +#: ../../whatsnew/3.13.rst:1779 msgid "" "Deprecate the non-standard and undocumented :class:`~decimal.Decimal` format " "specifier ``'N'``, which is only supported in the :mod:`!decimal` module's C " "implementation. (Contributed by Serhiy Storchaka in :gh:`89902`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1780 +#: ../../whatsnew/3.13.rst:1784 msgid ":mod:`dis`:" msgstr ":mod:`dis`:" -#: ../../whatsnew/3.13.rst:1782 +#: ../../whatsnew/3.13.rst:1786 msgid "" "Deprecate the :attr:`!HAVE_ARGUMENT` separator. Check membership in :data:" "`~dis.hasarg` instead. (Contributed by Irit Katriel in :gh:`109319`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1786 +#: ../../whatsnew/3.13.rst:1790 msgid ":mod:`getopt` and :mod:`optparse`:" msgstr ":mod:`getopt` 和 :mod:`optparse`:" -#: ../../whatsnew/3.13.rst:1788 +#: ../../whatsnew/3.13.rst:1792 msgid "" "Both modules are now :term:`soft deprecated`, with :mod:`argparse` preferred " "for new projects. This is a new soft-deprecation for the :mod:`!getopt` " @@ -2648,22 +2656,22 @@ msgid "" "deprecated. (Contributed by Victor Stinner in :gh:`106535`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1794 +#: ../../whatsnew/3.13.rst:1798 msgid ":mod:`gettext`:" msgstr ":mod:`gettext`:" -#: ../../whatsnew/3.13.rst:1796 +#: ../../whatsnew/3.13.rst:1800 msgid "" "Deprecate non-integer numbers as arguments to functions and methods that " "consider plural forms in the :mod:`!gettext` module, even if no translation " "was found. (Contributed by Serhiy Storchaka in :gh:`88434`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1801 +#: ../../whatsnew/3.13.rst:1805 msgid ":mod:`glob`:" msgstr ":mod:`glob`:" -#: ../../whatsnew/3.13.rst:1803 +#: ../../whatsnew/3.13.rst:1807 msgid "" "Deprecate the undocumented :func:`!glob0` and :func:`!glob1` functions. Use :" "func:`~glob.glob` and pass a :term:`path-like object` specifying the root " @@ -2671,12 +2679,12 @@ msgid "" "in :gh:`117337`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1808 -#: ../../deprecations/pending-removal-in-3.15.rst:9 +#: ../../whatsnew/3.13.rst:1812 +#: ../../deprecations/pending-removal-in-3.15.rst:21 msgid ":mod:`http.server`:" msgstr ":mod:`http.server`:" -#: ../../whatsnew/3.13.rst:1810 +#: ../../whatsnew/3.13.rst:1814 msgid "" "Deprecate :class:`~http.server.CGIHTTPRequestHandler`, to be removed in " "Python 3.15. Process-based CGI HTTP servers have been out of favor for a " @@ -2685,29 +2693,29 @@ msgid "" "by Gregory P. Smith in :gh:`109096`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1817 +#: ../../whatsnew/3.13.rst:1821 msgid "" "Deprecate the :option:`!--cgi` flag to the :program:`python -m http.server` " "command-line interface, to be removed in Python 3.15. (Contributed by " "Gregory P. Smith in :gh:`109096`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1822 +#: ../../whatsnew/3.13.rst:1826 msgid ":mod:`mimetypes`:" msgstr ":mod:`mimetypes`:" -#: ../../whatsnew/3.13.rst:1824 +#: ../../whatsnew/3.13.rst:1828 msgid "" ":term:`Soft-deprecate ` file path arguments to :func:" "`~mimetypes.guess_type`, use :func:`~mimetypes.guess_file_type` instead. " "(Contributed by Serhiy Storchaka in :gh:`66543`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1829 +#: ../../whatsnew/3.13.rst:1833 msgid ":mod:`re`:" msgstr ":mod:`re`:" -#: ../../whatsnew/3.13.rst:1831 +#: ../../whatsnew/3.13.rst:1835 msgid "" "Deprecate passing the optional *maxsplit*, *count*, or *flags* arguments as " "positional arguments to the module-level :func:`~re.split`, :func:`~re.sub`, " @@ -2716,46 +2724,46 @@ msgid "" "by Serhiy Storchaka in :gh:`56166`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1838 -#: ../../deprecations/pending-removal-in-3.15.rst:33 +#: ../../whatsnew/3.13.rst:1842 +#: ../../deprecations/pending-removal-in-3.15.rst:42 msgid ":mod:`pathlib`:" msgstr ":mod:`pathlib`:" -#: ../../whatsnew/3.13.rst:1840 +#: ../../whatsnew/3.13.rst:1844 msgid "" "Deprecate :meth:`.PurePath.is_reserved`, to be removed in Python 3.15. Use :" "func:`os.path.isreserved` to detect reserved paths on Windows. (Contributed " "by Barney Gale in :gh:`88569`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1845 -#: ../../deprecations/pending-removal-in-3.15.rst:39 +#: ../../whatsnew/3.13.rst:1849 +#: ../../deprecations/pending-removal-in-3.15.rst:48 msgid ":mod:`platform`:" msgstr ":mod:`platform`:" -#: ../../whatsnew/3.13.rst:1847 +#: ../../whatsnew/3.13.rst:1851 msgid "" "Deprecate :func:`~platform.java_ver`, to be removed in Python 3.15. This " "function is only useful for Jython support, has a confusing API, and is " "largely untested. (Contributed by Nikita Sobolev in :gh:`116349`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1853 +#: ../../whatsnew/3.13.rst:1857 msgid ":mod:`pydoc`:" msgstr ":mod:`pydoc`:" -#: ../../whatsnew/3.13.rst:1855 +#: ../../whatsnew/3.13.rst:1859 msgid "" "Deprecate the undocumented :func:`!ispackage` function. (Contributed by " "Zackery Spytz in :gh:`64020`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1858 -#: ../../deprecations/pending-removal-in-3.14.rst:91 +#: ../../whatsnew/3.13.rst:1862 +#: ../../deprecations/pending-removal-in-3.14.rst:98 msgid ":mod:`sqlite3`:" msgstr ":mod:`sqlite3`:" -#: ../../whatsnew/3.13.rst:1860 +#: ../../whatsnew/3.13.rst:1864 msgid "" "Deprecate passing more than one positional argument to the :func:`~sqlite3." "connect` function and the :class:`~sqlite3.Connection` constructor. The " @@ -2763,7 +2771,7 @@ msgid "" "by Erlend E. Aasland in :gh:`107948`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1866 +#: ../../whatsnew/3.13.rst:1870 msgid "" "Deprecate passing name, number of arguments, and the callable as keyword " "arguments for :meth:`.Connection.create_function` and :meth:`.Connection." @@ -2771,7 +2779,7 @@ msgid "" "3.15. (Contributed by Erlend E. Aasland in :gh:`108278`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1872 +#: ../../whatsnew/3.13.rst:1876 msgid "" "Deprecate passing the callback callable by keyword for the :meth:`~sqlite3." "Connection.set_authorizer`, :meth:`~sqlite3.Connection." @@ -2781,46 +2789,46 @@ msgid "" "`108278`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1880 +#: ../../whatsnew/3.13.rst:1884 #: ../../deprecations/pending-removal-in-3.16.rst:33 msgid ":mod:`sys`:" msgstr ":mod:`sys`:" -#: ../../whatsnew/3.13.rst:1882 +#: ../../whatsnew/3.13.rst:1886 msgid "" "Deprecate the :func:`~sys._enablelegacywindowsfsencoding` function, to be " "removed in Python 3.16. Use the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` " "environment variable instead. (Contributed by Inada Naoki in :gh:`73427`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1887 +#: ../../whatsnew/3.13.rst:1891 #: ../../deprecations/pending-removal-in-3.16.rst:39 msgid ":mod:`tarfile`:" msgstr ":mod:`tarfile`:" -#: ../../whatsnew/3.13.rst:1889 +#: ../../whatsnew/3.13.rst:1893 msgid "" "Deprecate the undocumented and unused :attr:`!TarFile.tarfile` attribute, to " "be removed in Python 3.16. (Contributed in :gh:`115256`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1893 +#: ../../whatsnew/3.13.rst:1897 msgid ":mod:`traceback`:" msgstr ":mod:`traceback`:" -#: ../../whatsnew/3.13.rst:1895 +#: ../../whatsnew/3.13.rst:1899 msgid "" "Deprecate the :attr:`.TracebackException.exc_type` attribute. Use :attr:`." "TracebackException.exc_type_str` instead. (Contributed by Irit Katriel in :" "gh:`112332`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1899 -#: ../../deprecations/pending-removal-in-3.15.rst:53 +#: ../../whatsnew/3.13.rst:1903 +#: ../../deprecations/pending-removal-in-3.15.rst:62 msgid ":mod:`typing`:" msgstr ":mod:`typing`:" -#: ../../whatsnew/3.13.rst:1901 +#: ../../whatsnew/3.13.rst:1905 msgid "" "Deprecate the undocumented keyword argument syntax for creating :class:" "`~typing.NamedTuple` classes (e.g. ``Point = NamedTuple(\"Point\", x=int, " @@ -2828,7 +2836,7 @@ msgid "" "functional syntax instead. (Contributed by Alex Waygood in :gh:`105566`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1908 +#: ../../whatsnew/3.13.rst:1912 msgid "" "Deprecate omitting the *fields* parameter when creating a :class:`~typing." "NamedTuple` or :class:`typing.TypedDict` class, and deprecate passing " @@ -2840,7 +2848,7 @@ msgid "" "Alex Waygood in :gh:`105566` and :gh:`105570`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1918 +#: ../../whatsnew/3.13.rst:1922 msgid "" "Deprecate the :func:`typing.no_type_check_decorator` decorator function, to " "be removed in in Python 3.15. After eight years in the :mod:`typing` module, " @@ -2848,7 +2856,7 @@ msgid "" "Waygood in :gh:`106309`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1924 +#: ../../whatsnew/3.13.rst:1928 msgid "" "Deprecate :data:`typing.AnyStr`. In Python 3.16, it will be removed from " "``typing.__all__``, and a :exc:`DeprecationWarning` will be emitted at " @@ -2857,12 +2865,12 @@ msgid "" "(Contributed by Michael The in :gh:`107116`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1932 -#: ../../deprecations/pending-removal-in-3.15.rst:66 +#: ../../whatsnew/3.13.rst:1936 +#: ../../deprecations/pending-removal-in-3.15.rst:75 msgid ":mod:`wave`:" msgstr ":mod:`wave`:" -#: ../../whatsnew/3.13.rst:1934 +#: ../../whatsnew/3.13.rst:1938 msgid "" "Deprecate the :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:" "`~wave.Wave_read.getmarkers` methods of the :class:`~wave.Wave_read` and :" @@ -2876,6 +2884,22 @@ msgid "Pending Removal in Python 3.14" msgstr "Python 3.14 中待移除的項目" #: ../../deprecations/pending-removal-in-3.14.rst:4 +#: ../../deprecations/pending-removal-in-3.15.rst:4 +msgid "The import system:" +msgstr "引入系統 (import system):" + +#: ../../deprecations/pending-removal-in-3.14.rst:6 +msgid "" +"Setting :attr:`~module.__loader__` on a module while failing to set :attr:" +"`__spec__.loader ` is deprecated. In " +"Python 3.14, :attr:`!__loader__` will cease to be set or taken into " +"consideration by the import system or the standard library." +msgstr "" +"在模組上設定 :attr:`~module.__loader__` 而沒有設定 :attr:`__spec__.loader " +"` 的做法已被棄用。在 Python 3.14 中," +"引入系統或標準函式庫將不再設定或考慮 :attr:`!__loader__` 。" + +#: ../../deprecations/pending-removal-in-3.14.rst:11 msgid "" ":mod:`argparse`: The *type*, *choices*, and *metavar* parameters of :class:`!" "argparse.BooleanOptionalAction` are deprecated and will be removed in 3.14. " @@ -2885,7 +2909,7 @@ msgstr "" "*choices* 和 *metavar* 參數已被棄用,將在 3.14 中移除。 (由 Nikita Sobolev " "於 :gh:`92248` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:9 +#: ../../deprecations/pending-removal-in-3.14.rst:16 msgid "" ":mod:`ast`: The following features have been deprecated in documentation " "since Python 3.8, now cause a :exc:`DeprecationWarning` to be emitted at " @@ -2894,38 +2918,38 @@ msgstr "" ":mod:`ast`:自 Python 3.8 起,下列功能已在文件中被棄用,現在在存取或使用時會" "於 runtime 發出 :exc:`DeprecationWarning`,並將在 Python 3.14 中移除:" -#: ../../deprecations/pending-removal-in-3.14.rst:13 +#: ../../deprecations/pending-removal-in-3.14.rst:20 msgid ":class:`!ast.Num`" msgstr ":class:`!ast.Num`" -#: ../../deprecations/pending-removal-in-3.14.rst:14 +#: ../../deprecations/pending-removal-in-3.14.rst:21 msgid ":class:`!ast.Str`" msgstr ":class:`!ast.Str`" -#: ../../deprecations/pending-removal-in-3.14.rst:15 +#: ../../deprecations/pending-removal-in-3.14.rst:22 msgid ":class:`!ast.Bytes`" msgstr ":class:`!ast.Bytes`" -#: ../../deprecations/pending-removal-in-3.14.rst:16 +#: ../../deprecations/pending-removal-in-3.14.rst:23 msgid ":class:`!ast.NameConstant`" msgstr ":class:`!ast.NameConstant`" -#: ../../deprecations/pending-removal-in-3.14.rst:17 +#: ../../deprecations/pending-removal-in-3.14.rst:24 msgid ":class:`!ast.Ellipsis`" msgstr ":class:`!ast.Ellipsis`" -#: ../../deprecations/pending-removal-in-3.14.rst:19 +#: ../../deprecations/pending-removal-in-3.14.rst:26 msgid "" "Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka in :gh:" "`90953`.)" msgstr "" "請改用 :class:`ast.Constant`。(由 Serhiy Storchaka 於 :gh:`90953` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:22 +#: ../../deprecations/pending-removal-in-3.14.rst:29 msgid ":mod:`asyncio`:" msgstr ":mod:`asyncio`:" -#: ../../deprecations/pending-removal-in-3.14.rst:24 +#: ../../deprecations/pending-removal-in-3.14.rst:31 msgid "" "The child watcher classes :class:`~asyncio.MultiLoopChildWatcher`, :class:" "`~asyncio.FastChildWatcher`, :class:`~asyncio.AbstractChildWatcher` and :" @@ -2937,7 +2961,7 @@ msgstr "" "AbstractChildWatcher` 和 :class:`~asyncio.SafeChildWatcher`。 (由 Kumar " "Aditya 於 :gh:`94597` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:30 +#: ../../deprecations/pending-removal-in-3.14.rst:37 msgid "" ":func:`asyncio.set_child_watcher`, :func:`asyncio.get_child_watcher`, :meth:" "`asyncio.AbstractEventLoopPolicy.set_child_watcher` and :meth:`asyncio." @@ -2949,7 +2973,7 @@ msgstr "" "AbstractEventLoopPolicy.get_child_watcher` 已被棄用並將在 Python 3.14 中移" "除。(由 Kumar Aditya 於 :gh:`94597` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:36 +#: ../../deprecations/pending-removal-in-3.14.rst:43 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 " @@ -2960,7 +2984,7 @@ msgstr "" "件迴圈且決定建立一個時發出 :exc:`DeprecationWarning`。 (由 Serhiy Storchaka " "和 Guido van Rossum 於 :gh:`100160` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:41 +#: ../../deprecations/pending-removal-in-3.14.rst:48 msgid "" ":mod:`collections.abc`: Deprecated :class:`~collections.abc.ByteString`. " "Prefer :class:`!Sequence` or :class:`~collections.abc.Buffer`. For use in " @@ -2972,7 +2996,7 @@ msgstr "" "改用聯集,如 ``bytes | bytearray``,或 :class:`collections.abc.Buffer`。(由 " "Shantanu Jain 於 :gh:`91896` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:47 +#: ../../deprecations/pending-removal-in-3.14.rst:54 msgid "" ":mod:`email`: Deprecated the *isdst* parameter in :func:`email.utils." "localtime`. (Contributed by Alan Williams in :gh:`72346`.)" @@ -2980,39 +3004,39 @@ msgstr "" ":mod:`email`:已棄用 :func:`email.utils.localtime` 中的 *isdst* 參數。(由 " "Alan Williams 於 :gh:`72346` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:50 +#: ../../deprecations/pending-removal-in-3.14.rst:57 msgid ":mod:`importlib.abc` deprecated classes:" msgstr ":mod:`importlib.abc` 的已棄用類別:" -#: ../../deprecations/pending-removal-in-3.14.rst:52 +#: ../../deprecations/pending-removal-in-3.14.rst:59 msgid ":class:`!importlib.abc.ResourceReader`" msgstr ":class:`!importlib.abc.ResourceReader`" -#: ../../deprecations/pending-removal-in-3.14.rst:53 +#: ../../deprecations/pending-removal-in-3.14.rst:60 msgid ":class:`!importlib.abc.Traversable`" msgstr ":class:`!importlib.abc.Traversable`" -#: ../../deprecations/pending-removal-in-3.14.rst:54 +#: ../../deprecations/pending-removal-in-3.14.rst:61 msgid ":class:`!importlib.abc.TraversableResources`" msgstr ":class:`!importlib.abc.TraversableResources`" -#: ../../deprecations/pending-removal-in-3.14.rst:56 +#: ../../deprecations/pending-removal-in-3.14.rst:63 msgid "Use :mod:`importlib.resources.abc` classes instead:" msgstr "請改用 :mod:`importlib.resources.abc` 類別:" -#: ../../deprecations/pending-removal-in-3.14.rst:58 +#: ../../deprecations/pending-removal-in-3.14.rst:65 msgid ":class:`importlib.resources.abc.Traversable`" msgstr ":class:`importlib.resources.abc.Traversable`" -#: ../../deprecations/pending-removal-in-3.14.rst:59 +#: ../../deprecations/pending-removal-in-3.14.rst:66 msgid ":class:`importlib.resources.abc.TraversableResources`" msgstr ":class:`importlib.resources.abc.TraversableResources`" -#: ../../deprecations/pending-removal-in-3.14.rst:61 +#: ../../deprecations/pending-removal-in-3.14.rst:68 msgid "(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)" msgstr "(由 Jason R. Coombs 和 Hugo van Kemenade 貢獻於 :gh:`93963`。)" -#: ../../deprecations/pending-removal-in-3.14.rst:63 +#: ../../deprecations/pending-removal-in-3.14.rst:70 msgid "" ":mod:`itertools` had undocumented, inefficient, historically buggy, and " "inconsistent support for copy, deepcopy, and pickle operations. This will be " @@ -3023,7 +3047,7 @@ msgstr "" "deepcopy 和 pickle 操作支援。將在 3.14 中移除以大幅減少程式碼量和維護負擔。 " "(由 Raymond Hettinger 於 :gh:`101588` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:69 +#: ../../deprecations/pending-removal-in-3.14.rst:76 msgid "" ":mod:`multiprocessing`: The default start method will change to a safer one " "on Linux, BSDs, and other non-macOS POSIX platforms where ``'fork'`` is " @@ -3040,7 +3064,7 @@ msgstr "" "API 來明確指定你的程式碼何時\\ *需要* ``'fork'``。請參閱 :ref:" "`multiprocessing-start-methods`。" -#: ../../deprecations/pending-removal-in-3.14.rst:77 +#: ../../deprecations/pending-removal-in-3.14.rst:84 msgid "" ":mod:`pathlib`: :meth:`~pathlib.PurePath.is_relative_to` and :meth:`~pathlib." "PurePath.relative_to`: passing additional arguments is deprecated." @@ -3048,7 +3072,7 @@ msgstr "" ":mod:`pathlib`:已棄用 :meth:`~pathlib.PurePath.is_relative_to` 和 :meth:" "`~pathlib.PurePath.relative_to`:額外引數的傳遞已被棄用。" -#: ../../deprecations/pending-removal-in-3.14.rst:81 +#: ../../deprecations/pending-removal-in-3.14.rst:88 msgid "" ":mod:`pkgutil`: :func:`~pkgutil.find_loader` and :func:`~pkgutil.get_loader` " "now raise :exc:`DeprecationWarning`; use :func:`importlib.util.find_spec` " @@ -3058,23 +3082,23 @@ msgstr "" "現在會引發 :exc:`DeprecationWarning`;請改用 :func:`importlib.util." "find_spec`。 (由 Nikita Sobolev 於 :gh:`97850` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:86 +#: ../../deprecations/pending-removal-in-3.14.rst:93 msgid ":mod:`pty`:" msgstr ":mod:`pty`:" -#: ../../deprecations/pending-removal-in-3.14.rst:88 +#: ../../deprecations/pending-removal-in-3.14.rst:95 msgid "``master_open()``: use :func:`pty.openpty`." msgstr "``master_open()``:請用 :func:`pty.openpty`。" -#: ../../deprecations/pending-removal-in-3.14.rst:89 +#: ../../deprecations/pending-removal-in-3.14.rst:96 msgid "``slave_open()``: use :func:`pty.openpty`." msgstr "``slave_open()``:請用 :func:`pty.openpty`。" -#: ../../deprecations/pending-removal-in-3.14.rst:93 +#: ../../deprecations/pending-removal-in-3.14.rst:100 msgid ":data:`~sqlite3.version` and :data:`~sqlite3.version_info`." msgstr ":data:`~sqlite3.version` 和 :data:`~sqlite3.version_info`。" -#: ../../deprecations/pending-removal-in-3.14.rst:95 +#: ../../deprecations/pending-removal-in-3.14.rst:102 msgid "" ":meth:`~sqlite3.Cursor.execute` and :meth:`~sqlite3.Cursor.executemany` if :" "ref:`named placeholders ` are used and *parameters* is " @@ -3084,7 +3108,7 @@ msgstr "" "使用 :ref:`named placeholders ` 且 *parameters* 是序列" "而不是 :class:`dict`。" -#: ../../deprecations/pending-removal-in-3.14.rst:99 +#: ../../deprecations/pending-removal-in-3.14.rst:106 msgid "" "date and datetime adapter, date and timestamp converter: see the :mod:" "`sqlite3` documentation for suggested replacement recipes." @@ -3092,7 +3116,7 @@ msgstr "" "date 和 datetime 的適配器 (adapter)、date 和 timestamp 轉換器 (converter):請" "參閱 :mod:`sqlite3` 文件以獲得建議的替代方案。" -#: ../../deprecations/pending-removal-in-3.14.rst:102 +#: ../../deprecations/pending-removal-in-3.14.rst:109 msgid "" ":class:`types.CodeType`: Accessing :attr:`~codeobject.co_lnotab` was " "deprecated in :pep:`626` since 3.10 and was planned to be removed in 3.12, " @@ -3104,7 +3128,7 @@ msgstr "" "exc:`DeprecationWarning`。可能在 3.14 中移除。(由 Nikita Sobolev 於 :gh:" "`101866` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:109 +#: ../../deprecations/pending-removal-in-3.14.rst:116 msgid "" ":mod:`typing`: :class:`~typing.ByteString`, deprecated since Python 3.9, now " "causes a :exc:`DeprecationWarning` to be emitted when it is used." @@ -3112,7 +3136,7 @@ msgstr "" ":mod:`typing`:自 Python 3.9 起已被棄用的 :class:`~typing.ByteString` 現在在" "使用時會發出 :exc:`DeprecationWarning`。" -#: ../../deprecations/pending-removal-in-3.14.rst:112 +#: ../../deprecations/pending-removal-in-3.14.rst:119 msgid "" ":mod:`urllib`: :class:`!urllib.parse.Quoter` is deprecated: it was not " "intended to be a public API. (Contributed by Gregory P. Smith in :gh:" @@ -3128,12 +3152,34 @@ msgstr "Python 3.15 中待移除的項目" #: ../../deprecations/pending-removal-in-3.15.rst:6 msgid "" +"Setting :attr:`~module.__cached__` on a module while failing to set :attr:" +"`__spec__.cached ` is deprecated. In " +"Python 3.15, :attr:`!__cached__` will cease to be set or take into " +"consideration by the import system or standard library. (:gh:`97879`)" +msgstr "" +"在模組上設定 :attr:`~module.__cached__` 而沒有設定 :attr:`__spec__.cached " +"` 的做法已被棄用。在 Python 3.15 中," +"引入系統或標準函式庫將不再設定或考慮 :attr:`!__cached__`。(:gh:`97879`)" + +#: ../../deprecations/pending-removal-in-3.15.rst:11 +msgid "" +"Setting :attr:`~module.__package__` on a module while failing to set :attr:" +"`__spec__.parent ` is deprecated. In " +"Python 3.15, :attr:`!__package__` will cease to be set or take into " +"consideration by the import system or standard library. (:gh:`97879`)" +msgstr "" +"在模組上設定 :attr:`~module.__package__` 而沒有設定 :attr:`__spec__.parent " +"` 的做法已被棄用。在 Python 3.15 中," +"引入系統或標準函式庫將不再設定或考慮 :attr:`!__package__`。(:gh:`97879`)" + +#: ../../deprecations/pending-removal-in-3.15.rst:18 +msgid "" "The undocumented :func:`!ctypes.SetPointerType` function has been deprecated " "since Python 3.13." msgstr "" "自 Python 3.13 起,未記錄的 :func:`!ctypes.SetPointerType` 函式已被棄用。" -#: ../../deprecations/pending-removal-in-3.15.rst:11 +#: ../../deprecations/pending-removal-in-3.15.rst:23 msgid "" "The obsolete and rarely used :class:`~http.server.CGIHTTPRequestHandler` has " "been deprecated since Python 3.13. No direct replacement exists. *Anything* " @@ -3143,7 +3189,7 @@ msgstr "" "起已被棄用。不存在直接的替代。*任何東西*\\ 都比 CGI 更好地將 Web 伺服器與請求" "處理程序介接起來。" -#: ../../deprecations/pending-removal-in-3.15.rst:17 +#: ../../deprecations/pending-removal-in-3.15.rst:29 msgid "" "The :option:`!--cgi` flag to the :program:`python -m http.server` command-" "line interface has been deprecated since Python 3.13." @@ -3151,19 +3197,11 @@ msgstr "" "自 Python 3.13 起,:program:`python -m http.server` 命令列介面的 :option:`!--" "cgi` 旗標已被棄用。" -#: ../../deprecations/pending-removal-in-3.15.rst:20 -msgid "" -":mod:`importlib`: ``__package__`` and ``__cached__`` will cease to be set or " -"taken into consideration by the import system (:gh:`97879`)." -msgstr "" -":mod:`importlib`:``__package__`` 和 ``__cached__`` 將不再被設定或被 import " -"系統考慮。 (:gh:`97879`)" - -#: ../../deprecations/pending-removal-in-3.15.rst:23 +#: ../../deprecations/pending-removal-in-3.15.rst:32 msgid ":class:`locale`:" msgstr ":class:`locale`:" -#: ../../deprecations/pending-removal-in-3.15.rst:25 +#: ../../deprecations/pending-removal-in-3.15.rst:34 msgid "" "The :func:`~locale.getdefaultlocale` function has been deprecated since " "Python 3.11. Its removal was originally planned for Python 3.13 (:gh:" @@ -3176,7 +3214,7 @@ msgstr "" "`~locale.getlocale`、:func:`~locale.setlocale` 和 :func:`~locale." "getencoding`。 (由 Hugo van Kemenade 於 :gh:`111187` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.15.rst:35 +#: ../../deprecations/pending-removal-in-3.15.rst:44 msgid "" ":meth:`.PurePath.is_reserved` has been deprecated since Python 3.13. Use :" "func:`os.path.isreserved` to detect reserved paths on Windows." @@ -3184,7 +3222,7 @@ msgstr "" ":meth:`.PurePath.is_reserved` 已自 Python 3.13 被棄用。請用 :func:`os.path." "isreserved` 來偵測 Windows 上的保留路徑。" -#: ../../deprecations/pending-removal-in-3.15.rst:41 +#: ../../deprecations/pending-removal-in-3.15.rst:50 msgid "" ":func:`~platform.java_ver` has been deprecated since Python 3.13. This " "function is only useful for Jython support, has a confusing API, and is " @@ -3193,11 +3231,11 @@ msgstr "" "自 Python 3.13 起,:func:`~platform.java_ver` 已被棄用。此函式僅對 Jython 支" "援有用,具有令人困惑的 API,基本上未經測試。" -#: ../../deprecations/pending-removal-in-3.15.rst:45 +#: ../../deprecations/pending-removal-in-3.15.rst:54 msgid ":mod:`threading`:" msgstr ":mod:`threading`:" -#: ../../deprecations/pending-removal-in-3.15.rst:47 +#: ../../deprecations/pending-removal-in-3.15.rst:56 msgid "" ":func:`~threading.RLock` will take no arguments in Python 3.15. Passing any " "arguments has been deprecated since Python 3.14, as the Python version does " @@ -3208,7 +3246,7 @@ msgstr "" "起,傳遞任何引數的用法已被棄用,因為 Python 版本不允許任何引數,但 C 版本允許" "任意數量的位置或關鍵字引數,並忽略每個引數。" -#: ../../deprecations/pending-removal-in-3.15.rst:55 +#: ../../deprecations/pending-removal-in-3.15.rst:64 msgid "" "The undocumented keyword argument syntax for creating :class:`~typing." "NamedTuple` classes (e.g. ``Point = NamedTuple(\"Point\", x=int, y=int)``) " @@ -3219,7 +3257,7 @@ msgstr "" "(``Point = NamedTuple(\"Point\", x=int, y=int)``) 已自 Python 3.13 棄用。請改" "用基於類別的語法或函式語法 (functional syntax)。" -#: ../../deprecations/pending-removal-in-3.15.rst:61 +#: ../../deprecations/pending-removal-in-3.15.rst:70 msgid "" "The :func:`typing.no_type_check_decorator` decorator function has been " "deprecated since Python 3.13. After eight years in the :mod:`typing` module, " @@ -3229,7 +3267,7 @@ msgstr "" "用。在 :mod:`typing` 模組中使用了八年之後,它尚未得到任何主要型別檢查器的支" "援。" -#: ../../deprecations/pending-removal-in-3.15.rst:68 +#: ../../deprecations/pending-removal-in-3.15.rst:77 msgid "" "The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:`~wave." "Wave_read.getmarkers` methods of the :class:`~wave.Wave_read` and :class:" @@ -3480,6 +3518,8 @@ msgid "" ":mod:`logging`: the ``warn()`` method has been deprecated since Python 3.3, " "use :meth:`~logging.warning` instead." msgstr "" +":mod:`logging`:自 Python 3.3 起,``warn()`` 方法已被棄用,請改用 :meth:" +"`~logging.warning`。" #: ../../deprecations/pending-removal-in-future.rst:72 msgid "" @@ -3728,11 +3768,11 @@ msgstr "" ":meth:`zipimport.zipimporter.load_module` 已被棄用:請改用 :meth:`~zipimport." "zipimporter.exec_module`。" -#: ../../whatsnew/3.13.rst:1951 +#: ../../whatsnew/3.13.rst:1955 msgid "CPython Bytecode Changes" msgstr "" -#: ../../whatsnew/3.13.rst:1953 +#: ../../whatsnew/3.13.rst:1957 msgid "" "The oparg of :opcode:`YIELD_VALUE` is now ``1`` if the yield is part of a " "yield-from or await, and ``0`` otherwise. The oparg of :opcode:`RESUME` was " @@ -3741,97 +3781,97 @@ msgid "" "`111354`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1961 +#: ../../whatsnew/3.13.rst:1965 msgid "C API Changes" msgstr "C API 變更" -#: ../../whatsnew/3.13.rst:1966 +#: ../../whatsnew/3.13.rst:1970 msgid "" "Add the :ref:`PyMonitoring C API ` for generating :pep:" "`669` monitoring events:" msgstr "" -#: ../../whatsnew/3.13.rst:1969 +#: ../../whatsnew/3.13.rst:1973 msgid ":c:type:`PyMonitoringState`" msgstr ":c:type:`PyMonitoringState`" -#: ../../whatsnew/3.13.rst:1970 +#: ../../whatsnew/3.13.rst:1974 msgid ":c:func:`PyMonitoring_FirePyStartEvent`" msgstr ":c:func:`PyMonitoring_FirePyStartEvent`" -#: ../../whatsnew/3.13.rst:1971 +#: ../../whatsnew/3.13.rst:1975 msgid ":c:func:`PyMonitoring_FirePyResumeEvent`" msgstr ":c:func:`PyMonitoring_FirePyResumeEvent`" -#: ../../whatsnew/3.13.rst:1972 +#: ../../whatsnew/3.13.rst:1976 msgid ":c:func:`PyMonitoring_FirePyReturnEvent`" msgstr ":c:func:`PyMonitoring_FirePyReturnEvent`" -#: ../../whatsnew/3.13.rst:1973 +#: ../../whatsnew/3.13.rst:1977 msgid ":c:func:`PyMonitoring_FirePyYieldEvent`" msgstr ":c:func:`PyMonitoring_FirePyYieldEvent`" -#: ../../whatsnew/3.13.rst:1974 +#: ../../whatsnew/3.13.rst:1978 msgid ":c:func:`PyMonitoring_FireCallEvent`" msgstr ":c:func:`PyMonitoring_FireCallEvent`" -#: ../../whatsnew/3.13.rst:1975 +#: ../../whatsnew/3.13.rst:1979 msgid ":c:func:`PyMonitoring_FireLineEvent`" msgstr ":c:func:`PyMonitoring_FireLineEvent`" -#: ../../whatsnew/3.13.rst:1976 +#: ../../whatsnew/3.13.rst:1980 msgid ":c:func:`PyMonitoring_FireJumpEvent`" msgstr ":c:func:`PyMonitoring_FireJumpEvent`" -#: ../../whatsnew/3.13.rst:1977 +#: ../../whatsnew/3.13.rst:1981 msgid ":c:func:`PyMonitoring_FireBranchEvent`" msgstr ":c:func:`PyMonitoring_FireBranchEvent`" -#: ../../whatsnew/3.13.rst:1978 +#: ../../whatsnew/3.13.rst:1982 msgid ":c:func:`PyMonitoring_FireCReturnEvent`" msgstr ":c:func:`PyMonitoring_FireCReturnEvent`" -#: ../../whatsnew/3.13.rst:1979 +#: ../../whatsnew/3.13.rst:1983 msgid ":c:func:`PyMonitoring_FirePyThrowEvent`" msgstr ":c:func:`PyMonitoring_FirePyThrowEvent`" -#: ../../whatsnew/3.13.rst:1980 +#: ../../whatsnew/3.13.rst:1984 msgid ":c:func:`PyMonitoring_FireRaiseEvent`" msgstr ":c:func:`PyMonitoring_FireRaiseEvent`" -#: ../../whatsnew/3.13.rst:1981 +#: ../../whatsnew/3.13.rst:1985 msgid ":c:func:`PyMonitoring_FireCRaiseEvent`" msgstr ":c:func:`PyMonitoring_FireCRaiseEvent`" -#: ../../whatsnew/3.13.rst:1982 +#: ../../whatsnew/3.13.rst:1986 msgid ":c:func:`PyMonitoring_FireReraiseEvent`" msgstr ":c:func:`PyMonitoring_FireReraiseEvent`" -#: ../../whatsnew/3.13.rst:1983 +#: ../../whatsnew/3.13.rst:1987 msgid ":c:func:`PyMonitoring_FireExceptionHandledEvent`" msgstr ":c:func:`PyMonitoring_FireExceptionHandledEvent`" -#: ../../whatsnew/3.13.rst:1984 +#: ../../whatsnew/3.13.rst:1988 msgid ":c:func:`PyMonitoring_FirePyUnwindEvent`" msgstr ":c:func:`PyMonitoring_FirePyUnwindEvent`" -#: ../../whatsnew/3.13.rst:1985 +#: ../../whatsnew/3.13.rst:1989 msgid ":c:func:`PyMonitoring_FireStopIterationEvent`" msgstr ":c:func:`PyMonitoring_FireStopIterationEvent`" -#: ../../whatsnew/3.13.rst:1986 +#: ../../whatsnew/3.13.rst:1990 msgid ":c:func:`PyMonitoring_EnterScope`" msgstr ":c:func:`PyMonitoring_EnterScope`" -#: ../../whatsnew/3.13.rst:1987 +#: ../../whatsnew/3.13.rst:1991 msgid ":c:func:`PyMonitoring_ExitScope`" msgstr ":c:func:`PyMonitoring_ExitScope`" -#: ../../whatsnew/3.13.rst:1989 +#: ../../whatsnew/3.13.rst:1993 msgid "(Contributed by Irit Katriel in :gh:`111997`)." msgstr "" -#: ../../whatsnew/3.13.rst:1991 +#: ../../whatsnew/3.13.rst:1995 msgid "" "Add :c:type:`PyMutex`, a lightweight mutex that occupies a single byte, and " "the new :c:func:`PyMutex_Lock` and :c:func:`PyMutex_Unlock` functions. :c:" @@ -3839,52 +3879,52 @@ msgid "" "operation needs to block. (Contributed by Sam Gross in :gh:`108724`.)" msgstr "" -#: ../../whatsnew/3.13.rst:1997 +#: ../../whatsnew/3.13.rst:2001 msgid "" "Add the :ref:`PyTime C API ` to provide access to system clocks:" msgstr "" -#: ../../whatsnew/3.13.rst:1999 +#: ../../whatsnew/3.13.rst:2003 msgid ":c:type:`PyTime_t`." msgstr ":c:type:`PyTime_t`。" -#: ../../whatsnew/3.13.rst:2000 +#: ../../whatsnew/3.13.rst:2004 msgid ":c:var:`PyTime_MIN` and :c:var:`PyTime_MAX`." msgstr "" -#: ../../whatsnew/3.13.rst:2001 +#: ../../whatsnew/3.13.rst:2005 msgid ":c:func:`PyTime_AsSecondsDouble`." msgstr ":c:func:`PyTime_AsSecondsDouble`。" -#: ../../whatsnew/3.13.rst:2002 +#: ../../whatsnew/3.13.rst:2006 msgid ":c:func:`PyTime_Monotonic`." msgstr ":c:func:`PyTime_Monotonic`。" -#: ../../whatsnew/3.13.rst:2003 +#: ../../whatsnew/3.13.rst:2007 msgid ":c:func:`PyTime_MonotonicRaw`." msgstr ":c:func:`PyTime_MonotonicRaw`。" -#: ../../whatsnew/3.13.rst:2004 +#: ../../whatsnew/3.13.rst:2008 msgid ":c:func:`PyTime_PerfCounter`." msgstr ":c:func:`PyTime_PerfCounter`。" -#: ../../whatsnew/3.13.rst:2005 +#: ../../whatsnew/3.13.rst:2009 msgid ":c:func:`PyTime_PerfCounterRaw`." msgstr ":c:func:`PyTime_PerfCounterRaw`。" -#: ../../whatsnew/3.13.rst:2006 +#: ../../whatsnew/3.13.rst:2010 msgid ":c:func:`PyTime_Time`." msgstr ":c:func:`PyTime_Time`。" -#: ../../whatsnew/3.13.rst:2007 +#: ../../whatsnew/3.13.rst:2011 msgid ":c:func:`PyTime_TimeRaw`." msgstr ":c:func:`PyTime_TimeRaw`。" -#: ../../whatsnew/3.13.rst:2009 +#: ../../whatsnew/3.13.rst:2013 msgid "(Contributed by Victor Stinner and Petr Viktorin in :gh:`110850`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2011 +#: ../../whatsnew/3.13.rst:2015 msgid "" "Add the :c:func:`PyDict_ContainsString` function with the same behavior as :" "c:func:`PyDict_Contains`, but *key* is specified as a :c:expr:`const char*` " @@ -3892,7 +3932,7 @@ msgid "" "by Victor Stinner in :gh:`108314`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2017 +#: ../../whatsnew/3.13.rst:2021 msgid "" "Add the :c:func:`PyDict_GetItemRef` and :c:func:`PyDict_GetItemStringRef` " "functions, which behave similarly to :c:func:`PyDict_GetItemWithError`, but " @@ -3902,7 +3942,7 @@ msgid "" "`106004`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2025 +#: ../../whatsnew/3.13.rst:2029 msgid "" "Add the :c:func:`PyDict_SetDefaultRef` function, which behaves similarly to :" "c:func:`PyDict_SetDefault`, but returns a :term:`strong reference` instead " @@ -3911,7 +3951,7 @@ msgid "" "dictionary. (Contributed by Sam Gross in :gh:`112066`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2033 +#: ../../whatsnew/3.13.rst:2037 msgid "" "Add the :c:func:`PyDict_Pop` and :c:func:`PyDict_PopString` functions to " "remove a key from a dictionary and optionally return the removed value. This " @@ -3920,7 +3960,7 @@ msgid "" "Victor Stinner in :gh:`111262`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2040 +#: ../../whatsnew/3.13.rst:2044 msgid "" "Add the :c:func:`PyMapping_GetOptionalItem` and :c:func:" "`PyMapping_GetOptionalItemString` functions as alternatives to :c:func:" @@ -3931,7 +3971,7 @@ msgid "" "gh:`106307`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2050 +#: ../../whatsnew/3.13.rst:2054 msgid "" "Add the :c:func:`PyObject_GetOptionalAttr` and :c:func:" "`PyObject_GetOptionalAttrString` functions as alternatives to :c:func:" @@ -3942,37 +3982,37 @@ msgid "" "Serhiy Storchaka in :gh:`106521`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2060 +#: ../../whatsnew/3.13.rst:2064 msgid "" "Add the :c:func:`PyErr_FormatUnraisable` function as an extension to :c:func:" "`PyErr_WriteUnraisable` that allows customizing the warning message. " "(Contributed by Serhiy Storchaka in :gh:`108082`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2065 +#: ../../whatsnew/3.13.rst:2069 msgid "" "Add new functions that return a :term:`strong reference` instead of a :term:" "`borrowed reference` for frame locals, globals, and builtins, as part of :" "ref:`PEP 667 `:" msgstr "" -#: ../../whatsnew/3.13.rst:2069 +#: ../../whatsnew/3.13.rst:2073 msgid ":c:func:`PyEval_GetFrameBuiltins` replaces :c:func:`PyEval_GetBuiltins`" -msgstr "" +msgstr ":c:func:`PyEval_GetFrameBuiltins` 取代 :c:func:`PyEval_GetBuiltins`" -#: ../../whatsnew/3.13.rst:2070 +#: ../../whatsnew/3.13.rst:2074 msgid ":c:func:`PyEval_GetFrameGlobals` replaces :c:func:`PyEval_GetGlobals`" -msgstr "" +msgstr ":c:func:`PyEval_GetFrameGlobals` 取代 :c:func:`PyEval_GetGlobals`" -#: ../../whatsnew/3.13.rst:2071 +#: ../../whatsnew/3.13.rst:2075 msgid ":c:func:`PyEval_GetFrameLocals` replaces :c:func:`PyEval_GetLocals`" -msgstr "" +msgstr ":c:func:`PyEval_GetFrameLocals` 取代 :c:func:`PyEval_GetLocals`" -#: ../../whatsnew/3.13.rst:2073 +#: ../../whatsnew/3.13.rst:2077 msgid "(Contributed by Mark Shannon and Tian Gao in :gh:`74929`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2075 +#: ../../whatsnew/3.13.rst:2079 msgid "" "Add the :c:func:`Py_GetConstant` and :c:func:`Py_GetConstantBorrowed` " "functions to get :term:`strong ` or :term:`borrowed " @@ -3981,7 +4021,7 @@ msgid "" "constant zero. (Contributed by Victor Stinner in :gh:`115754`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2082 +#: ../../whatsnew/3.13.rst:2086 msgid "" "Add the :c:func:`PyImport_AddModuleRef` function as a replacement for :c:" "func:`PyImport_AddModule` that returns a :term:`strong reference` instead of " @@ -3989,35 +4029,35 @@ msgid "" "`105922`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2087 +#: ../../whatsnew/3.13.rst:2091 msgid "" "Add the :c:func:`Py_IsFinalizing` function to check whether the main Python " "interpreter is :term:`shutting down `. (Contributed by " "Victor Stinner in :gh:`108014`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2092 +#: ../../whatsnew/3.13.rst:2096 msgid "" "Add the :c:func:`PyList_GetItemRef` function as a replacement for :c:func:" "`PyList_GetItem` that returns a :term:`strong reference` instead of a :term:" "`borrowed reference`. (Contributed by Sam Gross in :gh:`114329`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2097 +#: ../../whatsnew/3.13.rst:2101 msgid "" "Add the :c:func:`PyList_Extend` and :c:func:`PyList_Clear` functions, " "mirroring the Python :meth:`!list.extend` and :meth:`!list.clear` methods. " "(Contributed by Victor Stinner in :gh:`111138`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2101 +#: ../../whatsnew/3.13.rst:2105 msgid "" "Add the :c:func:`PyLong_AsInt` function. It behaves similarly to :c:func:" "`PyLong_AsLong`, but stores the result in a C :c:expr:`int` instead of a C :" "c:expr:`long`. (Contributed by Victor Stinner in :gh:`108014`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2106 +#: ../../whatsnew/3.13.rst:2110 msgid "" "Add the :c:func:`PyLong_AsNativeBytes`, :c:func:`PyLong_FromNativeBytes`, " "and :c:func:`PyLong_FromUnsignedNativeBytes` functions to simplify " @@ -4025,27 +4065,27 @@ msgid "" "(Contributed by Steve Dower in :gh:`111140`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2112 +#: ../../whatsnew/3.13.rst:2116 msgid "" "Add :c:func:`PyModule_Add` function, which is similar to :c:func:" "`PyModule_AddObjectRef` and :c:func:`PyModule_AddObject`, but always steals " "a reference to the value. (Contributed by Serhiy Storchaka in :gh:`86493`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2117 +#: ../../whatsnew/3.13.rst:2121 msgid "" "Add the :c:func:`PyObject_GenericHash` function that implements the default " "hashing function of a Python object. (Contributed by Serhiy Storchaka in :gh:" "`113024`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2121 +#: ../../whatsnew/3.13.rst:2125 msgid "" "Add the :c:func:`Py_HashPointer` function to hash a raw pointer. " "(Contributed by Victor Stinner in :gh:`111545`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2124 +#: ../../whatsnew/3.13.rst:2128 msgid "" "Add the :c:func:`PyObject_VisitManagedDict` and :c:func:" "`PyObject_ClearManagedDict` functions. which must be called by the traverse " @@ -4054,7 +4094,7 @@ msgid "" "with Python 3.11 and 3.12. (Contributed by Victor Stinner in :gh:`107073`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2132 +#: ../../whatsnew/3.13.rst:2136 msgid "" "Add the :c:func:`PyRefTracer_SetTracer` and :c:func:`PyRefTracer_GetTracer` " "functions, which enable tracking object creation and destruction in the same " @@ -4062,14 +4102,14 @@ msgid "" "in :gh:`93502`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2138 +#: ../../whatsnew/3.13.rst:2142 msgid "" "Add the :c:func:`PySys_AuditTuple` function as an alternative to :c:func:" "`PySys_Audit` that takes event arguments as a Python :class:`tuple` object. " "(Contributed by Victor Stinner in :gh:`85283`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2143 +#: ../../whatsnew/3.13.rst:2147 msgid "" "Add the :c:func:`PyThreadState_GetUnchecked()` function as an alternative " "to :c:func:`PyThreadState_Get()` that doesn't kill the process with a fatal " @@ -4077,7 +4117,7 @@ msgid "" "result is ``NULL``. (Contributed by Victor Stinner in :gh:`108867`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2149 +#: ../../whatsnew/3.13.rst:2153 msgid "" "Add the :c:func:`PyType_GetFullyQualifiedName` function to get the type's " "fully qualified name. The module name is prepended if :attr:`type." @@ -4085,14 +4125,14 @@ msgid "" "``'__main__'``. (Contributed by Victor Stinner in :gh:`111696`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2155 +#: ../../whatsnew/3.13.rst:2159 msgid "" "Add the :c:func:`PyType_GetModuleName` function to get the type's module " "name. This is equivalent to getting the :attr:`type.__module__` attribute. " "(Contributed by Eric Snow and Victor Stinner in :gh:`111696`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2160 +#: ../../whatsnew/3.13.rst:2164 msgid "" "Add the :c:func:`PyUnicode_EqualToUTF8AndSize` and :c:func:" "`PyUnicode_EqualToUTF8` functions to compare a Unicode object with a :c:expr:" @@ -4101,7 +4141,7 @@ msgid "" "Storchaka in :gh:`110289`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2167 +#: ../../whatsnew/3.13.rst:2171 msgid "" "Add the :c:func:`PyWeakref_GetRef` function as an alternative to :c:func:" "`PyWeakref_GetObject` that returns a :term:`strong reference` or ``NULL`` if " @@ -4109,47 +4149,47 @@ msgid "" "`105927`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2173 +#: ../../whatsnew/3.13.rst:2177 msgid "Add fixed variants of functions which silently ignore errors:" msgstr "" -#: ../../whatsnew/3.13.rst:2175 +#: ../../whatsnew/3.13.rst:2179 msgid "" ":c:func:`PyObject_HasAttrWithError` replaces :c:func:`PyObject_HasAttr`." msgstr "" -#: ../../whatsnew/3.13.rst:2176 +#: ../../whatsnew/3.13.rst:2180 msgid "" ":c:func:`PyObject_HasAttrStringWithError` replaces :c:func:" "`PyObject_HasAttrString`." msgstr "" -#: ../../whatsnew/3.13.rst:2178 +#: ../../whatsnew/3.13.rst:2182 msgid "" ":c:func:`PyMapping_HasKeyWithError` replaces :c:func:`PyMapping_HasKey`." msgstr "" -#: ../../whatsnew/3.13.rst:2179 +#: ../../whatsnew/3.13.rst:2183 msgid "" ":c:func:`PyMapping_HasKeyStringWithError` replaces :c:func:" "`PyMapping_HasKeyString`." msgstr "" -#: ../../whatsnew/3.13.rst:2182 +#: ../../whatsnew/3.13.rst:2186 msgid "" "The new functions return ``-1`` for errors and the standard ``1`` for true " "and ``0`` for false." msgstr "" -#: ../../whatsnew/3.13.rst:2185 +#: ../../whatsnew/3.13.rst:2189 msgid "(Contributed by Serhiy Storchaka in :gh:`108511`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2189 +#: ../../whatsnew/3.13.rst:2193 msgid "Changed C APIs" msgstr "" -#: ../../whatsnew/3.13.rst:2191 +#: ../../whatsnew/3.13.rst:2195 msgid "" "The *keywords* parameter of :c:func:`PyArg_ParseTupleAndKeywords` and :c:" "func:`PyArg_VaParseTupleAndKeywords` now has type :c:expr:`char * const *` " @@ -4162,20 +4202,20 @@ msgid "" "`65210`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2203 +#: ../../whatsnew/3.13.rst:2207 msgid "" ":c:func:`PyArg_ParseTupleAndKeywords` now supports non-ASCII keyword " "parameter names. (Contributed by Serhiy Storchaka in :gh:`110815`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2207 +#: ../../whatsnew/3.13.rst:2211 msgid "" "The :c:func:`!PyCode_GetFirstFree` function is now unstable API and is now " "named :c:func:`PyUnstable_Code_GetFirstFree`. (Contributed by Bogdan " "Romanyuk in :gh:`115781`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2211 +#: ../../whatsnew/3.13.rst:2215 msgid "" "The :c:func:`PyDict_GetItem`, :c:func:`PyDict_GetItemString`, :c:func:" "`PyMapping_HasKey`, :c:func:`PyMapping_HasKeyString`, :c:func:" @@ -4186,35 +4226,35 @@ msgid "" "documentation. (Contributed by Serhiy Storchaka in :gh:`106672`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2220 +#: ../../whatsnew/3.13.rst:2224 msgid "" "Add support for the ``%T``, ``%#T``, ``%N`` and ``%#N`` formats to :c:func:" "`PyUnicode_FromFormat`:" msgstr "" -#: ../../whatsnew/3.13.rst:2223 +#: ../../whatsnew/3.13.rst:2227 msgid "``%T``: Get the fully qualified name of an object type" msgstr "" -#: ../../whatsnew/3.13.rst:2224 +#: ../../whatsnew/3.13.rst:2228 msgid "``%#T``: As above, but use a colon as the separator" msgstr "" -#: ../../whatsnew/3.13.rst:2225 +#: ../../whatsnew/3.13.rst:2229 msgid "``%N``: Get the fully qualified name of a type" msgstr "" -#: ../../whatsnew/3.13.rst:2226 +#: ../../whatsnew/3.13.rst:2230 msgid "``%#N``: As above, but use a colon as the separator" msgstr "" -#: ../../whatsnew/3.13.rst:2228 +#: ../../whatsnew/3.13.rst:2232 msgid "" "See :pep:`737` for more information. (Contributed by Victor Stinner in :gh:" "`111696`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2231 +#: ../../whatsnew/3.13.rst:2235 msgid "" "You no longer have to define the ``PY_SSIZE_T_CLEAN`` macro before " "including :file:`Python.h` when using ``#`` formats in :ref:`format codes " @@ -4223,7 +4263,7 @@ msgid "" "`104922`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2237 +#: ../../whatsnew/3.13.rst:2241 msgid "" "If Python is built in :ref:`debug mode ` or :option:`with " "assertions <--with-assertions>`, :c:func:`PyTuple_SET_ITEM` and :c:func:" @@ -4231,60 +4271,60 @@ msgid "" "(Contributed by Victor Stinner in :gh:`106168`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2245 +#: ../../whatsnew/3.13.rst:2249 msgid "Limited C API Changes" msgstr "" -#: ../../whatsnew/3.13.rst:2247 +#: ../../whatsnew/3.13.rst:2251 msgid "The following functions are now included in the Limited C API:" msgstr "" -#: ../../whatsnew/3.13.rst:2249 +#: ../../whatsnew/3.13.rst:2253 msgid ":c:func:`PyMem_RawMalloc`" msgstr ":c:func:`PyMem_RawMalloc`" -#: ../../whatsnew/3.13.rst:2250 +#: ../../whatsnew/3.13.rst:2254 msgid ":c:func:`PyMem_RawCalloc`" msgstr ":c:func:`PyMem_RawCalloc`" -#: ../../whatsnew/3.13.rst:2251 +#: ../../whatsnew/3.13.rst:2255 msgid ":c:func:`PyMem_RawRealloc`" msgstr ":c:func:`PyMem_RawRealloc`" -#: ../../whatsnew/3.13.rst:2252 +#: ../../whatsnew/3.13.rst:2256 msgid ":c:func:`PyMem_RawFree`" msgstr ":c:func:`PyMem_RawFree`" -#: ../../whatsnew/3.13.rst:2253 +#: ../../whatsnew/3.13.rst:2257 msgid ":c:func:`PySys_Audit`" msgstr ":c:func:`PySys_Audit`" -#: ../../whatsnew/3.13.rst:2254 +#: ../../whatsnew/3.13.rst:2258 msgid ":c:func:`PySys_AuditTuple`" msgstr ":c:func:`PySys_AuditTuple`" -#: ../../whatsnew/3.13.rst:2255 +#: ../../whatsnew/3.13.rst:2259 msgid ":c:func:`PyType_GetModuleByDef`" msgstr ":c:func:`PyType_GetModuleByDef`" -#: ../../whatsnew/3.13.rst:2257 +#: ../../whatsnew/3.13.rst:2261 msgid "" "(Contributed by Victor Stinner in :gh:`85283`, :gh:`85283`, and :gh:" "`116936`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2259 +#: ../../whatsnew/3.13.rst:2263 msgid "" "Python built with :option:`--with-trace-refs` (tracing references) now " "supports the :ref:`Limited API `. (Contributed by Victor " "Stinner in :gh:`108634`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2265 +#: ../../whatsnew/3.13.rst:2269 msgid "Removed C APIs" msgstr "" -#: ../../whatsnew/3.13.rst:2267 +#: ../../whatsnew/3.13.rst:2271 msgid "" "Remove several functions, macros, variables, etc with names prefixed by " "``_Py`` or ``_PY`` (which are considered private). If your project is " @@ -4294,13 +4334,13 @@ msgid "" "Victor Stinner. (Contributed by Victor Stinner in :gh:`106320`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2275 +#: ../../whatsnew/3.13.rst:2279 msgid "" "Remove old buffer protocols deprecated in Python 3.0. Use :ref:" "`bufferobjects` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2278 +#: ../../whatsnew/3.13.rst:2282 msgid "" ":c:func:`!PyObject_CheckReadBuffer`: Use :c:func:`PyObject_CheckBuffer` to " "test whether the object supports the buffer protocol. Note that :c:func:" @@ -4309,13 +4349,13 @@ msgid "" "example of :c:func:`PyObject_GetBuffer`." msgstr "" -#: ../../whatsnew/3.13.rst:2286 +#: ../../whatsnew/3.13.rst:2290 msgid "" ":c:func:`!PyObject_AsCharBuffer`, :c:func:`!PyObject_AsReadBuffer`: Use :c:" "func:`PyObject_GetBuffer` and :c:func:`PyBuffer_Release` instead:" msgstr "" -#: ../../whatsnew/3.13.rst:2289 +#: ../../whatsnew/3.13.rst:2293 msgid "" "Py_buffer view;\n" "if (PyObject_GetBuffer(obj, &view, PyBUF_SIMPLE) < 0) {\n" @@ -4326,13 +4366,13 @@ msgid "" "PyBuffer_Release(&view);" msgstr "" -#: ../../whatsnew/3.13.rst:2299 +#: ../../whatsnew/3.13.rst:2303 msgid "" ":c:func:`!PyObject_AsWriteBuffer`: Use :c:func:`PyObject_GetBuffer` and :c:" "func:`PyBuffer_Release` instead:" msgstr "" -#: ../../whatsnew/3.13.rst:2302 +#: ../../whatsnew/3.13.rst:2306 msgid "" "Py_buffer view;\n" "if (PyObject_GetBuffer(obj, &view, PyBUF_WRITABLE) < 0) {\n" @@ -4342,21 +4382,21 @@ msgid "" "PyBuffer_Release(&view);" msgstr "" -#: ../../whatsnew/3.13.rst:2311 +#: ../../whatsnew/3.13.rst:2315 msgid "(Contributed by Inada Naoki in :gh:`85275`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2313 +#: ../../whatsnew/3.13.rst:2317 msgid "Remove various functions deprecated in Python 3.9:" msgstr "" -#: ../../whatsnew/3.13.rst:2315 +#: ../../whatsnew/3.13.rst:2319 msgid "" ":c:func:`!PyEval_CallObject`, :c:func:`!PyEval_CallObjectWithKeywords`: Use :" "c:func:`PyObject_CallNoArgs` or :c:func:`PyObject_Call` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2320 +#: ../../whatsnew/3.13.rst:2324 msgid "" "In :c:func:`PyObject_Call`, positional arguments must be a :class:`tuple` " "and must not be ``NULL``, and keyword arguments must be a :class:`dict` or " @@ -4367,106 +4407,107 @@ msgid "" "`PyTuple_New(0) `." msgstr "" -#: ../../whatsnew/3.13.rst:2330 +#: ../../whatsnew/3.13.rst:2334 msgid "" ":c:func:`!PyEval_CallFunction`: Use :c:func:`PyObject_CallFunction` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2332 +#: ../../whatsnew/3.13.rst:2336 msgid "" ":c:func:`!PyEval_CallMethod`: Use :c:func:`PyObject_CallMethod` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2334 +#: ../../whatsnew/3.13.rst:2338 msgid ":c:func:`!PyCFunction_Call`: Use :c:func:`PyObject_Call` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2337 +#: ../../whatsnew/3.13.rst:2341 msgid "(Contributed by Victor Stinner in :gh:`105107`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2339 +#: ../../whatsnew/3.13.rst:2343 msgid "" "Remove the following old functions to configure the Python initialization, " "deprecated in Python 3.11:" msgstr "" -#: ../../whatsnew/3.13.rst:2342 +#: ../../whatsnew/3.13.rst:2346 msgid "" ":c:func:`!PySys_AddWarnOptionUnicode`: Use :c:member:`PyConfig.warnoptions` " "instead." msgstr "" -#: ../../whatsnew/3.13.rst:2344 +#: ../../whatsnew/3.13.rst:2348 msgid "" ":c:func:`!PySys_AddWarnOption`: Use :c:member:`PyConfig.warnoptions` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2346 +#: ../../whatsnew/3.13.rst:2350 msgid ":c:func:`!PySys_AddXOption`: Use :c:member:`PyConfig.xoptions` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2348 +#: ../../whatsnew/3.13.rst:2352 msgid "" ":c:func:`!PySys_HasWarnOptions`: Use :c:member:`PyConfig.xoptions` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2350 +#: ../../whatsnew/3.13.rst:2354 msgid "" ":c:func:`!PySys_SetPath`: Set :c:member:`PyConfig.module_search_paths` " "instead." msgstr "" -#: ../../whatsnew/3.13.rst:2352 +#: ../../whatsnew/3.13.rst:2356 msgid "" ":c:func:`!Py_SetPath`: Set :c:member:`PyConfig.module_search_paths` instead." msgstr "" -#: ../../whatsnew/3.13.rst:2354 +#: ../../whatsnew/3.13.rst:2358 msgid "" ":c:func:`!Py_SetStandardStreamEncoding`: Set :c:member:`PyConfig." "stdio_encoding` instead, and set also maybe :c:member:`PyConfig." "legacy_windows_stdio` (on Windows)." msgstr "" -#: ../../whatsnew/3.13.rst:2357 +#: ../../whatsnew/3.13.rst:2361 msgid "" ":c:func:`!_Py_SetProgramFullPath`: Set :c:member:`PyConfig.executable` " "instead." msgstr "" -#: ../../whatsnew/3.13.rst:2360 +#: ../../whatsnew/3.13.rst:2364 msgid "" "Use the new :c:type:`PyConfig` API of the :ref:`Python Initialization " "Configuration ` instead (:pep:`587`), added to Python 3.8. " "(Contributed by Victor Stinner in :gh:`105145`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2364 +#: ../../whatsnew/3.13.rst:2368 msgid "" "Remove :c:func:`!PyEval_AcquireLock` and :c:func:`!PyEval_ReleaseLock` " "functions, deprecated in Python 3.2. They didn't update the current thread " "state. They can be replaced with:" msgstr "" -#: ../../whatsnew/3.13.rst:2369 +#: ../../whatsnew/3.13.rst:2373 msgid ":c:func:`PyEval_SaveThread` and :c:func:`PyEval_RestoreThread`;" msgstr ":c:func:`PyEval_SaveThread` 和 :c:func:`PyEval_RestoreThread`;" -#: ../../whatsnew/3.13.rst:2370 +#: ../../whatsnew/3.13.rst:2374 msgid "" "low-level :c:func:`PyEval_AcquireThread` and :c:func:`PyEval_RestoreThread`;" msgstr "" +"低階的 :c:func:`PyEval_AcquireThread` 和 :c:func:`PyEval_RestoreThread`;" -#: ../../whatsnew/3.13.rst:2371 +#: ../../whatsnew/3.13.rst:2375 msgid "or :c:func:`PyGILState_Ensure` and :c:func:`PyGILState_Release`." -msgstr "" +msgstr "或 :c:func:`PyGILState_Ensure` 與 :c:func:`PyGILState_Release`。" -#: ../../whatsnew/3.13.rst:2373 +#: ../../whatsnew/3.13.rst:2377 msgid "(Contributed by Victor Stinner in :gh:`105182`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2375 +#: ../../whatsnew/3.13.rst:2379 msgid "" "Remove the :c:func:`!PyEval_ThreadsInitialized` function, deprecated in " "Python 3.9. Since Python 3.7, :c:func:`!Py_Initialize` always creates the " @@ -4475,7 +4516,7 @@ msgid "" "Stinner in :gh:`105182`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2382 +#: ../../whatsnew/3.13.rst:2386 msgid "" "Remove the :c:func:`!_PyInterpreterState_Get` alias to :c:func:" "`PyInterpreterState_Get()` which was kept for backward compatibility with " @@ -4484,26 +4525,26 @@ msgid "" "Stinner in :gh:`106320`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2389 +#: ../../whatsnew/3.13.rst:2393 msgid "" "Remove the private :c:func:`!_PyObject_FastCall` function: use :c:func:`!" "PyObject_Vectorcall` which is available since Python 3.8 (:pep:`590`). " "(Contributed by Victor Stinner in :gh:`106023`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2394 +#: ../../whatsnew/3.13.rst:2398 msgid "" "Remove the ``cpython/pytime.h`` header file, which only contained private " "functions. (Contributed by Victor Stinner in :gh:`106316`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2398 +#: ../../whatsnew/3.13.rst:2402 msgid "" "Remove the undocumented ``PY_TIMEOUT_MAX`` constant from the limited C API. " "(Contributed by Victor Stinner in :gh:`110014`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2401 +#: ../../whatsnew/3.13.rst:2405 msgid "" "Remove the old trashcan macros ``Py_TRASHCAN_SAFE_BEGIN`` and " "``Py_TRASHCAN_SAFE_END``. Replace both with the new macros " @@ -4511,15 +4552,15 @@ msgid "" "in :gh:`105111`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2408 +#: ../../whatsnew/3.13.rst:2412 msgid "Deprecated C APIs" msgstr "器用的 C API" -#: ../../whatsnew/3.13.rst:2410 +#: ../../whatsnew/3.13.rst:2414 msgid "Deprecate old Python initialization functions:" msgstr "" -#: ../../whatsnew/3.13.rst:2412 +#: ../../whatsnew/3.13.rst:2416 #: ../../deprecations/c-api-pending-removal-in-3.15.rst:13 msgid "" ":c:func:`PySys_ResetWarnOptions`: Clear :data:`sys.warnoptions` and :data:`!" @@ -4528,32 +4569,32 @@ msgstr "" ":c:func:`PySys_ResetWarnOptions`:請改為清除 :data:`sys.warnoptions` 和 :" "data:`!warnings.filters`。" -#: ../../whatsnew/3.13.rst:2414 +#: ../../whatsnew/3.13.rst:2418 #: ../../deprecations/c-api-pending-removal-in-3.15.rst:15 msgid ":c:func:`Py_GetExecPrefix`: Get :data:`sys.exec_prefix` instead." msgstr ":c:func:`Py_GetExecPrefix`:請改用 :data:`sys.exec_prefix`。" -#: ../../whatsnew/3.13.rst:2416 +#: ../../whatsnew/3.13.rst:2420 #: ../../deprecations/c-api-pending-removal-in-3.15.rst:17 msgid ":c:func:`Py_GetPath`: Get :data:`sys.path` instead." msgstr ":c:func:`Py_GetPath`:請改用 :data:`sys.path`。" -#: ../../whatsnew/3.13.rst:2418 +#: ../../whatsnew/3.13.rst:2422 #: ../../deprecations/c-api-pending-removal-in-3.15.rst:19 msgid ":c:func:`Py_GetPrefix`: Get :data:`sys.prefix` instead." msgstr ":c:func:`Py_GetPrefix`:請改用 :data:`sys.prefix`。" -#: ../../whatsnew/3.13.rst:2420 +#: ../../whatsnew/3.13.rst:2424 #: ../../deprecations/c-api-pending-removal-in-3.15.rst:21 msgid ":c:func:`Py_GetProgramFullPath`: Get :data:`sys.executable` instead." msgstr ":c:func:`Py_GetProgramFullPath`:請改用 :data:`sys.executable`。" -#: ../../whatsnew/3.13.rst:2422 +#: ../../whatsnew/3.13.rst:2426 #: ../../deprecations/c-api-pending-removal-in-3.15.rst:23 msgid ":c:func:`Py_GetProgramName`: Get :data:`sys.executable` instead." msgstr ":c:func:`Py_GetProgramName`:請改用 :data:`sys.executable`。" -#: ../../whatsnew/3.13.rst:2424 +#: ../../whatsnew/3.13.rst:2428 #: ../../deprecations/c-api-pending-removal-in-3.15.rst:25 msgid "" ":c:func:`Py_GetPythonHome`: Get :c:member:`PyConfig.home` or the :envvar:" @@ -4562,32 +4603,32 @@ msgstr "" ":c:func:`Py_GetPythonHome`:請改用 :c:member:`PyConfig.home` 或 :envvar:" "`PYTHONHOME` 環境變數。" -#: ../../whatsnew/3.13.rst:2428 +#: ../../whatsnew/3.13.rst:2432 msgid "(Contributed by Victor Stinner in :gh:`105145`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2430 +#: ../../whatsnew/3.13.rst:2434 msgid "" ":term:`Soft deprecate ` the :c:func:`PyEval_GetBuiltins`, :" "c:func:`PyEval_GetGlobals`, and :c:func:`PyEval_GetLocals` functions, which " "return a :term:`borrowed reference`. (Soft deprecated as part of :pep:`667`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2436 +#: ../../whatsnew/3.13.rst:2440 msgid "" "Deprecate the :c:func:`PyImport_ImportModuleNoBlock` function, which is just " "an alias to :c:func:`PyImport_ImportModule` since Python 3.3. (Contributed " "by Victor Stinner in :gh:`105396`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2440 +#: ../../whatsnew/3.13.rst:2444 msgid "" ":term:`Soft deprecate ` the :c:func:`PyModule_AddObject` " "function. It should be replaced with :c:func:`PyModule_Add` or :c:func:" "`PyModule_AddObjectRef`. (Contributed by Serhiy Storchaka in :gh:`86493`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2446 +#: ../../whatsnew/3.13.rst:2450 msgid "" "Deprecate the old ``Py_UNICODE`` and ``PY_UNICODE_TYPE`` types and the :c:" "macro:`!Py_UNICODE_WIDE` define. Use the :c:type:`wchar_t` type directly " @@ -4596,7 +4637,7 @@ msgid "" "`105156`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2453 +#: ../../whatsnew/3.13.rst:2457 msgid "" "Deprecate the :c:func:`PyWeakref_GetObject` and :c:func:" "`PyWeakref_GET_OBJECT` functions, which return a :term:`borrowed reference`. " @@ -4957,55 +4998,56 @@ msgstr "" msgid ":c:func:`PyThread_ReInitTLS`: Unneeded since Python 3.7." msgstr ":c:func:`PyThread_ReInitTLS`:自 Python 3.7 起不再需要。" -#: ../../whatsnew/3.13.rst:2473 +#: ../../whatsnew/3.13.rst:2477 msgid "Build Changes" msgstr "建置變更" -#: ../../whatsnew/3.13.rst:2475 +#: ../../whatsnew/3.13.rst:2479 msgid "" "``arm64-apple-ios`` and ``arm64-apple-ios-simulator`` are both now :pep:`11` " "tier 3 platforms. (:ref:`PEP 730 ` written and " "implementation contributed by Russell Keith-Magee in :gh:`114099`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2480 +#: ../../whatsnew/3.13.rst:2484 msgid "" "``aarch64-linux-android`` and ``x86_64-linux-android`` are both now :pep:" "`11` tier 3 platforms. (:ref:`PEP 738 ` " "written and implementation contributed by Malcolm Smith in :gh:`116622`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2485 +#: ../../whatsnew/3.13.rst:2489 msgid "" "``wasm32-wasi`` is now a :pep:`11` tier 2 platform. (Contributed by Brett " "Cannon in :gh:`115192`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2488 +#: ../../whatsnew/3.13.rst:2492 msgid "" "``wasm32-emscripten`` is no longer a :pep:`11` supported platform. " "(Contributed by Brett Cannon in :gh:`115192`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2491 +#: ../../whatsnew/3.13.rst:2495 msgid "" "Building CPython now requires a compiler with support for the C11 atomic " "library, GCC built-in atomic functions, or MSVC interlocked intrinsics." msgstr "" -#: ../../whatsnew/3.13.rst:2494 +#: ../../whatsnew/3.13.rst:2498 msgid "" -"Autoconf 2.71 and aclocal 1.16.4 are now required to regenerate the :file:" -"`configure` script. (Contributed by Christian Heimes in :gh:`89886`.)" +"Autoconf 2.71 and aclocal 1.16.5 are now required to regenerate the :file:" +"`configure` script. (Contributed by Christian Heimes in :gh:`89886` and by " +"Victor Stinner in :gh:`112090`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2498 +#: ../../whatsnew/3.13.rst:2502 msgid "" "SQLite 3.15.2 or newer is required to build the :mod:`sqlite3` extension " "module. (Contributed by Erlend Aasland in :gh:`105875`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2502 +#: ../../whatsnew/3.13.rst:2506 msgid "" "CPython now bundles the `mimalloc library`_ by default. It is licensed under " "the MIT license; see :ref:`mimalloc license `. The bundled " @@ -5013,28 +5055,28 @@ msgid "" "Dino Viehland in :gh:`109914`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2510 +#: ../../whatsnew/3.13.rst:2514 msgid "" "The :file:`configure` option :option:`--with-system-libmpdec` now defaults " "to ``yes``. The bundled copy of ``libmpdecimal`` will be removed in Python " "3.15." msgstr "" -#: ../../whatsnew/3.13.rst:2514 +#: ../../whatsnew/3.13.rst:2518 msgid "" "Python built with :file:`configure` :option:`--with-trace-refs` (tracing " "references) is now ABI compatible with the Python release build and :ref:" "`debug build `. (Contributed by Victor Stinner in :gh:`108634`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2519 +#: ../../whatsnew/3.13.rst:2523 msgid "" "On POSIX systems, the pkg-config (``.pc``) filenames now include the ABI " "flags. For example, the free-threaded build generates ``python-3.13t.pc`` " "and the debug build generates ``python-3.13d.pc``." msgstr "" -#: ../../whatsnew/3.13.rst:2523 +#: ../../whatsnew/3.13.rst:2527 msgid "" "The ``errno``, ``fcntl``, ``grp``, ``md5``, ``pwd``, ``resource``, " "``termios``, ``winsound``, ``_ctypes_test``, ``_multiprocessing." @@ -5044,27 +5086,27 @@ msgid "" "`85283`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2532 +#: ../../whatsnew/3.13.rst:2536 msgid "Porting to Python 3.13" msgstr "移植至 Python 3.13" -#: ../../whatsnew/3.13.rst:2534 +#: ../../whatsnew/3.13.rst:2538 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." msgstr "" -#: ../../whatsnew/3.13.rst:2538 +#: ../../whatsnew/3.13.rst:2542 msgid "Changes in the Python API" msgstr "Python API 的變更" -#: ../../whatsnew/3.13.rst:2542 +#: ../../whatsnew/3.13.rst:2546 msgid "" ":ref:`PEP 667 ` introduces several changes to " "the semantics of :func:`locals` and :attr:`f_locals `:" msgstr "" -#: ../../whatsnew/3.13.rst:2545 +#: ../../whatsnew/3.13.rst:2549 msgid "" "Calling :func:`locals` in an :term:`optimized scope` now produces an " "independent snapshot on each call, and hence no longer implicitly updates " @@ -5076,7 +5118,7 @@ msgid "" "scope. (Changed as part of :pep:`667`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2554 +#: ../../whatsnew/3.13.rst:2558 msgid "" "Calling :func:`locals` from a comprehension at module or class scope " "(including via ``exec`` or ``eval``) once more behaves as if the " @@ -5086,7 +5128,7 @@ msgid "" "implementing :pep:`709`. (Changed as part of :pep:`667`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2561 +#: ../../whatsnew/3.13.rst:2565 msgid "" "Accessing :attr:`FrameType.f_locals ` in an :term:`optimized " "scope` now returns a write-through proxy rather than a snapshot that gets " @@ -5095,7 +5137,7 @@ msgid "" "of :pep:`667`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2567 +#: ../../whatsnew/3.13.rst:2571 msgid "" ":class:`functools.partial` now emits a :exc:`FutureWarning` when used as a " "method. The behavior will change in future Python versions. Wrap it in :func:" @@ -5103,14 +5145,14 @@ msgid "" "Serhiy Storchaka in :gh:`121027`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2573 +#: ../../whatsnew/3.13.rst:2577 msgid "" "An :exc:`OSError` is now raised by :func:`getpass.getuser` for any failure " "to retrieve a username, instead of :exc:`ImportError` on non-Unix platforms " "or :exc:`KeyError` on Unix platforms where the password database is empty." msgstr "" -#: ../../whatsnew/3.13.rst:2578 +#: ../../whatsnew/3.13.rst:2582 msgid "" "The value of the :attr:`!mode` attribute of :class:`gzip.GzipFile` is now a " "string (``'rb'`` or ``'wb'``) instead of an integer (``1`` or ``2``). The " @@ -5119,13 +5161,13 @@ msgid "" "(Contributed by Serhiy Storchaka in :gh:`115961`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2584 +#: ../../whatsnew/3.13.rst:2588 msgid "" ":class:`mailbox.Maildir` now ignores files with a leading dot (``.``). " "(Contributed by Zackery Spytz in :gh:`65559`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2587 +#: ../../whatsnew/3.13.rst:2591 msgid "" ":meth:`pathlib.Path.glob` and :meth:`~pathlib.Path.rglob` now return both " "files and directories if a pattern that ends with \"``**``\" is given, " @@ -5133,25 +5175,25 @@ msgid "" "behavior and only match directories." msgstr "" -#: ../../whatsnew/3.13.rst:2592 +#: ../../whatsnew/3.13.rst:2596 msgid "" "The :mod:`threading` module now expects the :mod:`!_thread` module to have " "an :func:`!_is_main_interpreter` function. This function takes no arguments " "and returns ``True`` if the current interpreter is the main interpreter." msgstr "" -#: ../../whatsnew/3.13.rst:2597 +#: ../../whatsnew/3.13.rst:2601 msgid "" "Any library or application that provides a custom :mod:`!_thread` module " "must provide :func:`!_is_main_interpreter`, just like the module's other " "\"private\" attributes. (:gh:`112826`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2604 +#: ../../whatsnew/3.13.rst:2608 msgid "Changes in the C API" msgstr "C API 中的改動" -#: ../../whatsnew/3.13.rst:2606 +#: ../../whatsnew/3.13.rst:2610 msgid "" "``Python.h`` no longer includes the ```` standard header. It was " "included for the :c:func:`!finite` function which is now provided by the " @@ -5160,7 +5202,7 @@ msgid "" "`108765`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2612 +#: ../../whatsnew/3.13.rst:2616 msgid "" "``Python.h`` no longer includes these standard header files: ````, " "```` and ````. If needed, they should now be " @@ -5171,7 +5213,7 @@ msgid "" "Victor Stinner in :gh:`108765`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2620 +#: ../../whatsnew/3.13.rst:2624 msgid "" "On Windows, ``Python.h`` no longer includes the ```` standard " "header file. If needed, it should now be included explicitly. For example, " @@ -5181,7 +5223,7 @@ msgid "" "(Contributed by Victor Stinner in :gh:`108765`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2627 +#: ../../whatsnew/3.13.rst:2631 msgid "" "If the :c:macro:`Py_LIMITED_API` macro is defined, :c:macro:`!" "Py_BUILD_CORE`, :c:macro:`!Py_BUILD_CORE_BUILTIN` and :c:macro:`!" @@ -5189,18 +5231,18 @@ msgid "" "(Contributed by Victor Stinner in :gh:`85283`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2632 +#: ../../whatsnew/3.13.rst:2636 msgid "" "The old trashcan macros ``Py_TRASHCAN_SAFE_BEGIN`` and " "``Py_TRASHCAN_SAFE_END`` were removed. They should be replaced by the new " "macros ``Py_TRASHCAN_BEGIN`` and ``Py_TRASHCAN_END``." msgstr "" -#: ../../whatsnew/3.13.rst:2636 +#: ../../whatsnew/3.13.rst:2640 msgid "A ``tp_dealloc`` function that has the old macros, such as::" msgstr "" -#: ../../whatsnew/3.13.rst:2638 +#: ../../whatsnew/3.13.rst:2642 msgid "" "static void\n" "mytype_dealloc(mytype *p)\n" @@ -5220,11 +5262,11 @@ msgstr "" " Py_TRASHCAN_SAFE_END\n" "}" -#: ../../whatsnew/3.13.rst:2647 +#: ../../whatsnew/3.13.rst:2651 msgid "should migrate to the new macros as follows::" msgstr "" -#: ../../whatsnew/3.13.rst:2649 +#: ../../whatsnew/3.13.rst:2653 msgid "" "static void\n" "mytype_dealloc(mytype *p)\n" @@ -5244,7 +5286,7 @@ msgstr "" " Py_TRASHCAN_END\n" "}" -#: ../../whatsnew/3.13.rst:2658 +#: ../../whatsnew/3.13.rst:2662 msgid "" "Note that ``Py_TRASHCAN_BEGIN`` has a second argument which should be the " "deallocation function it is in. The new macros were added in Python 3.8 and " @@ -5252,13 +5294,13 @@ msgid "" "in :gh:`105111`.)" msgstr "" -#: ../../whatsnew/3.13.rst:2665 +#: ../../whatsnew/3.13.rst:2669 msgid "" ":ref:`PEP 667 ` introduces several changes to " "frame-related functions:" msgstr "" -#: ../../whatsnew/3.13.rst:2668 +#: ../../whatsnew/3.13.rst:2672 msgid "" "The effects of mutating the dictionary returned from :c:func:" "`PyEval_GetLocals` in an :term:`optimized scope` have changed. New dict " @@ -5272,7 +5314,7 @@ msgid "" "being used, so refer to the deprecation notice on the function for details." msgstr "" -#: ../../whatsnew/3.13.rst:2681 +#: ../../whatsnew/3.13.rst:2685 msgid "" "Calling :c:func:`PyFrame_GetLocals` in an :term:`optimized scope` now " "returns a write-through proxy rather than a snapshot that gets updated at " @@ -5281,25 +5323,25 @@ msgid "" "`PyEval_GetFrameLocals` API." msgstr "" -#: ../../whatsnew/3.13.rst:2688 +#: ../../whatsnew/3.13.rst:2692 msgid "" ":c:func:`!PyFrame_FastToLocals` and :c:func:`!PyFrame_FastToLocalsWithError` " "no longer have any effect. Calling these functions has been redundant since " "Python 3.11, when :c:func:`PyFrame_GetLocals` was first introduced." msgstr "" -#: ../../whatsnew/3.13.rst:2693 +#: ../../whatsnew/3.13.rst:2697 msgid "" ":c:func:`!PyFrame_LocalsToFast` no longer has any effect. Calling this " "function is redundant now that :c:func:`PyFrame_GetLocals` returns a write-" "through proxy for :term:`optimized scopes `." msgstr "" -#: ../../whatsnew/3.13.rst:2698 +#: ../../whatsnew/3.13.rst:2702 msgid "Regression Test Changes" msgstr "" -#: ../../whatsnew/3.13.rst:2700 +#: ../../whatsnew/3.13.rst:2704 msgid "" "Python built with :file:`configure` :option:`--with-pydebug` now supports a :" "option:`-X presite=package.module <-X>` command-line option. If used, it " diff --git a/whatsnew/3.2.po b/whatsnew/3.2.po index a451e0c31c..2ed7e65d36 100644 --- a/whatsnew/3.2.po +++ b/whatsnew/3.2.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-10 00:13+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-" @@ -465,8 +465,8 @@ msgstr "" #: ../../whatsnew/3.2.rst:315 msgid "" -"Imported modules now have a :attr:`__cached__` attribute which stores the " -"name of the actual file that was imported:" +"Imported modules now have a :attr:`~module.__cached__` attribute which " +"stores the name of the actual file that was imported:" msgstr "" #: ../../whatsnew/3.2.rst:322 diff --git a/whatsnew/3.4.po b/whatsnew/3.4.po index 8323096a63..511a0066bc 100644 --- a/whatsnew/3.4.po +++ b/whatsnew/3.4.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 07:20+0000\n" +"POT-Creation-Date: 2024-10-10 00:13+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-" @@ -3271,13 +3271,13 @@ msgstr "" #: ../../whatsnew/3.4.rst:2274 msgid "" -"The module type now initializes the :attr:`__package__` and :attr:" -"`__loader__` attributes to ``None`` by default. To determine if these " -"attributes were set in a backwards-compatible fashion, use e.g. " +"The module type now initializes the :attr:`~module.__package__` and :attr:" +"`~module.__loader__` attributes to ``None`` by default. To determine if " +"these attributes were set in a backwards-compatible fashion, use e.g. " "``getattr(module, '__loader__', None) is not None``. (:issue:`17115`.)" msgstr "" -#: ../../whatsnew/3.4.rst:2279 +#: ../../whatsnew/3.4.rst:2280 msgid "" ":meth:`!importlib.util.module_for_loader` now sets ``__loader__`` and " "``__package__`` unconditionally to properly support reloading. If this is " @@ -3285,7 +3285,7 @@ msgid "" "use :func:`importlib.util.module_to_load` for module management." msgstr "" -#: ../../whatsnew/3.4.rst:2284 +#: ../../whatsnew/3.4.rst:2285 msgid "" "Import now resets relevant attributes (e.g. ``__name__``, ``__loader__``, " "``__package__``, ``__file__``, ``__cached__``) unconditionally when " @@ -3293,7 +3293,7 @@ msgid "" "module is re-found when re-loaded (:issue:`19413`)." msgstr "" -#: ../../whatsnew/3.4.rst:2289 +#: ../../whatsnew/3.4.rst:2290 msgid "" "Frozen packages no longer set ``__path__`` to a list containing the package " "name, they now set it to an empty list. The previous behavior could cause " @@ -3303,7 +3303,7 @@ msgid "" "'__path__')`` (:issue:`18065`)." msgstr "" -#: ../../whatsnew/3.4.rst:2296 +#: ../../whatsnew/3.4.rst:2297 msgid "" "Frozen modules no longer define a ``__file__`` attribute. It's semantically " "incorrect for frozen modules to set the attribute as they are not loaded " @@ -3314,7 +3314,7 @@ msgid "" "use :func:`!imp.is_frozen`." msgstr "" -#: ../../whatsnew/3.4.rst:2304 +#: ../../whatsnew/3.4.rst:2305 msgid "" ":func:`py_compile.compile` now raises :exc:`FileExistsError` if the file " "path it would write to is a symlink or a non-regular file. This is to act as " @@ -3322,7 +3322,7 @@ msgid "" "regardless of what type of file path they were originally." msgstr "" -#: ../../whatsnew/3.4.rst:2309 +#: ../../whatsnew/3.4.rst:2310 msgid "" ":meth:`importlib.abc.SourceLoader.get_source` no longer raises :exc:" "`ImportError` when the source code being loaded triggers a :exc:" @@ -3334,7 +3334,7 @@ msgid "" "exceptions now." msgstr "" -#: ../../whatsnew/3.4.rst:2318 +#: ../../whatsnew/3.4.rst:2319 msgid "" ":func:`functools.update_wrapper` and :func:`functools.wraps` now correctly " "set the ``__wrapped__`` attribute to the function being wrapped, even if " @@ -3346,7 +3346,7 @@ msgid "" "function in the chain that has no ``__wrapped__`` attribute." msgstr "" -#: ../../whatsnew/3.4.rst:2328 +#: ../../whatsnew/3.4.rst:2329 msgid "" ":func:`inspect.getfullargspec` has been reimplemented on top of :func:" "`inspect.signature` and hence handles a much wider variety of callable " @@ -3356,7 +3356,7 @@ msgid "" "will fail on non-Python callables may need to be adjusted accordingly." msgstr "" -#: ../../whatsnew/3.4.rst:2336 +#: ../../whatsnew/3.4.rst:2337 msgid "" ":class:`importlib.machinery.PathFinder` now passes on the current working " "directory to objects in :data:`sys.path_hooks` for the empty string. This " @@ -3370,7 +3370,7 @@ msgid "" "`18416`)." msgstr "" -#: ../../whatsnew/3.4.rst:2347 +#: ../../whatsnew/3.4.rst:2348 msgid "" "The removal of the *strict* argument to :class:`~http.client.HTTPConnection` " "and :class:`~http.client.HTTPSConnection` changes the meaning of the " @@ -3379,7 +3379,7 @@ msgid "" "should already be specifying any additional arguments via keywords." msgstr "" -#: ../../whatsnew/3.4.rst:2353 +#: ../../whatsnew/3.4.rst:2354 msgid "" "Strings between ``from __future__ import ...`` statements now *always* raise " "a :exc:`SyntaxError`. Previously if there was no leading docstring, an " @@ -3388,7 +3388,7 @@ msgid "" "`17434`)." msgstr "" -#: ../../whatsnew/3.4.rst:2359 +#: ../../whatsnew/3.4.rst:2360 msgid "" ":meth:`ssl.SSLSocket.getpeercert` and :meth:`ssl.SSLSocket.do_handshake` now " "raise an :exc:`OSError` with ``ENOTCONN`` when the ``SSLSocket`` is not " @@ -3397,7 +3397,7 @@ msgid "" "raise a :exc:`ValueError` if the handshake has not yet been done." msgstr "" -#: ../../whatsnew/3.4.rst:2365 +#: ../../whatsnew/3.4.rst:2366 msgid "" ":func:`base64.b32decode` now raises a :exc:`binascii.Error` when the input " "string contains non-b32-alphabet characters, instead of a :exc:`TypeError`. " @@ -3406,7 +3406,7 @@ msgid "" "`18011`.) Note: this change was also inadvertently applied in Python 3.3.3." msgstr "" -#: ../../whatsnew/3.4.rst:2372 +#: ../../whatsnew/3.4.rst:2373 msgid "" "The :attr:`!file` attribute is now automatically closed when the creating :" "class:`!cgi.FieldStorage` instance is garbage collected. If you were pulling " @@ -3416,14 +3416,14 @@ msgid "" "the :class:`!cgi.FieldStorage` instance is garbage collected." msgstr "" -#: ../../whatsnew/3.4.rst:2379 +#: ../../whatsnew/3.4.rst:2380 msgid "" "Calling ``read`` or ``write`` on a closed SSL socket now raises an " "informative :exc:`ValueError` rather than the previous more mysterious :exc:" "`AttributeError` (:issue:`9177`)." msgstr "" -#: ../../whatsnew/3.4.rst:2383 +#: ../../whatsnew/3.4.rst:2384 msgid "" ":meth:`slice.indices` no longer produces an :exc:`OverflowError` for huge " "values. As a consequence of this fix, :meth:`slice.indices` now raises a :" @@ -3431,7 +3431,7 @@ msgid "" "values (:issue:`14794`)." msgstr "" -#: ../../whatsnew/3.4.rst:2388 +#: ../../whatsnew/3.4.rst:2389 msgid "" "The :class:`complex` constructor, unlike the :mod:`cmath` functions, was " "incorrectly accepting :class:`float` values if an object's ``__complex__`` " @@ -3439,21 +3439,21 @@ msgid "" "`16290`.)" msgstr "" -#: ../../whatsnew/3.4.rst:2393 +#: ../../whatsnew/3.4.rst:2394 msgid "" "The :class:`int` constructor in 3.2 and 3.3 erroneously accepts :class:" "`float` values for the *base* parameter. It is unlikely anyone was doing " "this, but if so, it will now raise a :exc:`TypeError` (:issue:`16772`)." msgstr "" -#: ../../whatsnew/3.4.rst:2397 +#: ../../whatsnew/3.4.rst:2398 msgid "" "Defaults for keyword-only arguments are now evaluated *after* defaults for " "regular keyword arguments, instead of before. Hopefully no one wrote any " "code that depends on the previous buggy behavior (:issue:`16967`)." msgstr "" -#: ../../whatsnew/3.4.rst:2401 +#: ../../whatsnew/3.4.rst:2402 msgid "" "Stale thread states are now cleared after :func:`~os.fork`. This may cause " "some system resources to be released that previously were incorrectly kept " @@ -3461,21 +3461,21 @@ msgid "" "storage). (:issue:`17094`.)" msgstr "" -#: ../../whatsnew/3.4.rst:2406 +#: ../../whatsnew/3.4.rst:2407 msgid "" "Parameter names in ``__annotations__`` dicts are now mangled properly, " "similarly to :attr:`~function.__kwdefaults__`. (Contributed by Yury " "Selivanov in :issue:`20625`.)" msgstr "" -#: ../../whatsnew/3.4.rst:2410 +#: ../../whatsnew/3.4.rst:2411 msgid "" ":attr:`hashlib.hash.name` now always returns the identifier in lower case. " "Previously some builtin hashes had uppercase names, but now that it is a " "formal public interface the naming has been made consistent (:issue:`18532`)." msgstr "" -#: ../../whatsnew/3.4.rst:2414 +#: ../../whatsnew/3.4.rst:2415 msgid "" "Because :mod:`unittest.TestSuite` now drops references to tests after they " "are run, test harnesses that reuse a :class:`~unittest.TestSuite` to re-run " @@ -3488,7 +3488,7 @@ msgid "" "__iter__`) (:issue:`11798`)." msgstr "" -#: ../../whatsnew/3.4.rst:2424 +#: ../../whatsnew/3.4.rst:2425 msgid "" ":mod:`unittest` now uses :mod:`argparse` for command line parsing. There " "are certain invalid command forms that used to work that are no longer " @@ -3497,7 +3497,7 @@ msgid "" "use." msgstr "" -#: ../../whatsnew/3.4.rst:2429 +#: ../../whatsnew/3.4.rst:2430 msgid "" "The :func:`re.split`, :func:`re.findall`, and :func:`re.sub` functions, and " "the :meth:`~re.match.group` and :meth:`~re.match.groups` methods of " @@ -3507,13 +3507,13 @@ msgid "" "say, a ``bytearray``, you will need to change your code." msgstr "" -#: ../../whatsnew/3.4.rst:2436 +#: ../../whatsnew/3.4.rst:2437 msgid "" ":mod:`!audioop` functions now raise an error immediately if passed string " "input, instead of failing randomly later on (:issue:`16685`)." msgstr "" -#: ../../whatsnew/3.4.rst:2439 +#: ../../whatsnew/3.4.rst:2440 msgid "" "The new *convert_charrefs* argument to :class:`~html.parser.HTMLParser` " "currently defaults to ``False`` for backward compatibility, but will " @@ -3522,14 +3522,14 @@ msgid "" "HTMLParser` calls in your code (:issue:`13633`)." msgstr "" -#: ../../whatsnew/3.4.rst:2445 +#: ../../whatsnew/3.4.rst:2446 msgid "" "Since the *digestmod* argument to the :func:`hmac.new` function will in the " "future have no default, all calls to :func:`hmac.new` should be changed to " "explicitly specify a *digestmod* (:issue:`17276`)." msgstr "" -#: ../../whatsnew/3.4.rst:2449 +#: ../../whatsnew/3.4.rst:2450 msgid "" "Calling :func:`sysconfig.get_config_var` with the ``SO`` key, or looking " "``SO`` up in the results of a call to :func:`sysconfig.get_config_vars` is " @@ -3537,7 +3537,7 @@ msgid "" "``SHLIB_SUFFIX``, depending on the context (:issue:`19555`)." msgstr "" -#: ../../whatsnew/3.4.rst:2454 +#: ../../whatsnew/3.4.rst:2455 msgid "" "Any calls to ``open`` functions that specify ``U`` should be modified. ``U`` " "is ineffective in Python3 and will eventually raise an error if used. " @@ -3547,13 +3547,13 @@ msgid "" "`15204`)." msgstr "" -#: ../../whatsnew/3.4.rst:2461 +#: ../../whatsnew/3.4.rst:2462 msgid "" "If you use ``pyvenv`` in a script and desire that pip *not* be installed, " "you must add ``--without-pip`` to your command invocation." msgstr "" -#: ../../whatsnew/3.4.rst:2465 +#: ../../whatsnew/3.4.rst:2466 msgid "" "The default behavior of :func:`json.dump` and :func:`json.dumps` when an " "indent is specified has changed: it no longer produces trailing spaces after " @@ -3562,7 +3562,7 @@ msgid "" "output (:issue:`16333`)." msgstr "" -#: ../../whatsnew/3.4.rst:2471 +#: ../../whatsnew/3.4.rst:2472 msgid "" ":mod:`doctest` now looks for doctests in extension module ``__doc__`` " "strings, so if your doctest test discovery includes extension modules that " @@ -3570,7 +3570,7 @@ msgid "" "never seen before when running your tests (:issue:`3158`)." msgstr "" -#: ../../whatsnew/3.4.rst:2476 +#: ../../whatsnew/3.4.rst:2477 msgid "" "The :mod:`collections.abc` module has been slightly refactored as part of " "the Python startup improvements. As a consequence of this, it is no longer " @@ -3580,11 +3580,11 @@ msgid "" "`20784`)." msgstr "" -#: ../../whatsnew/3.4.rst:2485 +#: ../../whatsnew/3.4.rst:2486 msgid "Changes in the C API" msgstr "C API 中的改動" -#: ../../whatsnew/3.4.rst:2487 +#: ../../whatsnew/3.4.rst:2488 msgid "" ":c:func:`PyEval_EvalFrameEx`, :c:func:`PyObject_Repr`, and :c:func:" "`PyObject_Str`, along with some other internal C APIs, now include a " @@ -3598,14 +3598,14 @@ msgid "" "version of Python that is compiled with assertions enabled." msgstr "" -#: ../../whatsnew/3.4.rst:2499 +#: ../../whatsnew/3.4.rst:2500 msgid "" ":c:func:`PyErr_SetImportError` now sets :exc:`TypeError` when its **msg** " "argument is not set. Previously only ``NULL`` was returned with no exception " "set." msgstr "" -#: ../../whatsnew/3.4.rst:2503 +#: ../../whatsnew/3.4.rst:2504 msgid "" "The result of the :c:data:`PyOS_ReadlineFunctionPointer` callback must now " "be a string allocated by :c:func:`PyMem_RawMalloc` or :c:func:" @@ -3614,30 +3614,30 @@ msgid "" "`16742`)" msgstr "" -#: ../../whatsnew/3.4.rst:2509 +#: ../../whatsnew/3.4.rst:2510 msgid "" ":c:func:`PyThread_set_key_value` now always set the value. In Python 3.3, " "the function did nothing if the key already exists (if the current value is " "a non-``NULL`` pointer)." msgstr "" -#: ../../whatsnew/3.4.rst:2513 +#: ../../whatsnew/3.4.rst:2514 msgid "" "The ``f_tstate`` (thread state) field of the :c:type:`PyFrameObject` " "structure has been removed to fix a bug: see :issue:`14432` for the " "rationale." msgstr "" -#: ../../whatsnew/3.4.rst:2518 +#: ../../whatsnew/3.4.rst:2519 msgid "Changed in 3.4.3" msgstr "3.4.3 中的變更" -#: ../../whatsnew/3.4.rst:2523 +#: ../../whatsnew/3.4.rst:2524 msgid "" "PEP 476: Enabling certificate verification by default for stdlib http clients" msgstr "" -#: ../../whatsnew/3.4.rst:2525 +#: ../../whatsnew/3.4.rst:2526 msgid "" ":mod:`http.client` and modules which use it, such as :mod:`urllib.request` " "and :mod:`xmlrpc.client`, will now verify that the server presents a " @@ -3646,13 +3646,13 @@ msgid "" "improving security for many applications." msgstr "" -#: ../../whatsnew/3.4.rst:2531 +#: ../../whatsnew/3.4.rst:2532 msgid "" "For applications which require the old previous behavior, they can pass an " "alternate context::" msgstr "" -#: ../../whatsnew/3.4.rst:2534 +#: ../../whatsnew/3.4.rst:2535 msgid "" "import urllib.request\n" "import ssl\n" diff --git a/whatsnew/3.5.po b/whatsnew/3.5.po index 43c8937a1d..9de8d2caae 100644 --- a/whatsnew/3.5.po +++ b/whatsnew/3.5.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-27 00:14+0000\n" +"POT-Creation-Date: 2024-10-10 00:13+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-" @@ -669,7 +669,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:425 msgid "" "While these annotations are available at runtime through the usual :attr:" -"`__annotations__` attribute, *no automatic type checking happens at " +"`~object.__annotations__` attribute, *no automatic type checking happens at " "runtime*. Instead, it is assumed that a separate off-line type checker (e." "g. `mypy `_) will be used for on-demand source code " "analysis." diff --git a/whatsnew/3.7.po b/whatsnew/3.7.po index c9c6896a50..a02c86b5b8 100644 --- a/whatsnew/3.7.po +++ b/whatsnew/3.7.po @@ -595,7 +595,7 @@ msgstr "" #: ../../whatsnew/3.7.rst:400 msgid ":pep:`565` -- Show DeprecationWarning in ``__main__``" -msgstr "" +msgstr ":pep:`565` -- 在 ``__main__`` 中顯示 DeprecationWarning" #: ../../whatsnew/3.7.rst:401 msgid "PEP written and implemented by Nick Coghlan"