diff --git a/.scripts/poetry.lock b/.scripts/poetry.lock index 188366127e..7fa4a914bc 100644 --- a/.scripts/poetry.lock +++ b/.scripts/poetry.lock @@ -2,13 +2,13 @@ [[package]] name = "certifi" -version = "2023.5.7" +version = "2023.7.22" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.6" files = [ - {file = "certifi-2023.5.7-py3-none-any.whl", hash = "sha256:c6c2e98f5c7869efca1f8916fed228dd91539f9f1b444c314c06eef02980c716"}, - {file = "certifi-2023.5.7.tar.gz", hash = "sha256:0f0d56dc5a6ad56fd4ba36484d6cc34451e1c6548c61daad8c320169f91eddc7"}, + {file = "certifi-2023.7.22-py3-none-any.whl", hash = "sha256:92d6037539857d8206b8f6ae472e8b77db8058fec5937a1ef3f54304089edbb9"}, + {file = "certifi-2023.7.22.tar.gz", hash = "sha256:539cc1d13202e33ca466e88b2807e29f4c13049d6d87031a3c110744495cb082"}, ] [[package]] @@ -143,95 +143,108 @@ files = [ [[package]] name = "lxml" -version = "4.9.2" +version = "4.9.3" description = "Powerful and Pythonic XML processing library combining libxml2/libxslt with the ElementTree API." optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, != 3.4.*" files = [ - {file = "lxml-4.9.2-cp27-cp27m-macosx_10_15_x86_64.whl", hash = "sha256:76cf573e5a365e790396a5cc2b909812633409306c6531a6877c59061e42c4f2"}, - {file = "lxml-4.9.2-cp27-cp27m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:b1f42b6921d0e81b1bcb5e395bc091a70f41c4d4e55ba99c6da2b31626c44892"}, - {file = "lxml-4.9.2-cp27-cp27m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:9f102706d0ca011de571de32c3247c6476b55bb6bc65a20f682f000b07a4852a"}, - {file = "lxml-4.9.2-cp27-cp27m-win32.whl", hash = "sha256:8d0b4612b66ff5d62d03bcaa043bb018f74dfea51184e53f067e6fdcba4bd8de"}, - {file = "lxml-4.9.2-cp27-cp27m-win_amd64.whl", hash = "sha256:4c8f293f14abc8fd3e8e01c5bd86e6ed0b6ef71936ded5bf10fe7a5efefbaca3"}, - {file = "lxml-4.9.2-cp27-cp27mu-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2899456259589aa38bfb018c364d6ae7b53c5c22d8e27d0ec7609c2a1ff78b50"}, - {file = "lxml-4.9.2-cp27-cp27mu-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:6749649eecd6a9871cae297bffa4ee76f90b4504a2a2ab528d9ebe912b101975"}, - {file = "lxml-4.9.2-cp310-cp310-macosx_10_15_x86_64.whl", hash = "sha256:a08cff61517ee26cb56f1e949cca38caabe9ea9fbb4b1e10a805dc39844b7d5c"}, - {file = "lxml-4.9.2-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:85cabf64adec449132e55616e7ca3e1000ab449d1d0f9d7f83146ed5bdcb6d8a"}, - {file = "lxml-4.9.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:8340225bd5e7a701c0fa98284c849c9b9fc9238abf53a0ebd90900f25d39a4e4"}, - {file = "lxml-4.9.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:1ab8f1f932e8f82355e75dda5413a57612c6ea448069d4fb2e217e9a4bed13d4"}, - {file = "lxml-4.9.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:699a9af7dffaf67deeae27b2112aa06b41c370d5e7633e0ee0aea2e0b6c211f7"}, - {file = "lxml-4.9.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:b9cc34af337a97d470040f99ba4282f6e6bac88407d021688a5d585e44a23184"}, - {file = "lxml-4.9.2-cp310-cp310-win32.whl", hash = "sha256:d02a5399126a53492415d4906ab0ad0375a5456cc05c3fc0fc4ca11771745cda"}, - {file = "lxml-4.9.2-cp310-cp310-win_amd64.whl", hash = "sha256:a38486985ca49cfa574a507e7a2215c0c780fd1778bb6290c21193b7211702ab"}, - {file = "lxml-4.9.2-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:c83203addf554215463b59f6399835201999b5e48019dc17f182ed5ad87205c9"}, - {file = "lxml-4.9.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:2a87fa548561d2f4643c99cd13131acb607ddabb70682dcf1dff5f71f781a4bf"}, - {file = "lxml-4.9.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:d6b430a9938a5a5d85fc107d852262ddcd48602c120e3dbb02137c83d212b380"}, - {file = "lxml-4.9.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:3efea981d956a6f7173b4659849f55081867cf897e719f57383698af6f618a92"}, - {file = "lxml-4.9.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:df0623dcf9668ad0445e0558a21211d4e9a149ea8f5666917c8eeec515f0a6d1"}, - {file = "lxml-4.9.2-cp311-cp311-win32.whl", hash = "sha256:da248f93f0418a9e9d94b0080d7ebc407a9a5e6d0b57bb30db9b5cc28de1ad33"}, - {file = "lxml-4.9.2-cp311-cp311-win_amd64.whl", hash = "sha256:3818b8e2c4b5148567e1b09ce739006acfaa44ce3156f8cbbc11062994b8e8dd"}, - {file = "lxml-4.9.2-cp35-cp35m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:ca989b91cf3a3ba28930a9fc1e9aeafc2a395448641df1f387a2d394638943b0"}, - {file = "lxml-4.9.2-cp35-cp35m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:822068f85e12a6e292803e112ab876bc03ed1f03dddb80154c395f891ca6b31e"}, - {file = "lxml-4.9.2-cp35-cp35m-win32.whl", hash = "sha256:be7292c55101e22f2a3d4d8913944cbea71eea90792bf914add27454a13905df"}, - {file = "lxml-4.9.2-cp35-cp35m-win_amd64.whl", hash = "sha256:998c7c41910666d2976928c38ea96a70d1aa43be6fe502f21a651e17483a43c5"}, - {file = "lxml-4.9.2-cp36-cp36m-macosx_10_15_x86_64.whl", hash = "sha256:b26a29f0b7fc6f0897f043ca366142d2b609dc60756ee6e4e90b5f762c6adc53"}, - {file = "lxml-4.9.2-cp36-cp36m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:ab323679b8b3030000f2be63e22cdeea5b47ee0abd2d6a1dc0c8103ddaa56cd7"}, - {file = "lxml-4.9.2-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:689bb688a1db722485e4610a503e3e9210dcc20c520b45ac8f7533c837be76fe"}, - {file = "lxml-4.9.2-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:f49e52d174375a7def9915c9f06ec4e569d235ad428f70751765f48d5926678c"}, - {file = "lxml-4.9.2-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:36c3c175d34652a35475a73762b545f4527aec044910a651d2bf50de9c3352b1"}, - {file = "lxml-4.9.2-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:a35f8b7fa99f90dd2f5dc5a9fa12332642f087a7641289ca6c40d6e1a2637d8e"}, - {file = "lxml-4.9.2-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:58bfa3aa19ca4c0f28c5dde0ff56c520fbac6f0daf4fac66ed4c8d2fb7f22e74"}, - {file = "lxml-4.9.2-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:bc718cd47b765e790eecb74d044cc8d37d58562f6c314ee9484df26276d36a38"}, - {file = "lxml-4.9.2-cp36-cp36m-win32.whl", hash = "sha256:d5bf6545cd27aaa8a13033ce56354ed9e25ab0e4ac3b5392b763d8d04b08e0c5"}, - {file = "lxml-4.9.2-cp36-cp36m-win_amd64.whl", hash = "sha256:3ab9fa9d6dc2a7f29d7affdf3edebf6ece6fb28a6d80b14c3b2fb9d39b9322c3"}, - {file = "lxml-4.9.2-cp37-cp37m-macosx_10_15_x86_64.whl", hash = "sha256:05ca3f6abf5cf78fe053da9b1166e062ade3fa5d4f92b4ed688127ea7d7b1d03"}, - {file = "lxml-4.9.2-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:a5da296eb617d18e497bcf0a5c528f5d3b18dadb3619fbdadf4ed2356ef8d941"}, - {file = "lxml-4.9.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:04876580c050a8c5341d706dd464ff04fd597095cc8c023252566a8826505726"}, - {file = "lxml-4.9.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:c9ec3eaf616d67db0764b3bb983962b4f385a1f08304fd30c7283954e6a7869b"}, - {file = "lxml-4.9.2-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2a29ba94d065945944016b6b74e538bdb1751a1db6ffb80c9d3c2e40d6fa9894"}, - {file = "lxml-4.9.2-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:a82d05da00a58b8e4c0008edbc8a4b6ec5a4bc1e2ee0fb6ed157cf634ed7fa45"}, - {file = "lxml-4.9.2-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:223f4232855ade399bd409331e6ca70fb5578efef22cf4069a6090acc0f53c0e"}, - {file = "lxml-4.9.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:d17bc7c2ccf49c478c5bdd447594e82692c74222698cfc9b5daae7ae7e90743b"}, - {file = "lxml-4.9.2-cp37-cp37m-win32.whl", hash = "sha256:b64d891da92e232c36976c80ed7ebb383e3f148489796d8d31a5b6a677825efe"}, - {file = "lxml-4.9.2-cp37-cp37m-win_amd64.whl", hash = "sha256:a0a336d6d3e8b234a3aae3c674873d8f0e720b76bc1d9416866c41cd9500ffb9"}, - {file = "lxml-4.9.2-cp38-cp38-macosx_10_15_x86_64.whl", hash = "sha256:da4dd7c9c50c059aba52b3524f84d7de956f7fef88f0bafcf4ad7dde94a064e8"}, - {file = "lxml-4.9.2-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:821b7f59b99551c69c85a6039c65b75f5683bdc63270fec660f75da67469ca24"}, - {file = "lxml-4.9.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:e5168986b90a8d1f2f9dc1b841467c74221bd752537b99761a93d2d981e04889"}, - {file = "lxml-4.9.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:8e20cb5a47247e383cf4ff523205060991021233ebd6f924bca927fcf25cf86f"}, - {file = "lxml-4.9.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:13598ecfbd2e86ea7ae45ec28a2a54fb87ee9b9fdb0f6d343297d8e548392c03"}, - {file = "lxml-4.9.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:880bbbcbe2fca64e2f4d8e04db47bcdf504936fa2b33933efd945e1b429bea8c"}, - {file = "lxml-4.9.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:7d2278d59425777cfcb19735018d897ca8303abe67cc735f9f97177ceff8027f"}, - {file = "lxml-4.9.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:5344a43228767f53a9df6e5b253f8cdca7dfc7b7aeae52551958192f56d98457"}, - {file = "lxml-4.9.2-cp38-cp38-win32.whl", hash = "sha256:925073b2fe14ab9b87e73f9a5fde6ce6392da430f3004d8b72cc86f746f5163b"}, - {file = "lxml-4.9.2-cp38-cp38-win_amd64.whl", hash = "sha256:9b22c5c66f67ae00c0199f6055705bc3eb3fcb08d03d2ec4059a2b1b25ed48d7"}, - {file = "lxml-4.9.2-cp39-cp39-macosx_10_15_x86_64.whl", hash = "sha256:5f50a1c177e2fa3ee0667a5ab79fdc6b23086bc8b589d90b93b4bd17eb0e64d1"}, - {file = "lxml-4.9.2-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:090c6543d3696cbe15b4ac6e175e576bcc3f1ccfbba970061b7300b0c15a2140"}, - {file = "lxml-4.9.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:63da2ccc0857c311d764e7d3d90f429c252e83b52d1f8f1d1fe55be26827d1f4"}, - {file = "lxml-4.9.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:5b4545b8a40478183ac06c073e81a5ce4cf01bf1734962577cf2bb569a5b3bbf"}, - {file = "lxml-4.9.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2e430cd2824f05f2d4f687701144556646bae8f249fd60aa1e4c768ba7018947"}, - {file = "lxml-4.9.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:6804daeb7ef69e7b36f76caddb85cccd63d0c56dedb47555d2fc969e2af6a1a5"}, - {file = "lxml-4.9.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:a6e441a86553c310258aca15d1c05903aaf4965b23f3bc2d55f200804e005ee5"}, - {file = "lxml-4.9.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:ca34efc80a29351897e18888c71c6aca4a359247c87e0b1c7ada14f0ab0c0fb2"}, - {file = "lxml-4.9.2-cp39-cp39-win32.whl", hash = "sha256:6b418afe5df18233fc6b6093deb82a32895b6bb0b1155c2cdb05203f583053f1"}, - {file = "lxml-4.9.2-cp39-cp39-win_amd64.whl", hash = "sha256:f1496ea22ca2c830cbcbd473de8f114a320da308438ae65abad6bab7867fe38f"}, - {file = "lxml-4.9.2-pp37-pypy37_pp73-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:b264171e3143d842ded311b7dccd46ff9ef34247129ff5bf5066123c55c2431c"}, - {file = "lxml-4.9.2-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:0dc313ef231edf866912e9d8f5a042ddab56c752619e92dfd3a2c277e6a7299a"}, - {file = "lxml-4.9.2-pp38-pypy38_pp73-macosx_10_15_x86_64.whl", hash = "sha256:16efd54337136e8cd72fb9485c368d91d77a47ee2d42b057564aae201257d419"}, - {file = "lxml-4.9.2-pp38-pypy38_pp73-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:0f2b1e0d79180f344ff9f321327b005ca043a50ece8713de61d1cb383fb8ac05"}, - {file = "lxml-4.9.2-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:7b770ed79542ed52c519119473898198761d78beb24b107acf3ad65deae61f1f"}, - {file = "lxml-4.9.2-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:efa29c2fe6b4fdd32e8ef81c1528506895eca86e1d8c4657fda04c9b3786ddf9"}, - {file = "lxml-4.9.2-pp39-pypy39_pp73-macosx_10_15_x86_64.whl", hash = "sha256:7e91ee82f4199af8c43d8158024cbdff3d931df350252288f0d4ce656df7f3b5"}, - {file = "lxml-4.9.2-pp39-pypy39_pp73-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:b23e19989c355ca854276178a0463951a653309fb8e57ce674497f2d9f208746"}, - {file = "lxml-4.9.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:01d36c05f4afb8f7c20fd9ed5badca32a2029b93b1750f571ccc0b142531caf7"}, - {file = "lxml-4.9.2-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:7b515674acfdcadb0eb5d00d8a709868173acece5cb0be3dd165950cbfdf5409"}, - {file = "lxml-4.9.2.tar.gz", hash = "sha256:2455cfaeb7ac70338b3257f41e21f0724f4b5b0c0e7702da67ee6c3640835b67"}, + {file = "lxml-4.9.3-cp27-cp27m-macosx_11_0_x86_64.whl", hash = "sha256:b0a545b46b526d418eb91754565ba5b63b1c0b12f9bd2f808c852d9b4b2f9b5c"}, + {file = "lxml-4.9.3-cp27-cp27m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:075b731ddd9e7f68ad24c635374211376aa05a281673ede86cbe1d1b3455279d"}, + {file = "lxml-4.9.3-cp27-cp27m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:1e224d5755dba2f4a9498e150c43792392ac9b5380aa1b845f98a1618c94eeef"}, + {file = "lxml-4.9.3-cp27-cp27mu-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:c0781a98ff5e6586926293e59480b64ddd46282953203c76ae15dbbbf302e8bb"}, + {file = "lxml-4.9.3-cp27-cp27mu-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:cef2502e7e8a96fe5ad686d60b49e1ab03e438bd9123987994528febd569868e"}, + {file = "lxml-4.9.3-cp310-cp310-macosx_11_0_x86_64.whl", hash = "sha256:b86164d2cff4d3aaa1f04a14685cbc072efd0b4f99ca5708b2ad1b9b5988a991"}, + {file = "lxml-4.9.3-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:42871176e7896d5d45138f6d28751053c711ed4d48d8e30b498da155af39aebd"}, + {file = "lxml-4.9.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:ae8b9c6deb1e634ba4f1930eb67ef6e6bf6a44b6eb5ad605642b2d6d5ed9ce3c"}, + {file = "lxml-4.9.3-cp310-cp310-manylinux_2_28_aarch64.whl", hash = "sha256:411007c0d88188d9f621b11d252cce90c4a2d1a49db6c068e3c16422f306eab8"}, + {file = "lxml-4.9.3-cp310-cp310-manylinux_2_28_x86_64.whl", hash = "sha256:cd47b4a0d41d2afa3e58e5bf1f62069255aa2fd6ff5ee41604418ca925911d76"}, + {file = "lxml-4.9.3-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:0e2cb47860da1f7e9a5256254b74ae331687b9672dfa780eed355c4c9c3dbd23"}, + {file = "lxml-4.9.3-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:1247694b26342a7bf47c02e513d32225ededd18045264d40758abeb3c838a51f"}, + {file = "lxml-4.9.3-cp310-cp310-win32.whl", hash = "sha256:cdb650fc86227eba20de1a29d4b2c1bfe139dc75a0669270033cb2ea3d391b85"}, + {file = "lxml-4.9.3-cp310-cp310-win_amd64.whl", hash = "sha256:97047f0d25cd4bcae81f9ec9dc290ca3e15927c192df17331b53bebe0e3ff96d"}, + {file = "lxml-4.9.3-cp311-cp311-macosx_11_0_universal2.whl", hash = "sha256:1f447ea5429b54f9582d4b955f5f1985f278ce5cf169f72eea8afd9502973dd5"}, + {file = "lxml-4.9.3-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:57d6ba0ca2b0c462f339640d22882acc711de224d769edf29962b09f77129cbf"}, + {file = "lxml-4.9.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:9767e79108424fb6c3edf8f81e6730666a50feb01a328f4a016464a5893f835a"}, + {file = "lxml-4.9.3-cp311-cp311-manylinux_2_28_aarch64.whl", hash = "sha256:71c52db65e4b56b8ddc5bb89fb2e66c558ed9d1a74a45ceb7dcb20c191c3df2f"}, + {file = "lxml-4.9.3-cp311-cp311-manylinux_2_28_x86_64.whl", hash = "sha256:d73d8ecf8ecf10a3bd007f2192725a34bd62898e8da27eb9d32a58084f93962b"}, + {file = "lxml-4.9.3-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:0a3d3487f07c1d7f150894c238299934a2a074ef590b583103a45002035be120"}, + {file = "lxml-4.9.3-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:9e28c51fa0ce5674be9f560c6761c1b441631901993f76700b1b30ca6c8378d6"}, + {file = "lxml-4.9.3-cp311-cp311-win32.whl", hash = "sha256:0bfd0767c5c1de2551a120673b72e5d4b628737cb05414f03c3277bf9bed3305"}, + {file = "lxml-4.9.3-cp311-cp311-win_amd64.whl", hash = "sha256:25f32acefac14ef7bd53e4218fe93b804ef6f6b92ffdb4322bb6d49d94cad2bc"}, + {file = "lxml-4.9.3-cp312-cp312-macosx_11_0_universal2.whl", hash = "sha256:d3ff32724f98fbbbfa9f49d82852b159e9784d6094983d9a8b7f2ddaebb063d4"}, + {file = "lxml-4.9.3-cp312-cp312-manylinux_2_28_aarch64.whl", hash = "sha256:48d6ed886b343d11493129e019da91d4039826794a3e3027321c56d9e71505be"}, + {file = "lxml-4.9.3-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:9a92d3faef50658dd2c5470af249985782bf754c4e18e15afb67d3ab06233f13"}, + {file = "lxml-4.9.3-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:b4e4bc18382088514ebde9328da057775055940a1f2e18f6ad2d78aa0f3ec5b9"}, + {file = "lxml-4.9.3-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:fc9b106a1bf918db68619fdcd6d5ad4f972fdd19c01d19bdb6bf63f3589a9ec5"}, + {file = "lxml-4.9.3-cp312-cp312-win_amd64.whl", hash = "sha256:d37017287a7adb6ab77e1c5bee9bcf9660f90ff445042b790402a654d2ad81d8"}, + {file = "lxml-4.9.3-cp35-cp35m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:56dc1f1ebccc656d1b3ed288f11e27172a01503fc016bcabdcbc0978b19352b7"}, + {file = "lxml-4.9.3-cp35-cp35m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:578695735c5a3f51569810dfebd05dd6f888147a34f0f98d4bb27e92b76e05c2"}, + {file = "lxml-4.9.3-cp35-cp35m-win32.whl", hash = "sha256:704f61ba8c1283c71b16135caf697557f5ecf3e74d9e453233e4771d68a1f42d"}, + {file = "lxml-4.9.3-cp35-cp35m-win_amd64.whl", hash = "sha256:c41bfca0bd3532d53d16fd34d20806d5c2b1ace22a2f2e4c0008570bf2c58833"}, + {file = "lxml-4.9.3-cp36-cp36m-macosx_11_0_x86_64.whl", hash = "sha256:64f479d719dc9f4c813ad9bb6b28f8390360660b73b2e4beb4cb0ae7104f1c12"}, + {file = "lxml-4.9.3-cp36-cp36m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:dd708cf4ee4408cf46a48b108fb9427bfa00b9b85812a9262b5c668af2533ea5"}, + {file = "lxml-4.9.3-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5c31c7462abdf8f2ac0577d9f05279727e698f97ecbb02f17939ea99ae8daa98"}, + {file = "lxml-4.9.3-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:e3cd95e10c2610c360154afdc2f1480aea394f4a4f1ea0a5eacce49640c9b190"}, + {file = "lxml-4.9.3-cp36-cp36m-manylinux_2_28_x86_64.whl", hash = "sha256:4930be26af26ac545c3dffb662521d4e6268352866956672231887d18f0eaab2"}, + {file = "lxml-4.9.3-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:4aec80cde9197340bc353d2768e2a75f5f60bacda2bab72ab1dc499589b3878c"}, + {file = "lxml-4.9.3-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:14e019fd83b831b2e61baed40cab76222139926b1fb5ed0e79225bc0cae14584"}, + {file = "lxml-4.9.3-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:0c0850c8b02c298d3c7006b23e98249515ac57430e16a166873fc47a5d549287"}, + {file = "lxml-4.9.3-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:aca086dc5f9ef98c512bac8efea4483eb84abbf926eaeedf7b91479feb092458"}, + {file = "lxml-4.9.3-cp36-cp36m-win32.whl", hash = "sha256:50baa9c1c47efcaef189f31e3d00d697c6d4afda5c3cde0302d063492ff9b477"}, + {file = "lxml-4.9.3-cp36-cp36m-win_amd64.whl", hash = "sha256:bef4e656f7d98aaa3486d2627e7d2df1157d7e88e7efd43a65aa5dd4714916cf"}, + {file = "lxml-4.9.3-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:46f409a2d60f634fe550f7133ed30ad5321ae2e6630f13657fb9479506b00601"}, + {file = "lxml-4.9.3-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:4c28a9144688aef80d6ea666c809b4b0e50010a2aca784c97f5e6bf143d9f129"}, + {file = "lxml-4.9.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:141f1d1a9b663c679dc524af3ea1773e618907e96075262726c7612c02b149a4"}, + {file = "lxml-4.9.3-cp37-cp37m-manylinux_2_28_x86_64.whl", hash = "sha256:53ace1c1fd5a74ef662f844a0413446c0629d151055340e9893da958a374f70d"}, + {file = "lxml-4.9.3-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:17a753023436a18e27dd7769e798ce302963c236bc4114ceee5b25c18c52c693"}, + {file = "lxml-4.9.3-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:7d298a1bd60c067ea75d9f684f5f3992c9d6766fadbc0bcedd39750bf344c2f4"}, + {file = "lxml-4.9.3-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:081d32421db5df44c41b7f08a334a090a545c54ba977e47fd7cc2deece78809a"}, + {file = "lxml-4.9.3-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:23eed6d7b1a3336ad92d8e39d4bfe09073c31bfe502f20ca5116b2a334f8ec02"}, + {file = "lxml-4.9.3-cp37-cp37m-win32.whl", hash = "sha256:1509dd12b773c02acd154582088820893109f6ca27ef7291b003d0e81666109f"}, + {file = "lxml-4.9.3-cp37-cp37m-win_amd64.whl", hash = "sha256:120fa9349a24c7043854c53cae8cec227e1f79195a7493e09e0c12e29f918e52"}, + {file = "lxml-4.9.3-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:4d2d1edbca80b510443f51afd8496be95529db04a509bc8faee49c7b0fb6d2cc"}, + {file = "lxml-4.9.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:8d7e43bd40f65f7d97ad8ef5c9b1778943d02f04febef12def25f7583d19baac"}, + {file = "lxml-4.9.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:71d66ee82e7417828af6ecd7db817913cb0cf9d4e61aa0ac1fde0583d84358db"}, + {file = "lxml-4.9.3-cp38-cp38-manylinux_2_28_x86_64.whl", hash = "sha256:6fc3c450eaa0b56f815c7b62f2b7fba7266c4779adcf1cece9e6deb1de7305ce"}, + {file = "lxml-4.9.3-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:65299ea57d82fb91c7f019300d24050c4ddeb7c5a190e076b5f48a2b43d19c42"}, + {file = "lxml-4.9.3-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:eadfbbbfb41b44034a4c757fd5d70baccd43296fb894dba0295606a7cf3124aa"}, + {file = "lxml-4.9.3-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:3e9bdd30efde2b9ccfa9cb5768ba04fe71b018a25ea093379c857c9dad262c40"}, + {file = "lxml-4.9.3-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:fcdd00edfd0a3001e0181eab3e63bd5c74ad3e67152c84f93f13769a40e073a7"}, + {file = "lxml-4.9.3-cp38-cp38-win32.whl", hash = "sha256:57aba1bbdf450b726d58b2aea5fe47c7875f5afb2c4a23784ed78f19a0462574"}, + {file = "lxml-4.9.3-cp38-cp38-win_amd64.whl", hash = "sha256:92af161ecbdb2883c4593d5ed4815ea71b31fafd7fd05789b23100d081ecac96"}, + {file = "lxml-4.9.3-cp39-cp39-macosx_11_0_x86_64.whl", hash = "sha256:9bb6ad405121241e99a86efff22d3ef469024ce22875a7ae045896ad23ba2340"}, + {file = "lxml-4.9.3-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:8ed74706b26ad100433da4b9d807eae371efaa266ffc3e9191ea436087a9d6a7"}, + {file = "lxml-4.9.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:fbf521479bcac1e25a663df882c46a641a9bff6b56dc8b0fafaebd2f66fb231b"}, + {file = "lxml-4.9.3-cp39-cp39-manylinux_2_28_aarch64.whl", hash = "sha256:303bf1edce6ced16bf67a18a1cf8339d0db79577eec5d9a6d4a80f0fb10aa2da"}, + {file = "lxml-4.9.3-cp39-cp39-manylinux_2_28_x86_64.whl", hash = "sha256:5515edd2a6d1a5a70bfcdee23b42ec33425e405c5b351478ab7dc9347228f96e"}, + {file = "lxml-4.9.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:690dafd0b187ed38583a648076865d8c229661ed20e48f2335d68e2cf7dc829d"}, + {file = "lxml-4.9.3-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:b6420a005548ad52154c8ceab4a1290ff78d757f9e5cbc68f8c77089acd3c432"}, + {file = "lxml-4.9.3-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:bb3bb49c7a6ad9d981d734ef7c7193bc349ac338776a0360cc671eaee89bcf69"}, + {file = "lxml-4.9.3-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:d27be7405547d1f958b60837dc4c1007da90b8b23f54ba1f8b728c78fdb19d50"}, + {file = "lxml-4.9.3-cp39-cp39-win32.whl", hash = "sha256:8df133a2ea5e74eef5e8fc6f19b9e085f758768a16e9877a60aec455ed2609b2"}, + {file = "lxml-4.9.3-cp39-cp39-win_amd64.whl", hash = "sha256:4dd9a263e845a72eacb60d12401e37c616438ea2e5442885f65082c276dfb2b2"}, + {file = "lxml-4.9.3-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:6689a3d7fd13dc687e9102a27e98ef33730ac4fe37795d5036d18b4d527abd35"}, + {file = "lxml-4.9.3-pp37-pypy37_pp73-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:f6bdac493b949141b733c5345b6ba8f87a226029cbabc7e9e121a413e49441e0"}, + {file = "lxml-4.9.3-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:05186a0f1346ae12553d66df1cfce6f251589fea3ad3da4f3ef4e34b2d58c6a3"}, + {file = "lxml-4.9.3-pp37-pypy37_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:c2006f5c8d28dee289f7020f721354362fa304acbaaf9745751ac4006650254b"}, + {file = "lxml-4.9.3-pp38-pypy38_pp73-macosx_11_0_x86_64.whl", hash = "sha256:5c245b783db29c4e4fbbbfc9c5a78be496c9fea25517f90606aa1f6b2b3d5f7b"}, + {file = "lxml-4.9.3-pp38-pypy38_pp73-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:4fb960a632a49f2f089d522f70496640fdf1218f1243889da3822e0a9f5f3ba7"}, + {file = "lxml-4.9.3-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:50670615eaf97227d5dc60de2dc99fb134a7130d310d783314e7724bf163f75d"}, + {file = "lxml-4.9.3-pp38-pypy38_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:9719fe17307a9e814580af1f5c6e05ca593b12fb7e44fe62450a5384dbf61b4b"}, + {file = "lxml-4.9.3-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:3331bece23c9ee066e0fb3f96c61322b9e0f54d775fccefff4c38ca488de283a"}, + {file = "lxml-4.9.3-pp39-pypy39_pp73-macosx_11_0_x86_64.whl", hash = "sha256:ed667f49b11360951e201453fc3967344d0d0263aa415e1619e85ae7fd17b4e0"}, + {file = "lxml-4.9.3-pp39-pypy39_pp73-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:8b77946fd508cbf0fccd8e400a7f71d4ac0e1595812e66025bac475a8e811694"}, + {file = "lxml-4.9.3-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:e4da8ca0c0c0aea88fd46be8e44bd49716772358d648cce45fe387f7b92374a7"}, + {file = "lxml-4.9.3-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:fe4bda6bd4340caa6e5cf95e73f8fea5c4bfc55763dd42f1b50a94c1b4a2fbd4"}, + {file = "lxml-4.9.3-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:f3df3db1d336b9356dd3112eae5f5c2b8b377f3bc826848567f10bfddfee77e9"}, + {file = "lxml-4.9.3.tar.gz", hash = "sha256:48628bd53a426c9eb9bc066a923acaa0878d1e86129fd5359aee99285f4eed9c"}, ] [package.extras] cssselect = ["cssselect (>=0.7)"] html5 = ["html5lib"] htmlsoup = ["BeautifulSoup4"] -source = ["Cython (>=0.29.7)"] +source = ["Cython (>=0.29.35)"] [[package]] name = "polib" diff --git a/c-api/datetime.po b/c-api/datetime.po index aaf1c117c2..86b591964a 100644 --- a/c-api/datetime.po +++ b/c-api/datetime.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-07-15 00:18+0000\n" +"POT-Creation-Date: 2023-08-22 00:03+0000\n" "PO-Revision-Date: 2023-07-01 04:14+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -31,43 +31,92 @@ msgid "" "Various date and time objects are supplied by the :mod:`datetime` module. " "Before using any of these functions, the header file :file:`datetime.h` must " "be included in your source (note that this is not included by :file:`Python." -"h`), and the macro :c:macro:`PyDateTime_IMPORT` must be invoked, usually as " +"h`), and the macro :c:macro:`!PyDateTime_IMPORT` must be invoked, usually as " "part of the module initialisation function. The macro puts a pointer to a C " -"structure into a static variable, :c:data:`PyDateTimeAPI`, that is used by " +"structure into a static variable, :c:data:`!PyDateTimeAPI`, that is used by " "the following macros." msgstr "" ":mod:`datetime` 模組提供各種日期和時間物件。在使用任何這些函式之前,必須將標" "頭檔 :file:`datetime.h` 引入於原始碼中(請注意,:file:`Python.h` 並無引入該標" -"頭檔),且巨集 :c:macro:`PyDateTime_IMPORT` 必須被調用,而這通常作為模組初始" +"頭檔),且巨集 :c:macro:`!PyDateTime_IMPORT` 必須被調用,而這通常作為模組初始" "化函式的一部分。該巨集將指向 C 結構的指標放入靜態變數 :c:data:" -"`PyDateTimeAPI` 中,該變數會被以下巨集使用。" +"`!PyDateTimeAPI` 中,該變數會被以下巨集使用。" -#: ../../c-api/datetime.rst:16 +#: ../../c-api/datetime.rst:18 +msgid "This subtype of :c:type:`PyObject` represents a Python date object." +msgstr "" + +#: ../../c-api/datetime.rst:22 +msgid "This subtype of :c:type:`PyObject` represents a Python datetime object." +msgstr "" + +#: ../../c-api/datetime.rst:26 +msgid "This subtype of :c:type:`PyObject` represents a Python time object." +msgstr "" + +#: ../../c-api/datetime.rst:30 +msgid "" +"This subtype of :c:type:`PyObject` represents the difference between two " +"datetime values." +msgstr "" + +#: ../../c-api/datetime.rst:34 +msgid "" +"This instance of :c:type:`PyTypeObject` represents the Python date type; it " +"is the same object as :class:`datetime.date` in the Python layer." +msgstr "" + +#: ../../c-api/datetime.rst:39 +msgid "" +"This instance of :c:type:`PyTypeObject` represents the Python datetime type; " +"it is the same object as :class:`datetime.datetime` in the Python layer." +msgstr "" + +#: ../../c-api/datetime.rst:44 +msgid "" +"This instance of :c:type:`PyTypeObject` represents the Python time type; it " +"is the same object as :class:`datetime.time` in the Python layer." +msgstr "" + +#: ../../c-api/datetime.rst:49 +msgid "" +"This instance of :c:type:`PyTypeObject` represents Python type for the " +"difference between two datetime values; it is the same object as :class:" +"`datetime.timedelta` in the Python layer." +msgstr "" + +#: ../../c-api/datetime.rst:55 +msgid "" +"This instance of :c:type:`PyTypeObject` represents the Python time zone info " +"type; it is the same object as :class:`datetime.tzinfo` in the Python layer." +msgstr "" + +#: ../../c-api/datetime.rst:59 msgid "Macro for access to the UTC singleton:" msgstr "用於存取 UTC 單例 (singleton) 的巨集:" -#: ../../c-api/datetime.rst:20 +#: ../../c-api/datetime.rst:63 msgid "" "Returns the time zone singleton representing UTC, the same object as :attr:" "`datetime.timezone.utc`." msgstr "" "回傳表示 UTC 的時區單例,是與 :attr:`datetime.timezone.utc` 相同的物件。" -#: ../../c-api/datetime.rst:26 +#: ../../c-api/datetime.rst:69 msgid "Type-check macros:" msgstr "型別檢查巨集:" -#: ../../c-api/datetime.rst:30 +#: ../../c-api/datetime.rst:73 msgid "" "Return true if *ob* is of type :c:data:`PyDateTime_DateType` or a subtype " -"of :c:data:`PyDateTime_DateType`. *ob* must not be ``NULL``. This function " -"always succeeds." +"of :c:data:`!PyDateTime_DateType`. *ob* must not be ``NULL``. This " +"function always succeeds." msgstr "" "如果 *ob* 的型別為 :c:data:`PyDateTime_DateType` 或 :c:data:" -"`PyDateTime_DateType` 的子型別,則回傳 true。 *ob* 不得為 ``NULL``。這個函式" +"`!PyDateTime_DateType` 的子型別,則回傳 true。 *ob* 不得為 ``NULL``。這個函式" "一定會執行成功。" -#: ../../c-api/datetime.rst:37 +#: ../../c-api/datetime.rst:80 msgid "" "Return true if *ob* is of type :c:data:`PyDateTime_DateType`. *ob* must not " "be ``NULL``. This function always succeeds." @@ -75,17 +124,17 @@ msgstr "" "如果 *ob* 的型別為 :c:data:`PyDateTime_DateType`,則回傳 true。 *ob* 不得為 " "``NULL``。這個函式一定會執行成功。" -#: ../../c-api/datetime.rst:43 +#: ../../c-api/datetime.rst:86 msgid "" "Return true if *ob* is of type :c:data:`PyDateTime_DateTimeType` or a " -"subtype of :c:data:`PyDateTime_DateTimeType`. *ob* must not be ``NULL``. " +"subtype of :c:data:`!PyDateTime_DateTimeType`. *ob* must not be ``NULL``. " "This function always succeeds." msgstr "" "如果 *ob* 的型別為 :c:data:`PyDateTime_DateTimeType` 或 :c:data:" -"`PyDateTime_DateTimeType` 的子型別,則回傳 true。*ob* 不得為 ``NULL``。這個函" +"`!PyDateTime_DateTimeType` 的子型別,則回傳 true。*ob* 不得為 ``NULL``。這個函" "式一定會執行成功。" -#: ../../c-api/datetime.rst:50 +#: ../../c-api/datetime.rst:93 msgid "" "Return true if *ob* is of type :c:data:`PyDateTime_DateTimeType`. *ob* must " "not be ``NULL``. This function always succeeds." @@ -93,17 +142,17 @@ msgstr "" "如果 *ob* 的型別為 :c:data:`PyDateTime_DateTimeType`,則回傳 true。*ob* 不得" "為 ``NULL``。這個函式一定會執行成功。" -#: ../../c-api/datetime.rst:56 +#: ../../c-api/datetime.rst:99 msgid "" "Return true if *ob* is of type :c:data:`PyDateTime_TimeType` or a subtype " -"of :c:data:`PyDateTime_TimeType`. *ob* must not be ``NULL``. This function " -"always succeeds." +"of :c:data:`!PyDateTime_TimeType`. *ob* must not be ``NULL``. This " +"function always succeeds." msgstr "" "如果 *ob* 的型別為 :c:data:`PyDateTime_TimeType` 或 :c:data:" -"`PyDateTime_TimeType` 的子型別,則回傳 true。*ob* 不得為 ``NULL``。這個函式一" +"`!PyDateTime_TimeType` 的子型別,則回傳 true。*ob* 不得為 ``NULL``。這個函式一" "定會執行成功。" -#: ../../c-api/datetime.rst:63 +#: ../../c-api/datetime.rst:106 msgid "" "Return true if *ob* is of type :c:data:`PyDateTime_TimeType`. *ob* must not " "be ``NULL``. This function always succeeds." @@ -111,17 +160,17 @@ msgstr "" "如果 *ob* 的型別為 :c:data:`PyDateTime_TimeType`,則回傳 true。*ob* 不得為 " "``NULL``。這個函式一定會執行成功。" -#: ../../c-api/datetime.rst:69 +#: ../../c-api/datetime.rst:112 msgid "" "Return true if *ob* is of type :c:data:`PyDateTime_DeltaType` or a subtype " -"of :c:data:`PyDateTime_DeltaType`. *ob* must not be ``NULL``. This " +"of :c:data:`!PyDateTime_DeltaType`. *ob* must not be ``NULL``. This " "function always succeeds." msgstr "" "如果 *ob* 的型別為 :c:data:`PyDateTime_DeltaType` 或 :c:data:" -"`PyDateTime_DeltaType` 的子型別,則回傳 true。*ob* 不得為 ``NULL``。這個函式" +"`!PyDateTime_DeltaType` 的子型別,則回傳 true。*ob* 不得為 ``NULL``。這個函式" "一定會執行成功。" -#: ../../c-api/datetime.rst:76 +#: ../../c-api/datetime.rst:119 msgid "" "Return true if *ob* is of type :c:data:`PyDateTime_DeltaType`. *ob* must not " "be ``NULL``. This function always succeeds." @@ -129,17 +178,17 @@ msgstr "" "如果 *ob* 的型別為 :c:data:`PyDateTime_DeltaType`,則回傳 true。*ob* 不得為 " "``NULL``。這個函式一定會執行成功。" -#: ../../c-api/datetime.rst:82 +#: ../../c-api/datetime.rst:125 msgid "" "Return true if *ob* is of type :c:data:`PyDateTime_TZInfoType` or a subtype " -"of :c:data:`PyDateTime_TZInfoType`. *ob* must not be ``NULL``. This " +"of :c:data:`!PyDateTime_TZInfoType`. *ob* must not be ``NULL``. This " "function always succeeds." msgstr "" "如果 *ob* 的型別為 :c:data:`PyDateTime_TZInfoType` 或 :c:data:" -"`PyDateTime_TZInfoType` 的子型別,則回傳 true。*ob* 不得為 ``NULL``。這個函式" +"`!PyDateTime_TZInfoType` 的子型別,則回傳 true。*ob* 不得為 ``NULL``。這個函式" "一定會執行成功。" -#: ../../c-api/datetime.rst:89 +#: ../../c-api/datetime.rst:132 msgid "" "Return true if *ob* is of type :c:data:`PyDateTime_TZInfoType`. *ob* must " "not be ``NULL``. This function always succeeds." @@ -147,24 +196,24 @@ msgstr "" "如果 *ob* 的型別為 :c:data:`PyDateTime_TZInfoType`,則回傳 true。 *ob* 不得" "為 ``NULL``。這個函式一定會執行成功。" -#: ../../c-api/datetime.rst:93 +#: ../../c-api/datetime.rst:136 msgid "Macros to create objects:" msgstr "建立物件的巨集:" -#: ../../c-api/datetime.rst:97 +#: ../../c-api/datetime.rst:140 msgid "" "Return a :class:`datetime.date` object with the specified year, month and " "day." msgstr "回傳一個有特定年、月、日的物件 :class:`datetime.date`。" -#: ../../c-api/datetime.rst:102 +#: ../../c-api/datetime.rst:145 msgid "" "Return a :class:`datetime.datetime` object with the specified year, month, " "day, hour, minute, second and microsecond." msgstr "" "回傳一個有特定年、月、日、時、分、秒、微秒的物件 :class:`datetime.datetime`。" -#: ../../c-api/datetime.rst:108 +#: ../../c-api/datetime.rst:151 msgid "" "Return a :class:`datetime.datetime` object with the specified year, month, " "day, hour, minute, second, microsecond and fold." @@ -172,13 +221,13 @@ msgstr "" "回傳一個有特定年、月、日、時、分、秒、微秒與 fold(時間折疊)的物件 :class:" "`datetime.datetime`。" -#: ../../c-api/datetime.rst:116 +#: ../../c-api/datetime.rst:159 msgid "" "Return a :class:`datetime.time` object with the specified hour, minute, " "second and microsecond." msgstr "回傳一個有特定時、分、秒、微秒的物件 :class:`datetime.date`。" -#: ../../c-api/datetime.rst:122 +#: ../../c-api/datetime.rst:165 msgid "" "Return a :class:`datetime.time` object with the specified hour, minute, " "second, microsecond and fold." @@ -186,7 +235,7 @@ msgstr "" "回傳一個有特定時、分、秒、微秒與 fold(時間折疊)的物件 :class:`datetime." "time`。" -#: ../../c-api/datetime.rst:130 +#: ../../c-api/datetime.rst:173 msgid "" "Return a :class:`datetime.timedelta` object representing the given number of " "days, seconds and microseconds. Normalization is performed so that the " @@ -197,7 +246,7 @@ msgstr "" "標準化 (normalization) 以便生成的微秒數和秒數位於 :class:`datetime." "timedelta` 物件記錄的範圍內。" -#: ../../c-api/datetime.rst:138 +#: ../../c-api/datetime.rst:181 msgid "" "Return a :class:`datetime.timezone` object with an unnamed fixed offset " "represented by the *offset* argument." @@ -205,7 +254,7 @@ msgstr "" "回傳一個 :class:`datetime.timezone` 物件,其未命名的固定偏移量由 *offset* 引" "數表示。" -#: ../../c-api/datetime.rst:146 +#: ../../c-api/datetime.rst:189 msgid "" "Return a :class:`datetime.timezone` object with a fixed offset represented " "by the *offset* argument and with tzname *name*." @@ -213,97 +262,97 @@ msgstr "" "回傳一個 :class:`datetime.timezone` 物件,其固定偏移量由 *offset* 引數表示," "並帶有 tzname *name*。" -#: ../../c-api/datetime.rst:152 +#: ../../c-api/datetime.rst:195 msgid "" "Macros to extract fields from date objects. The argument must be an " -"instance of :c:data:`PyDateTime_Date`, including subclasses (such as :c:data:" +"instance of :c:type:`PyDateTime_Date`, including subclasses (such as :c:type:" "`PyDateTime_DateTime`). The argument must not be ``NULL``, and the type is " "not checked:" msgstr "" -"從 date 物件中提取欄位的巨集。引數必須是個 :c:data:`PyDateTime_Date` 的實例," -"包括子類別(例如 :c:data:`PyDateTime_DateTime`)。引數不得為 ``NULL``,並且不" +"從 date 物件中提取欄位的巨集。引數必須是個 :c:type:`PyDateTime_Date` 的實例," +"包括子類別(例如 :c:type:`PyDateTime_DateTime`)。引數不得為 ``NULL``,並且不" "會檢查型別:" -#: ../../c-api/datetime.rst:159 +#: ../../c-api/datetime.rst:202 msgid "Return the year, as a positive int." msgstr "回傳年份,為正整數。" -#: ../../c-api/datetime.rst:164 +#: ../../c-api/datetime.rst:207 msgid "Return the month, as an int from 1 through 12." msgstr "回傳月份,為正整數,從 1 到 12。" -#: ../../c-api/datetime.rst:169 +#: ../../c-api/datetime.rst:212 msgid "Return the day, as an int from 1 through 31." msgstr "回傳日期,為正整數,從 1 到 31。" -#: ../../c-api/datetime.rst:172 +#: ../../c-api/datetime.rst:215 msgid "" "Macros to extract fields from datetime objects. The argument must be an " -"instance of :c:data:`PyDateTime_DateTime`, including subclasses. The " +"instance of :c:type:`PyDateTime_DateTime`, including subclasses. The " "argument must not be ``NULL``, and the type is not checked:" msgstr "" -"從 datetime 物件中提取欄位的巨集。引數必須是個 :c:data:`PyDateTime_DateTime` " +"從 datetime 物件中提取欄位的巨集。引數必須是個 :c:type:`PyDateTime_DateTime` " "的實例,包括子類別。引數不得為 ``NULL``,並且不會檢查型別:" -#: ../../c-api/datetime.rst:178 ../../c-api/datetime.rst:216 +#: ../../c-api/datetime.rst:221 ../../c-api/datetime.rst:259 msgid "Return the hour, as an int from 0 through 23." msgstr "回傳小時,為正整數,從 0 到 23。" -#: ../../c-api/datetime.rst:183 ../../c-api/datetime.rst:221 +#: ../../c-api/datetime.rst:226 ../../c-api/datetime.rst:264 msgid "Return the minute, as an int from 0 through 59." msgstr "回傳分鐘,為正整數,從 0 到 59。" -#: ../../c-api/datetime.rst:188 ../../c-api/datetime.rst:226 +#: ../../c-api/datetime.rst:231 ../../c-api/datetime.rst:269 msgid "Return the second, as an int from 0 through 59." msgstr "回傳秒,為正整數,從0 到59。" -#: ../../c-api/datetime.rst:193 ../../c-api/datetime.rst:231 +#: ../../c-api/datetime.rst:236 ../../c-api/datetime.rst:274 msgid "Return the microsecond, as an int from 0 through 999999." msgstr "回傳微秒,為正整數,從 0 到 999999。" -#: ../../c-api/datetime.rst:198 ../../c-api/datetime.rst:236 +#: ../../c-api/datetime.rst:241 ../../c-api/datetime.rst:279 msgid "Return the fold, as an int from 0 through 1." msgstr "回傳 fold,為 0 或 1 的正整數。" -#: ../../c-api/datetime.rst:205 ../../c-api/datetime.rst:243 +#: ../../c-api/datetime.rst:248 ../../c-api/datetime.rst:286 msgid "Return the tzinfo (which may be ``None``)." msgstr "回傳 tzinfo(可能是 ``None``)。" -#: ../../c-api/datetime.rst:210 +#: ../../c-api/datetime.rst:253 msgid "" "Macros to extract fields from time objects. The argument must be an " -"instance of :c:data:`PyDateTime_Time`, including subclasses. The argument " +"instance of :c:type:`PyDateTime_Time`, including subclasses. The argument " "must not be ``NULL``, and the type is not checked:" msgstr "" -"從 time 物件中提取欄位的巨集。引數必須是個 :c:data:`PyDateTime_Time` 的實例," +"從 time 物件中提取欄位的巨集。引數必須是個 :c:type:`PyDateTime_Time` 的實例," "包括子類別。引數不得為 ``NULL``,並且不會檢查型別:" -#: ../../c-api/datetime.rst:248 +#: ../../c-api/datetime.rst:291 msgid "" "Macros to extract fields from time delta objects. The argument must be an " -"instance of :c:data:`PyDateTime_Delta`, including subclasses. The argument " +"instance of :c:type:`PyDateTime_Delta`, including subclasses. The argument " "must not be ``NULL``, and the type is not checked:" msgstr "" -"從 time delta 物件中提取欄位的巨集。引數必須是個 :c:data:`PyDateTime_Delta` " +"從 time delta 物件中提取欄位的巨集。引數必須是個 :c:type:`PyDateTime_Delta` " "的實例,包括子類別。引數不能為 ``NULL``,並且不會檢查型別:" -#: ../../c-api/datetime.rst:254 +#: ../../c-api/datetime.rst:297 msgid "Return the number of days, as an int from -999999999 to 999999999." msgstr "以 -999999999 到 999999999 之間的整數形式回傳天數。" -#: ../../c-api/datetime.rst:261 +#: ../../c-api/datetime.rst:304 msgid "Return the number of seconds, as an int from 0 through 86399." msgstr "以 0 到 86399 之間的整數形式回傳秒數。" -#: ../../c-api/datetime.rst:268 +#: ../../c-api/datetime.rst:311 msgid "Return the number of microseconds, as an int from 0 through 999999." msgstr "以 0 到 999999 之間的整數形式回傳微秒數。" -#: ../../c-api/datetime.rst:273 +#: ../../c-api/datetime.rst:316 msgid "Macros for the convenience of modules implementing the DB API:" msgstr "為了方便模組實作 DB API 的巨集:" -#: ../../c-api/datetime.rst:277 +#: ../../c-api/datetime.rst:320 msgid "" "Create and return a new :class:`datetime.datetime` object given an argument " "tuple suitable for passing to :meth:`datetime.datetime.fromtimestamp()`." @@ -311,7 +360,7 @@ msgstr "" "給定一個適合傳遞給 :meth:`datetime.datetime.fromtimestamp()` 的引數元組,建立" "並回傳一個新的 :class:`datetime.datetime` 物件。" -#: ../../c-api/datetime.rst:283 +#: ../../c-api/datetime.rst:326 msgid "" "Create and return a new :class:`datetime.date` object given an argument " "tuple suitable for passing to :meth:`datetime.date.fromtimestamp()`." diff --git a/c-api/dict.po b/c-api/dict.po index f6b39b92e0..5f484c64d1 100644 --- a/c-api/dict.po +++ b/c-api/dict.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-08-26 00:03+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-" @@ -90,9 +90,9 @@ msgstr "" #: ../../c-api/dict.rst:75 msgid "" "Insert *val* into the dictionary *p* using *key* as a key. *key* should be " -"a :c:expr:`const char*`. The key object is created using " -"``PyUnicode_FromString(key)``. Return ``0`` on success or ``-1`` on " -"failure. This function *does not* steal a reference to *val*." +"a :c:expr:`const char*` UTF-8 encoded bytes string. The key object is " +"created using ``PyUnicode_FromString(key)``. Return ``0`` on success or " +"``-1`` on failure. This function *does not* steal a reference to *val*." msgstr "" #: ../../c-api/dict.rst:83 @@ -105,44 +105,45 @@ msgstr "" #: ../../c-api/dict.rst:91 msgid "" -"Remove the entry in dictionary *p* which has a key specified by the string " -"*key*. If *key* is not in the dictionary, :exc:`KeyError` is raised. Return " -"``0`` on success or ``-1`` on failure." +"Remove the entry in dictionary *p* which has a key specified by the UTF-8 " +"encoded bytes string *key*. If *key* is not in the dictionary, :exc:" +"`KeyError` is raised. Return ``0`` on success or ``-1`` on failure." msgstr "" -#: ../../c-api/dict.rst:98 +#: ../../c-api/dict.rst:99 msgid "" "Return the object from dictionary *p* which has a key *key*. Return " "``NULL`` if the key *key* is not present, but *without* setting an exception." msgstr "" -#: ../../c-api/dict.rst:103 +#: ../../c-api/dict.rst:104 msgid "" "Exceptions that occur while this calls :meth:`~object.__hash__` and :meth:" "`~object.__eq__` methods are silently ignored. Prefer the :c:func:" "`PyDict_GetItemWithError` function instead." msgstr "" -#: ../../c-api/dict.rst:107 +#: ../../c-api/dict.rst:108 msgid "" "Calling this API without :term:`GIL` held had been allowed for historical " "reason. It is no longer allowed." msgstr "" -#: ../../c-api/dict.rst:114 +#: ../../c-api/dict.rst:115 msgid "" "Variant of :c:func:`PyDict_GetItem` that does not suppress exceptions. " "Return ``NULL`` **with** an exception set if an exception occurred. Return " "``NULL`` **without** an exception set if the key wasn't present." msgstr "" -#: ../../c-api/dict.rst:122 +#: ../../c-api/dict.rst:123 msgid "" "This is the same as :c:func:`PyDict_GetItem`, but *key* is specified as a :c:" -"expr:`const char*`, rather than a :c:expr:`PyObject*`." +"expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" +"`PyObject*`." msgstr "" -#: ../../c-api/dict.rst:127 +#: ../../c-api/dict.rst:129 msgid "" "Exceptions that occur while this calls :meth:`~object.__hash__` and :meth:" "`~object.__eq__` methods or while creating the temporary :class:`str` object " @@ -150,7 +151,7 @@ msgid "" "function with your own :c:func:`PyUnicode_FromString` *key* instead." msgstr "" -#: ../../c-api/dict.rst:136 +#: ../../c-api/dict.rst:138 msgid "" "This is the same as the Python-level :meth:`dict.setdefault`. If present, " "it returns the value corresponding to *key* from the dictionary *p*. If the " @@ -160,29 +161,29 @@ msgid "" "the insertion." msgstr "" -#: ../../c-api/dict.rst:146 +#: ../../c-api/dict.rst:148 msgid "" "Return a :c:type:`PyListObject` containing all the items from the dictionary." msgstr "" -#: ../../c-api/dict.rst:151 +#: ../../c-api/dict.rst:153 msgid "" "Return a :c:type:`PyListObject` containing all the keys from the dictionary." msgstr "" -#: ../../c-api/dict.rst:156 +#: ../../c-api/dict.rst:158 msgid "" "Return a :c:type:`PyListObject` containing all the values from the " "dictionary *p*." msgstr "" -#: ../../c-api/dict.rst:164 +#: ../../c-api/dict.rst:166 msgid "" "Return the number of items in the dictionary. This is equivalent to " "``len(p)`` on a dictionary." msgstr "" -#: ../../c-api/dict.rst:170 +#: ../../c-api/dict.rst:172 msgid "" "Iterate over all key-value pairs in the dictionary *p*. The :c:type:" "`Py_ssize_t` referred to by *ppos* must be initialized to ``0`` prior to the " @@ -196,21 +197,21 @@ msgid "" "structure is sparse, the offsets are not consecutive." msgstr "" -#: ../../c-api/dict.rst:181 +#: ../../c-api/dict.rst:183 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../c-api/dict.rst:191 +#: ../../c-api/dict.rst:193 msgid "" "The dictionary *p* should not be mutated during iteration. It is safe to " "modify the values of the keys as you iterate over the dictionary, but only " "so long as the set of keys does not change. For example::" msgstr "" -#: ../../c-api/dict.rst:216 +#: ../../c-api/dict.rst:218 msgid "" "Iterate over mapping object *b* adding key-value pairs to dictionary *a*. " "*b* may be a dictionary, or any object supporting :c:func:`PyMapping_Keys` " @@ -220,7 +221,7 @@ msgid "" "or ``-1`` if an exception was raised." msgstr "" -#: ../../c-api/dict.rst:226 +#: ../../c-api/dict.rst:228 msgid "" "This is the same as ``PyDict_Merge(a, b, 1)`` in C, and is similar to ``a." "update(b)`` in Python except that :c:func:`PyDict_Update` doesn't fall back " @@ -229,7 +230,7 @@ msgid "" "exception was raised." msgstr "" -#: ../../c-api/dict.rst:235 +#: ../../c-api/dict.rst:237 msgid "" "Update or merge into dictionary *a*, from the key-value pairs in *seq2*. " "*seq2* must be an iterable object producing iterable objects of length 2, " @@ -238,7 +239,7 @@ msgid "" "if an exception was raised. Equivalent Python (except for the return value)::" msgstr "" -#: ../../c-api/dict.rst:249 +#: ../../c-api/dict.rst:251 msgid "" "Register *callback* as a dictionary watcher. Return a non-negative integer " "id which must be passed to future calls to :c:func:`PyDict_Watch`. In case " @@ -246,21 +247,21 @@ msgid "" "exception." msgstr "" -#: ../../c-api/dict.rst:258 +#: ../../c-api/dict.rst:260 msgid "" "Clear watcher identified by *watcher_id* previously returned from :c:func:" "`PyDict_AddWatcher`. Return ``0`` on success, ``-1`` on error (e.g. if the " "given *watcher_id* was never registered.)" msgstr "" -#: ../../c-api/dict.rst:266 +#: ../../c-api/dict.rst:268 msgid "" "Mark dictionary *dict* as watched. The callback granted *watcher_id* by :c:" "func:`PyDict_AddWatcher` will be called when *dict* is modified or " "deallocated. Return ``0`` on success or ``-1`` on error." msgstr "" -#: ../../c-api/dict.rst:274 +#: ../../c-api/dict.rst:276 msgid "" "Mark dictionary *dict* as no longer watched. The callback granted " "*watcher_id* by :c:func:`PyDict_AddWatcher` will no longer be called when " @@ -268,7 +269,7 @@ msgid "" "watched by this watcher. Return ``0`` on success or ``-1`` on error." msgstr "" -#: ../../c-api/dict.rst:283 +#: ../../c-api/dict.rst:285 msgid "" "Enumeration of possible dictionary watcher events: ``PyDict_EVENT_ADDED``, " "``PyDict_EVENT_MODIFIED``, ``PyDict_EVENT_DELETED``, " @@ -276,11 +277,11 @@ msgid "" "``PyDict_EVENT_DEALLOCATED``." msgstr "" -#: ../../c-api/dict.rst:291 +#: ../../c-api/dict.rst:293 msgid "Type of a dict watcher callback function." msgstr "" -#: ../../c-api/dict.rst:293 +#: ../../c-api/dict.rst:295 msgid "" "If *event* is ``PyDict_EVENT_CLEARED`` or ``PyDict_EVENT_DEALLOCATED``, both " "*key* and *new_value* will be ``NULL``. If *event* is ``PyDict_EVENT_ADDED`` " @@ -289,7 +290,7 @@ msgid "" "dictionary and *new_value* will be ``NULL``." msgstr "" -#: ../../c-api/dict.rst:299 +#: ../../c-api/dict.rst:301 msgid "" "``PyDict_EVENT_CLONED`` occurs when *dict* was previously empty and another " "dict is merged into it. To maintain efficiency of this operation, per-key " @@ -297,14 +298,14 @@ msgid "" "``PyDict_EVENT_CLONED`` is issued, and *key* will be the source dictionary." msgstr "" -#: ../../c-api/dict.rst:305 +#: ../../c-api/dict.rst:307 msgid "" "The callback may inspect but must not modify *dict*; doing so could have " "unpredictable effects, including infinite recursion. Do not trigger Python " "code execution in the callback, as it could modify the dict as a side effect." msgstr "" -#: ../../c-api/dict.rst:309 +#: ../../c-api/dict.rst:311 msgid "" "If *event* is ``PyDict_EVENT_DEALLOCATED``, taking a new reference in the " "callback to the about-to-be-destroyed dictionary will resurrect it and " @@ -313,20 +314,20 @@ msgid "" "again." msgstr "" -#: ../../c-api/dict.rst:315 +#: ../../c-api/dict.rst:317 msgid "" "Callbacks occur before the notified modification to *dict* takes place, so " "the prior state of *dict* can be inspected." msgstr "" -#: ../../c-api/dict.rst:318 +#: ../../c-api/dict.rst:320 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/dict.rst:322 +#: ../../c-api/dict.rst:324 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 " @@ -347,10 +348,10 @@ msgstr "dictionary(字典)" msgid "PyUnicode_FromString()" msgstr "PyUnicode_FromString()" -#: ../../c-api/dict.rst:162 +#: ../../c-api/dict.rst:164 msgid "built-in function" msgstr "built-in function(內建函式)" -#: ../../c-api/dict.rst:162 +#: ../../c-api/dict.rst:164 msgid "len" msgstr "len" diff --git a/c-api/exceptions.po b/c-api/exceptions.po index 2950357cf0..5a9c81c291 100644 --- a/c-api/exceptions.po +++ b/c-api/exceptions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-09 00:03+0000\n" +"POT-Creation-Date: 2023-08-23 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -246,8 +246,8 @@ msgid "" msgstr "" #: ../../c-api/exceptions.rst:212 ../../c-api/exceptions.rst:220 -#: ../../c-api/exceptions.rst:229 ../../c-api/exceptions.rst:237 -#: ../../c-api/exceptions.rst:245 ../../c-api/exceptions.rst:255 +#: ../../c-api/exceptions.rst:231 ../../c-api/exceptions.rst:241 +#: ../../c-api/exceptions.rst:249 ../../c-api/exceptions.rst:259 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" @@ -259,30 +259,34 @@ msgstr "" #: ../../c-api/exceptions.rst:225 msgid "" -"Similar to :c:func:`PyErr_SetFromWindowsErrWithFilenameObject`, but the " -"filename is given as a C string. *filename* is decoded from the filesystem " -"encoding (:func:`os.fsdecode`)." +"Similar to :c:func:`PyErr_SetFromWindowsErr`, with the additional behavior " +"that if *filename* is not ``NULL``, it is decoded from the filesystem " +"encoding (:func:`os.fsdecode`) and passed to the constructor of :exc:" +"`OSError` as a third parameter to be used to define the :attr:`!filename` " +"attribute of the exception instance." msgstr "" -#: ../../c-api/exceptions.rst:234 +#: ../../c-api/exceptions.rst:236 msgid "" -"Similar to :c:func:`PyErr_SetFromWindowsErrWithFilenameObject`, with an " -"additional parameter specifying the exception type to be raised." +"Similar to :c:func:`PyErr_SetExcFromWindowsErr`, with the additional " +"behavior that if *filename* is not ``NULL``, it is passed to the constructor " +"of :exc:`OSError` as a third parameter to be used to define the :attr:`!" +"filename` attribute of the exception instance." msgstr "" -#: ../../c-api/exceptions.rst:242 +#: ../../c-api/exceptions.rst:246 msgid "" "Similar to :c:func:`PyErr_SetExcFromWindowsErrWithFilenameObject`, but " "accepts a second filename object." msgstr "" -#: ../../c-api/exceptions.rst:252 +#: ../../c-api/exceptions.rst:256 msgid "" "Similar to :c:func:`PyErr_SetFromWindowsErrWithFilename`, with an additional " "parameter specifying the exception type to be raised." msgstr "" -#: ../../c-api/exceptions.rst:260 +#: ../../c-api/exceptions.rst:264 msgid "" "This is a convenience function to raise :exc:`ImportError`. *msg* will be " "set as the exception's message string. *name* and *path*, both of which can " @@ -290,13 +294,13 @@ msgid "" "``path`` attributes." msgstr "" -#: ../../c-api/exceptions.rst:270 +#: ../../c-api/exceptions.rst:274 msgid "" "Much like :c:func:`PyErr_SetImportError` but this function allows for " "specifying a subclass of :exc:`ImportError` to raise." msgstr "" -#: ../../c-api/exceptions.rst:278 +#: ../../c-api/exceptions.rst:282 msgid "" "Set file, line, and offset information for the current exception. If the " "current exception is not a :exc:`SyntaxError`, then it sets additional " @@ -304,19 +308,19 @@ msgid "" "is a :exc:`SyntaxError`." msgstr "" -#: ../../c-api/exceptions.rst:288 +#: ../../c-api/exceptions.rst:292 msgid "" "Like :c:func:`PyErr_SyntaxLocationObject`, but *filename* is a byte string " "decoded from the :term:`filesystem encoding and error handler`." msgstr "" -#: ../../c-api/exceptions.rst:296 +#: ../../c-api/exceptions.rst:300 msgid "" "Like :c:func:`PyErr_SyntaxLocationEx`, but the *col_offset* parameter is " "omitted." msgstr "" -#: ../../c-api/exceptions.rst:302 +#: ../../c-api/exceptions.rst:306 msgid "" "This is a shorthand for ``PyErr_SetString(PyExc_SystemError, message)``, " "where *message* indicates that an internal operation (e.g. a Python/C API " @@ -324,11 +328,11 @@ msgid "" "use." msgstr "" -#: ../../c-api/exceptions.rst:309 +#: ../../c-api/exceptions.rst:313 msgid "Issuing warnings" msgstr "" -#: ../../c-api/exceptions.rst:311 +#: ../../c-api/exceptions.rst:315 msgid "" "Use these functions to issue warnings from C code. They mirror similar " "functions exported by the Python :mod:`warnings` module. They normally " @@ -344,7 +348,7 @@ msgid "" "return an error value)." msgstr "" -#: ../../c-api/exceptions.rst:326 +#: ../../c-api/exceptions.rst:330 msgid "" "Issue a warning message. The *category* argument is a warning category (see " "below) or ``NULL``; the *message* argument is a UTF-8 encoded string. " @@ -354,7 +358,7 @@ msgid "" "`PyErr_WarnEx`, 2 is the function above that, and so forth." msgstr "" -#: ../../c-api/exceptions.rst:333 +#: ../../c-api/exceptions.rst:337 msgid "" "Warning categories must be subclasses of :c:data:`PyExc_Warning`; :c:data:" "`PyExc_Warning` is a subclass of :c:data:`PyExc_Exception`; the default " @@ -363,14 +367,14 @@ msgid "" "enumerated at :ref:`standardwarningcategories`." msgstr "" -#: ../../c-api/exceptions.rst:339 +#: ../../c-api/exceptions.rst:343 msgid "" "For information about warning control, see the documentation for the :mod:" "`warnings` module and the :option:`-W` option in the command line " "documentation. There is no C API for warning control." msgstr "" -#: ../../c-api/exceptions.rst:346 +#: ../../c-api/exceptions.rst:350 msgid "" "Issue a warning message with explicit control over all warning attributes. " "This is a straightforward wrapper around the Python function :func:`warnings." @@ -378,31 +382,31 @@ msgid "" "arguments may be set to ``NULL`` to get the default effect described there." msgstr "" -#: ../../c-api/exceptions.rst:357 +#: ../../c-api/exceptions.rst:361 msgid "" "Similar to :c:func:`PyErr_WarnExplicitObject` except that *message* and " "*module* are UTF-8 encoded strings, and *filename* is decoded from the :term:" "`filesystem encoding and error handler`." msgstr "" -#: ../../c-api/exceptions.rst:364 +#: ../../c-api/exceptions.rst:368 msgid "" "Function similar to :c:func:`PyErr_WarnEx`, but use :c:func:" "`PyUnicode_FromFormat` to format the warning message. *format* is an ASCII-" "encoded string." msgstr "" -#: ../../c-api/exceptions.rst:373 +#: ../../c-api/exceptions.rst:377 msgid "" "Function similar to :c:func:`PyErr_WarnFormat`, but *category* is :exc:" "`ResourceWarning` and it passes *source* to :func:`warnings.WarningMessage`." msgstr "" -#: ../../c-api/exceptions.rst:380 +#: ../../c-api/exceptions.rst:384 msgid "Querying the error indicator" msgstr "" -#: ../../c-api/exceptions.rst:384 +#: ../../c-api/exceptions.rst:388 msgid "" "Test whether the error indicator is set. If set, return the exception " "*type* (the first argument to the last call to one of the ``PyErr_Set*`` " @@ -411,11 +415,11 @@ msgid "" "`Py_DECREF` it." msgstr "" -#: ../../c-api/exceptions.rst:390 +#: ../../c-api/exceptions.rst:394 msgid "The caller must hold the GIL." msgstr "" -#: ../../c-api/exceptions.rst:394 +#: ../../c-api/exceptions.rst:398 msgid "" "Do not compare the return value to a specific exception; use :c:func:" "`PyErr_ExceptionMatches` instead, shown below. (The comparison could easily " @@ -423,14 +427,14 @@ msgid "" "of a class exception, or it may be a subclass of the expected exception.)" msgstr "" -#: ../../c-api/exceptions.rst:402 +#: ../../c-api/exceptions.rst:406 msgid "" "Equivalent to ``PyErr_GivenExceptionMatches(PyErr_Occurred(), exc)``. This " "should only be called when an exception is actually set; a memory access " "violation will occur if no exception has been raised." msgstr "" -#: ../../c-api/exceptions.rst:409 +#: ../../c-api/exceptions.rst:413 msgid "" "Return true if the *given* exception matches the exception type in *exc*. " "If *exc* is a class object, this also returns true when *given* is an " @@ -438,43 +442,43 @@ msgid "" "tuple (and recursively in subtuples) are searched for a match." msgstr "" -#: ../../c-api/exceptions.rst:417 +#: ../../c-api/exceptions.rst:421 msgid "" "Return the exception currently being raised, clearing the error indicator at " "the same time." msgstr "" -#: ../../c-api/exceptions.rst:420 +#: ../../c-api/exceptions.rst:424 msgid "" "This function is used by code that needs to catch exceptions, or code that " "needs to save and restore the error indicator temporarily." msgstr "" -#: ../../c-api/exceptions.rst:423 ../../c-api/exceptions.rst:467 +#: ../../c-api/exceptions.rst:427 ../../c-api/exceptions.rst:471 msgid "For example::" msgstr "" -#: ../../c-api/exceptions.rst:433 +#: ../../c-api/exceptions.rst:437 msgid "" ":c:func:`PyErr_GetHandledException`, to save the exception currently being " "handled." msgstr "" -#: ../../c-api/exceptions.rst:441 +#: ../../c-api/exceptions.rst:445 msgid "" "Set *exc* as the exception currently being raised, clearing the existing " "exception if one is set." msgstr "" -#: ../../c-api/exceptions.rst:446 +#: ../../c-api/exceptions.rst:450 msgid "This call steals a reference to *exc*, which must be a valid exception." msgstr "" -#: ../../c-api/exceptions.rst:455 +#: ../../c-api/exceptions.rst:459 msgid "Use :c:func:`PyErr_GetRaisedException` instead." msgstr "" -#: ../../c-api/exceptions.rst:457 +#: ../../c-api/exceptions.rst:461 msgid "" "Retrieve the error indicator into three variables whose addresses are " "passed. If the error indicator is not set, set all three variables to " @@ -483,17 +487,17 @@ msgid "" "the type object is not." msgstr "" -#: ../../c-api/exceptions.rst:464 +#: ../../c-api/exceptions.rst:468 msgid "" "This function is normally only used by legacy code that needs to catch " "exceptions or save and restore the error indicator temporarily." msgstr "" -#: ../../c-api/exceptions.rst:483 +#: ../../c-api/exceptions.rst:487 msgid "Use :c:func:`PyErr_SetRaisedException` instead." msgstr "" -#: ../../c-api/exceptions.rst:485 +#: ../../c-api/exceptions.rst:489 msgid "" "Set the error indicator from the three objects, *type*, *value*, and " "*traceback*, clearing the existing exception if one is set. If the objects " @@ -506,20 +510,20 @@ msgid "" "don't use this function. I warned you.)" msgstr "" -#: ../../c-api/exceptions.rst:499 +#: ../../c-api/exceptions.rst:503 msgid "" "This function is normally only used by legacy code that needs to save and " "restore the error indicator temporarily. Use :c:func:`PyErr_Fetch` to save " "the current error indicator." msgstr "" -#: ../../c-api/exceptions.rst:508 +#: ../../c-api/exceptions.rst:512 msgid "" "Use :c:func:`PyErr_GetRaisedException` instead, to avoid any possible de-" "normalization." msgstr "" -#: ../../c-api/exceptions.rst:511 +#: ../../c-api/exceptions.rst:515 msgid "" "Under certain circumstances, the values returned by :c:func:`PyErr_Fetch` " "below can be \"unnormalized\", meaning that ``*exc`` is a class object but " @@ -529,14 +533,14 @@ msgid "" "improve performance." msgstr "" -#: ../../c-api/exceptions.rst:519 +#: ../../c-api/exceptions.rst:523 msgid "" "This function *does not* implicitly set the ``__traceback__`` attribute on " "the exception value. If setting the traceback appropriately is desired, the " "following additional snippet is needed::" msgstr "" -#: ../../c-api/exceptions.rst:530 +#: ../../c-api/exceptions.rst:534 msgid "" "Retrieve the active exception instance, as would be returned by :func:`sys." "exception`. This refers to an exception that was *already caught*, not to an " @@ -544,7 +548,7 @@ msgid "" "or ``NULL``. Does not modify the interpreter's exception state." msgstr "" -#: ../../c-api/exceptions.rst:537 +#: ../../c-api/exceptions.rst:541 msgid "" "This function is not normally used by code that wants to handle exceptions. " "Rather, it can be used when code needs to save and restore the exception " @@ -552,14 +556,14 @@ msgid "" "clear the exception state." msgstr "" -#: ../../c-api/exceptions.rst:546 +#: ../../c-api/exceptions.rst:550 msgid "" "Set the active exception, as known from ``sys.exception()``. This refers to " "an exception that was *already caught*, not to an exception that was freshly " "raised. To clear the exception state, pass ``NULL``." msgstr "" -#: ../../c-api/exceptions.rst:553 +#: ../../c-api/exceptions.rst:557 msgid "" "This function is not normally used by code that wants to handle exceptions. " "Rather, it can be used when code needs to save and restore the exception " @@ -567,7 +571,7 @@ msgid "" "exception state." msgstr "" -#: ../../c-api/exceptions.rst:562 +#: ../../c-api/exceptions.rst:566 msgid "" "Retrieve the old-style representation of the exception info, as known from :" "func:`sys.exc_info`. This refers to an exception that was *already caught*, " @@ -577,7 +581,7 @@ msgid "" "using :c:func:`PyErr_GetHandledException`." msgstr "" -#: ../../c-api/exceptions.rst:571 +#: ../../c-api/exceptions.rst:575 msgid "" "This function is not normally used by code that wants to handle exceptions. " "Rather, it can be used when code needs to save and restore the exception " @@ -585,7 +589,7 @@ msgid "" "exception state." msgstr "" -#: ../../c-api/exceptions.rst:581 +#: ../../c-api/exceptions.rst:585 msgid "" "Set the exception info, as known from ``sys.exc_info()``. This refers to an " "exception that was *already caught*, not to an exception that was freshly " @@ -595,7 +599,7 @@ msgid "" "`PyErr_SetHandledException`." msgstr "" -#: ../../c-api/exceptions.rst:590 +#: ../../c-api/exceptions.rst:594 msgid "" "This function is not normally used by code that wants to handle exceptions. " "Rather, it can be used when code needs to save and restore the exception " @@ -603,22 +607,22 @@ msgid "" "state." msgstr "" -#: ../../c-api/exceptions.rst:597 +#: ../../c-api/exceptions.rst:601 msgid "" "The ``type`` and ``traceback`` arguments are no longer used and can be NULL. " "The interpreter now derives them from the exception instance (the ``value`` " "argument). The function still steals references of all three arguments." msgstr "" -#: ../../c-api/exceptions.rst:605 +#: ../../c-api/exceptions.rst:609 msgid "Signal Handling" msgstr "" -#: ../../c-api/exceptions.rst:615 +#: ../../c-api/exceptions.rst:619 msgid "This function interacts with Python's signal handling." msgstr "" -#: ../../c-api/exceptions.rst:617 +#: ../../c-api/exceptions.rst:621 msgid "" "If the function is called from the main thread and under the main Python " "interpreter, it checks whether a signal has been sent to the processes and " @@ -626,7 +630,7 @@ msgid "" "module is supported, this can invoke a signal handler written in Python." msgstr "" -#: ../../c-api/exceptions.rst:622 +#: ../../c-api/exceptions.rst:626 msgid "" "The function attempts to handle all pending signals, and then returns ``0``. " "However, if a Python signal handler raises an exception, the error indicator " @@ -635,44 +639,44 @@ msgid "" "`PyErr_CheckSignals()` invocation)." msgstr "" -#: ../../c-api/exceptions.rst:628 +#: ../../c-api/exceptions.rst:632 msgid "" "If the function is called from a non-main thread, or under a non-main Python " "interpreter, it does nothing and returns ``0``." msgstr "" -#: ../../c-api/exceptions.rst:631 +#: ../../c-api/exceptions.rst:635 msgid "" "This function can be called by long-running C code that wants to be " "interruptible by user requests (such as by pressing Ctrl-C)." msgstr "" -#: ../../c-api/exceptions.rst:635 +#: ../../c-api/exceptions.rst:639 msgid "" "The default Python signal handler for :c:macro:`!SIGINT` raises the :exc:" "`KeyboardInterrupt` exception." msgstr "" -#: ../../c-api/exceptions.rst:646 +#: ../../c-api/exceptions.rst:650 msgid "" "Simulate the effect of a :c:macro:`!SIGINT` signal arriving. This is " "equivalent to ``PyErr_SetInterruptEx(SIGINT)``." msgstr "" -#: ../../c-api/exceptions.rst:650 ../../c-api/exceptions.rst:677 +#: ../../c-api/exceptions.rst:654 ../../c-api/exceptions.rst:681 msgid "" "This function is async-signal-safe. It can be called without the :term:" "`GIL` and from a C signal handler." msgstr "" -#: ../../c-api/exceptions.rst:660 +#: ../../c-api/exceptions.rst:664 msgid "" "Simulate the effect of a signal arriving. The next time :c:func:" "`PyErr_CheckSignals` is called, the Python signal handler for the given " "signal number will be called." msgstr "" -#: ../../c-api/exceptions.rst:664 +#: ../../c-api/exceptions.rst:668 msgid "" "This function can be called by C code that sets up its own signal handling " "and wants Python signal handlers to be invoked as expected when an " @@ -680,27 +684,27 @@ msgid "" "interrupt an operation)." msgstr "" -#: ../../c-api/exceptions.rst:669 +#: ../../c-api/exceptions.rst:673 msgid "" "If the given signal isn't handled by Python (it was set to :py:const:`signal." "SIG_DFL` or :py:const:`signal.SIG_IGN`), it will be ignored." msgstr "" -#: ../../c-api/exceptions.rst:672 +#: ../../c-api/exceptions.rst:676 msgid "" "If *signum* is outside of the allowed range of signal numbers, ``-1`` is " "returned. Otherwise, ``0`` is returned. The error indicator is never " "changed by this function." msgstr "" -#: ../../c-api/exceptions.rst:685 +#: ../../c-api/exceptions.rst:689 msgid "" "This utility function specifies a file descriptor to which the signal number " "is written as a single byte whenever a signal is received. *fd* must be non-" "blocking. It returns the previous such file descriptor." msgstr "" -#: ../../c-api/exceptions.rst:689 +#: ../../c-api/exceptions.rst:693 msgid "" "The value ``-1`` disables the feature; this is the initial state. This is " "equivalent to :func:`signal.set_wakeup_fd` in Python, but without any error " @@ -708,15 +712,15 @@ msgid "" "be called from the main thread." msgstr "" -#: ../../c-api/exceptions.rst:694 +#: ../../c-api/exceptions.rst:698 msgid "On Windows, the function now also supports socket handles." msgstr "" -#: ../../c-api/exceptions.rst:699 +#: ../../c-api/exceptions.rst:703 msgid "Exception Classes" msgstr "例外類別" -#: ../../c-api/exceptions.rst:703 +#: ../../c-api/exceptions.rst:707 msgid "" "This utility function creates and returns a new exception class. The *name* " "argument must be the name of the new exception, a C string of the form " @@ -725,7 +729,7 @@ msgid "" "(accessible in C as :c:data:`PyExc_Exception`)." msgstr "" -#: ../../c-api/exceptions.rst:709 +#: ../../c-api/exceptions.rst:713 msgid "" "The :attr:`__module__` attribute of the new class is set to the first part " "(up to the last dot) of the *name* argument, and the class name is set to " @@ -735,31 +739,31 @@ msgid "" "variables and methods." msgstr "" -#: ../../c-api/exceptions.rst:718 +#: ../../c-api/exceptions.rst:722 msgid "" "Same as :c:func:`PyErr_NewException`, except that the new exception class " "can easily be given a docstring: If *doc* is non-``NULL``, it will be used " "as the docstring for the exception class." msgstr "" -#: ../../c-api/exceptions.rst:726 +#: ../../c-api/exceptions.rst:730 msgid "Exception Objects" msgstr "例外物件" -#: ../../c-api/exceptions.rst:730 +#: ../../c-api/exceptions.rst:734 msgid "" "Return the traceback associated with the exception as a new reference, as " "accessible from Python through :attr:`__traceback__`. If there is no " "traceback associated, this returns ``NULL``." msgstr "" -#: ../../c-api/exceptions.rst:737 +#: ../../c-api/exceptions.rst:741 msgid "" "Set the traceback associated with the exception to *tb*. Use ``Py_None`` to " "clear it." msgstr "" -#: ../../c-api/exceptions.rst:743 +#: ../../c-api/exceptions.rst:747 msgid "" "Return the context (another exception instance during whose handling *ex* " "was raised) associated with the exception as a new reference, as accessible " @@ -767,41 +771,41 @@ msgid "" "this returns ``NULL``." msgstr "" -#: ../../c-api/exceptions.rst:751 +#: ../../c-api/exceptions.rst:755 msgid "" "Set the context associated with the exception to *ctx*. Use ``NULL`` to " "clear it. There is no type check to make sure that *ctx* is an exception " "instance. This steals a reference to *ctx*." msgstr "" -#: ../../c-api/exceptions.rst:758 +#: ../../c-api/exceptions.rst:762 msgid "" "Return the cause (either an exception instance, or ``None``, set by " "``raise ... from ...``) associated with the exception as a new reference, as " "accessible from Python through :attr:`__cause__`." msgstr "" -#: ../../c-api/exceptions.rst:765 +#: ../../c-api/exceptions.rst:769 msgid "" "Set the cause associated with the exception to *cause*. Use ``NULL`` to " "clear it. There is no type check to make sure that *cause* is either an " "exception instance or ``None``. This steals a reference to *cause*." msgstr "" -#: ../../c-api/exceptions.rst:769 +#: ../../c-api/exceptions.rst:773 msgid "" ":attr:`__suppress_context__` is implicitly set to ``True`` by this function." msgstr "" -#: ../../c-api/exceptions.rst:774 +#: ../../c-api/exceptions.rst:778 msgid "Return :attr:`~BaseException.args` of exception *ex*." msgstr "" -#: ../../c-api/exceptions.rst:779 +#: ../../c-api/exceptions.rst:783 msgid "Set :attr:`~BaseException.args` of exception *ex* to *args*." msgstr "" -#: ../../c-api/exceptions.rst:783 +#: ../../c-api/exceptions.rst:787 msgid "" "Implement part of the interpreter's implementation of :keyword:`!except*`. " "*orig* is the original exception that was caught, and *excs* is the list of " @@ -813,72 +817,72 @@ msgid "" "if there is nothing to reraise." msgstr "" -#: ../../c-api/exceptions.rst:797 +#: ../../c-api/exceptions.rst:801 msgid "Unicode Exception Objects" msgstr "" -#: ../../c-api/exceptions.rst:799 +#: ../../c-api/exceptions.rst:803 msgid "" "The following functions are used to create and modify Unicode exceptions " "from C." msgstr "" -#: ../../c-api/exceptions.rst:803 +#: ../../c-api/exceptions.rst:807 msgid "" "Create a :class:`UnicodeDecodeError` object with the attributes *encoding*, " "*object*, *length*, *start*, *end* and *reason*. *encoding* and *reason* are " "UTF-8 encoded strings." msgstr "" -#: ../../c-api/exceptions.rst:810 +#: ../../c-api/exceptions.rst:814 msgid "Return the *encoding* attribute of the given exception object." msgstr "" -#: ../../c-api/exceptions.rst:816 +#: ../../c-api/exceptions.rst:820 msgid "Return the *object* attribute of the given exception object." msgstr "" -#: ../../c-api/exceptions.rst:822 +#: ../../c-api/exceptions.rst:826 msgid "" "Get the *start* attribute of the given exception object and place it into " "*\\*start*. *start* must not be ``NULL``. Return ``0`` on success, ``-1`` " "on failure." msgstr "" -#: ../../c-api/exceptions.rst:830 +#: ../../c-api/exceptions.rst:834 msgid "" "Set the *start* attribute of the given exception object to *start*. Return " "``0`` on success, ``-1`` on failure." msgstr "" -#: ../../c-api/exceptions.rst:837 +#: ../../c-api/exceptions.rst:841 msgid "" "Get the *end* attribute of the given exception object and place it into " "*\\*end*. *end* must not be ``NULL``. Return ``0`` on success, ``-1`` on " "failure." msgstr "" -#: ../../c-api/exceptions.rst:845 +#: ../../c-api/exceptions.rst:849 msgid "" "Set the *end* attribute of the given exception object to *end*. Return " "``0`` on success, ``-1`` on failure." msgstr "" -#: ../../c-api/exceptions.rst:852 +#: ../../c-api/exceptions.rst:856 msgid "Return the *reason* attribute of the given exception object." msgstr "" -#: ../../c-api/exceptions.rst:858 +#: ../../c-api/exceptions.rst:862 msgid "" "Set the *reason* attribute of the given exception object to *reason*. " "Return ``0`` on success, ``-1`` on failure." msgstr "" -#: ../../c-api/exceptions.rst:865 +#: ../../c-api/exceptions.rst:869 msgid "Recursion Control" msgstr "" -#: ../../c-api/exceptions.rst:867 +#: ../../c-api/exceptions.rst:871 msgid "" "These two functions provide a way to perform safe recursive calls at the C " "level, both in the core and in extension modules. They are needed if the " @@ -888,44 +892,44 @@ msgid "" "recursion handling." msgstr "" -#: ../../c-api/exceptions.rst:876 +#: ../../c-api/exceptions.rst:880 msgid "Marks a point where a recursive C-level call is about to be performed." msgstr "" -#: ../../c-api/exceptions.rst:878 +#: ../../c-api/exceptions.rst:882 msgid "" "If :c:macro:`USE_STACKCHECK` is defined, this function checks if the OS " "stack overflowed using :c:func:`PyOS_CheckStack`. In this is the case, it " "sets a :exc:`MemoryError` and returns a nonzero value." msgstr "" -#: ../../c-api/exceptions.rst:882 +#: ../../c-api/exceptions.rst:886 msgid "" "The function then checks if the recursion limit is reached. If this is the " "case, a :exc:`RecursionError` is set and a nonzero value is returned. " "Otherwise, zero is returned." msgstr "" -#: ../../c-api/exceptions.rst:886 +#: ../../c-api/exceptions.rst:890 msgid "" "*where* should be a UTF-8 encoded string such as ``\" in instance check\"`` " "to be concatenated to the :exc:`RecursionError` message caused by the " "recursion depth limit." msgstr "" -#: ../../c-api/exceptions.rst:890 ../../c-api/exceptions.rst:898 +#: ../../c-api/exceptions.rst:894 ../../c-api/exceptions.rst:902 msgid "" "This function is now also available in the :ref:`limited API `." msgstr "" -#: ../../c-api/exceptions.rst:895 +#: ../../c-api/exceptions.rst:899 msgid "" "Ends a :c:func:`Py_EnterRecursiveCall`. Must be called once for each " "*successful* invocation of :c:func:`Py_EnterRecursiveCall`." msgstr "" -#: ../../c-api/exceptions.rst:901 +#: ../../c-api/exceptions.rst:905 msgid "" "Properly implementing :c:member:`~PyTypeObject.tp_repr` for container types " "requires special recursion handling. In addition to protecting the stack, :" @@ -934,13 +938,13 @@ msgid "" "Effectively, these are the C equivalent to :func:`reprlib.recursive_repr`." msgstr "" -#: ../../c-api/exceptions.rst:909 +#: ../../c-api/exceptions.rst:913 msgid "" "Called at the beginning of the :c:member:`~PyTypeObject.tp_repr` " "implementation to detect cycles." msgstr "" -#: ../../c-api/exceptions.rst:912 +#: ../../c-api/exceptions.rst:916 msgid "" "If the object has already been processed, the function returns a positive " "integer. In that case the :c:member:`~PyTypeObject.tp_repr` implementation " @@ -948,30 +952,30 @@ msgid "" "`dict` objects return ``{...}`` and :class:`list` objects return ``[...]``." msgstr "" -#: ../../c-api/exceptions.rst:918 +#: ../../c-api/exceptions.rst:922 msgid "" "The function will return a negative integer if the recursion limit is " "reached. In that case the :c:member:`~PyTypeObject.tp_repr` implementation " "should typically return ``NULL``." msgstr "" -#: ../../c-api/exceptions.rst:922 +#: ../../c-api/exceptions.rst:926 msgid "" "Otherwise, the function returns zero and the :c:member:`~PyTypeObject." "tp_repr` implementation can continue normally." msgstr "" -#: ../../c-api/exceptions.rst:927 +#: ../../c-api/exceptions.rst:931 msgid "" "Ends a :c:func:`Py_ReprEnter`. Must be called once for each invocation of :" "c:func:`Py_ReprEnter` that returns zero." msgstr "" -#: ../../c-api/exceptions.rst:934 +#: ../../c-api/exceptions.rst:938 msgid "Standard Exceptions" msgstr "" -#: ../../c-api/exceptions.rst:936 +#: ../../c-api/exceptions.rst:940 msgid "" "All standard Python exceptions are available as global variables whose names " "are ``PyExc_`` followed by the Python exception name. These have the type :" @@ -979,451 +983,451 @@ msgid "" "all the variables:" msgstr "" -#: ../../c-api/exceptions.rst:997 ../../c-api/exceptions.rst:1130 -#: ../../c-api/exceptions.rst:1175 +#: ../../c-api/exceptions.rst:1001 ../../c-api/exceptions.rst:1134 +#: ../../c-api/exceptions.rst:1179 msgid "C Name" msgstr "" -#: ../../c-api/exceptions.rst:997 ../../c-api/exceptions.rst:1175 +#: ../../c-api/exceptions.rst:1001 ../../c-api/exceptions.rst:1179 msgid "Python Name" msgstr "" -#: ../../c-api/exceptions.rst:997 ../../c-api/exceptions.rst:1130 -#: ../../c-api/exceptions.rst:1175 +#: ../../c-api/exceptions.rst:1001 ../../c-api/exceptions.rst:1134 +#: ../../c-api/exceptions.rst:1179 msgid "Notes" msgstr "註解" -#: ../../c-api/exceptions.rst:999 +#: ../../c-api/exceptions.rst:1003 msgid ":c:data:`PyExc_BaseException`" msgstr ":c:data:`PyExc_BaseException`" -#: ../../c-api/exceptions.rst:999 +#: ../../c-api/exceptions.rst:1003 msgid ":exc:`BaseException`" msgstr ":exc:`BaseException`" -#: ../../c-api/exceptions.rst:999 ../../c-api/exceptions.rst:1001 -#: ../../c-api/exceptions.rst:1003 ../../c-api/exceptions.rst:1049 -#: ../../c-api/exceptions.rst:1061 +#: ../../c-api/exceptions.rst:1003 ../../c-api/exceptions.rst:1005 +#: ../../c-api/exceptions.rst:1007 ../../c-api/exceptions.rst:1053 +#: ../../c-api/exceptions.rst:1065 msgid "[1]_" msgstr "[1]_" -#: ../../c-api/exceptions.rst:1001 +#: ../../c-api/exceptions.rst:1005 msgid ":c:data:`PyExc_Exception`" msgstr ":c:data:`PyExc_Exception`" -#: ../../c-api/exceptions.rst:1001 +#: ../../c-api/exceptions.rst:1005 msgid ":exc:`Exception`" msgstr ":exc:`Exception`" -#: ../../c-api/exceptions.rst:1003 +#: ../../c-api/exceptions.rst:1007 msgid ":c:data:`PyExc_ArithmeticError`" msgstr ":c:data:`PyExc_ArithmeticError`" -#: ../../c-api/exceptions.rst:1003 +#: ../../c-api/exceptions.rst:1007 msgid ":exc:`ArithmeticError`" msgstr ":exc:`ArithmeticError`" -#: ../../c-api/exceptions.rst:1005 +#: ../../c-api/exceptions.rst:1009 msgid ":c:data:`PyExc_AssertionError`" msgstr ":c:data:`PyExc_AssertionError`" -#: ../../c-api/exceptions.rst:1005 +#: ../../c-api/exceptions.rst:1009 msgid ":exc:`AssertionError`" msgstr ":exc:`AssertionError`" -#: ../../c-api/exceptions.rst:1007 +#: ../../c-api/exceptions.rst:1011 msgid ":c:data:`PyExc_AttributeError`" msgstr ":c:data:`PyExc_AttributeError`" -#: ../../c-api/exceptions.rst:1007 +#: ../../c-api/exceptions.rst:1011 msgid ":exc:`AttributeError`" msgstr ":exc:`AttributeError`" -#: ../../c-api/exceptions.rst:1009 +#: ../../c-api/exceptions.rst:1013 msgid ":c:data:`PyExc_BlockingIOError`" msgstr ":c:data:`PyExc_BlockingIOError`" -#: ../../c-api/exceptions.rst:1009 +#: ../../c-api/exceptions.rst:1013 msgid ":exc:`BlockingIOError`" msgstr ":exc:`BlockingIOError`" -#: ../../c-api/exceptions.rst:1011 +#: ../../c-api/exceptions.rst:1015 msgid ":c:data:`PyExc_BrokenPipeError`" msgstr ":c:data:`PyExc_BrokenPipeError`" -#: ../../c-api/exceptions.rst:1011 +#: ../../c-api/exceptions.rst:1015 msgid ":exc:`BrokenPipeError`" msgstr ":exc:`BrokenPipeError`" -#: ../../c-api/exceptions.rst:1013 +#: ../../c-api/exceptions.rst:1017 msgid ":c:data:`PyExc_BufferError`" msgstr ":c:data:`PyExc_BufferError`" -#: ../../c-api/exceptions.rst:1013 +#: ../../c-api/exceptions.rst:1017 msgid ":exc:`BufferError`" msgstr ":exc:`BufferError`" -#: ../../c-api/exceptions.rst:1015 +#: ../../c-api/exceptions.rst:1019 msgid ":c:data:`PyExc_ChildProcessError`" msgstr ":c:data:`PyExc_ChildProcessError`" -#: ../../c-api/exceptions.rst:1015 +#: ../../c-api/exceptions.rst:1019 msgid ":exc:`ChildProcessError`" msgstr ":exc:`ChildProcessError`" -#: ../../c-api/exceptions.rst:1017 +#: ../../c-api/exceptions.rst:1021 msgid ":c:data:`PyExc_ConnectionAbortedError`" msgstr ":c:data:`PyExc_ConnectionAbortedError`" -#: ../../c-api/exceptions.rst:1017 +#: ../../c-api/exceptions.rst:1021 msgid ":exc:`ConnectionAbortedError`" msgstr ":exc:`ConnectionAbortedError`" -#: ../../c-api/exceptions.rst:1019 +#: ../../c-api/exceptions.rst:1023 msgid ":c:data:`PyExc_ConnectionError`" msgstr ":c:data:`PyExc_ConnectionError`" -#: ../../c-api/exceptions.rst:1019 +#: ../../c-api/exceptions.rst:1023 msgid ":exc:`ConnectionError`" msgstr ":exc:`ConnectionError`" -#: ../../c-api/exceptions.rst:1021 +#: ../../c-api/exceptions.rst:1025 msgid ":c:data:`PyExc_ConnectionRefusedError`" msgstr ":c:data:`PyExc_ConnectionRefusedError`" -#: ../../c-api/exceptions.rst:1021 +#: ../../c-api/exceptions.rst:1025 msgid ":exc:`ConnectionRefusedError`" msgstr ":exc:`ConnectionRefusedError`" -#: ../../c-api/exceptions.rst:1023 +#: ../../c-api/exceptions.rst:1027 msgid ":c:data:`PyExc_ConnectionResetError`" msgstr ":c:data:`PyExc_ConnectionResetError`" -#: ../../c-api/exceptions.rst:1023 +#: ../../c-api/exceptions.rst:1027 msgid ":exc:`ConnectionResetError`" msgstr ":exc:`ConnectionResetError`" -#: ../../c-api/exceptions.rst:1025 +#: ../../c-api/exceptions.rst:1029 msgid ":c:data:`PyExc_EOFError`" msgstr ":c:data:`PyExc_EOFError`" -#: ../../c-api/exceptions.rst:1025 +#: ../../c-api/exceptions.rst:1029 msgid ":exc:`EOFError`" msgstr ":exc:`EOFError`" -#: ../../c-api/exceptions.rst:1027 +#: ../../c-api/exceptions.rst:1031 msgid ":c:data:`PyExc_FileExistsError`" msgstr ":c:data:`PyExc_FileExistsError`" -#: ../../c-api/exceptions.rst:1027 +#: ../../c-api/exceptions.rst:1031 msgid ":exc:`FileExistsError`" msgstr ":exc:`FileExistsError`" -#: ../../c-api/exceptions.rst:1029 +#: ../../c-api/exceptions.rst:1033 msgid ":c:data:`PyExc_FileNotFoundError`" msgstr ":c:data:`PyExc_FileNotFoundError`" -#: ../../c-api/exceptions.rst:1029 +#: ../../c-api/exceptions.rst:1033 msgid ":exc:`FileNotFoundError`" msgstr ":exc:`FileNotFoundError`" -#: ../../c-api/exceptions.rst:1031 +#: ../../c-api/exceptions.rst:1035 msgid ":c:data:`PyExc_FloatingPointError`" msgstr ":c:data:`PyExc_FloatingPointError`" -#: ../../c-api/exceptions.rst:1031 +#: ../../c-api/exceptions.rst:1035 msgid ":exc:`FloatingPointError`" msgstr ":exc:`FloatingPointError`" -#: ../../c-api/exceptions.rst:1033 +#: ../../c-api/exceptions.rst:1037 msgid ":c:data:`PyExc_GeneratorExit`" msgstr ":c:data:`PyExc_GeneratorExit`" -#: ../../c-api/exceptions.rst:1033 +#: ../../c-api/exceptions.rst:1037 msgid ":exc:`GeneratorExit`" msgstr ":exc:`GeneratorExit`" -#: ../../c-api/exceptions.rst:1035 +#: ../../c-api/exceptions.rst:1039 msgid ":c:data:`PyExc_ImportError`" msgstr ":c:data:`PyExc_ImportError`" -#: ../../c-api/exceptions.rst:1035 +#: ../../c-api/exceptions.rst:1039 msgid ":exc:`ImportError`" msgstr ":exc:`ImportError`" -#: ../../c-api/exceptions.rst:1037 +#: ../../c-api/exceptions.rst:1041 msgid ":c:data:`PyExc_IndentationError`" msgstr ":c:data:`PyExc_IndentationError`" -#: ../../c-api/exceptions.rst:1037 +#: ../../c-api/exceptions.rst:1041 msgid ":exc:`IndentationError`" msgstr ":exc:`IndentationError`" -#: ../../c-api/exceptions.rst:1039 +#: ../../c-api/exceptions.rst:1043 msgid ":c:data:`PyExc_IndexError`" msgstr ":c:data:`PyExc_IndexError`" -#: ../../c-api/exceptions.rst:1039 +#: ../../c-api/exceptions.rst:1043 msgid ":exc:`IndexError`" msgstr ":exc:`IndexError`" -#: ../../c-api/exceptions.rst:1041 +#: ../../c-api/exceptions.rst:1045 msgid ":c:data:`PyExc_InterruptedError`" msgstr ":c:data:`PyExc_InterruptedError`" -#: ../../c-api/exceptions.rst:1041 +#: ../../c-api/exceptions.rst:1045 msgid ":exc:`InterruptedError`" msgstr ":exc:`InterruptedError`" -#: ../../c-api/exceptions.rst:1043 +#: ../../c-api/exceptions.rst:1047 msgid ":c:data:`PyExc_IsADirectoryError`" msgstr ":c:data:`PyExc_IsADirectoryError`" -#: ../../c-api/exceptions.rst:1043 +#: ../../c-api/exceptions.rst:1047 msgid ":exc:`IsADirectoryError`" msgstr ":exc:`IsADirectoryError`" -#: ../../c-api/exceptions.rst:1045 +#: ../../c-api/exceptions.rst:1049 msgid ":c:data:`PyExc_KeyError`" msgstr ":c:data:`PyExc_KeyError`" -#: ../../c-api/exceptions.rst:1045 +#: ../../c-api/exceptions.rst:1049 msgid ":exc:`KeyError`" msgstr ":exc:`KeyError`" -#: ../../c-api/exceptions.rst:1047 +#: ../../c-api/exceptions.rst:1051 msgid ":c:data:`PyExc_KeyboardInterrupt`" msgstr ":c:data:`PyExc_KeyboardInterrupt`" -#: ../../c-api/exceptions.rst:1047 +#: ../../c-api/exceptions.rst:1051 msgid ":exc:`KeyboardInterrupt`" msgstr ":exc:`KeyboardInterrupt`" -#: ../../c-api/exceptions.rst:1049 +#: ../../c-api/exceptions.rst:1053 msgid ":c:data:`PyExc_LookupError`" msgstr ":c:data:`PyExc_LookupError`" -#: ../../c-api/exceptions.rst:1049 +#: ../../c-api/exceptions.rst:1053 msgid ":exc:`LookupError`" msgstr ":exc:`LookupError`" -#: ../../c-api/exceptions.rst:1051 +#: ../../c-api/exceptions.rst:1055 msgid ":c:data:`PyExc_MemoryError`" msgstr ":c:data:`PyExc_MemoryError`" -#: ../../c-api/exceptions.rst:1051 +#: ../../c-api/exceptions.rst:1055 msgid ":exc:`MemoryError`" msgstr ":exc:`MemoryError`" -#: ../../c-api/exceptions.rst:1053 +#: ../../c-api/exceptions.rst:1057 msgid ":c:data:`PyExc_ModuleNotFoundError`" msgstr ":c:data:`PyExc_ModuleNotFoundError`" -#: ../../c-api/exceptions.rst:1053 +#: ../../c-api/exceptions.rst:1057 msgid ":exc:`ModuleNotFoundError`" msgstr ":exc:`ModuleNotFoundError`" -#: ../../c-api/exceptions.rst:1055 +#: ../../c-api/exceptions.rst:1059 msgid ":c:data:`PyExc_NameError`" msgstr ":c:data:`PyExc_NameError`" -#: ../../c-api/exceptions.rst:1055 +#: ../../c-api/exceptions.rst:1059 msgid ":exc:`NameError`" msgstr ":exc:`NameError`" -#: ../../c-api/exceptions.rst:1057 +#: ../../c-api/exceptions.rst:1061 msgid ":c:data:`PyExc_NotADirectoryError`" msgstr ":c:data:`PyExc_NotADirectoryError`" -#: ../../c-api/exceptions.rst:1057 +#: ../../c-api/exceptions.rst:1061 msgid ":exc:`NotADirectoryError`" msgstr ":exc:`NotADirectoryError`" -#: ../../c-api/exceptions.rst:1059 +#: ../../c-api/exceptions.rst:1063 msgid ":c:data:`PyExc_NotImplementedError`" msgstr ":c:data:`PyExc_NotImplementedError`" -#: ../../c-api/exceptions.rst:1059 +#: ../../c-api/exceptions.rst:1063 msgid ":exc:`NotImplementedError`" msgstr ":exc:`NotImplementedError`" -#: ../../c-api/exceptions.rst:1061 +#: ../../c-api/exceptions.rst:1065 msgid ":c:data:`PyExc_OSError`" msgstr ":c:data:`PyExc_OSError`" -#: ../../c-api/exceptions.rst:1061 +#: ../../c-api/exceptions.rst:1065 msgid ":exc:`OSError`" msgstr ":exc:`OSError`" -#: ../../c-api/exceptions.rst:1063 +#: ../../c-api/exceptions.rst:1067 msgid ":c:data:`PyExc_OverflowError`" msgstr ":c:data:`PyExc_OverflowError`" -#: ../../c-api/exceptions.rst:1063 +#: ../../c-api/exceptions.rst:1067 msgid ":exc:`OverflowError`" msgstr ":exc:`OverflowError`" -#: ../../c-api/exceptions.rst:1065 +#: ../../c-api/exceptions.rst:1069 msgid ":c:data:`PyExc_PermissionError`" msgstr ":c:data:`PyExc_PermissionError`" -#: ../../c-api/exceptions.rst:1065 +#: ../../c-api/exceptions.rst:1069 msgid ":exc:`PermissionError`" msgstr ":exc:`PermissionError`" -#: ../../c-api/exceptions.rst:1067 +#: ../../c-api/exceptions.rst:1071 msgid ":c:data:`PyExc_ProcessLookupError`" msgstr ":c:data:`PyExc_ProcessLookupError`" -#: ../../c-api/exceptions.rst:1067 +#: ../../c-api/exceptions.rst:1071 msgid ":exc:`ProcessLookupError`" msgstr ":exc:`ProcessLookupError`" -#: ../../c-api/exceptions.rst:1069 +#: ../../c-api/exceptions.rst:1073 msgid ":c:data:`PyExc_RecursionError`" msgstr ":c:data:`PyExc_RecursionError`" -#: ../../c-api/exceptions.rst:1069 +#: ../../c-api/exceptions.rst:1073 msgid ":exc:`RecursionError`" msgstr ":exc:`RecursionError`" -#: ../../c-api/exceptions.rst:1071 +#: ../../c-api/exceptions.rst:1075 msgid ":c:data:`PyExc_ReferenceError`" msgstr ":c:data:`PyExc_ReferenceError`" -#: ../../c-api/exceptions.rst:1071 +#: ../../c-api/exceptions.rst:1075 msgid ":exc:`ReferenceError`" msgstr ":exc:`ReferenceError`" -#: ../../c-api/exceptions.rst:1073 +#: ../../c-api/exceptions.rst:1077 msgid ":c:data:`PyExc_RuntimeError`" msgstr ":c:data:`PyExc_RuntimeError`" -#: ../../c-api/exceptions.rst:1073 +#: ../../c-api/exceptions.rst:1077 msgid ":exc:`RuntimeError`" msgstr ":exc:`RuntimeError`" -#: ../../c-api/exceptions.rst:1075 +#: ../../c-api/exceptions.rst:1079 msgid ":c:data:`PyExc_StopAsyncIteration`" msgstr ":c:data:`PyExc_StopAsyncIteration`" -#: ../../c-api/exceptions.rst:1075 +#: ../../c-api/exceptions.rst:1079 msgid ":exc:`StopAsyncIteration`" msgstr ":exc:`StopAsyncIteration`" -#: ../../c-api/exceptions.rst:1077 +#: ../../c-api/exceptions.rst:1081 msgid ":c:data:`PyExc_StopIteration`" msgstr ":c:data:`PyExc_StopIteration`" -#: ../../c-api/exceptions.rst:1077 +#: ../../c-api/exceptions.rst:1081 msgid ":exc:`StopIteration`" msgstr ":exc:`StopIteration`" -#: ../../c-api/exceptions.rst:1079 +#: ../../c-api/exceptions.rst:1083 msgid ":c:data:`PyExc_SyntaxError`" msgstr ":c:data:`PyExc_SyntaxError`" -#: ../../c-api/exceptions.rst:1079 +#: ../../c-api/exceptions.rst:1083 msgid ":exc:`SyntaxError`" msgstr ":exc:`SyntaxError`" -#: ../../c-api/exceptions.rst:1081 +#: ../../c-api/exceptions.rst:1085 msgid ":c:data:`PyExc_SystemError`" msgstr ":c:data:`PyExc_SystemError`" -#: ../../c-api/exceptions.rst:1081 +#: ../../c-api/exceptions.rst:1085 msgid ":exc:`SystemError`" msgstr ":exc:`SystemError`" -#: ../../c-api/exceptions.rst:1083 +#: ../../c-api/exceptions.rst:1087 msgid ":c:data:`PyExc_SystemExit`" msgstr ":c:data:`PyExc_SystemExit`" -#: ../../c-api/exceptions.rst:1083 +#: ../../c-api/exceptions.rst:1087 msgid ":exc:`SystemExit`" msgstr ":exc:`SystemExit`" -#: ../../c-api/exceptions.rst:1085 +#: ../../c-api/exceptions.rst:1089 msgid ":c:data:`PyExc_TabError`" msgstr ":c:data:`PyExc_TabError`" -#: ../../c-api/exceptions.rst:1085 +#: ../../c-api/exceptions.rst:1089 msgid ":exc:`TabError`" msgstr ":exc:`TabError`" -#: ../../c-api/exceptions.rst:1087 +#: ../../c-api/exceptions.rst:1091 msgid ":c:data:`PyExc_TimeoutError`" msgstr ":c:data:`PyExc_TimeoutError`" -#: ../../c-api/exceptions.rst:1087 +#: ../../c-api/exceptions.rst:1091 msgid ":exc:`TimeoutError`" msgstr ":exc:`TimeoutError`" -#: ../../c-api/exceptions.rst:1089 +#: ../../c-api/exceptions.rst:1093 msgid ":c:data:`PyExc_TypeError`" msgstr ":c:data:`PyExc_TypeError`" -#: ../../c-api/exceptions.rst:1089 +#: ../../c-api/exceptions.rst:1093 msgid ":exc:`TypeError`" msgstr ":exc:`TypeError`" -#: ../../c-api/exceptions.rst:1091 +#: ../../c-api/exceptions.rst:1095 msgid ":c:data:`PyExc_UnboundLocalError`" msgstr ":c:data:`PyExc_UnboundLocalError`" -#: ../../c-api/exceptions.rst:1091 +#: ../../c-api/exceptions.rst:1095 msgid ":exc:`UnboundLocalError`" msgstr ":exc:`UnboundLocalError`" -#: ../../c-api/exceptions.rst:1093 +#: ../../c-api/exceptions.rst:1097 msgid ":c:data:`PyExc_UnicodeDecodeError`" msgstr ":c:data:`PyExc_UnicodeDecodeError`" -#: ../../c-api/exceptions.rst:1093 +#: ../../c-api/exceptions.rst:1097 msgid ":exc:`UnicodeDecodeError`" msgstr ":exc:`UnicodeDecodeError`" -#: ../../c-api/exceptions.rst:1095 +#: ../../c-api/exceptions.rst:1099 msgid ":c:data:`PyExc_UnicodeEncodeError`" msgstr ":c:data:`PyExc_UnicodeEncodeError`" -#: ../../c-api/exceptions.rst:1095 +#: ../../c-api/exceptions.rst:1099 msgid ":exc:`UnicodeEncodeError`" msgstr ":exc:`UnicodeEncodeError`" -#: ../../c-api/exceptions.rst:1097 +#: ../../c-api/exceptions.rst:1101 msgid ":c:data:`PyExc_UnicodeError`" msgstr ":c:data:`PyExc_UnicodeError`" -#: ../../c-api/exceptions.rst:1097 +#: ../../c-api/exceptions.rst:1101 msgid ":exc:`UnicodeError`" msgstr ":exc:`UnicodeError`" -#: ../../c-api/exceptions.rst:1099 +#: ../../c-api/exceptions.rst:1103 msgid ":c:data:`PyExc_UnicodeTranslateError`" msgstr ":c:data:`PyExc_UnicodeTranslateError`" -#: ../../c-api/exceptions.rst:1099 +#: ../../c-api/exceptions.rst:1103 msgid ":exc:`UnicodeTranslateError`" msgstr ":exc:`UnicodeTranslateError`" -#: ../../c-api/exceptions.rst:1101 +#: ../../c-api/exceptions.rst:1105 msgid ":c:data:`PyExc_ValueError`" msgstr ":c:data:`PyExc_ValueError`" -#: ../../c-api/exceptions.rst:1101 +#: ../../c-api/exceptions.rst:1105 msgid ":exc:`ValueError`" msgstr ":exc:`ValueError`" -#: ../../c-api/exceptions.rst:1103 +#: ../../c-api/exceptions.rst:1107 msgid ":c:data:`PyExc_ZeroDivisionError`" msgstr ":c:data:`PyExc_ZeroDivisionError`" -#: ../../c-api/exceptions.rst:1103 +#: ../../c-api/exceptions.rst:1107 msgid ":exc:`ZeroDivisionError`" msgstr ":exc:`ZeroDivisionError`" -#: ../../c-api/exceptions.rst:1106 +#: ../../c-api/exceptions.rst:1110 msgid "" ":c:data:`PyExc_BlockingIOError`, :c:data:`PyExc_BrokenPipeError`, :c:data:" "`PyExc_ChildProcessError`, :c:data:`PyExc_ConnectionError`, :c:data:" @@ -1443,58 +1447,58 @@ msgstr "" "`PyExc_PermissionError`, :c:data:`PyExc_ProcessLookupError` 和 :c:data:" "`PyExc_TimeoutError` 是在 :pep:`3151` 被引入。" -#: ../../c-api/exceptions.rst:1116 +#: ../../c-api/exceptions.rst:1120 msgid ":c:data:`PyExc_StopAsyncIteration` and :c:data:`PyExc_RecursionError`." msgstr "" ":c:data:`PyExc_StopAsyncIteration` 和 :c:data:`PyExc_RecursionError`\\ 。" -#: ../../c-api/exceptions.rst:1119 +#: ../../c-api/exceptions.rst:1123 msgid ":c:data:`PyExc_ModuleNotFoundError`." msgstr ":c:data:`PyExc_ModuleNotFoundError`\\ 。" -#: ../../c-api/exceptions.rst:1122 +#: ../../c-api/exceptions.rst:1126 msgid "These are compatibility aliases to :c:data:`PyExc_OSError`:" msgstr "" -#: ../../c-api/exceptions.rst:1132 +#: ../../c-api/exceptions.rst:1136 msgid ":c:data:`PyExc_EnvironmentError`" msgstr ":c:data:`PyExc_EnvironmentError`" -#: ../../c-api/exceptions.rst:1134 +#: ../../c-api/exceptions.rst:1138 msgid ":c:data:`PyExc_IOError`" msgstr ":c:data:`PyExc_IOError`" -#: ../../c-api/exceptions.rst:1136 +#: ../../c-api/exceptions.rst:1140 msgid ":c:data:`PyExc_WindowsError`" msgstr ":c:data:`PyExc_WindowsError`" -#: ../../c-api/exceptions.rst:1136 +#: ../../c-api/exceptions.rst:1140 msgid "[2]_" msgstr "[2]_" -#: ../../c-api/exceptions.rst:1139 +#: ../../c-api/exceptions.rst:1143 msgid "These aliases used to be separate exception types." msgstr "" -#: ../../c-api/exceptions.rst:1142 ../../c-api/exceptions.rst:1203 +#: ../../c-api/exceptions.rst:1146 ../../c-api/exceptions.rst:1207 msgid "Notes:" msgstr "註解:" -#: ../../c-api/exceptions.rst:1145 +#: ../../c-api/exceptions.rst:1149 msgid "This is a base class for other standard exceptions." msgstr "" -#: ../../c-api/exceptions.rst:1148 +#: ../../c-api/exceptions.rst:1152 msgid "" "Only defined on Windows; protect code that uses this by testing that the " "preprocessor macro ``MS_WINDOWS`` is defined." msgstr "" -#: ../../c-api/exceptions.rst:1154 +#: ../../c-api/exceptions.rst:1158 msgid "Standard Warning Categories" msgstr "" -#: ../../c-api/exceptions.rst:1156 +#: ../../c-api/exceptions.rst:1160 msgid "" "All standard Python warning categories are available as global variables " "whose names are ``PyExc_`` followed by the Python exception name. These have " @@ -1502,103 +1506,103 @@ msgid "" "here are all the variables:" msgstr "" -#: ../../c-api/exceptions.rst:1177 +#: ../../c-api/exceptions.rst:1181 msgid ":c:data:`PyExc_Warning`" msgstr ":c:data:`PyExc_Warning`" -#: ../../c-api/exceptions.rst:1177 +#: ../../c-api/exceptions.rst:1181 msgid ":exc:`Warning`" msgstr ":exc:`Warning`" -#: ../../c-api/exceptions.rst:1177 +#: ../../c-api/exceptions.rst:1181 msgid "[3]_" msgstr "[3]_" -#: ../../c-api/exceptions.rst:1179 +#: ../../c-api/exceptions.rst:1183 msgid ":c:data:`PyExc_BytesWarning`" msgstr ":c:data:`PyExc_BytesWarning`" -#: ../../c-api/exceptions.rst:1179 +#: ../../c-api/exceptions.rst:1183 msgid ":exc:`BytesWarning`" msgstr ":exc:`BytesWarning`" -#: ../../c-api/exceptions.rst:1181 +#: ../../c-api/exceptions.rst:1185 msgid ":c:data:`PyExc_DeprecationWarning`" msgstr ":c:data:`PyExc_DeprecationWarning`" -#: ../../c-api/exceptions.rst:1181 +#: ../../c-api/exceptions.rst:1185 msgid ":exc:`DeprecationWarning`" msgstr ":exc:`DeprecationWarning`" -#: ../../c-api/exceptions.rst:1183 +#: ../../c-api/exceptions.rst:1187 msgid ":c:data:`PyExc_FutureWarning`" msgstr ":c:data:`PyExc_FutureWarning`" -#: ../../c-api/exceptions.rst:1183 +#: ../../c-api/exceptions.rst:1187 msgid ":exc:`FutureWarning`" msgstr ":exc:`FutureWarning`" -#: ../../c-api/exceptions.rst:1185 +#: ../../c-api/exceptions.rst:1189 msgid ":c:data:`PyExc_ImportWarning`" msgstr ":c:data:`PyExc_ImportWarning`" -#: ../../c-api/exceptions.rst:1185 +#: ../../c-api/exceptions.rst:1189 msgid ":exc:`ImportWarning`" msgstr ":exc:`ImportWarning`" -#: ../../c-api/exceptions.rst:1187 +#: ../../c-api/exceptions.rst:1191 msgid ":c:data:`PyExc_PendingDeprecationWarning`" msgstr ":c:data:`PyExc_PendingDeprecationWarning`" -#: ../../c-api/exceptions.rst:1187 +#: ../../c-api/exceptions.rst:1191 msgid ":exc:`PendingDeprecationWarning`" msgstr ":exc:`PendingDeprecationWarning`" -#: ../../c-api/exceptions.rst:1189 +#: ../../c-api/exceptions.rst:1193 msgid ":c:data:`PyExc_ResourceWarning`" msgstr ":c:data:`PyExc_ResourceWarning`" -#: ../../c-api/exceptions.rst:1189 +#: ../../c-api/exceptions.rst:1193 msgid ":exc:`ResourceWarning`" msgstr ":exc:`ResourceWarning`" -#: ../../c-api/exceptions.rst:1191 +#: ../../c-api/exceptions.rst:1195 msgid ":c:data:`PyExc_RuntimeWarning`" msgstr ":c:data:`PyExc_RuntimeWarning`" -#: ../../c-api/exceptions.rst:1191 +#: ../../c-api/exceptions.rst:1195 msgid ":exc:`RuntimeWarning`" msgstr ":exc:`RuntimeWarning`" -#: ../../c-api/exceptions.rst:1193 +#: ../../c-api/exceptions.rst:1197 msgid ":c:data:`PyExc_SyntaxWarning`" msgstr ":c:data:`PyExc_SyntaxWarning`" -#: ../../c-api/exceptions.rst:1193 +#: ../../c-api/exceptions.rst:1197 msgid ":exc:`SyntaxWarning`" msgstr ":exc:`SyntaxWarning`" -#: ../../c-api/exceptions.rst:1195 +#: ../../c-api/exceptions.rst:1199 msgid ":c:data:`PyExc_UnicodeWarning`" msgstr ":c:data:`PyExc_UnicodeWarning`" -#: ../../c-api/exceptions.rst:1195 +#: ../../c-api/exceptions.rst:1199 msgid ":exc:`UnicodeWarning`" msgstr ":exc:`UnicodeWarning`" -#: ../../c-api/exceptions.rst:1197 +#: ../../c-api/exceptions.rst:1201 msgid ":c:data:`PyExc_UserWarning`" msgstr ":c:data:`PyExc_UserWarning`" -#: ../../c-api/exceptions.rst:1197 +#: ../../c-api/exceptions.rst:1201 msgid ":exc:`UserWarning`" msgstr ":exc:`UserWarning`" -#: ../../c-api/exceptions.rst:1200 +#: ../../c-api/exceptions.rst:1204 msgid ":c:data:`PyExc_ResourceWarning`." msgstr ":c:data:`PyExc_ResourceWarning`." -#: ../../c-api/exceptions.rst:1206 +#: ../../c-api/exceptions.rst:1210 msgid "This is a base class for other standard warning categories." msgstr "" @@ -1606,289 +1610,289 @@ msgstr "" msgid "strerror()" msgstr "strerror()" -#: ../../c-api/exceptions.rst:610 ../../c-api/exceptions.rst:641 -#: ../../c-api/exceptions.rst:656 +#: ../../c-api/exceptions.rst:614 ../../c-api/exceptions.rst:645 +#: ../../c-api/exceptions.rst:660 msgid "module" msgstr "module(模組)" -#: ../../c-api/exceptions.rst:610 ../../c-api/exceptions.rst:641 -#: ../../c-api/exceptions.rst:656 +#: ../../c-api/exceptions.rst:614 ../../c-api/exceptions.rst:645 +#: ../../c-api/exceptions.rst:660 msgid "signal" msgstr "signal(訊號)" -#: ../../c-api/exceptions.rst:610 ../../c-api/exceptions.rst:641 +#: ../../c-api/exceptions.rst:614 ../../c-api/exceptions.rst:645 msgid "SIGINT" msgstr "SIGINT" -#: ../../c-api/exceptions.rst:610 ../../c-api/exceptions.rst:641 -#: ../../c-api/exceptions.rst:656 +#: ../../c-api/exceptions.rst:614 ../../c-api/exceptions.rst:645 +#: ../../c-api/exceptions.rst:660 msgid "KeyboardInterrupt (built-in exception)" msgstr "KeyboardInterrupt(內建例外)" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_BaseException" msgstr "PyExc_BaseException" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_Exception" msgstr "PyExc_Exception" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_ArithmeticError" msgstr "PyExc_ArithmeticError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_AssertionError" msgstr "PyExc_AssertionError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_AttributeError" msgstr "PyExc_AttributeError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_BlockingIOError" msgstr "PyExc_BlockingIOError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_BrokenPipeError" msgstr "PyExc_BrokenPipeError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_BufferError" msgstr "PyExc_BufferError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_ChildProcessError" msgstr "PyExc_ChildProcessError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_ConnectionAbortedError" msgstr "PyExc_ConnectionAbortedError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_ConnectionError" msgstr "PyExc_ConnectionError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_ConnectionRefusedError" msgstr "PyExc_ConnectionRefusedError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_ConnectionResetError" msgstr "PyExc_ConnectionResetError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_EOFError" msgstr "PyExc_EOFError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_FileExistsError" msgstr "PyExc_FileExistsError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_FileNotFoundError" msgstr "PyExc_FileNotFoundError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_FloatingPointError" msgstr "PyExc_FloatingPointError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_GeneratorExit" msgstr "PyExc_GeneratorExit" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_ImportError" msgstr "PyExc_ImportError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_IndentationError" msgstr "PyExc_IndentationError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_IndexError" msgstr "PyExc_IndexError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_InterruptedError" msgstr "PyExc_InterruptedError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_IsADirectoryError" msgstr "PyExc_IsADirectoryError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_KeyError" msgstr "PyExc_KeyError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_KeyboardInterrupt" msgstr "PyExc_KeyboardInterrupt" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_LookupError" msgstr "PyExc_LookupError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_MemoryError" msgstr "PyExc_MemoryError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_ModuleNotFoundError" msgstr "PyExc_ModuleNotFoundError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_NameError" msgstr "PyExc_NameError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_NotADirectoryError" msgstr "PyExc_NotADirectoryError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_NotImplementedError" msgstr "PyExc_NotImplementedError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_OSError" msgstr "PyExc_OSError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_OverflowError" msgstr "PyExc_OverflowError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_PermissionError" msgstr "PyExc_PermissionError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_ProcessLookupError" msgstr "PyExc_ProcessLookupError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_RecursionError" msgstr "PyExc_RecursionError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_ReferenceError" msgstr "PyExc_ReferenceError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_RuntimeError" msgstr "PyExc_RuntimeError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_StopAsyncIteration" msgstr "PyExc_StopAsyncIteration" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_StopIteration" msgstr "PyExc_StopIteration" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_SyntaxError" msgstr "PyExc_SyntaxError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_SystemError" msgstr "PyExc_SystemError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_SystemExit" msgstr "PyExc_SystemExit" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_TabError" msgstr "PyExc_TabError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_TimeoutError" msgstr "PyExc_TimeoutError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_TypeError" msgstr "PyExc_TypeError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_UnboundLocalError" msgstr "PyExc_UnboundLocalError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_UnicodeDecodeError" msgstr "PyExc_UnicodeDecodeError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_UnicodeEncodeError" msgstr "PyExc_UnicodeEncodeError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_UnicodeError" msgstr "PyExc_UnicodeError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_UnicodeTranslateError" msgstr "PyExc_UnicodeTranslateError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_ValueError" msgstr "PyExc_ValueError" -#: ../../c-api/exceptions.rst:941 +#: ../../c-api/exceptions.rst:945 msgid "PyExc_ZeroDivisionError" msgstr "PyExc_ZeroDivisionError" -#: ../../c-api/exceptions.rst:1124 +#: ../../c-api/exceptions.rst:1128 msgid "PyExc_EnvironmentError" msgstr "PyExc_EnvironmentError" -#: ../../c-api/exceptions.rst:1124 +#: ../../c-api/exceptions.rst:1128 msgid "PyExc_IOError" msgstr "PyExc_IOError" -#: ../../c-api/exceptions.rst:1124 +#: ../../c-api/exceptions.rst:1128 msgid "PyExc_WindowsError" msgstr "PyExc_WindowsError" -#: ../../c-api/exceptions.rst:1161 +#: ../../c-api/exceptions.rst:1165 msgid "PyExc_Warning" msgstr "PyExc_Warning" -#: ../../c-api/exceptions.rst:1161 +#: ../../c-api/exceptions.rst:1165 msgid "PyExc_BytesWarning" msgstr "PyExc_BytesWarning" -#: ../../c-api/exceptions.rst:1161 +#: ../../c-api/exceptions.rst:1165 msgid "PyExc_DeprecationWarning" msgstr "PyExc_DeprecationWarning" -#: ../../c-api/exceptions.rst:1161 +#: ../../c-api/exceptions.rst:1165 msgid "PyExc_FutureWarning" msgstr "PyExc_FutureWarning" -#: ../../c-api/exceptions.rst:1161 +#: ../../c-api/exceptions.rst:1165 msgid "PyExc_ImportWarning" msgstr "PyExc_ImportWarning" -#: ../../c-api/exceptions.rst:1161 +#: ../../c-api/exceptions.rst:1165 msgid "PyExc_PendingDeprecationWarning" msgstr "PyExc_PendingDeprecationWarning" -#: ../../c-api/exceptions.rst:1161 +#: ../../c-api/exceptions.rst:1165 msgid "PyExc_ResourceWarning" msgstr "PyExc_ResourceWarning" -#: ../../c-api/exceptions.rst:1161 +#: ../../c-api/exceptions.rst:1165 msgid "PyExc_RuntimeWarning" msgstr "PyExc_RuntimeWarning" -#: ../../c-api/exceptions.rst:1161 +#: ../../c-api/exceptions.rst:1165 msgid "PyExc_SyntaxWarning" msgstr "PyExc_SyntaxWarning" -#: ../../c-api/exceptions.rst:1161 +#: ../../c-api/exceptions.rst:1165 msgid "PyExc_UnicodeWarning" msgstr "PyExc_UnicodeWarning" -#: ../../c-api/exceptions.rst:1161 +#: ../../c-api/exceptions.rst:1165 msgid "PyExc_UserWarning" msgstr "PyExc_UserWarning" diff --git a/c-api/init_config.po b/c-api/init_config.po index 6958b33c49..ef69a88c37 100644 --- a/c-api/init_config.po +++ b/c-api/init_config.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-09 00:03+0000\n" +"POT-Creation-Date: 2023-08-23 00:03+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-" @@ -86,310 +86,310 @@ msgid "" "be non-``NULL``." msgstr "" -#: ../../c-api/init_config.rst:85 +#: ../../c-api/init_config.rst:87 msgid "Methods:" msgstr "" -#: ../../c-api/init_config.rst:89 +#: ../../c-api/init_config.rst:91 msgid "Append *item* to *list*." msgstr "" -#: ../../c-api/init_config.rst:91 ../../c-api/init_config.rst:102 +#: ../../c-api/init_config.rst:93 ../../c-api/init_config.rst:104 msgid "Python must be preinitialized to call this function." msgstr "" -#: ../../c-api/init_config.rst:95 +#: ../../c-api/init_config.rst:97 msgid "Insert *item* into *list* at *index*." msgstr "" -#: ../../c-api/init_config.rst:97 +#: ../../c-api/init_config.rst:99 msgid "" "If *index* is greater than or equal to *list* length, append *item* to " "*list*." msgstr "" -#: ../../c-api/init_config.rst:100 +#: ../../c-api/init_config.rst:102 msgid "*index* must be greater than or equal to ``0``." msgstr "" -#: ../../c-api/init_config.rst:104 ../../c-api/init_config.rst:124 -#: ../../c-api/init_config.rst:231 ../../c-api/init_config.rst:540 +#: ../../c-api/init_config.rst:108 ../../c-api/init_config.rst:128 +#: ../../c-api/init_config.rst:235 ../../c-api/init_config.rst:544 msgid "Structure fields:" msgstr "" -#: ../../c-api/init_config.rst:108 +#: ../../c-api/init_config.rst:112 msgid "List length." msgstr "" -#: ../../c-api/init_config.rst:112 +#: ../../c-api/init_config.rst:116 msgid "List items." msgstr "" -#: ../../c-api/init_config.rst:115 +#: ../../c-api/init_config.rst:119 msgid "PyStatus" msgstr "PyStatus" -#: ../../c-api/init_config.rst:119 +#: ../../c-api/init_config.rst:123 msgid "" "Structure to store an initialization function status: success, error or exit." msgstr "" -#: ../../c-api/init_config.rst:122 +#: ../../c-api/init_config.rst:126 msgid "For an error, it can store the C function name which created the error." msgstr "" -#: ../../c-api/init_config.rst:128 +#: ../../c-api/init_config.rst:132 msgid "Exit code. Argument passed to ``exit()``." msgstr "" -#: ../../c-api/init_config.rst:132 +#: ../../c-api/init_config.rst:136 msgid "Error message." msgstr "錯誤訊息。" -#: ../../c-api/init_config.rst:136 +#: ../../c-api/init_config.rst:140 msgid "Name of the function which created an error, can be ``NULL``." msgstr "" -#: ../../c-api/init_config.rst:140 +#: ../../c-api/init_config.rst:144 msgid "Functions to create a status:" msgstr "" -#: ../../c-api/init_config.rst:144 +#: ../../c-api/init_config.rst:148 msgid "Success." msgstr "" -#: ../../c-api/init_config.rst:148 +#: ../../c-api/init_config.rst:152 msgid "Initialization error with a message." msgstr "" -#: ../../c-api/init_config.rst:150 +#: ../../c-api/init_config.rst:154 msgid "*err_msg* must not be ``NULL``." msgstr "*err_msg* 不可為 ``NULL``。" -#: ../../c-api/init_config.rst:154 +#: ../../c-api/init_config.rst:158 msgid "Memory allocation failure (out of memory)." msgstr "" -#: ../../c-api/init_config.rst:158 +#: ../../c-api/init_config.rst:162 msgid "Exit Python with the specified exit code." msgstr "" -#: ../../c-api/init_config.rst:160 +#: ../../c-api/init_config.rst:164 msgid "Functions to handle a status:" msgstr "" -#: ../../c-api/init_config.rst:164 +#: ../../c-api/init_config.rst:168 msgid "" "Is the status an error or an exit? If true, the exception must be handled; " "by calling :c:func:`Py_ExitStatusException` for example." msgstr "" -#: ../../c-api/init_config.rst:169 +#: ../../c-api/init_config.rst:173 msgid "Is the result an error?" msgstr "" -#: ../../c-api/init_config.rst:173 +#: ../../c-api/init_config.rst:177 msgid "Is the result an exit?" msgstr "" -#: ../../c-api/init_config.rst:177 +#: ../../c-api/init_config.rst:181 msgid "" "Call ``exit(exitcode)`` if *status* is an exit. Print the error message and " "exit with a non-zero exit code if *status* is an error. Must only be called " "if ``PyStatus_Exception(status)`` is non-zero." msgstr "" -#: ../../c-api/init_config.rst:182 +#: ../../c-api/init_config.rst:186 msgid "" "Internally, Python uses macros which set ``PyStatus.func``, whereas " "functions to create a status set ``func`` to ``NULL``." msgstr "" -#: ../../c-api/init_config.rst:185 +#: ../../c-api/init_config.rst:189 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../c-api/init_config.rst:209 +#: ../../c-api/init_config.rst:213 msgid "PyPreConfig" msgstr "PyPreConfig" -#: ../../c-api/init_config.rst:213 +#: ../../c-api/init_config.rst:217 msgid "Structure used to preinitialize Python." msgstr "" -#: ../../c-api/init_config.rst:217 +#: ../../c-api/init_config.rst:221 msgid "Function to initialize a preconfiguration:" msgstr "" -#: ../../c-api/init_config.rst:221 +#: ../../c-api/init_config.rst:225 msgid "" "Initialize the preconfiguration with :ref:`Python Configuration `." msgstr "" -#: ../../c-api/init_config.rst:226 +#: ../../c-api/init_config.rst:230 msgid "" "Initialize the preconfiguration with :ref:`Isolated Configuration `." msgstr "" -#: ../../c-api/init_config.rst:235 +#: ../../c-api/init_config.rst:239 msgid "Name of the Python memory allocators:" msgstr "" -#: ../../c-api/init_config.rst:237 +#: ../../c-api/init_config.rst:241 msgid "" "``PYMEM_ALLOCATOR_NOT_SET`` (``0``): don't change memory allocators (use " "defaults)." msgstr "" -#: ../../c-api/init_config.rst:239 +#: ../../c-api/init_config.rst:243 msgid "" "``PYMEM_ALLOCATOR_DEFAULT`` (``1``): :ref:`default memory allocators " "`." msgstr "" -#: ../../c-api/init_config.rst:241 +#: ../../c-api/init_config.rst:245 msgid "" "``PYMEM_ALLOCATOR_DEBUG`` (``2``): :ref:`default memory allocators ` with :ref:`debug hooks `." msgstr "" -#: ../../c-api/init_config.rst:244 +#: ../../c-api/init_config.rst:248 msgid "``PYMEM_ALLOCATOR_MALLOC`` (``3``): use ``malloc()`` of the C library." msgstr "" -#: ../../c-api/init_config.rst:245 +#: ../../c-api/init_config.rst:249 msgid "" "``PYMEM_ALLOCATOR_MALLOC_DEBUG`` (``4``): force usage of ``malloc()`` with :" "ref:`debug hooks `." msgstr "" -#: ../../c-api/init_config.rst:247 +#: ../../c-api/init_config.rst:251 msgid "" "``PYMEM_ALLOCATOR_PYMALLOC`` (``5``): :ref:`Python pymalloc memory allocator " "`." msgstr "" -#: ../../c-api/init_config.rst:249 +#: ../../c-api/init_config.rst:253 msgid "" "``PYMEM_ALLOCATOR_PYMALLOC_DEBUG`` (``6``): :ref:`Python pymalloc memory " "allocator ` with :ref:`debug hooks `." msgstr "" -#: ../../c-api/init_config.rst:253 +#: ../../c-api/init_config.rst:257 msgid "" "``PYMEM_ALLOCATOR_PYMALLOC`` and ``PYMEM_ALLOCATOR_PYMALLOC_DEBUG`` are not " "supported if Python is :option:`configured using --without-pymalloc <--" "without-pymalloc>`." msgstr "" -#: ../../c-api/init_config.rst:257 +#: ../../c-api/init_config.rst:261 msgid "See :ref:`Memory Management `." msgstr "請見\\ :ref:`記憶體管理 `\\ 。" -#: ../../c-api/init_config.rst:259 +#: ../../c-api/init_config.rst:263 msgid "Default: ``PYMEM_ALLOCATOR_NOT_SET``." msgstr "預設:\\ ``PYMEM_ALLOCATOR_NOT_SET``\\ 。" -#: ../../c-api/init_config.rst:263 +#: ../../c-api/init_config.rst:267 msgid "Set the LC_CTYPE locale to the user preferred locale." msgstr "" -#: ../../c-api/init_config.rst:265 +#: ../../c-api/init_config.rst:269 msgid "" "If equals to ``0``, set :c:member:`~PyPreConfig.coerce_c_locale` and :c:" "member:`~PyPreConfig.coerce_c_locale_warn` members to ``0``." msgstr "" -#: ../../c-api/init_config.rst:268 ../../c-api/init_config.rst:279 +#: ../../c-api/init_config.rst:272 ../../c-api/init_config.rst:283 msgid "See the :term:`locale encoding`." msgstr "請見 :term:`locale encoding`\\ 。" -#: ../../c-api/init_config.rst:270 ../../c-api/init_config.rst:325 -#: ../../c-api/init_config.rst:680 +#: ../../c-api/init_config.rst:274 ../../c-api/init_config.rst:329 +#: ../../c-api/init_config.rst:684 msgid "Default: ``1`` in Python config, ``0`` in isolated config." msgstr "" -#: ../../c-api/init_config.rst:274 +#: ../../c-api/init_config.rst:278 msgid "If equals to ``2``, coerce the C locale." msgstr "" -#: ../../c-api/init_config.rst:276 +#: ../../c-api/init_config.rst:280 msgid "" "If equals to ``1``, read the LC_CTYPE locale to decide if it should be " "coerced." msgstr "" -#: ../../c-api/init_config.rst:281 ../../c-api/init_config.rst:287 +#: ../../c-api/init_config.rst:285 ../../c-api/init_config.rst:291 msgid "Default: ``-1`` in Python config, ``0`` in isolated config." msgstr "" -#: ../../c-api/init_config.rst:285 +#: ../../c-api/init_config.rst:289 msgid "If non-zero, emit a warning if the C locale is coerced." msgstr "" -#: ../../c-api/init_config.rst:291 +#: ../../c-api/init_config.rst:295 msgid "" ":ref:`Python Development Mode `: see :c:member:`PyConfig.dev_mode`." msgstr "" -#: ../../c-api/init_config.rst:294 ../../c-api/init_config.rst:689 -#: ../../c-api/init_config.rst:731 ../../c-api/init_config.rst:1184 +#: ../../c-api/init_config.rst:298 ../../c-api/init_config.rst:693 +#: ../../c-api/init_config.rst:735 ../../c-api/init_config.rst:1188 msgid "Default: ``-1`` in Python mode, ``0`` in isolated mode." msgstr "" -#: ../../c-api/init_config.rst:298 +#: ../../c-api/init_config.rst:302 msgid "Isolated mode: see :c:member:`PyConfig.isolated`." msgstr "" -#: ../../c-api/init_config.rst:300 ../../c-api/init_config.rst:876 +#: ../../c-api/init_config.rst:304 ../../c-api/init_config.rst:880 msgid "Default: ``0`` in Python mode, ``1`` in isolated mode." msgstr "" -#: ../../c-api/init_config.rst:304 +#: ../../c-api/init_config.rst:308 msgid "If non-zero:" msgstr "如果不為 0:" -#: ../../c-api/init_config.rst:306 +#: ../../c-api/init_config.rst:310 msgid "Set :c:member:`PyPreConfig.utf8_mode` to ``0``," msgstr "將 :c:member:`PyPreConfig.utf8_mode` 設為 ``0``\\ 、" -#: ../../c-api/init_config.rst:307 +#: ../../c-api/init_config.rst:311 msgid "Set :c:member:`PyConfig.filesystem_encoding` to ``\"mbcs\"``," msgstr "將 :c:member:`PyConfig.filesystem_encoding` 設為 ``\"mbcs\"``\\ 、" -#: ../../c-api/init_config.rst:308 +#: ../../c-api/init_config.rst:312 msgid "Set :c:member:`PyConfig.filesystem_errors` to ``\"replace\"``." msgstr "將 :c:member:`PyConfig.filesystem_errors` 設為 ``\"replace\"``\\ 。" -#: ../../c-api/init_config.rst:310 +#: ../../c-api/init_config.rst:314 msgid "" "Initialized the from :envvar:`PYTHONLEGACYWINDOWSFSENCODING` environment " "variable value." msgstr "" -#: ../../c-api/init_config.rst:313 ../../c-api/init_config.rst:890 +#: ../../c-api/init_config.rst:317 ../../c-api/init_config.rst:894 msgid "" "Only available on Windows. ``#ifdef MS_WINDOWS`` macro can be used for " "Windows specific code." msgstr "" -#: ../../c-api/init_config.rst:316 ../../c-api/init_config.rst:628 -#: ../../c-api/init_config.rst:635 ../../c-api/init_config.rst:702 -#: ../../c-api/init_config.rst:811 ../../c-api/init_config.rst:825 -#: ../../c-api/init_config.rst:839 ../../c-api/init_config.rst:893 -#: ../../c-api/init_config.rst:907 ../../c-api/init_config.rst:967 -#: ../../c-api/init_config.rst:1019 ../../c-api/init_config.rst:1079 -#: ../../c-api/init_config.rst:1119 ../../c-api/init_config.rst:1148 -#: ../../c-api/init_config.rst:1235 +#: ../../c-api/init_config.rst:320 ../../c-api/init_config.rst:632 +#: ../../c-api/init_config.rst:639 ../../c-api/init_config.rst:706 +#: ../../c-api/init_config.rst:815 ../../c-api/init_config.rst:829 +#: ../../c-api/init_config.rst:843 ../../c-api/init_config.rst:897 +#: ../../c-api/init_config.rst:911 ../../c-api/init_config.rst:971 +#: ../../c-api/init_config.rst:1023 ../../c-api/init_config.rst:1083 +#: ../../c-api/init_config.rst:1123 ../../c-api/init_config.rst:1152 +#: ../../c-api/init_config.rst:1239 msgid "Default: ``0``." msgstr "預設:\\ ``0``。" -#: ../../c-api/init_config.rst:320 +#: ../../c-api/init_config.rst:324 msgid "" "If non-zero, :c:func:`Py_PreInitializeFromArgs` and :c:func:" "`Py_PreInitializeFromBytesArgs` parse their ``argv`` argument the same way " @@ -397,95 +397,95 @@ msgid "" "Arguments `." msgstr "" -#: ../../c-api/init_config.rst:329 +#: ../../c-api/init_config.rst:333 msgid "" "Use :ref:`environment variables `? See :c:member:`PyConfig." "use_environment`." msgstr "" -#: ../../c-api/init_config.rst:332 ../../c-api/init_config.rst:1209 +#: ../../c-api/init_config.rst:336 ../../c-api/init_config.rst:1213 msgid "Default: ``1`` in Python config and ``0`` in isolated config." msgstr "" -#: ../../c-api/init_config.rst:336 +#: ../../c-api/init_config.rst:340 msgid "If non-zero, enable the :ref:`Python UTF-8 Mode `." msgstr "" -#: ../../c-api/init_config.rst:338 +#: ../../c-api/init_config.rst:342 msgid "" "Set to ``0`` or ``1`` by the :option:`-X utf8 <-X>` command line option and " "the :envvar:`PYTHONUTF8` environment variable." msgstr "" -#: ../../c-api/init_config.rst:341 +#: ../../c-api/init_config.rst:345 msgid "Also set to ``1`` if the ``LC_CTYPE`` locale is ``C`` or ``POSIX``." msgstr "" -#: ../../c-api/init_config.rst:343 +#: ../../c-api/init_config.rst:347 msgid "Default: ``-1`` in Python config and ``0`` in isolated config." msgstr "" -#: ../../c-api/init_config.rst:349 +#: ../../c-api/init_config.rst:353 msgid "Preinitialize Python with PyPreConfig" msgstr "" -#: ../../c-api/init_config.rst:351 +#: ../../c-api/init_config.rst:355 msgid "The preinitialization of Python:" msgstr "" -#: ../../c-api/init_config.rst:353 +#: ../../c-api/init_config.rst:357 msgid "Set the Python memory allocators (:c:member:`PyPreConfig.allocator`)" msgstr "" -#: ../../c-api/init_config.rst:354 +#: ../../c-api/init_config.rst:358 msgid "Configure the LC_CTYPE locale (:term:`locale encoding`)" msgstr "" -#: ../../c-api/init_config.rst:355 +#: ../../c-api/init_config.rst:359 msgid "" "Set the :ref:`Python UTF-8 Mode ` (:c:member:`PyPreConfig." "utf8_mode`)" msgstr "" -#: ../../c-api/init_config.rst:358 +#: ../../c-api/init_config.rst:362 msgid "" "The current preconfiguration (``PyPreConfig`` type) is stored in " "``_PyRuntime.preconfig``." msgstr "" -#: ../../c-api/init_config.rst:361 +#: ../../c-api/init_config.rst:365 msgid "Functions to preinitialize Python:" msgstr "" -#: ../../c-api/init_config.rst:365 ../../c-api/init_config.rst:371 -#: ../../c-api/init_config.rst:380 +#: ../../c-api/init_config.rst:369 ../../c-api/init_config.rst:375 +#: ../../c-api/init_config.rst:384 msgid "Preinitialize Python from *preconfig* preconfiguration." msgstr "" -#: ../../c-api/init_config.rst:367 ../../c-api/init_config.rst:376 -#: ../../c-api/init_config.rst:385 +#: ../../c-api/init_config.rst:371 ../../c-api/init_config.rst:380 +#: ../../c-api/init_config.rst:389 msgid "*preconfig* must not be ``NULL``." msgstr "*preconfig* 不可為 ``NULL``。" -#: ../../c-api/init_config.rst:373 +#: ../../c-api/init_config.rst:377 msgid "" "Parse *argv* command line arguments (bytes strings) if :c:member:" "`~PyPreConfig.parse_argv` of *preconfig* is non-zero." msgstr "" -#: ../../c-api/init_config.rst:382 +#: ../../c-api/init_config.rst:386 msgid "" "Parse *argv* command line arguments (wide strings) if :c:member:" "`~PyPreConfig.parse_argv` of *preconfig* is non-zero." msgstr "" -#: ../../c-api/init_config.rst:387 ../../c-api/init_config.rst:1297 +#: ../../c-api/init_config.rst:391 ../../c-api/init_config.rst:1301 msgid "" "The caller is responsible to handle exceptions (error or exit) using :c:func:" "`PyStatus_Exception` and :c:func:`Py_ExitStatusException`." msgstr "" -#: ../../c-api/init_config.rst:390 +#: ../../c-api/init_config.rst:394 msgid "" "For :ref:`Python Configuration ` (:c:func:" "`PyPreConfig_InitPythonConfig`), if Python is initialized with command line " @@ -495,7 +495,7 @@ msgid "" "`Python UTF-8 Mode `." msgstr "" -#: ../../c-api/init_config.rst:397 +#: ../../c-api/init_config.rst:401 msgid "" "``PyMem_SetAllocator()`` can be called after :c:func:`Py_PreInitialize` and " "before :c:func:`Py_InitializeFromConfig` to install a custom memory " @@ -503,7 +503,7 @@ msgid "" "`PyPreConfig.allocator` is set to ``PYMEM_ALLOCATOR_NOT_SET``." msgstr "" -#: ../../c-api/init_config.rst:402 +#: ../../c-api/init_config.rst:406 msgid "" "Python memory allocation functions like :c:func:`PyMem_RawMalloc` must not " "be used before the Python preinitialization, whereas calling directly " @@ -511,90 +511,90 @@ msgid "" "not be called before the Python preinitialization." msgstr "" -#: ../../c-api/init_config.rst:407 +#: ../../c-api/init_config.rst:411 msgid "" "Example using the preinitialization to enable the :ref:`Python UTF-8 Mode " "`::" msgstr "" -#: ../../c-api/init_config.rst:429 +#: ../../c-api/init_config.rst:433 msgid "PyConfig" msgstr "PyConfig" -#: ../../c-api/init_config.rst:433 +#: ../../c-api/init_config.rst:437 msgid "Structure containing most parameters to configure Python." msgstr "" -#: ../../c-api/init_config.rst:435 +#: ../../c-api/init_config.rst:439 msgid "" "When done, the :c:func:`PyConfig_Clear` function must be used to release the " "configuration memory." msgstr "" -#: ../../c-api/init_config.rst:440 +#: ../../c-api/init_config.rst:444 msgid "Structure methods:" msgstr "" -#: ../../c-api/init_config.rst:444 +#: ../../c-api/init_config.rst:448 msgid "" "Initialize configuration with the :ref:`Python Configuration `." msgstr "" -#: ../../c-api/init_config.rst:449 +#: ../../c-api/init_config.rst:453 msgid "" "Initialize configuration with the :ref:`Isolated Configuration `." msgstr "" -#: ../../c-api/init_config.rst:454 +#: ../../c-api/init_config.rst:458 msgid "Copy the wide character string *str* into ``*config_str``." msgstr "" -#: ../../c-api/init_config.rst:456 ../../c-api/init_config.rst:463 -#: ../../c-api/init_config.rst:470 ../../c-api/init_config.rst:478 -#: ../../c-api/init_config.rst:484 ../../c-api/init_config.rst:501 +#: ../../c-api/init_config.rst:460 ../../c-api/init_config.rst:467 +#: ../../c-api/init_config.rst:474 ../../c-api/init_config.rst:482 +#: ../../c-api/init_config.rst:488 ../../c-api/init_config.rst:505 msgid ":ref:`Preinitialize Python ` if needed." msgstr "" -#: ../../c-api/init_config.rst:460 +#: ../../c-api/init_config.rst:464 msgid "" "Decode *str* using :c:func:`Py_DecodeLocale` and set the result into " "``*config_str``." msgstr "" -#: ../../c-api/init_config.rst:467 +#: ../../c-api/init_config.rst:471 msgid "" "Set command line arguments (:c:member:`~PyConfig.argv` member of *config*) " "from the *argv* list of wide character strings." msgstr "" -#: ../../c-api/init_config.rst:474 +#: ../../c-api/init_config.rst:478 msgid "" "Set command line arguments (:c:member:`~PyConfig.argv` member of *config*) " "from the *argv* list of bytes strings. Decode bytes using :c:func:" "`Py_DecodeLocale`." msgstr "" -#: ../../c-api/init_config.rst:482 +#: ../../c-api/init_config.rst:486 msgid "Set the list of wide strings *list* to *length* and *items*." msgstr "" -#: ../../c-api/init_config.rst:488 +#: ../../c-api/init_config.rst:492 msgid "Read all Python configuration." msgstr "" -#: ../../c-api/init_config.rst:490 +#: ../../c-api/init_config.rst:494 msgid "Fields which are already initialized are left unchanged." msgstr "" -#: ../../c-api/init_config.rst:492 +#: ../../c-api/init_config.rst:496 msgid "" "Fields for :ref:`path configuration ` are no longer " "calculated or modified when calling this function, as of Python 3.11." msgstr "" -#: ../../c-api/init_config.rst:495 ../../c-api/init_config.rst:996 +#: ../../c-api/init_config.rst:499 ../../c-api/init_config.rst:1000 msgid "" "The :c:func:`PyConfig_Read` function only parses :c:member:`PyConfig.argv` " "arguments once: :c:member:`PyConfig.parse_argv` is set to ``2`` after " @@ -603,25 +603,25 @@ msgid "" "as Python options." msgstr "" -#: ../../c-api/init_config.rst:503 +#: ../../c-api/init_config.rst:507 msgid "" "The :c:member:`PyConfig.argv` arguments are now only parsed once, :c:member:" "`PyConfig.parse_argv` is set to ``2`` after arguments are parsed, and " "arguments are only parsed if :c:member:`PyConfig.parse_argv` equals ``1``." msgstr "" -#: ../../c-api/init_config.rst:509 +#: ../../c-api/init_config.rst:513 msgid "" ":c:func:`PyConfig_Read` no longer calculates all paths, and so fields listed " "under :ref:`Python Path Configuration ` may no longer be " "updated until :c:func:`Py_InitializeFromConfig` is called." msgstr "" -#: ../../c-api/init_config.rst:517 +#: ../../c-api/init_config.rst:521 msgid "Release configuration memory." msgstr "" -#: ../../c-api/init_config.rst:519 +#: ../../c-api/init_config.rst:523 msgid "" "Most ``PyConfig`` methods :ref:`preinitialize Python ` if needed. " "In that case, the Python preinitialization configuration (:c:type:" @@ -630,23 +630,23 @@ msgid "" "before calling a :c:type:`PyConfig` method:" msgstr "" -#: ../../c-api/init_config.rst:525 +#: ../../c-api/init_config.rst:529 msgid ":c:member:`PyConfig.dev_mode`" msgstr ":c:member:`PyConfig.dev_mode`" -#: ../../c-api/init_config.rst:526 +#: ../../c-api/init_config.rst:530 msgid ":c:member:`PyConfig.isolated`" msgstr ":c:member:`PyConfig.isolated`" -#: ../../c-api/init_config.rst:527 +#: ../../c-api/init_config.rst:531 msgid ":c:member:`PyConfig.parse_argv`" msgstr ":c:member:`PyConfig.parse_argv`" -#: ../../c-api/init_config.rst:528 +#: ../../c-api/init_config.rst:532 msgid ":c:member:`PyConfig.use_environment`" msgstr ":c:member:`PyConfig.use_environment`" -#: ../../c-api/init_config.rst:530 +#: ../../c-api/init_config.rst:534 msgid "" "Moreover, if :c:func:`PyConfig_SetArgv` or :c:func:`PyConfig_SetBytesArgv` " "is used, this method must be called before other methods, since the " @@ -654,412 +654,412 @@ msgid "" "member:`~PyConfig.parse_argv` is non-zero)." msgstr "" -#: ../../c-api/init_config.rst:535 +#: ../../c-api/init_config.rst:539 msgid "" "The caller of these methods is responsible to handle exceptions (error or " "exit) using ``PyStatus_Exception()`` and ``Py_ExitStatusException()``." msgstr "" -#: ../../c-api/init_config.rst:544 +#: ../../c-api/init_config.rst:548 msgid "Command line arguments: :data:`sys.argv`." msgstr "" -#: ../../c-api/init_config.rst:546 +#: ../../c-api/init_config.rst:550 msgid "" "Set :c:member:`~PyConfig.parse_argv` to ``1`` to parse :c:member:`~PyConfig." "argv` the same way the regular Python parses Python command line arguments " "and then to strip Python arguments from :c:member:`~PyConfig.argv`." msgstr "" -#: ../../c-api/init_config.rst:551 +#: ../../c-api/init_config.rst:555 msgid "" "If :c:member:`~PyConfig.argv` is empty, an empty string is added to ensure " "that :data:`sys.argv` always exists and is never empty." msgstr "" -#: ../../c-api/init_config.rst:554 ../../c-api/init_config.rst:581 -#: ../../c-api/init_config.rst:593 ../../c-api/init_config.rst:601 -#: ../../c-api/init_config.rst:709 ../../c-api/init_config.rst:718 -#: ../../c-api/init_config.rst:800 ../../c-api/init_config.rst:937 -#: ../../c-api/init_config.rst:1038 ../../c-api/init_config.rst:1056 -#: ../../c-api/init_config.rst:1070 ../../c-api/init_config.rst:1087 -#: ../../c-api/init_config.rst:1100 ../../c-api/init_config.rst:1108 +#: ../../c-api/init_config.rst:558 ../../c-api/init_config.rst:585 +#: ../../c-api/init_config.rst:597 ../../c-api/init_config.rst:605 +#: ../../c-api/init_config.rst:713 ../../c-api/init_config.rst:722 +#: ../../c-api/init_config.rst:804 ../../c-api/init_config.rst:941 +#: ../../c-api/init_config.rst:1042 ../../c-api/init_config.rst:1060 +#: ../../c-api/init_config.rst:1074 ../../c-api/init_config.rst:1091 +#: ../../c-api/init_config.rst:1104 ../../c-api/init_config.rst:1112 msgid "Default: ``NULL``." msgstr "預設值:\\ ``NULL``\\ 。" -#: ../../c-api/init_config.rst:556 +#: ../../c-api/init_config.rst:560 msgid "See also the :c:member:`~PyConfig.orig_argv` member." msgstr "" -#: ../../c-api/init_config.rst:560 +#: ../../c-api/init_config.rst:564 msgid "" "If equals to zero, ``Py_RunMain()`` prepends a potentially unsafe path to :" "data:`sys.path` at startup:" msgstr "" -#: ../../c-api/init_config.rst:563 +#: ../../c-api/init_config.rst:567 msgid "" "If :c:member:`argv[0] ` is equal to ``L\"-m\"`` (``python -m " "module``), prepend the current working directory." msgstr "" -#: ../../c-api/init_config.rst:565 +#: ../../c-api/init_config.rst:569 msgid "" "If running a script (``python script.py``), prepend the script's directory. " "If it's a symbolic link, resolve symbolic links." msgstr "" -#: ../../c-api/init_config.rst:567 +#: ../../c-api/init_config.rst:571 msgid "" "Otherwise (``python -c code`` and ``python``), prepend an empty string, " "which means the current working directory." msgstr "" -#: ../../c-api/init_config.rst:570 +#: ../../c-api/init_config.rst:574 msgid "" "Set to ``1`` by the :option:`-P` command line option and the :envvar:" "`PYTHONSAFEPATH` environment variable." msgstr "" -#: ../../c-api/init_config.rst:573 +#: ../../c-api/init_config.rst:577 msgid "Default: ``0`` in Python config, ``1`` in isolated config." msgstr "" -#: ../../c-api/init_config.rst:579 +#: ../../c-api/init_config.rst:583 msgid ":data:`sys.base_exec_prefix`." msgstr ":data:`sys.base_exec_prefix`\\ 。" -#: ../../c-api/init_config.rst:583 ../../c-api/init_config.rst:595 -#: ../../c-api/init_config.rst:603 ../../c-api/init_config.rst:711 -#: ../../c-api/init_config.rst:720 ../../c-api/init_config.rst:954 -#: ../../c-api/init_config.rst:1040 +#: ../../c-api/init_config.rst:587 ../../c-api/init_config.rst:599 +#: ../../c-api/init_config.rst:607 ../../c-api/init_config.rst:715 +#: ../../c-api/init_config.rst:724 ../../c-api/init_config.rst:958 +#: ../../c-api/init_config.rst:1044 msgid "Part of the :ref:`Python Path Configuration ` output." msgstr "" -#: ../../c-api/init_config.rst:587 +#: ../../c-api/init_config.rst:591 msgid "Python base executable: :data:`sys._base_executable`." msgstr "" -#: ../../c-api/init_config.rst:589 +#: ../../c-api/init_config.rst:593 msgid "Set by the :envvar:`__PYVENV_LAUNCHER__` environment variable." msgstr "" -#: ../../c-api/init_config.rst:591 +#: ../../c-api/init_config.rst:595 msgid "Set from :c:member:`PyConfig.executable` if ``NULL``." msgstr "" -#: ../../c-api/init_config.rst:599 +#: ../../c-api/init_config.rst:603 msgid ":data:`sys.base_prefix`." msgstr ":data:`sys.base_prefix`\\ 。" -#: ../../c-api/init_config.rst:607 +#: ../../c-api/init_config.rst:611 msgid "" "If equals to ``0`` and :c:member:`~PyConfig.configure_c_stdio` is non-zero, " "disable buffering on the C streams stdout and stderr." msgstr "" -#: ../../c-api/init_config.rst:610 +#: ../../c-api/init_config.rst:614 msgid "" "Set to ``0`` by the :option:`-u` command line option and the :envvar:" "`PYTHONUNBUFFERED` environment variable." msgstr "" -#: ../../c-api/init_config.rst:613 +#: ../../c-api/init_config.rst:617 msgid "stdin is always opened in buffered mode." msgstr "" -#: ../../c-api/init_config.rst:615 ../../c-api/init_config.rst:648 -#: ../../c-api/init_config.rst:1136 ../../c-api/init_config.rst:1267 +#: ../../c-api/init_config.rst:619 ../../c-api/init_config.rst:652 +#: ../../c-api/init_config.rst:1140 ../../c-api/init_config.rst:1271 msgid "Default: ``1``." msgstr "預設值:\\ ``1``\\ 。" -#: ../../c-api/init_config.rst:619 +#: ../../c-api/init_config.rst:623 msgid "" "If equals to ``1``, issue a warning when comparing :class:`bytes` or :class:" "`bytearray` with :class:`str`, or comparing :class:`bytes` with :class:`int`." msgstr "" -#: ../../c-api/init_config.rst:623 +#: ../../c-api/init_config.rst:627 msgid "" "If equal or greater to ``2``, raise a :exc:`BytesWarning` exception in these " "cases." msgstr "" -#: ../../c-api/init_config.rst:626 +#: ../../c-api/init_config.rst:630 msgid "Incremented by the :option:`-b` command line option." msgstr "" -#: ../../c-api/init_config.rst:632 +#: ../../c-api/init_config.rst:636 msgid "" "If non-zero, emit a :exc:`EncodingWarning` warning when :class:`io." "TextIOWrapper` uses its default encoding. See :ref:`io-encoding-warning` for " "details." msgstr "" -#: ../../c-api/init_config.rst:641 +#: ../../c-api/init_config.rst:645 msgid "" "If equals to ``0``, disables the inclusion of the end line and column " "mappings in code objects. Also disables traceback printing carets to " "specific error locations." msgstr "" -#: ../../c-api/init_config.rst:645 +#: ../../c-api/init_config.rst:649 msgid "" "Set to ``0`` by the :envvar:`PYTHONNODEBUGRANGES` environment variable and " "by the :option:`-X no_debug_ranges <-X>` command line option." msgstr "" -#: ../../c-api/init_config.rst:654 +#: ../../c-api/init_config.rst:658 msgid "" "Control the validation behavior of hash-based ``.pyc`` files: value of the :" "option:`--check-hash-based-pycs` command line option." msgstr "" -#: ../../c-api/init_config.rst:657 +#: ../../c-api/init_config.rst:661 msgid "Valid values:" msgstr "" -#: ../../c-api/init_config.rst:659 +#: ../../c-api/init_config.rst:663 msgid "" "``L\"always\"``: Hash the source file for invalidation regardless of value " "of the 'check_source' flag." msgstr "" -#: ../../c-api/init_config.rst:661 +#: ../../c-api/init_config.rst:665 msgid "``L\"never\"``: Assume that hash-based pycs always are valid." msgstr "" -#: ../../c-api/init_config.rst:662 +#: ../../c-api/init_config.rst:666 msgid "" "``L\"default\"``: The 'check_source' flag in hash-based pycs determines " "invalidation." msgstr "" -#: ../../c-api/init_config.rst:665 +#: ../../c-api/init_config.rst:669 msgid "Default: ``L\"default\"``." msgstr "預設:\\ ``L\"default\"``。" -#: ../../c-api/init_config.rst:667 +#: ../../c-api/init_config.rst:671 msgid "See also :pep:`552` \"Deterministic pycs\"." msgstr "" -#: ../../c-api/init_config.rst:671 +#: ../../c-api/init_config.rst:675 msgid "If non-zero, configure C standard streams:" msgstr "" -#: ../../c-api/init_config.rst:673 +#: ../../c-api/init_config.rst:677 msgid "" "On Windows, set the binary mode (``O_BINARY``) on stdin, stdout and stderr." msgstr "" -#: ../../c-api/init_config.rst:675 +#: ../../c-api/init_config.rst:679 msgid "" "If :c:member:`~PyConfig.buffered_stdio` equals zero, disable buffering of " "stdin, stdout and stderr streams." msgstr "" -#: ../../c-api/init_config.rst:677 +#: ../../c-api/init_config.rst:681 msgid "" "If :c:member:`~PyConfig.interactive` is non-zero, enable stream buffering on " "stdin and stdout (only stdout on Windows)." msgstr "" -#: ../../c-api/init_config.rst:684 +#: ../../c-api/init_config.rst:688 msgid "If non-zero, enable the :ref:`Python Development Mode `." msgstr "" -#: ../../c-api/init_config.rst:686 +#: ../../c-api/init_config.rst:690 msgid "" "Set to ``1`` by the :option:`-X dev <-X>` option and the :envvar:" "`PYTHONDEVMODE` environment variable." msgstr "" -#: ../../c-api/init_config.rst:693 +#: ../../c-api/init_config.rst:697 msgid "Dump Python references?" msgstr "" -#: ../../c-api/init_config.rst:695 +#: ../../c-api/init_config.rst:699 msgid "If non-zero, dump all objects which are still alive at exit." msgstr "" -#: ../../c-api/init_config.rst:697 +#: ../../c-api/init_config.rst:701 msgid "Set to ``1`` by the :envvar:`PYTHONDUMPREFS` environment variable." msgstr "" -#: ../../c-api/init_config.rst:699 +#: ../../c-api/init_config.rst:703 msgid "" "Need a special build of Python with the ``Py_TRACE_REFS`` macro defined: see " "the :option:`configure --with-trace-refs option <--with-trace-refs>`." msgstr "" -#: ../../c-api/init_config.rst:706 +#: ../../c-api/init_config.rst:710 msgid "" "The site-specific directory prefix where the platform-dependent Python files " "are installed: :data:`sys.exec_prefix`." msgstr "" -#: ../../c-api/init_config.rst:715 +#: ../../c-api/init_config.rst:719 msgid "" "The absolute path of the executable binary for the Python interpreter: :data:" "`sys.executable`." msgstr "" -#: ../../c-api/init_config.rst:724 +#: ../../c-api/init_config.rst:728 msgid "Enable faulthandler?" msgstr "" -#: ../../c-api/init_config.rst:726 +#: ../../c-api/init_config.rst:730 msgid "If non-zero, call :func:`faulthandler.enable` at startup." msgstr "" -#: ../../c-api/init_config.rst:728 +#: ../../c-api/init_config.rst:732 msgid "" "Set to ``1`` by :option:`-X faulthandler <-X>` and the :envvar:" "`PYTHONFAULTHANDLER` environment variable." msgstr "" -#: ../../c-api/init_config.rst:735 +#: ../../c-api/init_config.rst:739 msgid "" ":term:`Filesystem encoding `: :func:" "`sys.getfilesystemencoding`." msgstr "" -#: ../../c-api/init_config.rst:738 +#: ../../c-api/init_config.rst:742 msgid "On macOS, Android and VxWorks: use ``\"utf-8\"`` by default." msgstr "" -#: ../../c-api/init_config.rst:740 +#: ../../c-api/init_config.rst:744 msgid "" "On Windows: use ``\"utf-8\"`` by default, or ``\"mbcs\"`` if :c:member:" "`~PyPreConfig.legacy_windows_fs_encoding` of :c:type:`PyPreConfig` is non-" "zero." msgstr "" -#: ../../c-api/init_config.rst:744 +#: ../../c-api/init_config.rst:748 msgid "Default encoding on other platforms:" msgstr "" -#: ../../c-api/init_config.rst:746 +#: ../../c-api/init_config.rst:750 msgid "``\"utf-8\"`` if :c:member:`PyPreConfig.utf8_mode` is non-zero." msgstr "" -#: ../../c-api/init_config.rst:747 +#: ../../c-api/init_config.rst:751 msgid "" "``\"ascii\"`` if Python detects that ``nl_langinfo(CODESET)`` announces the " "ASCII encoding, whereas the ``mbstowcs()`` function decodes from a different " "encoding (usually Latin1)." msgstr "" -#: ../../c-api/init_config.rst:750 +#: ../../c-api/init_config.rst:754 msgid "``\"utf-8\"`` if ``nl_langinfo(CODESET)`` returns an empty string." msgstr "" -#: ../../c-api/init_config.rst:751 +#: ../../c-api/init_config.rst:755 msgid "" "Otherwise, use the :term:`locale encoding`: ``nl_langinfo(CODESET)`` result." msgstr "" -#: ../../c-api/init_config.rst:754 +#: ../../c-api/init_config.rst:758 msgid "" "At Python startup, the encoding name is normalized to the Python codec name. " "For example, ``\"ANSI_X3.4-1968\"`` is replaced with ``\"ascii\"``." msgstr "" -#: ../../c-api/init_config.rst:757 +#: ../../c-api/init_config.rst:761 msgid "See also the :c:member:`~PyConfig.filesystem_errors` member." msgstr "" -#: ../../c-api/init_config.rst:761 +#: ../../c-api/init_config.rst:765 msgid "" ":term:`Filesystem error handler `: :" "func:`sys.getfilesystemencodeerrors`." msgstr "" -#: ../../c-api/init_config.rst:764 +#: ../../c-api/init_config.rst:768 msgid "" "On Windows: use ``\"surrogatepass\"`` by default, or ``\"replace\"`` if :c:" "member:`~PyPreConfig.legacy_windows_fs_encoding` of :c:type:`PyPreConfig` is " "non-zero." msgstr "" -#: ../../c-api/init_config.rst:768 +#: ../../c-api/init_config.rst:772 msgid "On other platforms: use ``\"surrogateescape\"`` by default." msgstr "" -#: ../../c-api/init_config.rst:770 +#: ../../c-api/init_config.rst:774 msgid "Supported error handlers:" msgstr "" -#: ../../c-api/init_config.rst:772 +#: ../../c-api/init_config.rst:776 msgid "``\"strict\"``" msgstr "``\"strict\"``" -#: ../../c-api/init_config.rst:773 +#: ../../c-api/init_config.rst:777 msgid "``\"surrogateescape\"``" msgstr "``\"surrogateescape\"``" -#: ../../c-api/init_config.rst:774 +#: ../../c-api/init_config.rst:778 msgid "``\"surrogatepass\"`` (only supported with the UTF-8 encoding)" msgstr "" -#: ../../c-api/init_config.rst:776 +#: ../../c-api/init_config.rst:780 msgid "See also the :c:member:`~PyConfig.filesystem_encoding` member." msgstr "" -#: ../../c-api/init_config.rst:781 +#: ../../c-api/init_config.rst:785 msgid "Randomized hash function seed." msgstr "" -#: ../../c-api/init_config.rst:783 +#: ../../c-api/init_config.rst:787 msgid "" "If :c:member:`~PyConfig.use_hash_seed` is zero, a seed is chosen randomly at " "Python startup, and :c:member:`~PyConfig.hash_seed` is ignored." msgstr "" -#: ../../c-api/init_config.rst:786 +#: ../../c-api/init_config.rst:790 msgid "Set by the :envvar:`PYTHONHASHSEED` environment variable." msgstr "" -#: ../../c-api/init_config.rst:788 +#: ../../c-api/init_config.rst:792 msgid "" "Default *use_hash_seed* value: ``-1`` in Python mode, ``0`` in isolated mode." msgstr "" -#: ../../c-api/init_config.rst:793 +#: ../../c-api/init_config.rst:797 msgid "Python home directory." msgstr "" -#: ../../c-api/init_config.rst:795 +#: ../../c-api/init_config.rst:799 msgid "" "If :c:func:`Py_SetPythonHome` has been called, use its argument if it is not " "``NULL``." msgstr "" -#: ../../c-api/init_config.rst:798 +#: ../../c-api/init_config.rst:802 msgid "Set by the :envvar:`PYTHONHOME` environment variable." msgstr "" -#: ../../c-api/init_config.rst:802 ../../c-api/init_config.rst:919 -#: ../../c-api/init_config.rst:939 ../../c-api/init_config.rst:1028 -#: ../../c-api/init_config.rst:1058 +#: ../../c-api/init_config.rst:806 ../../c-api/init_config.rst:923 +#: ../../c-api/init_config.rst:943 ../../c-api/init_config.rst:1032 +#: ../../c-api/init_config.rst:1062 msgid "Part of the :ref:`Python Path Configuration ` input." msgstr "" -#: ../../c-api/init_config.rst:806 +#: ../../c-api/init_config.rst:810 msgid "If non-zero, profile import time." msgstr "" -#: ../../c-api/init_config.rst:808 +#: ../../c-api/init_config.rst:812 msgid "" "Set the ``1`` by the :option:`-X importtime <-X>` option and the :envvar:" "`PYTHONPROFILEIMPORTTIME` environment variable." msgstr "" -#: ../../c-api/init_config.rst:815 +#: ../../c-api/init_config.rst:819 msgid "Enter interactive mode after executing a script or a command." msgstr "" -#: ../../c-api/init_config.rst:817 +#: ../../c-api/init_config.rst:821 msgid "" "If greater than ``0``, enable inspect: when a script is passed as first " "argument or the -c option is used, enter interactive mode after executing " @@ -1067,30 +1067,30 @@ msgid "" "a terminal." msgstr "" -#: ../../c-api/init_config.rst:822 +#: ../../c-api/init_config.rst:826 msgid "" "Incremented by the :option:`-i` command line option. Set to ``1`` if the :" "envvar:`PYTHONINSPECT` environment variable is non-empty." msgstr "" -#: ../../c-api/init_config.rst:829 +#: ../../c-api/init_config.rst:833 msgid "Install Python signal handlers?" msgstr "" -#: ../../c-api/init_config.rst:831 ../../c-api/init_config.rst:1002 -#: ../../c-api/init_config.rst:1026 ../../c-api/init_config.rst:1219 +#: ../../c-api/init_config.rst:835 ../../c-api/init_config.rst:1006 +#: ../../c-api/init_config.rst:1030 ../../c-api/init_config.rst:1223 msgid "Default: ``1`` in Python mode, ``0`` in isolated mode." msgstr "" -#: ../../c-api/init_config.rst:835 +#: ../../c-api/init_config.rst:839 msgid "If greater than ``0``, enable the interactive mode (REPL)." msgstr "" -#: ../../c-api/init_config.rst:837 +#: ../../c-api/init_config.rst:841 msgid "Incremented by the :option:`-i` command line option." msgstr "" -#: ../../c-api/init_config.rst:843 +#: ../../c-api/init_config.rst:847 msgid "" "Configures the :ref:`integer string conversion length limitation " "`. An initial value of ``-1`` means the value will be " @@ -1100,30 +1100,30 @@ msgid "" "str_digits_check_threshold`) are unsupported and will produce an error." msgstr "" -#: ../../c-api/init_config.rst:851 +#: ../../c-api/init_config.rst:855 msgid "" "Configured by the :option:`-X int_max_str_digits <-X>` command line flag or " "the :envvar:`PYTHONINTMAXSTRDIGITS` environment variable." msgstr "" -#: ../../c-api/init_config.rst:854 +#: ../../c-api/init_config.rst:858 msgid "" "Default: ``-1`` in Python mode. 4300 (:data:`sys.int_info." "default_max_str_digits`) in isolated mode." msgstr "" -#: ../../c-api/init_config.rst:861 +#: ../../c-api/init_config.rst:865 msgid "If greater than ``0``, enable isolated mode:" msgstr "" -#: ../../c-api/init_config.rst:863 +#: ../../c-api/init_config.rst:867 msgid "" "Set :c:member:`~PyConfig.safe_path` to ``1``: don't prepend a potentially " "unsafe path to :data:`sys.path` at Python startup, such as the current " "directory, the script's directory or an empty string." msgstr "" -#: ../../c-api/init_config.rst:867 +#: ../../c-api/init_config.rst:871 msgid "" "Set :c:member:`~PyConfig.use_environment` to ``0``: ignore ``PYTHON`` " "environment variables." @@ -1131,77 +1131,77 @@ msgstr "" "將 :c:member:`~PyConfig.use_environment` 設定為 ``0``:忽略 ``PYTHON`` 環境變" "數。" -#: ../../c-api/init_config.rst:869 +#: ../../c-api/init_config.rst:873 msgid "" "Set :c:member:`~PyConfig.user_site_directory` to ``0``: don't add the user " "site directory to :data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:871 +#: ../../c-api/init_config.rst:875 msgid "" "Python REPL doesn't import :mod:`readline` nor enable default readline " "configuration on interactive prompts." msgstr "" -#: ../../c-api/init_config.rst:874 +#: ../../c-api/init_config.rst:878 msgid "Set to ``1`` by the :option:`-I` command line option." msgstr "" -#: ../../c-api/init_config.rst:878 +#: ../../c-api/init_config.rst:882 msgid "" "See also the :ref:`Isolated Configuration ` and :c:" "member:`PyPreConfig.isolated`." msgstr "" -#: ../../c-api/init_config.rst:883 +#: ../../c-api/init_config.rst:887 msgid "" "If non-zero, use :class:`io.FileIO` instead of :class:`!io." "_WindowsConsoleIO` for :data:`sys.stdin`, :data:`sys.stdout` and :data:`sys." "stderr`." msgstr "" -#: ../../c-api/init_config.rst:887 +#: ../../c-api/init_config.rst:891 msgid "" "Set to ``1`` if the :envvar:`PYTHONLEGACYWINDOWSSTDIO` environment variable " "is set to a non-empty string." msgstr "" -#: ../../c-api/init_config.rst:895 +#: ../../c-api/init_config.rst:899 msgid "See also the :pep:`528` (Change Windows console encoding to UTF-8)." msgstr "" -#: ../../c-api/init_config.rst:899 +#: ../../c-api/init_config.rst:903 msgid "" "If non-zero, dump statistics on :ref:`Python pymalloc memory allocator " "` at exit." msgstr "" -#: ../../c-api/init_config.rst:902 +#: ../../c-api/init_config.rst:906 msgid "Set to ``1`` by the :envvar:`PYTHONMALLOCSTATS` environment variable." msgstr "" -#: ../../c-api/init_config.rst:904 +#: ../../c-api/init_config.rst:908 msgid "" "The option is ignored if Python is :option:`configured using the --without-" "pymalloc option <--without-pymalloc>`." msgstr "" -#: ../../c-api/init_config.rst:911 +#: ../../c-api/init_config.rst:915 msgid "Platform library directory name: :data:`sys.platlibdir`." msgstr "" -#: ../../c-api/init_config.rst:913 +#: ../../c-api/init_config.rst:917 msgid "Set by the :envvar:`PYTHONPLATLIBDIR` environment variable." msgstr "" -#: ../../c-api/init_config.rst:915 +#: ../../c-api/init_config.rst:919 msgid "" "Default: value of the ``PLATLIBDIR`` macro which is set by the :option:" "`configure --with-platlibdir option <--with-platlibdir>` (default: " "``\"lib\"``, or ``\"DLLs\"`` on Windows)." msgstr "" -#: ../../c-api/init_config.rst:923 +#: ../../c-api/init_config.rst:927 msgid "" "This macro is now used on Windows to locate the standard library extension " "modules, typically under ``DLLs``. However, for compatibility, note that " @@ -1209,21 +1209,21 @@ msgid "" "and virtual environments." msgstr "" -#: ../../c-api/init_config.rst:932 +#: ../../c-api/init_config.rst:936 msgid "" "Module search paths (:data:`sys.path`) as a string separated by ``DELIM`` (:" "data:`os.pathsep`)." msgstr "" -#: ../../c-api/init_config.rst:935 +#: ../../c-api/init_config.rst:939 msgid "Set by the :envvar:`PYTHONPATH` environment variable." msgstr "" -#: ../../c-api/init_config.rst:944 +#: ../../c-api/init_config.rst:948 msgid "Module search paths: :data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:946 +#: ../../c-api/init_config.rst:950 msgid "" "If :c:member:`~PyConfig.module_search_paths_set` is equal to ``0``, :c:func:" "`Py_InitializeFromConfig` will replace :c:member:`~PyConfig." @@ -1231,41 +1231,41 @@ msgid "" "to ``1``." msgstr "" -#: ../../c-api/init_config.rst:951 +#: ../../c-api/init_config.rst:955 msgid "" "Default: empty list (``module_search_paths``) and ``0`` " "(``module_search_paths_set``)." msgstr "" -#: ../../c-api/init_config.rst:958 +#: ../../c-api/init_config.rst:962 msgid "Compilation optimization level:" msgstr "" -#: ../../c-api/init_config.rst:960 +#: ../../c-api/init_config.rst:964 msgid "``0``: Peephole optimizer, set ``__debug__`` to ``True``." msgstr "" -#: ../../c-api/init_config.rst:961 +#: ../../c-api/init_config.rst:965 msgid "``1``: Level 0, remove assertions, set ``__debug__`` to ``False``." msgstr "" -#: ../../c-api/init_config.rst:962 +#: ../../c-api/init_config.rst:966 msgid "``2``: Level 1, strip docstrings." msgstr "" -#: ../../c-api/init_config.rst:964 +#: ../../c-api/init_config.rst:968 msgid "" "Incremented by the :option:`-O` command line option. Set to the :envvar:" "`PYTHONOPTIMIZE` environment variable value." msgstr "" -#: ../../c-api/init_config.rst:971 +#: ../../c-api/init_config.rst:975 msgid "" "The list of the original command line arguments passed to the Python " "executable: :data:`sys.orig_argv`." msgstr "" -#: ../../c-api/init_config.rst:974 +#: ../../c-api/init_config.rst:978 msgid "" "If :c:member:`~PyConfig.orig_argv` list is empty and :c:member:`~PyConfig." "argv` is not a list only containing an empty string, :c:func:`PyConfig_Read` " @@ -1274,388 +1274,388 @@ msgid "" "parse_argv` is non-zero)." msgstr "" -#: ../../c-api/init_config.rst:981 +#: ../../c-api/init_config.rst:985 msgid "" "See also the :c:member:`~PyConfig.argv` member and the :c:func:" "`Py_GetArgcArgv` function." msgstr "" -#: ../../c-api/init_config.rst:984 ../../c-api/init_config.rst:1254 -#: ../../c-api/init_config.rst:1273 +#: ../../c-api/init_config.rst:988 ../../c-api/init_config.rst:1258 +#: ../../c-api/init_config.rst:1277 msgid "Default: empty list." msgstr "" -#: ../../c-api/init_config.rst:990 +#: ../../c-api/init_config.rst:994 msgid "Parse command line arguments?" msgstr "" -#: ../../c-api/init_config.rst:992 +#: ../../c-api/init_config.rst:996 msgid "" "If equals to ``1``, parse :c:member:`~PyConfig.argv` the same way the " "regular Python parses :ref:`command line arguments `, and " "strip Python arguments from :c:member:`~PyConfig.argv`." msgstr "" -#: ../../c-api/init_config.rst:1004 +#: ../../c-api/init_config.rst:1008 msgid "" "The :c:member:`PyConfig.argv` arguments are now only parsed if :c:member:" "`PyConfig.parse_argv` equals to ``1``." msgstr "" -#: ../../c-api/init_config.rst:1010 +#: ../../c-api/init_config.rst:1014 msgid "" "Parser debug mode. If greater than ``0``, turn on parser debugging output " "(for expert only, depending on compilation options)." msgstr "" -#: ../../c-api/init_config.rst:1013 +#: ../../c-api/init_config.rst:1017 msgid "" "Incremented by the :option:`-d` command line option. Set to the :envvar:" "`PYTHONDEBUG` environment variable value." msgstr "" -#: ../../c-api/init_config.rst:1016 +#: ../../c-api/init_config.rst:1020 msgid "" "Need a :ref:`debug build of Python ` (the ``Py_DEBUG`` macro " "must be defined)." msgstr "" -#: ../../c-api/init_config.rst:1023 +#: ../../c-api/init_config.rst:1027 msgid "" "If non-zero, calculation of path configuration is allowed to log warnings " "into ``stderr``. If equals to ``0``, suppress these warnings." msgstr "" -#: ../../c-api/init_config.rst:1030 +#: ../../c-api/init_config.rst:1034 msgid "Now also applies on Windows." msgstr "" -#: ../../c-api/init_config.rst:1035 +#: ../../c-api/init_config.rst:1039 msgid "" "The site-specific directory prefix where the platform independent Python " "files are installed: :data:`sys.prefix`." msgstr "" -#: ../../c-api/init_config.rst:1044 +#: ../../c-api/init_config.rst:1048 msgid "" "Program name used to initialize :c:member:`~PyConfig.executable` and in " "early error messages during Python initialization." msgstr "" -#: ../../c-api/init_config.rst:1047 +#: ../../c-api/init_config.rst:1051 msgid "If :func:`Py_SetProgramName` has been called, use its argument." msgstr "" -#: ../../c-api/init_config.rst:1048 +#: ../../c-api/init_config.rst:1052 msgid "On macOS, use :envvar:`PYTHONEXECUTABLE` environment variable if set." msgstr "" -#: ../../c-api/init_config.rst:1049 +#: ../../c-api/init_config.rst:1053 msgid "" "If the ``WITH_NEXT_FRAMEWORK`` macro is defined, use :envvar:" "`__PYVENV_LAUNCHER__` environment variable if set." msgstr "" -#: ../../c-api/init_config.rst:1051 +#: ../../c-api/init_config.rst:1055 msgid "" "Use ``argv[0]`` of :c:member:`~PyConfig.argv` if available and non-empty." msgstr "" -#: ../../c-api/init_config.rst:1053 +#: ../../c-api/init_config.rst:1057 msgid "" "Otherwise, use ``L\"python\"`` on Windows, or ``L\"python3\"`` on other " "platforms." msgstr "" -#: ../../c-api/init_config.rst:1062 +#: ../../c-api/init_config.rst:1066 msgid "" "Directory where cached ``.pyc`` files are written: :data:`sys." "pycache_prefix`." msgstr "" -#: ../../c-api/init_config.rst:1065 +#: ../../c-api/init_config.rst:1069 msgid "" "Set by the :option:`-X pycache_prefix=PATH <-X>` command line option and " "the :envvar:`PYTHONPYCACHEPREFIX` environment variable." msgstr "" -#: ../../c-api/init_config.rst:1068 +#: ../../c-api/init_config.rst:1072 msgid "If ``NULL``, :data:`sys.pycache_prefix` is set to ``None``." msgstr "" -#: ../../c-api/init_config.rst:1074 +#: ../../c-api/init_config.rst:1078 msgid "" "Quiet mode. If greater than ``0``, don't display the copyright and version " "at Python startup in interactive mode." msgstr "" -#: ../../c-api/init_config.rst:1077 +#: ../../c-api/init_config.rst:1081 msgid "Incremented by the :option:`-q` command line option." msgstr "" -#: ../../c-api/init_config.rst:1083 +#: ../../c-api/init_config.rst:1087 msgid "Value of the :option:`-c` command line option." msgstr "" -#: ../../c-api/init_config.rst:1085 ../../c-api/init_config.rst:1106 +#: ../../c-api/init_config.rst:1089 ../../c-api/init_config.rst:1110 msgid "Used by :c:func:`Py_RunMain`." msgstr "" -#: ../../c-api/init_config.rst:1091 +#: ../../c-api/init_config.rst:1095 msgid "" "Filename passed on the command line: trailing command line argument without :" "option:`-c` or :option:`-m`. It is used by the :c:func:`Py_RunMain` function." msgstr "" -#: ../../c-api/init_config.rst:1095 +#: ../../c-api/init_config.rst:1099 msgid "" "For example, it is set to ``script.py`` by the ``python3 script.py arg`` " "command line." msgstr "" -#: ../../c-api/init_config.rst:1098 +#: ../../c-api/init_config.rst:1102 msgid "See also the :c:member:`PyConfig.skip_source_first_line` option." msgstr "也請見 :c:member:`PyConfig.skip_source_first_line` 選項。" -#: ../../c-api/init_config.rst:1104 +#: ../../c-api/init_config.rst:1108 msgid "Value of the :option:`-m` command line option." msgstr "" -#: ../../c-api/init_config.rst:1112 +#: ../../c-api/init_config.rst:1116 msgid "Show total reference count at exit (excluding immortal objects)?" msgstr "" -#: ../../c-api/init_config.rst:1114 +#: ../../c-api/init_config.rst:1118 msgid "Set to ``1`` by :option:`-X showrefcount <-X>` command line option." msgstr "" -#: ../../c-api/init_config.rst:1116 +#: ../../c-api/init_config.rst:1120 msgid "" "Need a :ref:`debug build of Python ` (the ``Py_REF_DEBUG`` " "macro must be defined)." msgstr "" -#: ../../c-api/init_config.rst:1123 +#: ../../c-api/init_config.rst:1127 msgid "Import the :mod:`site` module at startup?" msgstr "" -#: ../../c-api/init_config.rst:1125 +#: ../../c-api/init_config.rst:1129 msgid "" "If equal to zero, disable the import of the module site and the site-" "dependent manipulations of :data:`sys.path` that it entails." msgstr "" -#: ../../c-api/init_config.rst:1128 +#: ../../c-api/init_config.rst:1132 msgid "" "Also disable these manipulations if the :mod:`site` module is explicitly " "imported later (call :func:`site.main` if you want them to be triggered)." msgstr "" -#: ../../c-api/init_config.rst:1131 +#: ../../c-api/init_config.rst:1135 msgid "Set to ``0`` by the :option:`-S` command line option." msgstr "" -#: ../../c-api/init_config.rst:1133 +#: ../../c-api/init_config.rst:1137 msgid "" ":data:`sys.flags.no_site ` is set to the inverted value of :c:" "member:`~PyConfig.site_import`." msgstr "" -#: ../../c-api/init_config.rst:1140 +#: ../../c-api/init_config.rst:1144 msgid "" "If non-zero, skip the first line of the :c:member:`PyConfig.run_filename` " "source." msgstr "" -#: ../../c-api/init_config.rst:1143 +#: ../../c-api/init_config.rst:1147 msgid "" "It allows the usage of non-Unix forms of ``#!cmd``. This is intended for a " "DOS specific hack only." msgstr "" -#: ../../c-api/init_config.rst:1146 +#: ../../c-api/init_config.rst:1150 msgid "Set to ``1`` by the :option:`-x` command line option." msgstr "" -#: ../../c-api/init_config.rst:1153 +#: ../../c-api/init_config.rst:1157 msgid "" "Encoding and encoding errors of :data:`sys.stdin`, :data:`sys.stdout` and :" "data:`sys.stderr` (but :data:`sys.stderr` always uses " "``\"backslashreplace\"`` error handler)." msgstr "" -#: ../../c-api/init_config.rst:1157 +#: ../../c-api/init_config.rst:1161 msgid "" "If :c:func:`Py_SetStandardStreamEncoding` has been called, use its *error* " "and *errors* arguments if they are not ``NULL``." msgstr "" -#: ../../c-api/init_config.rst:1160 +#: ../../c-api/init_config.rst:1164 msgid "" "Use the :envvar:`PYTHONIOENCODING` environment variable if it is non-empty." msgstr "" -#: ../../c-api/init_config.rst:1163 +#: ../../c-api/init_config.rst:1167 msgid "Default encoding:" msgstr "" -#: ../../c-api/init_config.rst:1165 +#: ../../c-api/init_config.rst:1169 msgid "``\"UTF-8\"`` if :c:member:`PyPreConfig.utf8_mode` is non-zero." msgstr "" -#: ../../c-api/init_config.rst:1166 +#: ../../c-api/init_config.rst:1170 msgid "Otherwise, use the :term:`locale encoding`." msgstr "" -#: ../../c-api/init_config.rst:1168 +#: ../../c-api/init_config.rst:1172 msgid "Default error handler:" msgstr "" -#: ../../c-api/init_config.rst:1170 +#: ../../c-api/init_config.rst:1174 msgid "On Windows: use ``\"surrogateescape\"``." msgstr "" -#: ../../c-api/init_config.rst:1171 +#: ../../c-api/init_config.rst:1175 msgid "" "``\"surrogateescape\"`` if :c:member:`PyPreConfig.utf8_mode` is non-zero, or " "if the LC_CTYPE locale is \"C\" or \"POSIX\"." msgstr "" -#: ../../c-api/init_config.rst:1173 +#: ../../c-api/init_config.rst:1177 msgid "``\"strict\"`` otherwise." msgstr "" -#: ../../c-api/init_config.rst:1177 +#: ../../c-api/init_config.rst:1181 msgid "Enable tracemalloc?" msgstr "" -#: ../../c-api/init_config.rst:1179 +#: ../../c-api/init_config.rst:1183 msgid "If non-zero, call :func:`tracemalloc.start` at startup." msgstr "" -#: ../../c-api/init_config.rst:1181 +#: ../../c-api/init_config.rst:1185 msgid "" "Set by :option:`-X tracemalloc=N <-X>` command line option and by the :" "envvar:`PYTHONTRACEMALLOC` environment variable." msgstr "" -#: ../../c-api/init_config.rst:1188 +#: ../../c-api/init_config.rst:1192 msgid "Enable compatibility mode with the perf profiler?" msgstr "" -#: ../../c-api/init_config.rst:1190 +#: ../../c-api/init_config.rst:1194 msgid "" "If non-zero, initialize the perf trampoline. See :ref:`perf_profiling` for " "more information." msgstr "" -#: ../../c-api/init_config.rst:1193 +#: ../../c-api/init_config.rst:1197 msgid "" "Set by :option:`-X perf <-X>` command line option and by the :envvar:" "`PYTHONPERFSUPPORT` environment variable." msgstr "" -#: ../../c-api/init_config.rst:1196 +#: ../../c-api/init_config.rst:1200 msgid "Default: ``-1``." msgstr "預設值:``1``。" -#: ../../c-api/init_config.rst:1202 +#: ../../c-api/init_config.rst:1206 msgid "Use :ref:`environment variables `?" msgstr "" -#: ../../c-api/init_config.rst:1204 +#: ../../c-api/init_config.rst:1208 msgid "" "If equals to zero, ignore the :ref:`environment variables `." msgstr "" -#: ../../c-api/init_config.rst:1207 +#: ../../c-api/init_config.rst:1211 msgid "Set to ``0`` by the :option:`-E` environment variable." msgstr "" -#: ../../c-api/init_config.rst:1213 +#: ../../c-api/init_config.rst:1217 msgid "If non-zero, add the user site directory to :data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:1215 +#: ../../c-api/init_config.rst:1219 msgid "Set to ``0`` by the :option:`-s` and :option:`-I` command line options." msgstr "" -#: ../../c-api/init_config.rst:1217 +#: ../../c-api/init_config.rst:1221 msgid "Set to ``0`` by the :envvar:`PYTHONNOUSERSITE` environment variable." msgstr "" -#: ../../c-api/init_config.rst:1223 +#: ../../c-api/init_config.rst:1227 msgid "" "Verbose mode. If greater than ``0``, print a message each time a module is " "imported, showing the place (filename or built-in module) from which it is " "loaded." msgstr "" -#: ../../c-api/init_config.rst:1227 +#: ../../c-api/init_config.rst:1231 msgid "" "If greater than or equal to ``2``, print a message for each file that is " "checked for when searching for a module. Also provides information on module " "cleanup at exit." msgstr "" -#: ../../c-api/init_config.rst:1231 +#: ../../c-api/init_config.rst:1235 msgid "Incremented by the :option:`-v` command line option." msgstr "" -#: ../../c-api/init_config.rst:1233 +#: ../../c-api/init_config.rst:1237 msgid "Set by the :envvar:`PYTHONVERBOSE` environment variable value." msgstr "" -#: ../../c-api/init_config.rst:1239 +#: ../../c-api/init_config.rst:1243 msgid "" "Options of the :mod:`warnings` module to build warnings filters, lowest to " "highest priority: :data:`sys.warnoptions`." msgstr "" -#: ../../c-api/init_config.rst:1242 +#: ../../c-api/init_config.rst:1246 msgid "" "The :mod:`warnings` module adds :data:`sys.warnoptions` in the reverse " "order: the last :c:member:`PyConfig.warnoptions` item becomes the first item " "of :data:`warnings.filters` which is checked first (highest priority)." msgstr "" -#: ../../c-api/init_config.rst:1247 +#: ../../c-api/init_config.rst:1251 msgid "" "The :option:`-W` command line options adds its value to :c:member:`~PyConfig." "warnoptions`, it can be used multiple times." msgstr "" -#: ../../c-api/init_config.rst:1250 +#: ../../c-api/init_config.rst:1254 msgid "" "The :envvar:`PYTHONWARNINGS` environment variable can also be used to add " "warning options. Multiple options can be specified, separated by commas (``," "``)." msgstr "" -#: ../../c-api/init_config.rst:1258 +#: ../../c-api/init_config.rst:1262 msgid "" "If equal to ``0``, Python won't try to write ``.pyc`` files on the import of " "source modules." msgstr "" -#: ../../c-api/init_config.rst:1261 +#: ../../c-api/init_config.rst:1265 msgid "" "Set to ``0`` by the :option:`-B` command line option and the :envvar:" "`PYTHONDONTWRITEBYTECODE` environment variable." msgstr "" -#: ../../c-api/init_config.rst:1264 +#: ../../c-api/init_config.rst:1268 msgid "" ":data:`sys.dont_write_bytecode` is initialized to the inverted value of :c:" "member:`~PyConfig.write_bytecode`." msgstr "" -#: ../../c-api/init_config.rst:1271 +#: ../../c-api/init_config.rst:1275 msgid "Values of the :option:`-X` command line options: :data:`sys._xoptions`." msgstr "" -#: ../../c-api/init_config.rst:1275 +#: ../../c-api/init_config.rst:1279 msgid "" "If :c:member:`~PyConfig.parse_argv` is non-zero, :c:member:`~PyConfig.argv` " "arguments are parsed the same way the regular Python parses :ref:`command " @@ -1663,29 +1663,29 @@ msgid "" "c:member:`~PyConfig.argv`." msgstr "" -#: ../../c-api/init_config.rst:1280 +#: ../../c-api/init_config.rst:1284 msgid "" "The :c:member:`~PyConfig.xoptions` options are parsed to set other options: " "see the :option:`-X` command line option." msgstr "" -#: ../../c-api/init_config.rst:1285 +#: ../../c-api/init_config.rst:1289 msgid "The ``show_alloc_count`` field has been removed." msgstr "" -#: ../../c-api/init_config.rst:1289 +#: ../../c-api/init_config.rst:1293 msgid "Initialization with PyConfig" msgstr "" -#: ../../c-api/init_config.rst:1291 +#: ../../c-api/init_config.rst:1295 msgid "Function to initialize Python:" msgstr "" -#: ../../c-api/init_config.rst:1295 +#: ../../c-api/init_config.rst:1299 msgid "Initialize Python from *config* configuration." msgstr "" -#: ../../c-api/init_config.rst:1300 +#: ../../c-api/init_config.rst:1304 msgid "" "If :c:func:`PyImport_FrozenModules`, :c:func:`PyImport_AppendInittab` or :c:" "func:`PyImport_ExtendInittab` are used, they must be set or called after " @@ -1694,17 +1694,17 @@ msgid "" "`PyImport_ExtendInittab` must be called before each Python initialization." msgstr "" -#: ../../c-api/init_config.rst:1307 +#: ../../c-api/init_config.rst:1311 msgid "" "The current configuration (``PyConfig`` type) is stored in " "``PyInterpreterState.config``." msgstr "" -#: ../../c-api/init_config.rst:1310 +#: ../../c-api/init_config.rst:1314 msgid "Example setting the program name::" msgstr "" -#: ../../c-api/init_config.rst:1338 +#: ../../c-api/init_config.rst:1342 msgid "" "More complete example modifying the default configuration, read the " "configuration, and then override some parameters. Note that since 3.11, many " @@ -1713,18 +1713,18 @@ msgid "" "called will be left unchanged by initialization::" msgstr "" -#: ../../c-api/init_config.rst:1401 +#: ../../c-api/init_config.rst:1405 msgid "Isolated Configuration" msgstr "" -#: ../../c-api/init_config.rst:1403 +#: ../../c-api/init_config.rst:1407 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:1408 +#: ../../c-api/init_config.rst:1412 msgid "" "This configuration ignores global configuration variables, environment " "variables, command line arguments (:c:member:`PyConfig.argv` is not parsed) " @@ -1732,115 +1732,115 @@ msgid "" "LC_CTYPE locale are left unchanged. Signal handlers are not installed." msgstr "" -#: ../../c-api/init_config.rst:1413 +#: ../../c-api/init_config.rst:1417 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:1421 +#: ../../c-api/init_config.rst:1425 msgid "Python Configuration" msgstr "" -#: ../../c-api/init_config.rst:1423 +#: ../../c-api/init_config.rst:1427 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:1427 +#: ../../c-api/init_config.rst:1431 msgid "" "Environments variables and command line arguments are used to configure " "Python, whereas global configuration variables are ignored." msgstr "" -#: ../../c-api/init_config.rst:1430 +#: ../../c-api/init_config.rst:1434 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:1439 +#: ../../c-api/init_config.rst:1443 msgid "Python Path Configuration" msgstr "" -#: ../../c-api/init_config.rst:1441 +#: ../../c-api/init_config.rst:1445 msgid ":c:type:`PyConfig` contains multiple fields for the path configuration:" msgstr "" -#: ../../c-api/init_config.rst:1443 +#: ../../c-api/init_config.rst:1447 msgid "Path configuration inputs:" msgstr "" -#: ../../c-api/init_config.rst:1445 +#: ../../c-api/init_config.rst:1449 msgid ":c:member:`PyConfig.home`" msgstr ":c:member:`PyConfig.home`" -#: ../../c-api/init_config.rst:1446 +#: ../../c-api/init_config.rst:1450 msgid ":c:member:`PyConfig.platlibdir`" msgstr ":c:member:`PyConfig.platlibdir`" -#: ../../c-api/init_config.rst:1447 +#: ../../c-api/init_config.rst:1451 msgid ":c:member:`PyConfig.pathconfig_warnings`" msgstr ":c:member:`PyConfig.pathconfig_warnings`" -#: ../../c-api/init_config.rst:1448 +#: ../../c-api/init_config.rst:1452 msgid ":c:member:`PyConfig.program_name`" msgstr ":c:member:`PyConfig.program_name`" -#: ../../c-api/init_config.rst:1449 +#: ../../c-api/init_config.rst:1453 msgid ":c:member:`PyConfig.pythonpath_env`" msgstr ":c:member:`PyConfig.pythonpath_env`" -#: ../../c-api/init_config.rst:1450 +#: ../../c-api/init_config.rst:1454 msgid "current working directory: to get absolute paths" msgstr "" -#: ../../c-api/init_config.rst:1451 +#: ../../c-api/init_config.rst:1455 msgid "" "``PATH`` environment variable to get the program full path (from :c:member:" "`PyConfig.program_name`)" msgstr "" -#: ../../c-api/init_config.rst:1453 +#: ../../c-api/init_config.rst:1457 msgid "``__PYVENV_LAUNCHER__`` environment variable" msgstr "``__PYVENV_LAUNCHER__`` 環境變數" -#: ../../c-api/init_config.rst:1454 +#: ../../c-api/init_config.rst:1458 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:1458 +#: ../../c-api/init_config.rst:1462 msgid "Path configuration output fields:" msgstr "" -#: ../../c-api/init_config.rst:1460 +#: ../../c-api/init_config.rst:1464 msgid ":c:member:`PyConfig.base_exec_prefix`" msgstr ":c:member:`PyConfig.base_exec_prefix`" -#: ../../c-api/init_config.rst:1461 +#: ../../c-api/init_config.rst:1465 msgid ":c:member:`PyConfig.base_executable`" msgstr ":c:member:`PyConfig.base_executable`" -#: ../../c-api/init_config.rst:1462 +#: ../../c-api/init_config.rst:1466 msgid ":c:member:`PyConfig.base_prefix`" msgstr ":c:member:`PyConfig.base_prefix`" -#: ../../c-api/init_config.rst:1463 +#: ../../c-api/init_config.rst:1467 msgid ":c:member:`PyConfig.exec_prefix`" msgstr ":c:member:`PyConfig.exec_prefix`" -#: ../../c-api/init_config.rst:1464 +#: ../../c-api/init_config.rst:1468 msgid ":c:member:`PyConfig.executable`" msgstr ":c:member:`PyConfig.executable`" -#: ../../c-api/init_config.rst:1465 +#: ../../c-api/init_config.rst:1469 msgid "" ":c:member:`PyConfig.module_search_paths_set`, :c:member:`PyConfig." "module_search_paths`" @@ -1848,11 +1848,11 @@ msgstr "" ":c:member:`PyConfig.module_search_paths_set`, :c:member:`PyConfig." "module_search_paths`" -#: ../../c-api/init_config.rst:1467 +#: ../../c-api/init_config.rst:1471 msgid ":c:member:`PyConfig.prefix`" msgstr ":c:member:`PyConfig.prefix`" -#: ../../c-api/init_config.rst:1469 +#: ../../c-api/init_config.rst:1473 msgid "" "If at least one \"output field\" is not set, Python calculates the path " "configuration to fill unset fields. If :c:member:`~PyConfig." @@ -1861,7 +1861,7 @@ msgid "" "module_search_paths_set` is set to ``1``." msgstr "" -#: ../../c-api/init_config.rst:1475 +#: ../../c-api/init_config.rst:1479 msgid "" "It is possible to completely ignore the function calculating the default " "path configuration by setting explicitly all path configuration output " @@ -1871,52 +1871,52 @@ msgid "" "modification." msgstr "" -#: ../../c-api/init_config.rst:1482 +#: ../../c-api/init_config.rst:1486 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:1485 +#: ../../c-api/init_config.rst:1489 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:1489 +#: ../../c-api/init_config.rst:1493 msgid ":c:func:`Py_RunMain` and :c:func:`Py_Main` modify :data:`sys.path`:" msgstr "" -#: ../../c-api/init_config.rst:1491 +#: ../../c-api/init_config.rst:1495 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:1494 +#: ../../c-api/init_config.rst:1498 msgid "If :c:member:`~PyConfig.isolated` is zero:" msgstr "" -#: ../../c-api/init_config.rst:1496 +#: ../../c-api/init_config.rst:1500 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:1498 +#: ../../c-api/init_config.rst:1502 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:1500 +#: ../../c-api/init_config.rst:1504 msgid "Otherwise, prepend an empty string to :data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:1502 +#: ../../c-api/init_config.rst:1506 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." @@ -1925,170 +1925,170 @@ msgid "" "data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:1508 +#: ../../c-api/init_config.rst:1512 msgid "The following configuration files are used by the path configuration:" msgstr "" -#: ../../c-api/init_config.rst:1510 +#: ../../c-api/init_config.rst:1514 msgid "``pyvenv.cfg``" msgstr "``pyvenv.cfg``" -#: ../../c-api/init_config.rst:1511 +#: ../../c-api/init_config.rst:1515 msgid "``._pth`` file (ex: ``python._pth``)" msgstr "" -#: ../../c-api/init_config.rst:1512 +#: ../../c-api/init_config.rst:1516 msgid "``pybuilddir.txt`` (Unix only)" msgstr "" -#: ../../c-api/init_config.rst:1514 +#: ../../c-api/init_config.rst:1518 msgid "If a ``._pth`` file is present:" msgstr "" -#: ../../c-api/init_config.rst:1516 +#: ../../c-api/init_config.rst:1520 msgid "Set :c:member:`~PyConfig.isolated` to ``1``." msgstr "將 :c:member:`~PyConfig.isolated` 設定為 ``1``。" -#: ../../c-api/init_config.rst:1517 +#: ../../c-api/init_config.rst:1521 msgid "Set :c:member:`~PyConfig.use_environment` to ``0``." msgstr "將 :c:member:`~PyConfig.use_environment` 設定為 ``0``。" -#: ../../c-api/init_config.rst:1518 +#: ../../c-api/init_config.rst:1522 msgid "Set :c:member:`~PyConfig.site_import` to ``0``." msgstr "將 :c:member:`~PyConfig.site_import` 設定為 ``0``。" -#: ../../c-api/init_config.rst:1519 +#: ../../c-api/init_config.rst:1523 msgid "Set :c:member:`~PyConfig.safe_path` to ``1``." msgstr "將 :c:member:`~PyConfig.safe_path` 設定為 ``1``。" -#: ../../c-api/init_config.rst:1521 +#: ../../c-api/init_config.rst:1525 msgid "" "The ``__PYVENV_LAUNCHER__`` environment variable is used to set :c:member:" "`PyConfig.base_executable`" msgstr "" -#: ../../c-api/init_config.rst:1526 +#: ../../c-api/init_config.rst:1530 msgid "Py_RunMain()" msgstr "Py_RunMain()" -#: ../../c-api/init_config.rst:1530 +#: ../../c-api/init_config.rst:1534 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:1535 +#: ../../c-api/init_config.rst:1539 msgid "By default and when if :option:`-i` option is used, run the REPL." msgstr "" -#: ../../c-api/init_config.rst:1537 +#: ../../c-api/init_config.rst:1541 msgid "" "Finally, finalizes Python and returns an exit status that can be passed to " "the ``exit()`` function." msgstr "" -#: ../../c-api/init_config.rst:1540 +#: ../../c-api/init_config.rst:1544 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:1546 +#: ../../c-api/init_config.rst:1550 msgid "Py_GetArgcArgv()" msgstr "Py_GetArgcArgv()" -#: ../../c-api/init_config.rst:1550 +#: ../../c-api/init_config.rst:1554 msgid "Get the original command line arguments, before Python modified them." msgstr "" -#: ../../c-api/init_config.rst:1552 +#: ../../c-api/init_config.rst:1556 msgid "See also :c:member:`PyConfig.orig_argv` member." msgstr "" -#: ../../c-api/init_config.rst:1556 +#: ../../c-api/init_config.rst:1560 msgid "Multi-Phase Initialization Private Provisional API" msgstr "" -#: ../../c-api/init_config.rst:1558 +#: ../../c-api/init_config.rst:1562 msgid "" "This section is a private provisional API introducing multi-phase " "initialization, the core feature of :pep:`432`:" msgstr "" -#: ../../c-api/init_config.rst:1561 +#: ../../c-api/init_config.rst:1565 msgid "\"Core\" initialization phase, \"bare minimum Python\":" msgstr "" -#: ../../c-api/init_config.rst:1563 +#: ../../c-api/init_config.rst:1567 msgid "Builtin types;" msgstr "" -#: ../../c-api/init_config.rst:1564 +#: ../../c-api/init_config.rst:1568 msgid "Builtin exceptions;" msgstr "" -#: ../../c-api/init_config.rst:1565 +#: ../../c-api/init_config.rst:1569 msgid "Builtin and frozen modules;" msgstr "" -#: ../../c-api/init_config.rst:1566 +#: ../../c-api/init_config.rst:1570 msgid "" "The :mod:`sys` module is only partially initialized (ex: :data:`sys.path` " "doesn't exist yet)." msgstr "" -#: ../../c-api/init_config.rst:1569 +#: ../../c-api/init_config.rst:1573 msgid "\"Main\" initialization phase, Python is fully initialized:" msgstr "" -#: ../../c-api/init_config.rst:1571 +#: ../../c-api/init_config.rst:1575 msgid "Install and configure :mod:`importlib`;" msgstr "" -#: ../../c-api/init_config.rst:1572 +#: ../../c-api/init_config.rst:1576 msgid "Apply the :ref:`Path Configuration `;" msgstr "" -#: ../../c-api/init_config.rst:1573 +#: ../../c-api/init_config.rst:1577 msgid "Install signal handlers;" msgstr "" -#: ../../c-api/init_config.rst:1574 +#: ../../c-api/init_config.rst:1578 msgid "" "Finish :mod:`sys` module initialization (ex: create :data:`sys.stdout` and :" "data:`sys.path`);" msgstr "" -#: ../../c-api/init_config.rst:1576 +#: ../../c-api/init_config.rst:1580 msgid "" "Enable optional features like :mod:`faulthandler` and :mod:`tracemalloc`;" msgstr "" -#: ../../c-api/init_config.rst:1577 +#: ../../c-api/init_config.rst:1581 msgid "Import the :mod:`site` module;" msgstr "" -#: ../../c-api/init_config.rst:1578 +#: ../../c-api/init_config.rst:1582 msgid "etc." msgstr "" -#: ../../c-api/init_config.rst:1580 +#: ../../c-api/init_config.rst:1584 msgid "Private provisional API:" msgstr "" -#: ../../c-api/init_config.rst:1582 +#: ../../c-api/init_config.rst:1586 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:1587 +#: ../../c-api/init_config.rst:1591 msgid "" "Move to the \"Main\" initialization phase, finish the Python initialization." msgstr "" -#: ../../c-api/init_config.rst:1589 +#: ../../c-api/init_config.rst:1593 msgid "" "No module is imported during the \"Core\" phase and the ``importlib`` module " "is not configured: the :ref:`Path Configuration ` is only " @@ -2097,14 +2097,14 @@ msgid "" "maybe install a custom :data:`sys.meta_path` importer or an import hook, etc." msgstr "" -#: ../../c-api/init_config.rst:1595 +#: ../../c-api/init_config.rst:1599 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:1599 +#: ../../c-api/init_config.rst:1603 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 " @@ -2112,7 +2112,7 @@ msgid "" "until a proper public API is designed." msgstr "" -#: ../../c-api/init_config.rst:1604 +#: ../../c-api/init_config.rst:1608 msgid "" "Example running Python code between \"Core\" and \"Main\" initialization " "phases::" diff --git a/c-api/module.po b/c-api/module.po index 56d28314f2..e0ceacc0f2 100644 --- a/c-api/module.po +++ b/c-api/module.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-09 00:03+0000\n" +"POT-Creation-Date: 2023-08-23 00:03+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-" @@ -373,27 +373,27 @@ msgid "" "*value* pointer of this slot must point to a function of the signature:" msgstr "" -#: ../../c-api/module.rst:342 +#: ../../c-api/module.rst:343 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:347 +#: ../../c-api/module.rst:348 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:351 +#: ../../c-api/module.rst:352 msgid "" "Multiple ``Py_mod_create`` slots may not be specified in one module " "definition." msgstr "" -#: ../../c-api/module.rst:354 +#: ../../c-api/module.rst:355 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 " @@ -402,7 +402,7 @@ msgid "" "through symlinks, all while sharing a single module definition." msgstr "" -#: ../../c-api/module.rst:360 +#: ../../c-api/module.rst:361 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 " @@ -412,7 +412,7 @@ msgid "" "``Py_mod_create``." msgstr "" -#: ../../c-api/module.rst:369 +#: ../../c-api/module.rst:370 msgid "" "Specifies a function that is called to *execute* the module. This is " "equivalent to executing the code of a Python module: typically, this " @@ -420,59 +420,59 @@ msgid "" "function is:" msgstr "" -#: ../../c-api/module.rst:376 +#: ../../c-api/module.rst:378 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:381 +#: ../../c-api/module.rst:383 msgid "Specifies one of the following values:" msgstr "" -#: ../../c-api/module.rst:385 +#: ../../c-api/module.rst:389 msgid "The module does not support being imported in subinterpreters." msgstr "" -#: ../../c-api/module.rst:389 +#: ../../c-api/module.rst:393 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:395 +#: ../../c-api/module.rst:399 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:399 +#: ../../c-api/module.rst:403 msgid "" "This slot determines whether or not importing this module in a " "subinterpreter will fail." msgstr "" -#: ../../c-api/module.rst:402 +#: ../../c-api/module.rst:406 msgid "" "Multiple ``Py_mod_multiple_interpreters`` slots may not be specified in one " "module definition." msgstr "" -#: ../../c-api/module.rst:405 +#: ../../c-api/module.rst:409 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:410 +#: ../../c-api/module.rst:414 msgid "See :PEP:`489` for more details on multi-phase initialization." msgstr "" -#: ../../c-api/module.rst:413 +#: ../../c-api/module.rst:417 msgid "Low-level module creation functions" msgstr "" -#: ../../c-api/module.rst:415 +#: ../../c-api/module.rst:419 msgid "" "The following functions are called under the hood when using multi-phase " "initialization. They can be used directly, for example when creating module " @@ -480,14 +480,14 @@ msgid "" "``PyModule_ExecDef`` must be called to fully initialize a module." msgstr "" -#: ../../c-api/module.rst:422 +#: ../../c-api/module.rst:426 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:430 +#: ../../c-api/module.rst:434 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 " @@ -495,24 +495,24 @@ msgid "" "emitted." msgstr "" -#: ../../c-api/module.rst:437 +#: ../../c-api/module.rst:441 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:444 +#: ../../c-api/module.rst:448 msgid "Process any execution slots (:c:data:`Py_mod_exec`) given in *def*." msgstr "" -#: ../../c-api/module.rst:450 +#: ../../c-api/module.rst:454 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:459 +#: ../../c-api/module.rst:463 msgid "" "Add the functions from the ``NULL`` terminated *functions* array to " "*module*. Refer to the :c:type:`PyMethodDef` documentation for details on " @@ -524,11 +524,11 @@ msgid "" "``PyModule_FromDefAndSpec``." msgstr "" -#: ../../c-api/module.rst:471 +#: ../../c-api/module.rst:475 msgid "Support functions" msgstr "" -#: ../../c-api/module.rst:473 +#: ../../c-api/module.rst:477 msgid "" "The module initialization function (if using single phase initialization) or " "a function called from a module execution slot (if using multi-phase " @@ -536,82 +536,82 @@ msgid "" "module state:" msgstr "" -#: ../../c-api/module.rst:480 +#: ../../c-api/module.rst:484 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:483 +#: ../../c-api/module.rst:487 msgid "" "On success, return ``0``. On error, raise an exception and return ``-1``." msgstr "" -#: ../../c-api/module.rst:485 +#: ../../c-api/module.rst:489 msgid "" "Return ``NULL`` if *value* is ``NULL``. It must be called with an exception " "raised in this case." msgstr "" -#: ../../c-api/module.rst:488 ../../c-api/module.rst:537 +#: ../../c-api/module.rst:492 ../../c-api/module.rst:541 msgid "Example usage::" msgstr "" "用法範例:\n" "\n" "::" -#: ../../c-api/module.rst:502 ../../c-api/module.rst:555 +#: ../../c-api/module.rst:506 ../../c-api/module.rst:559 msgid "" "The example can also be written without checking explicitly if *obj* is " "``NULL``::" msgstr "" -#: ../../c-api/module.rst:514 ../../c-api/module.rst:571 +#: ../../c-api/module.rst:518 ../../c-api/module.rst:575 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:522 +#: ../../c-api/module.rst:526 msgid "" "Similar to :c:func:`PyModule_AddObjectRef`, but steals a reference to " "*value* on success (if it returns ``0``)." msgstr "" -#: ../../c-api/module.rst:525 +#: ../../c-api/module.rst:529 msgid "" "The new :c:func:`PyModule_AddObjectRef` function is recommended, since it is " "easy to introduce reference leaks by misusing the :c:func:" "`PyModule_AddObject` function." msgstr "" -#: ../../c-api/module.rst:531 +#: ../../c-api/module.rst:535 msgid "" "Unlike other functions that steal references, ``PyModule_AddObject()`` only " "releases the reference to *value* **on success**." msgstr "" -#: ../../c-api/module.rst:534 +#: ../../c-api/module.rst:538 msgid "" "This means that its return value must be checked, and calling code must :c:" "func:`Py_DECREF` *value* manually on error." msgstr "" -#: ../../c-api/module.rst:577 +#: ../../c-api/module.rst:581 msgid "" "Add an integer constant to *module* as *name*. This convenience function " "can be used from the module's initialization function. Return ``-1`` on " "error, ``0`` on success." msgstr "" -#: ../../c-api/module.rst:584 +#: ../../c-api/module.rst:588 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 " "be ``NULL``-terminated. Return ``-1`` on error, ``0`` on success." msgstr "" -#: ../../c-api/module.rst:591 +#: ../../c-api/module.rst:595 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 " @@ -619,11 +619,11 @@ msgid "" "error, ``0`` on success." msgstr "" -#: ../../c-api/module.rst:599 +#: ../../c-api/module.rst:603 msgid "Add a string constant to *module*." msgstr "" -#: ../../c-api/module.rst:603 +#: ../../c-api/module.rst:607 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 " @@ -631,25 +631,25 @@ msgid "" "``-1`` on error, ``0`` on success." msgstr "" -#: ../../c-api/module.rst:613 +#: ../../c-api/module.rst:617 msgid "Module lookup" msgstr "" -#: ../../c-api/module.rst:615 +#: ../../c-api/module.rst:619 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:619 +#: ../../c-api/module.rst:623 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:624 +#: ../../c-api/module.rst:628 msgid "" "Returns the module object that was created from *def* for the current " "interpreter. This method requires that the module object has been attached " @@ -658,18 +658,18 @@ msgid "" "to the interpreter state yet, it returns ``NULL``." msgstr "" -#: ../../c-api/module.rst:631 +#: ../../c-api/module.rst:635 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:634 +#: ../../c-api/module.rst:638 msgid "Only effective on modules created using single-phase initialization." msgstr "" -#: ../../c-api/module.rst:636 +#: ../../c-api/module.rst:640 msgid "" "Python calls ``PyState_AddModule`` automatically after importing a module, " "so it is unnecessary (but harmless) to call it from module initialization " @@ -680,15 +680,15 @@ msgid "" "state updates)." msgstr "" -#: ../../c-api/module.rst:644 ../../c-api/module.rst:655 +#: ../../c-api/module.rst:648 ../../c-api/module.rst:659 msgid "The caller must hold the GIL." msgstr "" -#: ../../c-api/module.rst:646 +#: ../../c-api/module.rst:650 msgid "Return 0 on success or -1 on failure." msgstr "" -#: ../../c-api/module.rst:652 +#: ../../c-api/module.rst:656 msgid "" "Removes the module object created from *def* from the interpreter state. " "Return 0 on success or -1 on failure." diff --git a/c-api/unicode.po b/c-api/unicode.po index 4795cf2177..313c860031 100644 --- a/c-api/unicode.po +++ b/c-api/unicode.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-09 00:03+0000\n" +"POT-Creation-Date: 2023-08-23 00:03+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-" @@ -1538,7 +1538,7 @@ msgstr "" msgid "" "Encode the Unicode object using the specified code page and return a Python " "bytes object. Return ``NULL`` if an exception was raised by the codec. Use :" -"c:macro:`CP_ACP` code page to get the MBCS encoder." +"c:macro:`!CP_ACP` code page to get the MBCS encoder." msgstr "" #: ../../c-api/unicode.rst:1308 diff --git a/extending/newtypes.po b/extending/newtypes.po index d352b52139..2ca6d500b7 100644 --- a/extending/newtypes.po +++ b/extending/newtypes.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-08-23 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:34+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -307,7 +307,7 @@ msgstr "" #: ../../extending/newtypes.rst:301 msgid "" "As with the :c:member:`~PyTypeObject.tp_methods` table, a sentinel entry " -"with a :c:member:`~PyMethodDef.name` value of ``NULL`` is required." +"with a :c:member:`~PyMethodDef.ml_name` value of ``NULL`` is required." msgstr "" #: ../../extending/newtypes.rst:315 diff --git a/extending/newtypes_tutorial.po b/extending/newtypes_tutorial.po index b28bcd6288..9af5fbe23a 100644 --- a/extending/newtypes_tutorial.po +++ b/extending/newtypes_tutorial.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-08-23 00:03+0000\n" "PO-Revision-Date: 2018-07-15 18:56+0800\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -230,56 +230,50 @@ msgstr "" #: ../../extending/newtypes_tutorial.rst:198 msgid "" "That's it! All that remains is to build it; put the above code in a file " -"called :file:`custom.c` and:" +"called :file:`custom.c`," msgstr "" -#: ../../extending/newtypes_tutorial.rst:207 +#: ../../extending/newtypes_tutorial.rst:203 +msgid "in a file called :file:`pyproject.toml`, and" +msgstr "" + +#: ../../extending/newtypes_tutorial.rst:210 msgid "in a file called :file:`setup.py`; then typing" msgstr "" -#: ../../extending/newtypes_tutorial.rst:213 +#: ../../extending/newtypes_tutorial.rst:216 msgid "" -"at a shell should produce a file :file:`custom.so` in a subdirectory; move " -"to that directory and fire up Python --- you should be able to ``import " -"custom`` and play around with Custom objects." +"in a shell should produce a file :file:`custom.so` in a subdirectory and " +"install it; now fire up Python --- you should be able to ``import custom`` " +"and play around with ``Custom`` objects." msgstr "" -#: ../../extending/newtypes_tutorial.rst:217 +#: ../../extending/newtypes_tutorial.rst:220 msgid "That wasn't so hard, was it?" msgstr "" -#: ../../extending/newtypes_tutorial.rst:219 +#: ../../extending/newtypes_tutorial.rst:222 msgid "" "Of course, the current Custom type is pretty uninteresting. It has no data " "and doesn't do anything. It can't even be subclassed." msgstr "" -#: ../../extending/newtypes_tutorial.rst:223 -msgid "" -"While this documentation showcases the standard :mod:`!distutils` module for " -"building C extensions, it is recommended in real-world use cases to use the " -"newer and better-maintained ``setuptools`` library. Documentation on how to " -"do this is out of scope for this document and can be found in the `Python " -"Packaging User's Guide `_." -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:231 +#: ../../extending/newtypes_tutorial.rst:227 msgid "Adding data and methods to the Basic example" msgstr "" -#: ../../extending/newtypes_tutorial.rst:233 +#: ../../extending/newtypes_tutorial.rst:229 msgid "" "Let's extend the basic example to add some data and methods. Let's also " "make the type usable as a base class. We'll create a new module, :mod:`!" "custom2` that adds these capabilities:" msgstr "" -#: ../../extending/newtypes_tutorial.rst:240 +#: ../../extending/newtypes_tutorial.rst:236 msgid "This version of the module has a number of changes." msgstr "" -#: ../../extending/newtypes_tutorial.rst:242 +#: ../../extending/newtypes_tutorial.rst:238 msgid "" "The :class:`!Custom` type now has three data attributes in its C struct, " "*first*, *last*, and *number*. The *first* and *last* variables are Python " @@ -287,21 +281,21 @@ msgid "" "integer." msgstr "" -#: ../../extending/newtypes_tutorial.rst:246 +#: ../../extending/newtypes_tutorial.rst:242 msgid "The object structure is updated accordingly::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:255 +#: ../../extending/newtypes_tutorial.rst:251 msgid "" "Because we now have data to manage, we have to be more careful about object " "allocation and deallocation. At a minimum, we need a deallocation method::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:266 +#: ../../extending/newtypes_tutorial.rst:262 msgid "which is assigned to the :c:member:`~PyTypeObject.tp_dealloc` member::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:270 +#: ../../extending/newtypes_tutorial.rst:266 msgid "" "This method first clears the reference counts of the two Python attributes. :" "c:func:`Py_XDECREF` correctly handles the case where its argument is " @@ -312,7 +306,7 @@ msgid "" "an instance of a subclass." msgstr "" -#: ../../extending/newtypes_tutorial.rst:279 +#: ../../extending/newtypes_tutorial.rst:275 msgid "" "The explicit cast to ``destructor`` above is needed because we defined " "``Custom_dealloc`` to take a ``CustomObject *`` argument, but the " @@ -321,17 +315,17 @@ msgid "" "oriented polymorphism, in C!" msgstr "" -#: ../../extending/newtypes_tutorial.rst:285 +#: ../../extending/newtypes_tutorial.rst:281 msgid "" "We want to make sure that the first and last names are initialized to empty " "strings, so we provide a ``tp_new`` implementation::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:309 +#: ../../extending/newtypes_tutorial.rst:305 msgid "and install it in the :c:member:`~PyTypeObject.tp_new` member::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:313 +#: ../../extending/newtypes_tutorial.rst:309 msgid "" "The ``tp_new`` handler is responsible for creating (as opposed to " "initializing) objects of the type. It is exposed in Python as the :meth:" @@ -342,7 +336,7 @@ msgid "" "``first`` and ``last`` attributes to non-``NULL`` default values." msgstr "" -#: ../../extending/newtypes_tutorial.rst:321 +#: ../../extending/newtypes_tutorial.rst:317 msgid "" "``tp_new`` is passed the type being instantiated (not necessarily " "``CustomType``, if a subclass is instantiated) and any arguments passed when " @@ -352,25 +346,25 @@ msgid "" "k.a. ``tp_init`` in C or ``__init__`` in Python) methods." msgstr "" -#: ../../extending/newtypes_tutorial.rst:329 +#: ../../extending/newtypes_tutorial.rst:325 msgid "" "``tp_new`` shouldn't call ``tp_init`` explicitly, as the interpreter will do " "it itself." msgstr "" -#: ../../extending/newtypes_tutorial.rst:332 +#: ../../extending/newtypes_tutorial.rst:328 msgid "" "The ``tp_new`` implementation calls the :c:member:`~PyTypeObject.tp_alloc` " "slot to allocate memory::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:337 +#: ../../extending/newtypes_tutorial.rst:333 msgid "" "Since memory allocation may fail, we must check the :c:member:`~PyTypeObject." "tp_alloc` result against ``NULL`` before proceeding." msgstr "" -#: ../../extending/newtypes_tutorial.rst:341 +#: ../../extending/newtypes_tutorial.rst:337 msgid "" "We didn't fill the :c:member:`~PyTypeObject.tp_alloc` slot ourselves. " "Rather :c:func:`PyType_Ready` fills it for us by inheriting it from our base " @@ -378,7 +372,7 @@ msgid "" "allocation strategy." msgstr "" -#: ../../extending/newtypes_tutorial.rst:347 +#: ../../extending/newtypes_tutorial.rst:343 msgid "" "If you are creating a co-operative :c:member:`~PyTypeObject.tp_new` (one " "that calls a base type's :c:member:`~PyTypeObject.tp_new` or :meth:`~object." @@ -391,17 +385,17 @@ msgid "" "subclasses without getting a :exc:`TypeError`.)" msgstr "" -#: ../../extending/newtypes_tutorial.rst:357 +#: ../../extending/newtypes_tutorial.rst:353 msgid "" "We also define an initialization function which accepts arguments to provide " "initial values for our instance::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:386 +#: ../../extending/newtypes_tutorial.rst:382 msgid "by filling the :c:member:`~PyTypeObject.tp_init` slot. ::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:390 +#: ../../extending/newtypes_tutorial.rst:386 msgid "" "The :c:member:`~PyTypeObject.tp_init` slot is exposed in Python as the :meth:" "`~object.__init__` method. It is used to initialize an object after it's " @@ -409,7 +403,7 @@ msgid "" "they should return either ``0`` on success or ``-1`` on error." msgstr "" -#: ../../extending/newtypes_tutorial.rst:395 +#: ../../extending/newtypes_tutorial.rst:391 msgid "" "Unlike the ``tp_new`` handler, there is no guarantee that ``tp_init`` is " "called at all (for example, the :mod:`pickle` module by default doesn't " @@ -420,7 +414,7 @@ msgid "" "``first`` member like this::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:409 +#: ../../extending/newtypes_tutorial.rst:405 msgid "" "But this would be risky. Our type doesn't restrict the type of the " "``first`` member, so it could be any kind of object. It could have a " @@ -430,49 +424,49 @@ msgid "" "accesses and modifies our object." msgstr "" -#: ../../extending/newtypes_tutorial.rst:416 +#: ../../extending/newtypes_tutorial.rst:412 msgid "" "To be paranoid and protect ourselves against this possibility, we almost " "always reassign members before decrementing their reference counts. When " "don't we have to do this?" msgstr "" -#: ../../extending/newtypes_tutorial.rst:420 +#: ../../extending/newtypes_tutorial.rst:416 msgid "when we absolutely know that the reference count is greater than 1;" msgstr "" -#: ../../extending/newtypes_tutorial.rst:422 +#: ../../extending/newtypes_tutorial.rst:418 msgid "" "when we know that deallocation of the object [#]_ will neither release the :" "term:`GIL` nor cause any calls back into our type's code;" msgstr "" -#: ../../extending/newtypes_tutorial.rst:425 +#: ../../extending/newtypes_tutorial.rst:421 msgid "" "when decrementing a reference count in a :c:member:`~PyTypeObject." "tp_dealloc` handler on a type which doesn't support cyclic garbage " "collection [#]_." msgstr "" -#: ../../extending/newtypes_tutorial.rst:428 +#: ../../extending/newtypes_tutorial.rst:424 msgid "" "We want to expose our instance variables as attributes. There are a number " "of ways to do that. The simplest way is to define member definitions::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:441 +#: ../../extending/newtypes_tutorial.rst:437 msgid "" "and put the definitions in the :c:member:`~PyTypeObject.tp_members` slot::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:445 +#: ../../extending/newtypes_tutorial.rst:441 msgid "" "Each member definition has a member name, type, offset, access flags and " "documentation string. See the :ref:`Generic-Attribute-Management` section " "below for details." msgstr "" -#: ../../extending/newtypes_tutorial.rst:449 +#: ../../extending/newtypes_tutorial.rst:445 msgid "" "A disadvantage of this approach is that it doesn't provide a way to restrict " "the types of objects that can be assigned to the Python attributes. We " @@ -483,13 +477,13 @@ msgid "" "deleted." msgstr "" -#: ../../extending/newtypes_tutorial.rst:456 +#: ../../extending/newtypes_tutorial.rst:452 msgid "" "We define a single method, :meth:`!Custom.name()`, that outputs the objects " "name as the concatenation of the first and last names. ::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:473 +#: ../../extending/newtypes_tutorial.rst:469 msgid "" "The method is implemented as a C function that takes a :class:`!Custom` (or :" "class:`!Custom` subclass) instance as the first argument. Methods always " @@ -499,7 +493,7 @@ msgid "" "method is equivalent to the Python method:" msgstr "" -#: ../../extending/newtypes_tutorial.rst:485 +#: ../../extending/newtypes_tutorial.rst:481 msgid "" "Note that we have to check for the possibility that our :attr:`!first` and :" "attr:`!last` members are ``NULL``. This is because they can be deleted, in " @@ -508,23 +502,23 @@ msgid "" "We'll see how to do that in the next section." msgstr "" -#: ../../extending/newtypes_tutorial.rst:491 +#: ../../extending/newtypes_tutorial.rst:487 msgid "" "Now that we've defined the method, we need to create an array of method " "definitions::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:501 +#: ../../extending/newtypes_tutorial.rst:497 msgid "" "(note that we used the :c:macro:`METH_NOARGS` flag to indicate that the " "method is expecting no arguments other than *self*)" msgstr "" -#: ../../extending/newtypes_tutorial.rst:504 +#: ../../extending/newtypes_tutorial.rst:500 msgid "and assign it to the :c:member:`~PyTypeObject.tp_methods` slot::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:508 +#: ../../extending/newtypes_tutorial.rst:504 msgid "" "Finally, we'll make our type usable as a base class for subclassing. We've " "written our methods carefully so far so that they don't make any assumptions " @@ -532,15 +526,19 @@ msgid "" "to add the :c:macro:`Py_TPFLAGS_BASETYPE` to our class flag definition::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:515 +#: ../../extending/newtypes_tutorial.rst:511 msgid "" "We rename :c:func:`!PyInit_custom` to :c:func:`!PyInit_custom2`, update the " "module name in the :c:type:`PyModuleDef` struct, and update the full class " "name in the :c:type:`PyTypeObject` struct." msgstr "" -#: ../../extending/newtypes_tutorial.rst:519 -msgid "Finally, we update our :file:`setup.py` file to build the new module:" +#: ../../extending/newtypes_tutorial.rst:515 +msgid "Finally, we update our :file:`setup.py` file to include the new module," +msgstr "" + +#: ../../extending/newtypes_tutorial.rst:525 +msgid "and then we re-install so that we can ``import custom2``:" msgstr "" #: ../../extending/newtypes_tutorial.rst:532 diff --git a/faq/design.po b/faq/design.po index 4fd16d64f1..235df21366 100644 --- a/faq/design.po +++ b/faq/design.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-08-21 00:03+0000\n" "PO-Revision-Date: 2023-02-18 13:10+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1025,16 +1025,16 @@ msgid "" "An appropriate testing discipline can help build large complex applications " "in Python as well as having interface specifications would. In fact, it can " "be better because an interface specification cannot test certain properties " -"of a program. For example, the :meth:`list.append` method is expected to " +"of a program. For example, the :meth:`!list.append` method is expected to " "add new elements to the end of some internal list; an interface " -"specification cannot test that your :meth:`list.append` implementation will " +"specification cannot test that your :meth:`!list.append` implementation will " "actually do this correctly, but it's trivial to check this property in a " "test suite." msgstr "" "就像介面規範一樣,一個適當的測試規則在建造大型又複雜的 Python 應用程式時可以" "幫上忙。事實上,他可能可以有更好的表現,因為介面規範無法測試程式的特定屬性。" -"舉例來說,:meth:`list.append` 方法應該要在某個內部的串列最後面加上新的元素," -"而介面規範沒辦法測試你的 :meth:`list.append` 是不是真的有正確的實作,但這在測" +"舉例來說,:meth:`!list.append` 方法應該要在某個內部的串列最後面加上新的元素," +"而介面規範沒辦法測試你的 :meth:`!list.append` 是不是真的有正確的實作,但這在測" "試套件裡是件很簡單的事。" #: ../../faq/design.rst:592 diff --git a/faq/library.po b/faq/library.po index 13cf2d4551..bc85469cc8 100644 --- a/faq/library.po +++ b/faq/library.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:16+0000\n" +"POT-Creation-Date: 2023-08-21 00:03+0000\n" "PO-Revision-Date: 2023-02-18 13:22+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -222,7 +222,7 @@ msgstr "Python 中是否有等同於 C 的 onexit() 的函式?" #, fuzzy msgid "" "The :mod:`atexit` module provides a register function that is similar to " -"C's :c:func:`onexit`." +"C's :c:func:`!onexit`." msgstr "" ":mod:`atexit` 模組提供了一個類似於 C 的 :c:func:`onexit` 的寄存器函式。" @@ -554,9 +554,9 @@ msgstr "" #, fuzzy msgid "" "Operations that replace other objects may invoke those other objects' :meth:" -"`__del__` method when their reference count reaches zero, and that can " -"affect things. This is especially true for the mass updates to dictionaries " -"and lists. When in doubt, use a mutex!" +"`~object.__del__` method when their reference count reaches zero, and that " +"can affect things. This is especially true for the mass updates to " +"dictionaries and lists. When in doubt, use a mutex!" msgstr "" "替換其他物件的操作可能會在引用計數達到零時呼叫其他物件的 :meth:`__del__` 方" "法,這可能會影響事情。對於字典和列表的大量更新尤其如此。如有疑問,請使用互斥" @@ -1031,32 +1031,33 @@ msgstr ":mod:`select` 模組通常用於幫助處理 socket 上的非同步 I/O #, fuzzy msgid "" "To prevent the TCP connect from blocking, you can set the socket to non-" -"blocking mode. Then when you do the :meth:`socket.connect`, you will either " -"connect immediately (unlikely) or get an exception that contains the error " -"number as ``.errno``. ``errno.EINPROGRESS`` indicates that the connection is " -"in progress, but hasn't finished yet. Different OSes will return different " -"values, so you're going to have to check what's returned on your system." +"blocking mode. Then when you do the :meth:`~socket.socket.connect`, you " +"will either connect immediately (unlikely) or get an exception that contains " +"the error number as ``.errno``. ``errno.EINPROGRESS`` indicates that the " +"connection is in progress, but hasn't finished yet. Different OSes will " +"return different values, so you're going to have to check what's returned on " +"your system." msgstr "" "為防止 TCP 連接阻塞,可以將 socket 設定為非阻塞模式。然後當你執行 :meth:" "`socket.connect` 時,你要麼立即連接(不太可能),要麼得到一個例外,其中包含錯" "誤號 ``.errno``。 ``errno.EINPROGRESS`` 表示連接正在進行中,但尚未完成。不同" "的作業系統將回傳不同的值,因此你將不得不檢查系統回傳的內容。" -#: ../../faq/library.rst:774 +#: ../../faq/library.rst:775 #, fuzzy msgid "" -"You can use the :meth:`socket.connect_ex` method to avoid creating an " -"exception. It will just return the errno value. To poll, you can call :" -"meth:`socket.connect_ex` again later -- ``0`` or ``errno.EISCONN`` indicate " -"that you're connected -- or you can pass this socket to :meth:`select." -"select` to check if it's writable." +"You can use the :meth:`~socket.socket.connect_ex` method to avoid creating " +"an exception. It will just return the errno value. To poll, you can call :" +"meth:`~socket.socket.connect_ex` again later -- ``0`` or ``errno.EISCONN`` " +"indicate that you're connected -- or you can pass this socket to :meth:" +"`select.select` to check if it's writable." msgstr "" "你可以使用 :meth:`socket.connect_ex` 方法來避免建立例外。它只會回傳 errno " "值。要輪詢,你可以稍後再次呼叫:meth:`socket.connect_ex` - ``0`` 或 ``errno." "EISCONN`` 表示你已連接 - 或者你可以將此 socket 傳遞給:meth:` select." "select` 檢查它是否可寫。" -#: ../../faq/library.rst:780 +#: ../../faq/library.rst:783 msgid "" "The :mod:`asyncio` module provides a general purpose single-threaded and " "concurrent asynchronous library, which can be used for writing non-blocking " @@ -1067,19 +1068,19 @@ msgstr "" "網路程式碼。第三方 `Twisted `_ 函式庫是一種流行且功能豐" "富的替代方案。" -#: ../../faq/library.rst:788 +#: ../../faq/library.rst:791 msgid "Databases" msgstr "資料庫" -#: ../../faq/library.rst:791 +#: ../../faq/library.rst:794 msgid "Are there any interfaces to database packages in Python?" msgstr "Python 中是否有任何資料庫套件的介面?" -#: ../../faq/library.rst:793 +#: ../../faq/library.rst:796 msgid "Yes." msgstr "有的。" -#: ../../faq/library.rst:795 +#: ../../faq/library.rst:798 #, fuzzy msgid "" "Interfaces to disk-based hashes such as :mod:`DBM ` and :mod:`GDBM " @@ -1091,7 +1092,7 @@ msgstr "" "含在標準 Python 中。還有 :mod:`sqlite3` 模組,它提供了一個輕量級的基於磁盤的" "關係資料庫。" -#: ../../faq/library.rst:800 +#: ../../faq/library.rst:803 #, fuzzy msgid "" "Support for most relational databases is available. See the " @@ -1101,12 +1102,12 @@ msgstr "" "支援大多數關係資料庫。有關詳細資訊,請參閱`DatabaseProgramming 維基頁面 " "`_。" -#: ../../faq/library.rst:806 +#: ../../faq/library.rst:809 #, fuzzy msgid "How do you implement persistent objects in Python?" msgstr "你如何在 Python 中實作持久物件?" -#: ../../faq/library.rst:808 +#: ../../faq/library.rst:811 #, fuzzy msgid "" "The :mod:`pickle` library module solves this in a very general way (though " @@ -1118,15 +1119,15 @@ msgstr "" "如打開的檔案、socket 或窗口之類的東西),而 :mod:`shelve` 庫模組使用 pickle " "和 (g) dbm 建立包含任意 Python 物件的持久映射。" -#: ../../faq/library.rst:815 +#: ../../faq/library.rst:818 msgid "Mathematics and Numerics" msgstr "數學和數值" -#: ../../faq/library.rst:818 +#: ../../faq/library.rst:821 msgid "How do I generate random numbers in Python?" msgstr "如何在 Python 中生成隨機數?" -#: ../../faq/library.rst:820 +#: ../../faq/library.rst:823 msgid "" "The standard module :mod:`random` implements a random number generator. " "Usage is simple::" @@ -1135,41 +1136,41 @@ msgstr "" "\n" "::" -#: ../../faq/library.rst:826 +#: ../../faq/library.rst:829 msgid "This returns a random floating point number in the range [0, 1)." msgstr "這將回傳 [0, 1) 範圍內的隨機浮點數。" -#: ../../faq/library.rst:828 +#: ../../faq/library.rst:831 msgid "" "There are also many other specialized generators in this module, such as:" msgstr "該模組中還有許多其他專用生成器,例如:" -#: ../../faq/library.rst:830 +#: ../../faq/library.rst:833 msgid "``randrange(a, b)`` chooses an integer in the range [a, b)." msgstr "``randrange(a, b)`` 會選擇 [a, b) 範圍內的一個整數。" -#: ../../faq/library.rst:831 +#: ../../faq/library.rst:834 msgid "``uniform(a, b)`` chooses a floating point number in the range [a, b)." msgstr "``uniform(a, b)`` 會選擇 [a, b) 範圍內的浮點數。" -#: ../../faq/library.rst:832 +#: ../../faq/library.rst:835 msgid "" "``normalvariate(mean, sdev)`` samples the normal (Gaussian) distribution." msgstr "``normalvariate(mean, sdev)`` 對常態(高斯)分佈進行採樣 (sample)。" -#: ../../faq/library.rst:834 +#: ../../faq/library.rst:837 msgid "Some higher-level functions operate on sequences directly, such as:" msgstr "一些更高階的函式會直接對序列進行操作,例如:" -#: ../../faq/library.rst:836 +#: ../../faq/library.rst:839 msgid "``choice(S)`` chooses a random element from a given sequence." msgstr "``choice(S)`` 會從給定序列中選擇一個隨機元素。" -#: ../../faq/library.rst:837 +#: ../../faq/library.rst:840 msgid "``shuffle(L)`` shuffles a list in-place, i.e. permutes it randomly." msgstr "``shuffle(L)`` 會原地 (in-place) 打亂 list,即隨機排列它。" -#: ../../faq/library.rst:839 +#: ../../faq/library.rst:842 msgid "" "There's also a ``Random`` class you can instantiate to create independent " "multiple random number generators." diff --git a/glossary.po b/glossary.po index a5b4f9f455..e3237f4157 100644 --- a/glossary.po +++ b/glossary.po @@ -2596,7 +2596,7 @@ msgid "" "continuation character, making them especially useful when writing " "docstrings." msgstr "" -"由三個雙引號 (“) 或單引號 (') 的作為邊界的一個字串。雖然它們並沒有提供異於單" +"由三個雙引號 (\") 或單引號 (') 的作為邊界的一個字串。雖然它們並沒有提供異於單" "引號字串的任何額外功能,但基於許多原因,它們仍是很有用的。它們讓你可以在字串" "中包含未跳脫 (unescaped) 的單引號和雙引號,而且它們不需使用連續字元 " "(continuation character) 就可以跨越多行,這使得它們在編寫說明字串時特別有用。" diff --git a/howto/isolating-extensions.po b/howto/isolating-extensions.po index f6f7481fe9..4ed313d54e 100644 --- a/howto/isolating-extensions.po +++ b/howto/isolating-extensions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-01 00:03+0000\n" +"POT-Creation-Date: 2023-08-22 00:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -114,8 +114,8 @@ msgstr "" msgid "" "Instead of focusing on per-interpreter state, Python's C API is evolving to " "better support the more granular *per-module* state. This means that C-level " -"data is be attached to a *module object*. Each interpreter creates its own " -"module object, keeping the data separate. For testing the isolation, " +"data should be attached to a *module object*. Each interpreter creates its " +"own module object, keeping the data separate. For testing the isolation, " "multiple module objects corresponding to a single extension can even be " "loaded in a single interpreter." msgstr "" diff --git a/howto/pyporting.po b/howto/pyporting.po index 55115aa436..d20f916a8f 100644 --- a/howto/pyporting.po +++ b/howto/pyporting.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-06-03 00:13+0000\n" +"POT-Creation-Date: 2023-08-25 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:37+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -20,8 +20,8 @@ msgstr "" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../howto/pyporting.rst:5 -msgid "Porting Python 2 Code to Python 3" -msgstr "Python 2 的程式碼移植到Python 3" +msgid "How to port Python 2 Code to Python 3" +msgstr "如何將 Python 2 的程式碼移植到 Python 3" #: ../../howto/pyporting.rst:0 msgid "author" @@ -37,161 +37,144 @@ msgstr "摘要" #: ../../howto/pyporting.rst:11 msgid "" -"With Python 3 being the future of Python while Python 2 is still in active " -"use, it is good to have your project available for both major releases of " -"Python. This guide is meant to help you figure out how best to support both " -"Python 2 & 3 simultaneously." +"Python 2 reached its official end-of-life at the start of 2020. This means " +"that no new bug reports, fixes, or changes will be made to Python 2 - it's " +"no longer supported." msgstr "" -#: ../../howto/pyporting.rst:16 +#: ../../howto/pyporting.rst:15 msgid "" -"If you are looking to port an extension module instead of pure Python code, " -"please see :ref:`cporting-howto`." +"This guide is intended to provide you with a path to Python 3 for your code, " +"that includes compatibility with Python 2 as a first step." msgstr "" -#: ../../howto/pyporting.rst:19 +#: ../../howto/pyporting.rst:18 msgid "" -"If you would like to read one core Python developer's take on why Python 3 " -"came into existence, you can read Nick Coghlan's `Python 3 Q & A`_ or Brett " -"Cannon's `Why Python 3 exists`_." +"If you are looking to port an extension module instead of pure Python code, " +"please see :ref:`cporting-howto`." msgstr "" -#: ../../howto/pyporting.rst:24 +#: ../../howto/pyporting.rst:21 msgid "" -"For help with porting, you can view the archived python-porting_ mailing " -"list." +"The archived python-porting_ mailing list may contain some useful guidance." msgstr "" -#: ../../howto/pyporting.rst:27 +#: ../../howto/pyporting.rst:25 msgid "The Short Explanation" msgstr "簡短的說明" -#: ../../howto/pyporting.rst:29 +#: ../../howto/pyporting.rst:27 msgid "" -"To make your project be single-source Python 2/3 compatible, the basic steps " +"To achieve Python 2/3 compatibility in a single code base, the basic steps " "are:" msgstr "" -#: ../../howto/pyporting.rst:32 +#: ../../howto/pyporting.rst:30 msgid "Only worry about supporting Python 2.7" msgstr "" -#: ../../howto/pyporting.rst:33 +#: ../../howto/pyporting.rst:31 msgid "" "Make sure you have good test coverage (coverage.py_ can help; ``python -m " "pip install coverage``)" msgstr "" -#: ../../howto/pyporting.rst:35 ../../howto/pyporting.rst:122 -msgid "Learn the differences between Python 2 & 3" -msgstr "瞭解Python 2 & 3的差異" +#: ../../howto/pyporting.rst:33 +msgid "Learn the differences between Python 2 and 3" +msgstr "瞭解 Python 2 & 3 的差異" -#: ../../howto/pyporting.rst:36 +#: ../../howto/pyporting.rst:34 msgid "" "Use Futurize_ (or Modernize_) to update your code (e.g. ``python -m pip " "install future``)" msgstr "" -#: ../../howto/pyporting.rst:37 +#: ../../howto/pyporting.rst:35 msgid "" "Use Pylint_ to help make sure you don't regress on your Python 3 support " "(``python -m pip install pylint``)" msgstr "" -#: ../../howto/pyporting.rst:39 +#: ../../howto/pyporting.rst:37 msgid "" "Use caniusepython3_ to find out which of your dependencies are blocking your " "use of Python 3 (``python -m pip install caniusepython3``)" msgstr "" -#: ../../howto/pyporting.rst:41 +#: ../../howto/pyporting.rst:39 msgid "" "Once your dependencies are no longer blocking you, use continuous " -"integration to make sure you stay compatible with Python 2 & 3 (tox_ can " +"integration to make sure you stay compatible with Python 2 and 3 (tox_ can " "help test against multiple versions of Python; ``python -m pip install tox``)" msgstr "" -#: ../../howto/pyporting.rst:44 +#: ../../howto/pyporting.rst:42 msgid "" "Consider using optional static type checking to make sure your type usage " -"works in both Python 2 & 3 (e.g. use mypy_ to check your typing under both " -"Python 2 & Python 3; ``python -m pip install mypy``)." +"works in both Python 2 and 3 (e.g. use mypy_ to check your typing under both " +"Python 2 and Python 3; ``python -m pip install mypy``)." msgstr "" -#: ../../howto/pyporting.rst:50 +#: ../../howto/pyporting.rst:48 msgid "" "Note: Using ``python -m pip install`` guarantees that the ``pip`` you invoke " "is the one installed for the Python currently in use, whether it be a system-" "wide ``pip`` or one installed within a :ref:`virtual environment `." msgstr "" -#: ../../howto/pyporting.rst:56 +#: ../../howto/pyporting.rst:54 msgid "Details" msgstr "詳細的" -#: ../../howto/pyporting.rst:58 +#: ../../howto/pyporting.rst:56 msgid "" -"A key point about supporting Python 2 & 3 simultaneously is that you can " -"start **today**! Even if your dependencies are not supporting Python 3 yet " -"that does not mean you can't modernize your code **now** to support Python " -"3. Most changes required to support Python 3 lead to cleaner code using " -"newer practices even in Python 2 code." +"Even if other factors - say, dependencies over which you have no control - " +"still require you to support Python 2, that does not prevent you taking the " +"step of including Python 3 support." msgstr "" -#: ../../howto/pyporting.rst:64 +#: ../../howto/pyporting.rst:60 msgid "" -"Another key point is that modernizing your Python 2 code to also support " -"Python 3 is largely automated for you. While you might have to make some API " -"decisions thanks to Python 3 clarifying text data versus binary data, the " -"lower-level work is now mostly done for you and thus can at least benefit " -"from the automated changes immediately." +"Most changes required to support Python 3 lead to cleaner code using newer " +"practices even in Python 2 code." msgstr "" -#: ../../howto/pyporting.rst:70 -msgid "" -"Keep those key points in mind while you read on about the details of porting " -"your code to support Python 2 & 3 simultaneously." +#: ../../howto/pyporting.rst:65 +msgid "Different versions of Python 2" msgstr "" -#: ../../howto/pyporting.rst:75 -msgid "Drop support for Python 2.6 and older" -msgstr "向下支援Python 2.6和更舊的版本" +#: ../../howto/pyporting.rst:67 +msgid "" +"Ideally, your code should be compatible with Python 2.7, which was the last " +"supported version of Python 2." +msgstr "" -#: ../../howto/pyporting.rst:77 +#: ../../howto/pyporting.rst:70 msgid "" -"While you can make Python 2.5 work with Python 3, it is **much** easier if " -"you only have to work with Python 2.7. If dropping Python 2.5 is not an " -"option then the six_ project can help you support Python 2.5 & 3 " -"simultaneously (``python -m pip install six``). Do realize, though, that " -"nearly all the projects listed in this HOWTO will not be available to you." +"Some of the tools mentioned in this guide will not work with Python 2.6." msgstr "" -#: ../../howto/pyporting.rst:83 +#: ../../howto/pyporting.rst:72 msgid "" -"If you are able to skip Python 2.5 and older, then the required changes to " -"your code should continue to look and feel like idiomatic Python code. At " -"worst you will have to use a function instead of a method in some instances " -"or have to import a function instead of using a built-in one, but otherwise " -"the overall transformation should not feel foreign to you." +"If absolutely necessary, the six_ project can help you support Python 2.5 " +"and 3 simultaneously. Do realize, though, that nearly all the projects " +"listed in this guide will not be available to you." msgstr "" -#: ../../howto/pyporting.rst:89 +#: ../../howto/pyporting.rst:76 msgid "" -"But you should aim for only supporting Python 2.7. Python 2.6 is no longer " -"freely supported and thus is not receiving bugfixes. This means **you** will " -"have to work around any issues you come across with Python 2.6. There are " -"also some tools mentioned in this HOWTO which do not support Python 2.6 (e." -"g., Pylint_), and this will become more commonplace as time goes on. It will " -"simply be easier for you if you only support the versions of Python that you " -"have to support." +"If you are able to skip Python 2.5 and older, the required changes to your " +"code will be minimal. At worst you will have to use a function instead of a " +"method in some instances or have to import a function instead of using a " +"built-in one." msgstr "" -#: ../../howto/pyporting.rst:98 +#: ../../howto/pyporting.rst:83 msgid "" "Make sure you specify the proper version support in your ``setup.py`` file" msgstr "" -#: ../../howto/pyporting.rst:100 +#: ../../howto/pyporting.rst:85 msgid "" "In your ``setup.py`` file you should have the proper `trove classifier`_ " "specifying what versions of Python you support. As your project does not " @@ -201,11 +184,11 @@ msgid "" "Python :: 2.7``." msgstr "" -#: ../../howto/pyporting.rst:109 +#: ../../howto/pyporting.rst:94 msgid "Have good test coverage" msgstr "有好的測試覆蓋率" -#: ../../howto/pyporting.rst:111 +#: ../../howto/pyporting.rst:96 msgid "" "Once you have your code supporting the oldest version of Python 2 you want " "it to, you will want to make sure your test suite has good coverage. A good " @@ -217,88 +200,105 @@ msgid "" "test coverage then coverage.py_ is recommended." msgstr "" -#: ../../howto/pyporting.rst:124 +#: ../../howto/pyporting.rst:107 +msgid "Be aware of the differences between Python 2 and 3" +msgstr "注意 Python 2 & 3 的差異" + +#: ../../howto/pyporting.rst:109 msgid "" "Once you have your code well-tested you are ready to begin porting your code " "to Python 3! But to fully understand how your code is going to change and " "what you want to look out for while you code, you will want to learn what " -"changes Python 3 makes in terms of Python 2. Typically the two best ways of " -"doing that is reading the :ref:`\"What's New\" ` doc for " -"each release of Python 3 and the `Porting to Python 3`_ book (which is free " -"online). There is also a handy `cheat sheet`_ from the Python-Future project." +"changes Python 3 makes in terms of Python 2." +msgstr "" + +#: ../../howto/pyporting.rst:114 +msgid "" +"Some resources for understanding the differences and their implications for " +"you code:" +msgstr "" + +#: ../../howto/pyporting.rst:117 +msgid "" +"the :ref:`\"What's New\" ` doc for each release of Python 3" msgstr "" -#: ../../howto/pyporting.rst:134 +#: ../../howto/pyporting.rst:118 +msgid "the `Porting to Python 3`_ book (which is free online)" +msgstr "" + +#: ../../howto/pyporting.rst:119 +msgid "the handy `cheat sheet`_ from the Python-Future project." +msgstr "" + +#: ../../howto/pyporting.rst:123 msgid "Update your code" msgstr "更新你的程式碼" -#: ../../howto/pyporting.rst:136 +#: ../../howto/pyporting.rst:125 +msgid "There are tools available that can port your code automatically." +msgstr "" + +#: ../../howto/pyporting.rst:127 msgid "" -"Once you feel like you know what is different in Python 3 compared to Python " -"2, it's time to update your code! You have a choice between two tools in " -"porting your code automatically: Futurize_ and Modernize_. Which tool you " -"choose will depend on how much like Python 3 you want your code to be. " "Futurize_ does its best to make Python 3 idioms and practices exist in " "Python 2, e.g. backporting the ``bytes`` type from Python 3 so that you have " -"semantic parity between the major versions of Python. Modernize_, on the " -"other hand, is more conservative and targets a Python 2/3 subset of Python, " -"directly relying on six_ to help provide compatibility. As Python 3 is the " -"future, it might be best to consider Futurize to begin adjusting to any new " -"practices that Python 3 introduces which you are not accustomed to yet." +"semantic parity between the major versions of Python. This is the better " +"approach for most cases." msgstr "" -#: ../../howto/pyporting.rst:148 +#: ../../howto/pyporting.rst:132 msgid "" -"Regardless of which tool you choose, they will update your code to run under " -"Python 3 while staying compatible with the version of Python 2 you started " -"with. Depending on how conservative you want to be, you may want to run the " -"tool over your test suite first and visually inspect the diff to make sure " -"the transformation is accurate. After you have transformed your test suite " -"and verified that all the tests still pass as expected, then you can " -"transform your application code knowing that any tests which fail is a " -"translation failure." +"Modernize_, on the other hand, is more conservative and targets a Python 2/3 " +"subset of Python, directly relying on six_ to help provide compatibility." msgstr "" -#: ../../howto/pyporting.rst:156 +#: ../../howto/pyporting.rst:135 +msgid "" +"A good approach is to run the tool over your test suite first and visually " +"inspect the diff to make sure the transformation is accurate. After you have " +"transformed your test suite and verified that all the tests still pass as " +"expected, then you can transform your application code knowing that any " +"tests which fail is a translation failure." +msgstr "" + +#: ../../howto/pyporting.rst:141 msgid "" "Unfortunately the tools can't automate everything to make your code work " -"under Python 3 and so there are a handful of things you will need to update " -"manually to get full Python 3 support (which of these steps are necessary " -"vary between the tools). Read the documentation for the tool you choose to " -"use to see what it fixes by default and what it can do optionally to know " -"what will (not) be fixed for you and what you may have to fix on your own (e." -"g. using ``io.open()`` over the built-in ``open()`` function is off by " -"default in Modernize). Luckily, though, there are only a couple of things to " -"watch out for which can be considered large issues that may be hard to debug " -"if not watched for." -msgstr "" - -#: ../../howto/pyporting.rst:168 +"under Python 3, and you will also need to read the tools' documentation in " +"case some options you need are turned off by default." +msgstr "" + +#: ../../howto/pyporting.rst:145 +msgid "Key issues to be aware of and check for:" +msgstr "" + +#: ../../howto/pyporting.rst:148 msgid "Division" msgstr "" -#: ../../howto/pyporting.rst:170 +#: ../../howto/pyporting.rst:150 msgid "" -"In Python 3, ``5 / 2 == 2.5`` and not ``2``; all division between ``int`` " -"values result in a ``float``. This change has actually been planned since " -"Python 2.2 which was released in 2002. Since then users have been encouraged " -"to add ``from __future__ import division`` to any and all files which use " -"the ``/`` and ``//`` operators or to be running the interpreter with the ``-" -"Q`` flag. If you have not been doing this then you will need to go through " -"your code and do two things:" +"In Python 3, ``5 / 2 == 2.5`` and not ``2`` as it was in Python 2; all " +"division between ``int`` values result in a ``float``. This change has " +"actually been planned since Python 2.2 which was released in 2002. Since " +"then users have been encouraged to add ``from __future__ import division`` " +"to any and all files which use the ``/`` and ``//`` operators or to be " +"running the interpreter with the ``-Q`` flag. If you have not been doing " +"this then you will need to go through your code and do two things:" msgstr "" -#: ../../howto/pyporting.rst:178 +#: ../../howto/pyporting.rst:158 msgid "Add ``from __future__ import division`` to your files" msgstr "" -#: ../../howto/pyporting.rst:179 +#: ../../howto/pyporting.rst:159 msgid "" "Update any division operator as necessary to either use ``//`` to use floor " "division or continue using ``/`` and expect a float" msgstr "" -#: ../../howto/pyporting.rst:182 +#: ../../howto/pyporting.rst:162 msgid "" "The reason that ``/`` isn't simply translated to ``//`` automatically is " "that if an object defines a ``__truediv__`` method but not ``__floordiv__`` " @@ -306,11 +306,11 @@ msgid "" "`` to signify some operation but not ``//`` for the same thing or at all)." msgstr "" -#: ../../howto/pyporting.rst:189 +#: ../../howto/pyporting.rst:169 msgid "Text versus binary data" msgstr "" -#: ../../howto/pyporting.rst:191 +#: ../../howto/pyporting.rst:171 msgid "" "In Python 2 you could use the ``str`` type for both text and binary data. " "Unfortunately this confluence of two different concepts could lead to " @@ -322,71 +322,73 @@ msgid "" "``unicode`` when they claimed text data support." msgstr "" -#: ../../howto/pyporting.rst:200 +#: ../../howto/pyporting.rst:180 msgid "" -"To make the distinction between text and binary data clearer and more " -"pronounced, Python 3 did what most languages created in the age of the " -"internet have done and made text and binary data distinct types that cannot " -"blindly be mixed together (Python predates widespread access to the " -"internet). For any code that deals only with text or only binary data, this " -"separation doesn't pose an issue. But for code that has to deal with both, " -"it does mean you might have to now care about when you are using text " +"Python 3 made text and binary data distinct types that cannot simply be " +"mixed together. For any code that deals only with text or only binary data, " +"this separation doesn't pose an issue. But for code that has to deal with " +"both, it does mean you might have to now care about when you are using text " "compared to binary data, which is why this cannot be entirely automated." msgstr "" -#: ../../howto/pyporting.rst:209 +#: ../../howto/pyporting.rst:186 msgid "" -"To start, you will need to decide which APIs take text and which take binary " -"(it is **highly** recommended you don't design APIs that can take both due " -"to the difficulty of keeping the code working; as stated earlier it is " -"difficult to do well). In Python 2 this means making sure the APIs that take " -"text can work with ``unicode`` and those that work with binary data work " -"with the ``bytes`` type from Python 3 (which is a subset of ``str`` in " -"Python 2 and acts as an alias for ``bytes`` type in Python 2). Usually the " -"biggest issue is realizing which methods exist on which types in Python 2 & " -"3 simultaneously (for text that's ``unicode`` in Python 2 and ``str`` in " +"Decide which APIs take text and which take binary (it is **highly** " +"recommended you don't design APIs that can take both due to the difficulty " +"of keeping the code working; as stated earlier it is difficult to do well). " +"In Python 2 this means making sure the APIs that take text can work with " +"``unicode`` and those that work with binary data work with the ``bytes`` " +"type from Python 3 (which is a subset of ``str`` in Python 2 and acts as an " +"alias for ``bytes`` type in Python 2). Usually the biggest issue is " +"realizing which methods exist on which types in Python 2 and 3 " +"simultaneously (for text that's ``unicode`` in Python 2 and ``str`` in " "Python 3, for binary that's ``str``/``bytes`` in Python 2 and ``bytes`` in " -"Python 3). The following table lists the **unique** methods of each data " -"type across Python 2 & 3 (e.g., the ``decode()`` method is usable on the " -"equivalent binary data type in either Python 2 or 3, but it can't be used by " -"the textual data type consistently between Python 2 and 3 because ``str`` in " +"Python 3)." +msgstr "" + +#: ../../howto/pyporting.rst:197 +msgid "" +"The following table lists the **unique** methods of each data type across " +"Python 2 and 3 (e.g., the ``decode()`` method is usable on the equivalent " +"binary data type in either Python 2 or 3, but it can't be used by the " +"textual data type consistently between Python 2 and 3 because ``str`` in " "Python 3 doesn't have the method). Do note that as of Python 3.5 the " "``__mod__`` method was added to the bytes type." msgstr "" -#: ../../howto/pyporting.rst:226 +#: ../../howto/pyporting.rst:205 msgid "**Text data**" msgstr "" -#: ../../howto/pyporting.rst:226 +#: ../../howto/pyporting.rst:205 msgid "**Binary data**" msgstr "" -#: ../../howto/pyporting.rst:228 +#: ../../howto/pyporting.rst:207 msgid "\\" msgstr "\\" -#: ../../howto/pyporting.rst:228 +#: ../../howto/pyporting.rst:207 msgid "decode" msgstr "" -#: ../../howto/pyporting.rst:230 +#: ../../howto/pyporting.rst:209 msgid "encode" msgstr "" -#: ../../howto/pyporting.rst:232 +#: ../../howto/pyporting.rst:211 msgid "format" msgstr "" -#: ../../howto/pyporting.rst:234 +#: ../../howto/pyporting.rst:213 msgid "isdecimal" msgstr "isdecimal" -#: ../../howto/pyporting.rst:236 +#: ../../howto/pyporting.rst:215 msgid "isnumeric" msgstr "isnumeric" -#: ../../howto/pyporting.rst:239 +#: ../../howto/pyporting.rst:218 msgid "" "Making the distinction easier to handle can be accomplished by encoding and " "decoding between binary data and text at the edge of your code. This means " @@ -396,20 +398,19 @@ msgid "" "eliminates having to keep track of what type of data you are working with." msgstr "" -#: ../../howto/pyporting.rst:246 +#: ../../howto/pyporting.rst:225 msgid "" "The next issue is making sure you know whether the string literals in your " "code represent text or binary data. You should add a ``b`` prefix to any " "literal that presents binary data. For text you should add a ``u`` prefix to " -"the text literal. (there is a :mod:`__future__` import to force all " +"the text literal. (There is a :mod:`__future__` import to force all " "unspecified literals to be Unicode, but usage has shown it isn't as " "effective as adding a ``b`` or ``u`` prefix to all literals explicitly)" msgstr "" -#: ../../howto/pyporting.rst:253 +#: ../../howto/pyporting.rst:232 msgid "" -"As part of this dichotomy you also need to be careful about opening files. " -"Unless you have been working on Windows, there is a chance you have not " +"You also need to be careful about opening files. Possibly you have not " "always bothered to add the ``b`` mode when opening a binary file (e.g., " "``rb`` for binary reading). Under Python 3, binary files and text files are " "clearly distinct and mutually incompatible; see the :mod:`io` module for " @@ -424,20 +425,20 @@ msgid "" "2.5." msgstr "" -#: ../../howto/pyporting.rst:267 +#: ../../howto/pyporting.rst:245 msgid "" "The constructors of both ``str`` and ``bytes`` have different semantics for " -"the same arguments between Python 2 & 3. Passing an integer to ``bytes`` in " -"Python 2 will give you the string representation of the integer: ``bytes(3) " -"== '3'``. But in Python 3, an integer argument to ``bytes`` will give you a " -"bytes object as long as the integer specified, filled with null bytes: " -"``bytes(3) == b'\\x00\\x00\\x00'``. A similar worry is necessary when " +"the same arguments between Python 2 and 3. Passing an integer to ``bytes`` " +"in Python 2 will give you the string representation of the integer: " +"``bytes(3) == '3'``. But in Python 3, an integer argument to ``bytes`` will " +"give you a bytes object as long as the integer specified, filled with null " +"bytes: ``bytes(3) == b'\\x00\\x00\\x00'``. A similar worry is necessary when " "passing a bytes object to ``str``. In Python 2 you just get the bytes object " "back: ``str(b'3') == b'3'``. But in Python 3 you get the string " "representation of the bytes object: ``str(b'3') == \"b'3'\"``." msgstr "" -#: ../../howto/pyporting.rst:277 +#: ../../howto/pyporting.rst:255 msgid "" "Finally, the indexing of binary data requires careful handling (slicing does " "**not** require any special handling). In Python 2, ``b'123'[1] == b'2'`` " @@ -449,48 +450,48 @@ msgid "" "indexbytes(b'123', 1)``." msgstr "" -#: ../../howto/pyporting.rst:286 +#: ../../howto/pyporting.rst:264 msgid "To summarize:" msgstr "" -#: ../../howto/pyporting.rst:288 +#: ../../howto/pyporting.rst:266 msgid "Decide which of your APIs take text and which take binary data" msgstr "" -#: ../../howto/pyporting.rst:289 +#: ../../howto/pyporting.rst:267 msgid "" "Make sure that your code that works with text also works with ``unicode`` " "and code for binary data works with ``bytes`` in Python 2 (see the table " "above for what methods you cannot use for each type)" msgstr "" -#: ../../howto/pyporting.rst:292 +#: ../../howto/pyporting.rst:270 msgid "" "Mark all binary literals with a ``b`` prefix, textual literals with a ``u`` " "prefix" msgstr "" -#: ../../howto/pyporting.rst:294 +#: ../../howto/pyporting.rst:272 msgid "" "Decode binary data to text as soon as possible, encode text as binary data " "as late as possible" msgstr "" -#: ../../howto/pyporting.rst:296 +#: ../../howto/pyporting.rst:274 msgid "" "Open files using :func:`io.open` and make sure to specify the ``b`` mode " "when appropriate" msgstr "" -#: ../../howto/pyporting.rst:298 +#: ../../howto/pyporting.rst:276 msgid "Be careful when indexing into binary data" msgstr "" -#: ../../howto/pyporting.rst:302 +#: ../../howto/pyporting.rst:280 msgid "Use feature detection instead of version detection" msgstr "" -#: ../../howto/pyporting.rst:304 +#: ../../howto/pyporting.rst:282 msgid "" "Inevitably you will have code that has to choose what to do based on what " "version of Python is running. The best way to do this is with feature " @@ -500,7 +501,7 @@ msgid "" "let's look at an example." msgstr "" -#: ../../howto/pyporting.rst:311 +#: ../../howto/pyporting.rst:289 msgid "" "Let's pretend that you need access to a feature of :mod:`importlib` that is " "available in Python's standard library since Python 3.3 and available for " @@ -508,7 +509,7 @@ msgid "" "access e.g. the :mod:`importlib.abc` module by doing the following::" msgstr "" -#: ../../howto/pyporting.rst:323 +#: ../../howto/pyporting.rst:301 msgid "" "The problem with this code is what happens when Python 4 comes out? It would " "be better to treat Python 2 as the exceptional case instead of Python 3 and " @@ -516,18 +517,18 @@ msgid "" "than Python 2::" msgstr "" -#: ../../howto/pyporting.rst:335 +#: ../../howto/pyporting.rst:313 msgid "" "The best solution, though, is to do no version detection at all and instead " "rely on feature detection. That avoids any potential issues of getting the " "version detection wrong and helps keep you future-compatible::" msgstr "" -#: ../../howto/pyporting.rst:346 +#: ../../howto/pyporting.rst:324 msgid "Prevent compatibility regressions" msgstr "" -#: ../../howto/pyporting.rst:348 +#: ../../howto/pyporting.rst:326 msgid "" "Once you have fully translated your code to be compatible with Python 3, you " "will want to make sure your code doesn't regress and stop working under " @@ -535,13 +536,13 @@ msgid "" "you from actually running under Python 3 at the moment." msgstr "" -#: ../../howto/pyporting.rst:353 +#: ../../howto/pyporting.rst:331 msgid "" "To help with staying compatible, any new modules you create should have at " "least the following block of code at the top of it::" msgstr "" -#: ../../howto/pyporting.rst:360 +#: ../../howto/pyporting.rst:338 msgid "" "You can also run Python 2 with the ``-3`` flag to be warned about various " "compatibility issues your code triggers during execution. If you turn " @@ -549,7 +550,7 @@ msgid "" "accidentally miss a warning." msgstr "" -#: ../../howto/pyporting.rst:365 +#: ../../howto/pyporting.rst:343 msgid "" "You can also use the Pylint_ project and its ``--py3k`` flag to lint your " "code to receive warnings when your code begins to deviate from Python 3 " @@ -559,11 +560,11 @@ msgid "" "Pylint's minimum Python version support." msgstr "" -#: ../../howto/pyporting.rst:374 +#: ../../howto/pyporting.rst:352 msgid "Check which dependencies block your transition" msgstr "" -#: ../../howto/pyporting.rst:376 +#: ../../howto/pyporting.rst:354 msgid "" "**After** you have made your code compatible with Python 3 you should begin " "to care about whether your dependencies have also been ported. The " @@ -573,7 +574,7 @@ msgid "" "caniusepython3.com." msgstr "" -#: ../../howto/pyporting.rst:383 +#: ../../howto/pyporting.rst:361 msgid "" "The project also provides code which you can integrate into your test suite " "so that you will have a failing test when you no longer have dependencies " @@ -582,11 +583,11 @@ msgid "" "start running on Python 3." msgstr "" -#: ../../howto/pyporting.rst:390 +#: ../../howto/pyporting.rst:368 msgid "Update your ``setup.py`` file to denote Python 3 compatibility" msgstr "" -#: ../../howto/pyporting.rst:392 +#: ../../howto/pyporting.rst:370 msgid "" "Once your code works under Python 3, you should update the classifiers in " "your ``setup.py`` to contain ``Programming Language :: Python :: 3`` and to " @@ -595,20 +596,20 @@ msgid "" "classifiers for each major/minor version of Python you now support." msgstr "" -#: ../../howto/pyporting.rst:400 +#: ../../howto/pyporting.rst:378 msgid "Use continuous integration to stay compatible" msgstr "" -#: ../../howto/pyporting.rst:402 +#: ../../howto/pyporting.rst:380 msgid "" "Once you are able to fully run under Python 3 you will want to make sure " -"your code always works under both Python 2 & 3. Probably the best tool for " +"your code always works under both Python 2 and 3. Probably the best tool for " "running your tests under multiple Python interpreters is tox_. You can then " "integrate tox with your continuous integration system so that you never " "accidentally break Python 2 or 3 support." msgstr "" -#: ../../howto/pyporting.rst:408 +#: ../../howto/pyporting.rst:386 msgid "" "You may also want to use the ``-bb`` flag with the Python 3 interpreter to " "trigger an exception when you are comparing bytes to strings or bytes to an " @@ -620,19 +621,11 @@ msgid "" "down." msgstr "" -#: ../../howto/pyporting.rst:416 -msgid "" -"And that's mostly it! At this point your code base is compatible with both " -"Python 2 and 3 simultaneously. Your testing will also be set up so that you " -"don't accidentally break Python 2 or 3 compatibility regardless of which " -"version you typically run your tests under while developing." -msgstr "" - -#: ../../howto/pyporting.rst:423 +#: ../../howto/pyporting.rst:396 msgid "Consider using optional static type checking" msgstr "" -#: ../../howto/pyporting.rst:425 +#: ../../howto/pyporting.rst:398 msgid "" "Another way to help port your code is to use a static type checker like " "mypy_ or pytype_ on your code. These tools can be used to analyze your code " diff --git a/library/asyncio-dev.po b/library/asyncio-dev.po index 27f0911772..7509085757 100644 --- a/library/asyncio-dev.po +++ b/library/asyncio-dev.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-08-22 00:03+0000\n" "PO-Revision-Date: 2023-02-18 14:17+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -187,10 +187,8 @@ msgstr "" "::" #: ../../library/asyncio-dev.rst:102 -msgid "" -"To handle signals and to execute subprocesses, the event loop must be run in " -"the main thread." -msgstr "為了能夠處理訊號和執行子行程,事件迴圈必須於主執行緒中運行。" +msgid "To handle signals the event loop must be run in the main thread." +msgstr "為了能夠處理訊號,事件迴圈必須於主執行緒中運行。" #: ../../library/asyncio-dev.rst:105 msgid "" diff --git a/library/asyncio-eventloop.po b/library/asyncio-eventloop.po index 7bb353e610..372e08e38e 100644 --- a/library/asyncio-eventloop.po +++ b/library/asyncio-eventloop.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-08-23 00:03+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-" @@ -259,7 +259,7 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:176 #: ../../library/asyncio-eventloop.rst:1236 -#: ../../library/asyncio-eventloop.rst:1642 +#: ../../library/asyncio-eventloop.rst:1643 msgid "Example::" msgstr "" "範例:\n" @@ -1026,8 +1026,8 @@ msgid "" "option :py:const:`~socket.TCP_NODELAY` is set by default for all TCP " "connections." msgstr "" -"新增 *ssl_handshake_timeout* 與 *start_serving* 參數。所有 TCP 連線都預設有 " -":py:const:`~socket.TCP_NODELAY` socket 選項。" +"新增 *ssl_handshake_timeout* 與 *start_serving* 參數。所有 TCP 連線都預設有 :" +"py:const:`~socket.TCP_NODELAY` socket 選項。" #: ../../library/asyncio-eventloop.rst:768 msgid "" @@ -1787,64 +1787,70 @@ msgid "*stdin* can be any of these:" msgstr "" #: ../../library/asyncio-eventloop.rst:1444 -#: ../../library/asyncio-eventloop.rst:1454 -#: ../../library/asyncio-eventloop.rst:1464 +#: ../../library/asyncio-eventloop.rst:1455 +#: ../../library/asyncio-eventloop.rst:1465 msgid "a file-like object" msgstr "" #: ../../library/asyncio-eventloop.rst:1445 -#: ../../library/asyncio-eventloop.rst:1455 -#: ../../library/asyncio-eventloop.rst:1465 +msgid "" +"an existing file descriptor (a positive integer), for example those created " +"with :meth:`os.pipe()`" +msgstr "" + +#: ../../library/asyncio-eventloop.rst:1446 +#: ../../library/asyncio-eventloop.rst:1456 +#: ../../library/asyncio-eventloop.rst:1466 msgid "" "the :const:`subprocess.PIPE` constant (default) which will create a new pipe " "and connect it," msgstr "" -#: ../../library/asyncio-eventloop.rst:1447 -#: ../../library/asyncio-eventloop.rst:1457 -#: ../../library/asyncio-eventloop.rst:1467 +#: ../../library/asyncio-eventloop.rst:1448 +#: ../../library/asyncio-eventloop.rst:1458 +#: ../../library/asyncio-eventloop.rst:1468 msgid "" "the value ``None`` which will make the subprocess inherit the file " "descriptor from this process" msgstr "" -#: ../../library/asyncio-eventloop.rst:1449 -#: ../../library/asyncio-eventloop.rst:1459 -#: ../../library/asyncio-eventloop.rst:1469 +#: ../../library/asyncio-eventloop.rst:1450 +#: ../../library/asyncio-eventloop.rst:1460 +#: ../../library/asyncio-eventloop.rst:1470 msgid "" "the :const:`subprocess.DEVNULL` constant which indicates that the special :" "data:`os.devnull` file will be used" msgstr "" -#: ../../library/asyncio-eventloop.rst:1452 +#: ../../library/asyncio-eventloop.rst:1453 msgid "*stdout* can be any of these:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1462 +#: ../../library/asyncio-eventloop.rst:1463 msgid "*stderr* can be any of these:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1471 +#: ../../library/asyncio-eventloop.rst:1472 msgid "" "the :const:`subprocess.STDOUT` constant which will connect the standard " "error stream to the process' standard output stream" msgstr "" -#: ../../library/asyncio-eventloop.rst:1474 +#: ../../library/asyncio-eventloop.rst:1475 msgid "" "All other keyword arguments are passed to :class:`subprocess.Popen` without " "interpretation, except for *bufsize*, *universal_newlines*, *shell*, *text*, " "*encoding* and *errors*, which should not be specified at all." msgstr "" -#: ../../library/asyncio-eventloop.rst:1479 +#: ../../library/asyncio-eventloop.rst:1480 msgid "" "The ``asyncio`` subprocess API does not support decoding the streams as " "text. :func:`bytes.decode` can be used to convert the bytes returned from " "the stream to text." msgstr "" -#: ../../library/asyncio-eventloop.rst:1483 +#: ../../library/asyncio-eventloop.rst:1484 msgid "" "If a file-like object passed as *stdin*, *stdout* or *stderr* represents a " "pipe, then the other side of this pipe should be registered with :meth:" @@ -1852,52 +1858,52 @@ msgid "" "the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1488 +#: ../../library/asyncio-eventloop.rst:1489 msgid "" "See the constructor of the :class:`subprocess.Popen` class for documentation " "on other arguments." msgstr "" -#: ../../library/asyncio-eventloop.rst:1491 +#: ../../library/asyncio-eventloop.rst:1492 msgid "" "Returns a pair of ``(transport, protocol)``, where *transport* conforms to " "the :class:`asyncio.SubprocessTransport` base class and *protocol* is an " "object instantiated by the *protocol_factory*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1499 +#: ../../library/asyncio-eventloop.rst:1500 msgid "" "Create a subprocess from *cmd*, which can be a :class:`str` or a :class:" "`bytes` string encoded to the :ref:`filesystem encoding `, using the platform's \"shell\" syntax." msgstr "" -#: ../../library/asyncio-eventloop.rst:1504 +#: ../../library/asyncio-eventloop.rst:1505 msgid "" "This is similar to the standard library :class:`subprocess.Popen` class " "called with ``shell=True``." msgstr "" -#: ../../library/asyncio-eventloop.rst:1507 +#: ../../library/asyncio-eventloop.rst:1508 msgid "" "The *protocol_factory* must be a callable returning a subclass of the :class:" "`SubprocessProtocol` class." msgstr "" -#: ../../library/asyncio-eventloop.rst:1510 +#: ../../library/asyncio-eventloop.rst:1511 msgid "" "See :meth:`~loop.subprocess_exec` for more details about the remaining " "arguments." msgstr "" -#: ../../library/asyncio-eventloop.rst:1513 +#: ../../library/asyncio-eventloop.rst:1514 msgid "" "Returns a pair of ``(transport, protocol)``, where *transport* conforms to " "the :class:`SubprocessTransport` base class and *protocol* is an object " "instantiated by the *protocol_factory*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1518 +#: ../../library/asyncio-eventloop.rst:1519 msgid "" "It is the application's responsibility to ensure that all whitespace and " "special characters are quoted appropriately to avoid `shell injection " @@ -1907,116 +1913,116 @@ msgid "" "used to construct shell commands." msgstr "" -#: ../../library/asyncio-eventloop.rst:1527 +#: ../../library/asyncio-eventloop.rst:1528 msgid "Callback Handles" msgstr "" -#: ../../library/asyncio-eventloop.rst:1531 +#: ../../library/asyncio-eventloop.rst:1532 msgid "" "A callback wrapper object returned by :meth:`loop.call_soon`, :meth:`loop." "call_soon_threadsafe`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1536 +#: ../../library/asyncio-eventloop.rst:1537 msgid "" "Return the :class:`contextvars.Context` object associated with the handle." msgstr "" -#: ../../library/asyncio-eventloop.rst:1543 +#: ../../library/asyncio-eventloop.rst:1544 msgid "" "Cancel the callback. If the callback has already been canceled or executed, " "this method has no effect." msgstr "" -#: ../../library/asyncio-eventloop.rst:1548 +#: ../../library/asyncio-eventloop.rst:1549 msgid "Return ``True`` if the callback was cancelled." msgstr "" -#: ../../library/asyncio-eventloop.rst:1554 +#: ../../library/asyncio-eventloop.rst:1555 msgid "" "A callback wrapper object returned by :meth:`loop.call_later`, and :meth:" "`loop.call_at`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1557 +#: ../../library/asyncio-eventloop.rst:1558 msgid "This class is a subclass of :class:`Handle`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1561 +#: ../../library/asyncio-eventloop.rst:1562 msgid "Return a scheduled callback time as :class:`float` seconds." msgstr "" -#: ../../library/asyncio-eventloop.rst:1563 +#: ../../library/asyncio-eventloop.rst:1564 msgid "" "The time is an absolute timestamp, using the same time reference as :meth:" "`loop.time`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1570 +#: ../../library/asyncio-eventloop.rst:1571 msgid "Server Objects" msgstr "" -#: ../../library/asyncio-eventloop.rst:1572 +#: ../../library/asyncio-eventloop.rst:1573 msgid "" "Server objects are created by :meth:`loop.create_server`, :meth:`loop." "create_unix_server`, :func:`start_server`, and :func:`start_unix_server` " "functions." msgstr "" -#: ../../library/asyncio-eventloop.rst:1576 +#: ../../library/asyncio-eventloop.rst:1577 msgid "Do not instantiate the :class:`Server` class directly." msgstr "" -#: ../../library/asyncio-eventloop.rst:1580 +#: ../../library/asyncio-eventloop.rst:1581 msgid "" "*Server* objects are asynchronous context managers. When used in an ``async " "with`` statement, it's guaranteed that the Server object is closed and not " "accepting new connections when the ``async with`` statement is completed::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1593 +#: ../../library/asyncio-eventloop.rst:1594 msgid "Server object is an asynchronous context manager since Python 3.7." msgstr "" -#: ../../library/asyncio-eventloop.rst:1596 +#: ../../library/asyncio-eventloop.rst:1597 msgid "" "This class was exposed publicly as ``asyncio.Server`` in Python 3.9.11, " "3.10.3 and 3.11." msgstr "" -#: ../../library/asyncio-eventloop.rst:1601 +#: ../../library/asyncio-eventloop.rst:1602 msgid "" "Stop serving: close listening sockets and set the :attr:`sockets` attribute " "to ``None``." msgstr "" -#: ../../library/asyncio-eventloop.rst:1604 +#: ../../library/asyncio-eventloop.rst:1605 msgid "" "The sockets that represent existing incoming client connections are left " "open." msgstr "" -#: ../../library/asyncio-eventloop.rst:1607 +#: ../../library/asyncio-eventloop.rst:1608 msgid "" "The server is closed asynchronously, use the :meth:`wait_closed` coroutine " "to wait until the server is closed." msgstr "" -#: ../../library/asyncio-eventloop.rst:1612 +#: ../../library/asyncio-eventloop.rst:1613 msgid "Return the event loop associated with the server object." msgstr "" -#: ../../library/asyncio-eventloop.rst:1618 +#: ../../library/asyncio-eventloop.rst:1619 msgid "Start accepting connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:1620 +#: ../../library/asyncio-eventloop.rst:1621 msgid "" "This method is idempotent, so it can be called when the server is already " "serving." msgstr "" -#: ../../library/asyncio-eventloop.rst:1623 +#: ../../library/asyncio-eventloop.rst:1624 msgid "" "The *start_serving* keyword-only parameter to :meth:`loop.create_server` " "and :meth:`asyncio.start_server` allows creating a Server object that is not " @@ -2025,98 +2031,98 @@ msgid "" "accepting connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:1634 +#: ../../library/asyncio-eventloop.rst:1635 msgid "" "Start accepting connections until the coroutine is cancelled. Cancellation " "of ``serve_forever`` task causes the server to be closed." msgstr "" -#: ../../library/asyncio-eventloop.rst:1638 +#: ../../library/asyncio-eventloop.rst:1639 msgid "" "This method can be called if the server is already accepting connections. " "Only one ``serve_forever`` task can exist per one *Server* object." msgstr "" -#: ../../library/asyncio-eventloop.rst:1660 +#: ../../library/asyncio-eventloop.rst:1661 msgid "Return ``True`` if the server is accepting new connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:1666 +#: ../../library/asyncio-eventloop.rst:1667 msgid "Wait until the :meth:`close` method completes." msgstr "" -#: ../../library/asyncio-eventloop.rst:1670 +#: ../../library/asyncio-eventloop.rst:1671 msgid "" "List of socket-like objects, ``asyncio.trsock.TransportSocket``, which the " "server is listening on." msgstr "" -#: ../../library/asyncio-eventloop.rst:1673 +#: ../../library/asyncio-eventloop.rst:1674 msgid "" "Prior to Python 3.7 ``Server.sockets`` used to return an internal list of " "server sockets directly. In 3.7 a copy of that list is returned." msgstr "" -#: ../../library/asyncio-eventloop.rst:1683 +#: ../../library/asyncio-eventloop.rst:1684 msgid "Event Loop Implementations" msgstr "" -#: ../../library/asyncio-eventloop.rst:1685 +#: ../../library/asyncio-eventloop.rst:1686 msgid "" "asyncio ships with two different event loop implementations: :class:" "`SelectorEventLoop` and :class:`ProactorEventLoop`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1688 +#: ../../library/asyncio-eventloop.rst:1689 msgid "" "By default asyncio is configured to use :class:`SelectorEventLoop` on Unix " "and :class:`ProactorEventLoop` on Windows." msgstr "" -#: ../../library/asyncio-eventloop.rst:1694 +#: ../../library/asyncio-eventloop.rst:1695 msgid "An event loop based on the :mod:`selectors` module." msgstr "" -#: ../../library/asyncio-eventloop.rst:1696 +#: ../../library/asyncio-eventloop.rst:1697 msgid "" "Uses the most efficient *selector* available for the given platform. It is " "also possible to manually configure the exact selector implementation to be " "used::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1711 +#: ../../library/asyncio-eventloop.rst:1712 msgid ":ref:`Availability `: Unix, Windows." msgstr ":ref:`適用 `:Unix、Windows。" -#: ../../library/asyncio-eventloop.rst:1716 +#: ../../library/asyncio-eventloop.rst:1717 msgid "An event loop for Windows that uses \"I/O Completion Ports\" (IOCP)." msgstr "" -#: ../../library/asyncio-eventloop.rst:1718 +#: ../../library/asyncio-eventloop.rst:1719 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../library/asyncio-eventloop.rst:1722 +#: ../../library/asyncio-eventloop.rst:1723 msgid "" "`MSDN documentation on I/O Completion Ports `_." msgstr "" -#: ../../library/asyncio-eventloop.rst:1728 +#: ../../library/asyncio-eventloop.rst:1729 msgid "Abstract base class for asyncio-compliant event loops." msgstr "" -#: ../../library/asyncio-eventloop.rst:1730 +#: ../../library/asyncio-eventloop.rst:1731 msgid "" "The :ref:`asyncio-event-loop-methods` section lists all methods that an " "alternative implementation of ``AbstractEventLoop`` should have defined." msgstr "" -#: ../../library/asyncio-eventloop.rst:1736 +#: ../../library/asyncio-eventloop.rst:1737 msgid "Examples" msgstr "範例" -#: ../../library/asyncio-eventloop.rst:1738 +#: ../../library/asyncio-eventloop.rst:1739 msgid "" "Note that all examples in this section **purposefully** show how to use the " "low-level event loop APIs, such as :meth:`loop.run_forever` and :meth:`loop." @@ -2124,70 +2130,70 @@ msgid "" "consider using the high-level functions like :func:`asyncio.run`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1748 +#: ../../library/asyncio-eventloop.rst:1749 msgid "Hello World with call_soon()" msgstr "" -#: ../../library/asyncio-eventloop.rst:1750 +#: ../../library/asyncio-eventloop.rst:1751 msgid "" "An example using the :meth:`loop.call_soon` method to schedule a callback. " "The callback displays ``\"Hello World\"`` and then stops the event loop::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1774 +#: ../../library/asyncio-eventloop.rst:1775 msgid "" "A similar :ref:`Hello World ` example created with a coroutine " "and the :func:`run` function." msgstr "" -#: ../../library/asyncio-eventloop.rst:1781 +#: ../../library/asyncio-eventloop.rst:1782 msgid "Display the current date with call_later()" msgstr "" -#: ../../library/asyncio-eventloop.rst:1783 +#: ../../library/asyncio-eventloop.rst:1784 msgid "" "An example of a callback displaying the current date every second. The " "callback uses the :meth:`loop.call_later` method to reschedule itself after " "5 seconds, and then stops the event loop::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1811 +#: ../../library/asyncio-eventloop.rst:1812 msgid "" "A similar :ref:`current date ` example created with a " "coroutine and the :func:`run` function." msgstr "" -#: ../../library/asyncio-eventloop.rst:1818 +#: ../../library/asyncio-eventloop.rst:1819 msgid "Watch a file descriptor for read events" msgstr "" -#: ../../library/asyncio-eventloop.rst:1820 +#: ../../library/asyncio-eventloop.rst:1821 msgid "" "Wait until a file descriptor received some data using the :meth:`loop." "add_reader` method and then close the event loop::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1858 +#: ../../library/asyncio-eventloop.rst:1859 msgid "" "A similar :ref:`example ` using " "transports, protocols, and the :meth:`loop.create_connection` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:1862 +#: ../../library/asyncio-eventloop.rst:1863 msgid "" "Another similar :ref:`example ` " "using the high-level :func:`asyncio.open_connection` function and streams." msgstr "" -#: ../../library/asyncio-eventloop.rst:1870 +#: ../../library/asyncio-eventloop.rst:1871 msgid "Set signal handlers for SIGINT and SIGTERM" msgstr "" -#: ../../library/asyncio-eventloop.rst:1872 +#: ../../library/asyncio-eventloop.rst:1873 msgid "(This ``signals`` example only works on Unix.)" msgstr "" -#: ../../library/asyncio-eventloop.rst:1874 +#: ../../library/asyncio-eventloop.rst:1875 msgid "" "Register handlers for signals :py:data:`SIGINT` and :py:data:`SIGTERM` using " "the :meth:`loop.add_signal_handler` method::" diff --git a/library/calendar.po b/library/calendar.po index 55370dc52a..b4e689ca0d 100644 --- a/library/calendar.po +++ b/library/calendar.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" -"PO-Revision-Date: 2023-08-18 15:42+0800\n" +"POT-Creation-Date: 2023-08-26 00:03+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-" "tw)\n" @@ -490,20 +490,44 @@ msgid "" "Aliases for day numbers, where ``MONDAY`` is ``0`` and ``SUNDAY`` is ``6``." msgstr "一週每一天的別名,其中 ``MONDAY`` 是 ``0`` 而 ``SUNDAY`` 是 ``6``。" -#: ../../library/calendar.rst:476 +#: ../../library/calendar.rst:473 +msgid "The :mod:`calendar` module defines the following exceptions:" +msgstr "" + +#: ../../library/calendar.rst:477 +msgid "" +"A subclass of :exc:`ValueError`, raised when the given month number is " +"outside of the range 1-12 (inclusive)." +msgstr "" + +#: ../../library/calendar.rst:482 +msgid "The invalid month number." +msgstr "" + +#: ../../library/calendar.rst:487 +msgid "" +"A subclass of :exc:`ValueError`, raised when the given weekday number is " +"outside of the range 0-6 (inclusive)." +msgstr "" + +#: ../../library/calendar.rst:492 +msgid "The invalid weekday number." +msgstr "" + +#: ../../library/calendar.rst:499 msgid "Module :mod:`datetime`" msgstr ":mod:`datetime` 模組" -#: ../../library/calendar.rst:475 +#: ../../library/calendar.rst:498 msgid "" "Object-oriented interface to dates and times with similar functionality to " "the :mod:`time` module." msgstr "日期與時間的物件導向介面,和 :mod:`time` 模組有相似的功能。" -#: ../../library/calendar.rst:478 +#: ../../library/calendar.rst:501 msgid "Module :mod:`time`" msgstr ":mod:`time` 模組" -#: ../../library/calendar.rst:479 +#: ../../library/calendar.rst:502 msgid "Low-level time related functions." msgstr "底層的時間相關函式。" diff --git a/library/dataclasses.po b/library/dataclasses.po index adf66b1e07..4bd6371f89 100644 --- a/library/dataclasses.po +++ b/library/dataclasses.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-08-24 00:03+0000\n" "PO-Revision-Date: 2023-02-11 15:02+0800\n" "Last-Translator: \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -960,7 +960,7 @@ msgstr "" msgid "" "There is a tiny performance penalty when using ``frozen=True``: :meth:" "`~object.__init__` cannot use simple assignment to initialize fields, and " -"must use :meth:`~object.__setattr__`." +"must use :meth:`!object.__setattr__`." msgstr "" "使用 ``frozen=True`` 時有一個微小的性能損失::meth:`__init__` 不能使用簡單賦" "值來初始化欄位,必須使用 :meth:`object.__setattr__`。" diff --git a/library/datetime.po b/library/datetime.po index ae93d210f7..a61def35c8 100644 --- a/library/datetime.po +++ b/library/datetime.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-08-23 00:03+0000\n" "PO-Revision-Date: 2023-08-07 10:20+0800\n" "Last-Translator: Griiid \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -38,49 +38,53 @@ msgid "" "is on efficient attribute extraction for output formatting and manipulation." msgstr "" -#: ../../library/datetime.rst:25 +#: ../../library/datetime.rst:24 +msgid "Skip to :ref:`the format codes `." +msgstr "" + +#: ../../library/datetime.rst:29 msgid "Module :mod:`calendar`" msgstr ":mod:`calendar` 模組" -#: ../../library/datetime.rst:25 +#: ../../library/datetime.rst:29 msgid "General calendar related functions." msgstr "" -#: ../../library/datetime.rst:28 +#: ../../library/datetime.rst:32 msgid "Module :mod:`time`" msgstr ":mod:`time` 模組" -#: ../../library/datetime.rst:28 +#: ../../library/datetime.rst:32 msgid "Time access and conversions." msgstr "" -#: ../../library/datetime.rst:31 +#: ../../library/datetime.rst:35 msgid "Module :mod:`zoneinfo`" msgstr ":mod:`zoneinfo` 模組" -#: ../../library/datetime.rst:31 +#: ../../library/datetime.rst:35 msgid "Concrete time zones representing the IANA time zone database." msgstr "" -#: ../../library/datetime.rst:33 +#: ../../library/datetime.rst:37 msgid "Package `dateutil `_" msgstr "" -#: ../../library/datetime.rst:34 +#: ../../library/datetime.rst:38 msgid "Third-party library with expanded time zone and parsing support." msgstr "" -#: ../../library/datetime.rst:39 +#: ../../library/datetime.rst:43 msgid "Aware and Naive Objects" msgstr "" -#: ../../library/datetime.rst:41 +#: ../../library/datetime.rst:45 msgid "" "Date and time objects may be categorized as \"aware\" or \"naive\" depending " "on whether or not they include timezone information." msgstr "" -#: ../../library/datetime.rst:44 +#: ../../library/datetime.rst:48 msgid "" "With sufficient knowledge of applicable algorithmic and political time " "adjustments, such as time zone and daylight saving time information, an " @@ -89,7 +93,7 @@ msgid "" "interpretation. [#]_" msgstr "" -#: ../../library/datetime.rst:50 +#: ../../library/datetime.rst:54 msgid "" "A **naive** object does not contain enough information to unambiguously " "locate itself relative to other date/time objects. Whether a naive object " @@ -100,7 +104,7 @@ msgid "" "some aspects of reality." msgstr "" -#: ../../library/datetime.rst:57 +#: ../../library/datetime.rst:61 msgid "" "For applications requiring aware objects, :class:`.datetime` and :class:`." "time` objects have an optional time zone information attribute, :attr:`!" @@ -110,7 +114,7 @@ msgid "" "is in effect." msgstr "" -#: ../../library/datetime.rst:63 +#: ../../library/datetime.rst:67 msgid "" "Only one concrete :class:`tzinfo` class, the :class:`timezone` class, is " "supplied by the :mod:`datetime` module. The :class:`timezone` class can " @@ -121,42 +125,42 @@ msgid "" "there is no standard suitable for every application aside from UTC." msgstr "" -#: ../../library/datetime.rst:72 +#: ../../library/datetime.rst:76 msgid "Constants" msgstr "常數" -#: ../../library/datetime.rst:74 +#: ../../library/datetime.rst:78 msgid "The :mod:`datetime` module exports the following constants:" msgstr ":mod:`datetime` 模組匯出以下常數:" -#: ../../library/datetime.rst:78 +#: ../../library/datetime.rst:82 msgid "" "The smallest year number allowed in a :class:`date` or :class:`.datetime` " "object. :const:`MINYEAR` is ``1``." msgstr "" -#: ../../library/datetime.rst:84 +#: ../../library/datetime.rst:88 msgid "" "The largest year number allowed in a :class:`date` or :class:`.datetime` " "object. :const:`MAXYEAR` is ``9999``." msgstr "" -#: ../../library/datetime.rst:89 +#: ../../library/datetime.rst:93 msgid "Alias for the UTC timezone singleton :attr:`datetime.timezone.utc`." msgstr "" -#: ../../library/datetime.rst:94 +#: ../../library/datetime.rst:98 msgid "Available Types" msgstr "" -#: ../../library/datetime.rst:99 +#: ../../library/datetime.rst:103 msgid "" "An idealized naive date, assuming the current Gregorian calendar always was, " "and always will be, in effect. Attributes: :attr:`year`, :attr:`month`, and :" "attr:`day`." msgstr "" -#: ../../library/datetime.rst:107 +#: ../../library/datetime.rst:111 msgid "" "An idealized time, independent of any particular day, assuming that every " "day has exactly 24\\*60\\*60 seconds. (There is no notion of \"leap " @@ -164,14 +168,14 @@ msgid "" "attr:`microsecond`, and :attr:`.tzinfo`." msgstr "" -#: ../../library/datetime.rst:116 +#: ../../library/datetime.rst:120 msgid "" "A combination of a date and a time. Attributes: :attr:`year`, :attr:" "`month`, :attr:`day`, :attr:`hour`, :attr:`minute`, :attr:`second`, :attr:" "`microsecond`, and :attr:`.tzinfo`." msgstr "" -#: ../../library/datetime.rst:124 +#: ../../library/datetime.rst:128 msgid "" "A duration expressing the difference between two :class:`date`, :class:`." "time`, or :class:`.datetime` instances to microsecond resolution." @@ -179,7 +183,7 @@ msgstr "" "表示兩個 :class:`date`、:class:`.time` 或 :class:`.datetime` 實例之間時間的差" "異,以微秒為解析度。" -#: ../../library/datetime.rst:131 +#: ../../library/datetime.rst:135 msgid "" "An abstract base class for time zone information objects. These are used by " "the :class:`.datetime` and :class:`.time` classes to provide a customizable " @@ -187,158 +191,158 @@ msgid "" "daylight saving time)." msgstr "" -#: ../../library/datetime.rst:139 +#: ../../library/datetime.rst:143 msgid "" "A class that implements the :class:`tzinfo` abstract base class as a fixed " "offset from the UTC." msgstr "" -#: ../../library/datetime.rst:144 ../../library/datetime.rst:162 +#: ../../library/datetime.rst:148 ../../library/datetime.rst:166 msgid "Objects of these types are immutable." msgstr "" -#: ../../library/datetime.rst:146 +#: ../../library/datetime.rst:150 msgid "Subclass relationships::" msgstr "" -#: ../../library/datetime.rst:157 +#: ../../library/datetime.rst:161 msgid "Common Properties" msgstr "常見屬性" -#: ../../library/datetime.rst:159 +#: ../../library/datetime.rst:163 msgid "" "The :class:`date`, :class:`.datetime`, :class:`.time`, and :class:`timezone` " "types share these common features:" msgstr "" -#: ../../library/datetime.rst:163 +#: ../../library/datetime.rst:167 msgid "" "Objects of these types are :term:`hashable`, meaning that they can be used " "as dictionary keys." msgstr "" -#: ../../library/datetime.rst:165 +#: ../../library/datetime.rst:169 msgid "" "Objects of these types support efficient pickling via the :mod:`pickle` " "module." msgstr "" -#: ../../library/datetime.rst:168 +#: ../../library/datetime.rst:172 msgid "Determining if an Object is Aware or Naive" msgstr "" -#: ../../library/datetime.rst:170 +#: ../../library/datetime.rst:174 msgid "Objects of the :class:`date` type are always naive." msgstr "" -#: ../../library/datetime.rst:172 +#: ../../library/datetime.rst:176 msgid "" "An object of type :class:`.time` or :class:`.datetime` may be aware or naive." msgstr "" -#: ../../library/datetime.rst:174 +#: ../../library/datetime.rst:178 msgid "A :class:`.datetime` object *d* is aware if both of the following hold:" msgstr "" -#: ../../library/datetime.rst:176 +#: ../../library/datetime.rst:180 msgid "``d.tzinfo`` is not ``None``" msgstr "``d.tzinfo`` 不是 ``None``" -#: ../../library/datetime.rst:177 +#: ../../library/datetime.rst:181 msgid "``d.tzinfo.utcoffset(d)`` does not return ``None``" msgstr "``d.tzinfo.utcoffset(d)`` 不會回傳 ``None``" -#: ../../library/datetime.rst:179 +#: ../../library/datetime.rst:183 msgid "Otherwise, *d* is naive." msgstr "否則 *d* 會是 naive 的。" -#: ../../library/datetime.rst:181 +#: ../../library/datetime.rst:185 msgid "A :class:`.time` object *t* is aware if both of the following hold:" msgstr "" -#: ../../library/datetime.rst:183 +#: ../../library/datetime.rst:187 msgid "``t.tzinfo`` is not ``None``" msgstr "``t.tzinfo`` 不是 ``None``" -#: ../../library/datetime.rst:184 +#: ../../library/datetime.rst:188 msgid "``t.tzinfo.utcoffset(None)`` does not return ``None``." msgstr "``t.tzinfo.utcoffset(None)`` 沒有回傳 ``None``\\ 。" -#: ../../library/datetime.rst:186 +#: ../../library/datetime.rst:190 msgid "Otherwise, *t* is naive." msgstr "" -#: ../../library/datetime.rst:188 +#: ../../library/datetime.rst:192 msgid "" "The distinction between aware and naive doesn't apply to :class:`timedelta` " "objects." msgstr "" -#: ../../library/datetime.rst:194 +#: ../../library/datetime.rst:198 msgid ":class:`timedelta` Objects" msgstr ":class:`timedelta` 物件" -#: ../../library/datetime.rst:196 +#: ../../library/datetime.rst:200 msgid "" "A :class:`timedelta` object represents a duration, the difference between " "two dates or times." msgstr "" "一個 :class:`timedelta` 物件代表著一段持續時間,即兩個日期或時間之間的差異。" -#: ../../library/datetime.rst:201 +#: ../../library/datetime.rst:205 msgid "" "All arguments are optional and default to ``0``. Arguments may be integers " "or floats, and may be positive or negative." msgstr "" -#: ../../library/datetime.rst:204 +#: ../../library/datetime.rst:208 msgid "" "Only *days*, *seconds* and *microseconds* are stored internally. Arguments " "are converted to those units:" msgstr "" -#: ../../library/datetime.rst:207 +#: ../../library/datetime.rst:211 msgid "A millisecond is converted to 1000 microseconds." msgstr "一毫秒會被轉換為 1000 微秒。" -#: ../../library/datetime.rst:208 +#: ../../library/datetime.rst:212 msgid "A minute is converted to 60 seconds." msgstr "一分鐘會被轉換為 60 秒。" -#: ../../library/datetime.rst:209 +#: ../../library/datetime.rst:213 msgid "An hour is converted to 3600 seconds." msgstr "一小時會被轉換為 3600 秒。" -#: ../../library/datetime.rst:210 +#: ../../library/datetime.rst:214 msgid "A week is converted to 7 days." msgstr "一週會被轉換為 7 天。" -#: ../../library/datetime.rst:212 +#: ../../library/datetime.rst:216 msgid "" "and days, seconds and microseconds are then normalized so that the " "representation is unique, with" msgstr "" -#: ../../library/datetime.rst:215 +#: ../../library/datetime.rst:219 msgid "``0 <= microseconds < 1000000``" msgstr "``0 <= microseconds < 1000000``" -#: ../../library/datetime.rst:216 +#: ../../library/datetime.rst:220 msgid "``0 <= seconds < 3600*24`` (the number of seconds in one day)" msgstr "" -#: ../../library/datetime.rst:217 +#: ../../library/datetime.rst:221 msgid "``-999999999 <= days <= 999999999``" msgstr "``-999999999 <= days <= 999999999``" -#: ../../library/datetime.rst:219 +#: ../../library/datetime.rst:223 msgid "" "The following example illustrates how any arguments besides *days*, " "*seconds* and *microseconds* are \"merged\" and normalized into those three " "resulting attributes::" msgstr "" -#: ../../library/datetime.rst:237 +#: ../../library/datetime.rst:241 msgid "" "If any argument is a float and there are fractional microseconds, the " "fractional microseconds left over from all arguments are combined and their " @@ -347,281 +351,281 @@ msgid "" "processes are exact (no information is lost)." msgstr "" -#: ../../library/datetime.rst:244 +#: ../../library/datetime.rst:248 msgid "" "If the normalized value of days lies outside the indicated range, :exc:" "`OverflowError` is raised." msgstr "" -#: ../../library/datetime.rst:247 +#: ../../library/datetime.rst:251 msgid "" "Note that normalization of negative values may be surprising at first. For " "example::" msgstr "" -#: ../../library/datetime.rst:256 ../../library/datetime.rst:552 -#: ../../library/datetime.rst:1065 ../../library/datetime.rst:1684 -#: ../../library/datetime.rst:2286 +#: ../../library/datetime.rst:260 ../../library/datetime.rst:556 +#: ../../library/datetime.rst:1069 ../../library/datetime.rst:1688 +#: ../../library/datetime.rst:2290 msgid "Class attributes:" msgstr "類別屬性:" -#: ../../library/datetime.rst:260 +#: ../../library/datetime.rst:264 msgid "The most negative :class:`timedelta` object, ``timedelta(-999999999)``." msgstr "" -#: ../../library/datetime.rst:265 +#: ../../library/datetime.rst:269 msgid "" "The most positive :class:`timedelta` object, ``timedelta(days=999999999, " "hours=23, minutes=59, seconds=59, microseconds=999999)``." msgstr "" -#: ../../library/datetime.rst:271 +#: ../../library/datetime.rst:275 msgid "" "The smallest possible difference between non-equal :class:`timedelta` " "objects, ``timedelta(microseconds=1)``." msgstr "" -#: ../../library/datetime.rst:274 +#: ../../library/datetime.rst:278 msgid "" "Note that, because of normalization, ``timedelta.max`` > ``-timedelta.min``. " "``-timedelta.max`` is not representable as a :class:`timedelta` object." msgstr "" -#: ../../library/datetime.rst:277 ../../library/datetime.rst:570 -#: ../../library/datetime.rst:1085 ../../library/datetime.rst:1704 +#: ../../library/datetime.rst:281 ../../library/datetime.rst:574 +#: ../../library/datetime.rst:1089 ../../library/datetime.rst:1708 msgid "Instance attributes (read-only):" msgstr "" -#: ../../library/datetime.rst:280 +#: ../../library/datetime.rst:284 msgid "Attribute" msgstr "屬性" -#: ../../library/datetime.rst:280 +#: ../../library/datetime.rst:284 msgid "Value" msgstr "" -#: ../../library/datetime.rst:282 +#: ../../library/datetime.rst:286 msgid "``days``" msgstr "``days``" -#: ../../library/datetime.rst:282 +#: ../../library/datetime.rst:286 msgid "Between -999999999 and 999999999 inclusive" msgstr "" -#: ../../library/datetime.rst:284 +#: ../../library/datetime.rst:288 msgid "``seconds``" msgstr "``seconds``" -#: ../../library/datetime.rst:284 +#: ../../library/datetime.rst:288 msgid "Between 0 and 86399 inclusive" msgstr "在 0 到 86399 (含)之間" -#: ../../library/datetime.rst:286 +#: ../../library/datetime.rst:290 msgid "``microseconds``" msgstr "``microseconds``" -#: ../../library/datetime.rst:286 +#: ../../library/datetime.rst:290 msgid "Between 0 and 999999 inclusive" msgstr "在 0 到 999999 (含)之間" -#: ../../library/datetime.rst:289 ../../library/datetime.rst:587 -#: ../../library/datetime.rst:1138 +#: ../../library/datetime.rst:293 ../../library/datetime.rst:591 +#: ../../library/datetime.rst:1142 msgid "Supported operations:" msgstr "" -#: ../../library/datetime.rst:294 ../../library/datetime.rst:590 -#: ../../library/datetime.rst:1141 +#: ../../library/datetime.rst:298 ../../library/datetime.rst:594 +#: ../../library/datetime.rst:1145 msgid "Operation" msgstr "" -#: ../../library/datetime.rst:294 ../../library/datetime.rst:590 -#: ../../library/datetime.rst:1141 +#: ../../library/datetime.rst:298 ../../library/datetime.rst:594 +#: ../../library/datetime.rst:1145 msgid "Result" msgstr "" -#: ../../library/datetime.rst:296 +#: ../../library/datetime.rst:300 msgid "``t1 = t2 + t3``" msgstr "``t1 = t2 + t3``" -#: ../../library/datetime.rst:296 +#: ../../library/datetime.rst:300 msgid "" "Sum of *t2* and *t3*. Afterwards *t1*-*t2* == *t3* and *t1*-*t3* == *t2* are " "true. (1)" msgstr "" -#: ../../library/datetime.rst:299 +#: ../../library/datetime.rst:303 msgid "``t1 = t2 - t3``" msgstr "``t1 = t2 - t3``" -#: ../../library/datetime.rst:299 +#: ../../library/datetime.rst:303 msgid "" "Difference of *t2* and *t3*. Afterwards *t1* == *t2* - *t3* and *t2* == *t1* " "+ *t3* are true. (1)(6)" msgstr "" -#: ../../library/datetime.rst:303 +#: ../../library/datetime.rst:307 msgid "``t1 = t2 * i or t1 = i * t2``" msgstr "``t1 = t2 * i or t1 = i * t2``" -#: ../../library/datetime.rst:303 +#: ../../library/datetime.rst:307 msgid "" "Delta multiplied by an integer. Afterwards *t1* // i == *t2* is true, " "provided ``i != 0``." msgstr "" -#: ../../library/datetime.rst:307 +#: ../../library/datetime.rst:311 msgid "In general, *t1* \\* i == *t1* \\* (i-1) + *t1* is true. (1)" msgstr "" -#: ../../library/datetime.rst:310 +#: ../../library/datetime.rst:314 msgid "``t1 = t2 * f or t1 = f * t2``" msgstr "``t1 = t2 * f or t1 = f * t2``" -#: ../../library/datetime.rst:310 +#: ../../library/datetime.rst:314 msgid "" "Delta multiplied by a float. The result is rounded to the nearest multiple " "of timedelta.resolution using round-half-to-even." msgstr "" -#: ../../library/datetime.rst:314 +#: ../../library/datetime.rst:318 msgid "``f = t2 / t3``" msgstr "``f = t2 / t3``" -#: ../../library/datetime.rst:314 +#: ../../library/datetime.rst:318 msgid "" "Division (3) of overall duration *t2* by interval unit *t3*. Returns a :" "class:`float` object." msgstr "" -#: ../../library/datetime.rst:318 +#: ../../library/datetime.rst:322 msgid "``t1 = t2 / f or t1 = t2 / i``" msgstr "``t1 = t2 / f or t1 = t2 / i``" -#: ../../library/datetime.rst:318 +#: ../../library/datetime.rst:322 msgid "" "Delta divided by a float or an int. The result is rounded to the nearest " "multiple of timedelta.resolution using round-half-to-even." msgstr "" -#: ../../library/datetime.rst:322 +#: ../../library/datetime.rst:326 msgid "``t1 = t2 // i`` or ``t1 = t2 // t3``" msgstr "``t1 = t2 // i`` or ``t1 = t2 // t3``" -#: ../../library/datetime.rst:322 +#: ../../library/datetime.rst:326 msgid "" "The floor is computed and the remainder (if any) is thrown away. In the " "second case, an integer is returned. (3)" msgstr "" -#: ../../library/datetime.rst:326 +#: ../../library/datetime.rst:330 msgid "``t1 = t2 % t3``" msgstr "``t1 = t2 % t3``" -#: ../../library/datetime.rst:326 +#: ../../library/datetime.rst:330 msgid "The remainder is computed as a :class:`timedelta` object. (3)" msgstr "" -#: ../../library/datetime.rst:329 +#: ../../library/datetime.rst:333 msgid "``q, r = divmod(t1, t2)``" msgstr "``q, r = divmod(t1, t2)``" -#: ../../library/datetime.rst:329 +#: ../../library/datetime.rst:333 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." msgstr "" -#: ../../library/datetime.rst:334 +#: ../../library/datetime.rst:338 msgid "``+t1``" msgstr "``+t1``" -#: ../../library/datetime.rst:334 +#: ../../library/datetime.rst:338 msgid "Returns a :class:`timedelta` object with the same value. (2)" msgstr "" -#: ../../library/datetime.rst:337 +#: ../../library/datetime.rst:341 msgid "``-t1``" msgstr "``-t1``" -#: ../../library/datetime.rst:337 +#: ../../library/datetime.rst:341 msgid "" "equivalent to :class:`timedelta`\\ (-*t1.days*, -*t1.seconds*, -*t1." "microseconds*), and to *t1*\\* -1. (1)(4)" msgstr "" -#: ../../library/datetime.rst:342 +#: ../../library/datetime.rst:346 msgid "``abs(t)``" msgstr "``abs(t)``" -#: ../../library/datetime.rst:342 +#: ../../library/datetime.rst:346 msgid "" "equivalent to +\\ *t* when ``t.days >= 0``, and to -*t* when ``t.days < 0``. " "(2)" msgstr "" -#: ../../library/datetime.rst:345 +#: ../../library/datetime.rst:349 msgid "``str(t)``" msgstr "``str(t)``" -#: ../../library/datetime.rst:345 +#: ../../library/datetime.rst:349 msgid "" "Returns a string in the form ``[D day[s], ][H]H:MM:SS[.UUUUUU]``, where D is " "negative for negative ``t``. (5)" msgstr "" -#: ../../library/datetime.rst:349 +#: ../../library/datetime.rst:353 msgid "``repr(t)``" msgstr "``repr(t)``" -#: ../../library/datetime.rst:349 +#: ../../library/datetime.rst:353 msgid "" "Returns a string representation of the :class:`timedelta` object as a " "constructor call with canonical attribute values." msgstr "" -#: ../../library/datetime.rst:355 ../../library/datetime.rst:604 -#: ../../library/datetime.rst:2515 +#: ../../library/datetime.rst:359 ../../library/datetime.rst:608 +#: ../../library/datetime.rst:2521 msgid "Notes:" msgstr "註解:" -#: ../../library/datetime.rst:358 +#: ../../library/datetime.rst:362 msgid "This is exact but may overflow." msgstr "這是精確的,但可能會溢位。" -#: ../../library/datetime.rst:361 +#: ../../library/datetime.rst:365 msgid "This is exact and cannot overflow." msgstr "這是精確的,且不會溢位。" -#: ../../library/datetime.rst:364 +#: ../../library/datetime.rst:368 msgid "Division by 0 raises :exc:`ZeroDivisionError`." msgstr "" -#: ../../library/datetime.rst:367 +#: ../../library/datetime.rst:371 msgid "-*timedelta.max* is not representable as a :class:`timedelta` object." msgstr "" -#: ../../library/datetime.rst:370 +#: ../../library/datetime.rst:374 msgid "" "String representations of :class:`timedelta` objects are normalized " "similarly to their internal representation. This leads to somewhat unusual " "results for negative timedeltas. For example::" msgstr "" -#: ../../library/datetime.rst:380 +#: ../../library/datetime.rst:384 msgid "" "The expression ``t2 - t3`` will always be equal to the expression ``t2 + (-" "t3)`` except when t3 is equal to ``timedelta.max``; in that case the former " "will produce a result while the latter will overflow." msgstr "" -#: ../../library/datetime.rst:384 +#: ../../library/datetime.rst:388 msgid "" "In addition to the operations listed above, :class:`timedelta` objects " "support certain additions and subtractions with :class:`date` and :class:`." "datetime` objects (see below)." msgstr "" -#: ../../library/datetime.rst:388 +#: ../../library/datetime.rst:392 msgid "" "Floor division and true division of a :class:`timedelta` object by another :" "class:`timedelta` object are now supported, as are remainder operations and " @@ -629,119 +633,119 @@ msgid "" "`timedelta` object by a :class:`float` object are now supported." msgstr "" -#: ../../library/datetime.rst:395 +#: ../../library/datetime.rst:399 msgid "" "Comparisons of :class:`timedelta` objects are supported, with some caveats." msgstr "" -#: ../../library/datetime.rst:397 +#: ../../library/datetime.rst:401 msgid "" "The comparisons ``==`` or ``!=`` *always* return a :class:`bool`, no matter " "the type of the compared object::" msgstr "" -#: ../../library/datetime.rst:408 +#: ../../library/datetime.rst:412 msgid "" "For all other comparisons (such as ``<`` and ``>``), when a :class:" "`timedelta` object is compared to an object of a different type, :exc:" "`TypeError` is raised::" msgstr "" -#: ../../library/datetime.rst:419 +#: ../../library/datetime.rst:423 msgid "" "In Boolean contexts, a :class:`timedelta` object is considered to be true if " "and only if it isn't equal to ``timedelta(0)``." msgstr "" -#: ../../library/datetime.rst:422 ../../library/datetime.rst:633 -#: ../../library/datetime.rst:1212 ../../library/datetime.rst:1812 +#: ../../library/datetime.rst:426 ../../library/datetime.rst:637 +#: ../../library/datetime.rst:1216 ../../library/datetime.rst:1816 msgid "Instance methods:" msgstr "實例方法:" -#: ../../library/datetime.rst:426 +#: ../../library/datetime.rst:430 msgid "" "Return the total number of seconds contained in the duration. Equivalent to " "``td / timedelta(seconds=1)``. For interval units other than seconds, use " "the division form directly (e.g. ``td / timedelta(microseconds=1)``)." msgstr "" -#: ../../library/datetime.rst:430 +#: ../../library/datetime.rst:434 msgid "" "Note that for very large time intervals (greater than 270 years on most " "platforms) this method will lose microsecond accuracy." msgstr "" -#: ../../library/datetime.rst:436 +#: ../../library/datetime.rst:440 msgid "Examples of usage: :class:`timedelta`" msgstr "用法範例:\\ :class:`timedelta`" -#: ../../library/datetime.rst:438 +#: ../../library/datetime.rst:442 msgid "An additional example of normalization::" msgstr "" -#: ../../library/datetime.rst:450 +#: ../../library/datetime.rst:454 msgid "Examples of :class:`timedelta` arithmetic::" msgstr "" -#: ../../library/datetime.rst:469 +#: ../../library/datetime.rst:473 msgid ":class:`date` Objects" msgstr ":class:`date` 物件" -#: ../../library/datetime.rst:471 +#: ../../library/datetime.rst:475 msgid "" "A :class:`date` object represents a date (year, month and day) in an " "idealized calendar, the current Gregorian calendar indefinitely extended in " "both directions." msgstr "" -#: ../../library/datetime.rst:475 +#: ../../library/datetime.rst:479 msgid "" "January 1 of year 1 is called day number 1, January 2 of year 1 is called " "day number 2, and so on. [#]_" msgstr "" -#: ../../library/datetime.rst:480 +#: ../../library/datetime.rst:484 msgid "" "All arguments are required. Arguments must be integers, in the following " "ranges:" msgstr "" -#: ../../library/datetime.rst:483 +#: ../../library/datetime.rst:487 msgid "``MINYEAR <= year <= MAXYEAR``" msgstr "``MINYEAR <= year <= MAXYEAR``" -#: ../../library/datetime.rst:484 +#: ../../library/datetime.rst:488 msgid "``1 <= month <= 12``" msgstr "``1 <= month <= 12``" -#: ../../library/datetime.rst:485 +#: ../../library/datetime.rst:489 msgid "``1 <= day <= number of days in the given month and year``" msgstr "" -#: ../../library/datetime.rst:487 ../../library/datetime.rst:848 +#: ../../library/datetime.rst:491 ../../library/datetime.rst:852 msgid "" "If an argument outside those ranges is given, :exc:`ValueError` is raised." msgstr "" -#: ../../library/datetime.rst:490 ../../library/datetime.rst:853 +#: ../../library/datetime.rst:494 ../../library/datetime.rst:857 msgid "Other constructors, all class methods:" msgstr "" -#: ../../library/datetime.rst:494 +#: ../../library/datetime.rst:498 msgid "Return the current local date." msgstr "回傳目前的本地日期。" -#: ../../library/datetime.rst:496 +#: ../../library/datetime.rst:500 msgid "This is equivalent to ``date.fromtimestamp(time.time())``." msgstr "這等同於 ``date.fromtimestamp(time.time())``。" -#: ../../library/datetime.rst:500 +#: ../../library/datetime.rst:504 msgid "" "Return the local date corresponding to the POSIX timestamp, such as is " "returned by :func:`time.time`." msgstr "" -#: ../../library/datetime.rst:503 +#: ../../library/datetime.rst:507 msgid "" "This may raise :exc:`OverflowError`, if the timestamp is out of the range of " "values supported by the platform C :c:func:`localtime` function, and :exc:" @@ -751,7 +755,7 @@ msgid "" "ignored by :meth:`fromtimestamp`." msgstr "" -#: ../../library/datetime.rst:510 +#: ../../library/datetime.rst:514 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` " @@ -759,96 +763,96 @@ msgid "" "`localtime` failure." msgstr "" -#: ../../library/datetime.rst:519 +#: ../../library/datetime.rst:523 msgid "" "Return the date corresponding to the proleptic Gregorian ordinal, where " "January 1 of year 1 has ordinal 1." msgstr "" -#: ../../library/datetime.rst:522 +#: ../../library/datetime.rst:526 msgid "" ":exc:`ValueError` is raised unless ``1 <= ordinal <= date.max.toordinal()``. " "For any date *d*, ``date.fromordinal(d.toordinal()) == d``." msgstr "" -#: ../../library/datetime.rst:529 +#: ../../library/datetime.rst:533 msgid "" "Return a :class:`date` corresponding to a *date_string* given in any valid " "ISO 8601 format, except ordinal dates (e.g. ``YYYY-DDD``)::" msgstr "" -#: ../../library/datetime.rst:541 +#: ../../library/datetime.rst:545 msgid "Previously, this method only supported the format ``YYYY-MM-DD``." msgstr "" -#: ../../library/datetime.rst:546 +#: ../../library/datetime.rst:550 msgid "" "Return a :class:`date` corresponding to the ISO calendar date specified by " "year, week and day. This is the inverse of the function :meth:`date." "isocalendar`." msgstr "" -#: ../../library/datetime.rst:556 +#: ../../library/datetime.rst:560 msgid "The earliest representable date, ``date(MINYEAR, 1, 1)``." msgstr "" -#: ../../library/datetime.rst:561 +#: ../../library/datetime.rst:565 msgid "The latest representable date, ``date(MAXYEAR, 12, 31)``." msgstr "" -#: ../../library/datetime.rst:566 +#: ../../library/datetime.rst:570 msgid "" "The smallest possible difference between non-equal date objects, " "``timedelta(days=1)``." msgstr "" -#: ../../library/datetime.rst:574 ../../library/datetime.rst:1089 +#: ../../library/datetime.rst:578 ../../library/datetime.rst:1093 msgid "Between :const:`MINYEAR` and :const:`MAXYEAR` inclusive." msgstr "" -#: ../../library/datetime.rst:579 ../../library/datetime.rst:1094 +#: ../../library/datetime.rst:583 ../../library/datetime.rst:1098 msgid "Between 1 and 12 inclusive." msgstr "在 1 到 12 (含)之間。" -#: ../../library/datetime.rst:584 ../../library/datetime.rst:1099 +#: ../../library/datetime.rst:588 ../../library/datetime.rst:1103 msgid "Between 1 and the number of days in the given month of the given year." msgstr "" -#: ../../library/datetime.rst:592 +#: ../../library/datetime.rst:596 msgid "``date2 = date1 + timedelta``" msgstr "``date2 = date1 + timedelta``" -#: ../../library/datetime.rst:592 +#: ../../library/datetime.rst:596 msgid "*date2* will be ``timedelta.days`` days after *date1*. (1)" msgstr "" -#: ../../library/datetime.rst:595 +#: ../../library/datetime.rst:599 msgid "``date2 = date1 - timedelta``" msgstr "``date2 = date1 - timedelta``" -#: ../../library/datetime.rst:595 +#: ../../library/datetime.rst:599 msgid "Computes *date2* such that ``date2 + timedelta == date1``. (2)" msgstr "" -#: ../../library/datetime.rst:598 +#: ../../library/datetime.rst:602 msgid "``timedelta = date1 - date2``" msgstr "``timedelta = date1 - date2``" -#: ../../library/datetime.rst:598 ../../library/datetime.rst:1147 +#: ../../library/datetime.rst:602 ../../library/datetime.rst:1151 msgid "\\(3)" msgstr "\\(3)" -#: ../../library/datetime.rst:600 +#: ../../library/datetime.rst:604 msgid "``date1 < date2``" msgstr "``date1 < date2``" -#: ../../library/datetime.rst:600 +#: ../../library/datetime.rst:604 msgid "" "*date1* is considered less than *date2* when *date1* precedes *date2* in " "time. (4)" msgstr "" -#: ../../library/datetime.rst:607 +#: ../../library/datetime.rst:611 msgid "" "*date2* is moved forward in time if ``timedelta.days > 0``, or backward if " "``timedelta.days < 0``. Afterward ``date2 - date1 == timedelta.days``. " @@ -857,17 +861,17 @@ msgid "" "`MINYEAR` or larger than :const:`MAXYEAR`." msgstr "" -#: ../../library/datetime.rst:614 +#: ../../library/datetime.rst:618 msgid "``timedelta.seconds`` and ``timedelta.microseconds`` are ignored." msgstr "``timedelta.seconds`` 和 ``timedelta.microseconds`` 被忽略。" -#: ../../library/datetime.rst:617 +#: ../../library/datetime.rst:621 msgid "" "This is exact, and cannot overflow. timedelta.seconds and timedelta." "microseconds are 0, and date2 + timedelta == date1 after." msgstr "" -#: ../../library/datetime.rst:621 +#: ../../library/datetime.rst:625 msgid "" "In other words, ``date1 < date2`` if and only if ``date1.toordinal() < date2." "toordinal()``. Date comparison raises :exc:`TypeError` if the other " @@ -880,83 +884,83 @@ msgid "" "`True`, respectively." msgstr "" -#: ../../library/datetime.rst:631 +#: ../../library/datetime.rst:635 msgid "" "In Boolean contexts, all :class:`date` objects are considered to be true." msgstr "" -#: ../../library/datetime.rst:637 +#: ../../library/datetime.rst:641 msgid "" "Return a date with the same value, except for those parameters given new " "values by whichever keyword arguments are specified." msgstr "" -#: ../../library/datetime.rst:640 ../../library/datetime.rst:1855 +#: ../../library/datetime.rst:644 ../../library/datetime.rst:1859 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/datetime.rst:650 ../../library/datetime.rst:1325 +#: ../../library/datetime.rst:654 ../../library/datetime.rst:1329 msgid "" "Return a :class:`time.struct_time` such as returned by :func:`time." "localtime`." msgstr "" "回傳一個 :class:`time.struct_time`,如同 :func:`time.localtime` 所回傳。" -#: ../../library/datetime.rst:652 +#: ../../library/datetime.rst:656 msgid "The hours, minutes and seconds are 0, and the DST flag is -1." msgstr "" -#: ../../library/datetime.rst:654 ../../library/datetime.rst:1327 +#: ../../library/datetime.rst:658 ../../library/datetime.rst:1331 msgid "``d.timetuple()`` is equivalent to::" msgstr "" "``d.timetuple()`` 等價於:\n" "\n" "::" -#: ../../library/datetime.rst:658 +#: ../../library/datetime.rst:662 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." msgstr "" -#: ../../library/datetime.rst:664 +#: ../../library/datetime.rst:668 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." "toordinal()) == d``." msgstr "" -#: ../../library/datetime.rst:671 +#: ../../library/datetime.rst:675 msgid "" "Return the day of the week as an integer, where Monday is 0 and Sunday is 6. " "For example, ``date(2002, 12, 4).weekday() == 2``, a Wednesday. See also :" "meth:`isoweekday`." msgstr "" -"回傳一個代表星期幾的整數,星期一為 0、星期日為 6。" -"例如 ``date(2002, 12, 4).weekday() == 2`` 為星期三。也請參考 :meth:`isoweekday`。" +"回傳一個代表星期幾的整數,星期一為 0、星期日為 6。例如 ``date(2002, 12, 4)." +"weekday() == 2`` 為星期三。也請參考 :meth:`isoweekday`。" -#: ../../library/datetime.rst:678 +#: ../../library/datetime.rst:682 msgid "" "Return the day of the week as an integer, where Monday is 1 and Sunday is 7. " "For example, ``date(2002, 12, 4).isoweekday() == 3``, a Wednesday. See also :" "meth:`weekday`, :meth:`isocalendar`." msgstr "" -#: ../../library/datetime.rst:685 +#: ../../library/datetime.rst:689 msgid "" "Return a :term:`named tuple` object with three components: ``year``, " "``week`` and ``weekday``." msgstr "" -#: ../../library/datetime.rst:688 +#: ../../library/datetime.rst:692 msgid "" "The ISO calendar is a widely used variant of the Gregorian calendar. [#]_" msgstr "" -#: ../../library/datetime.rst:690 +#: ../../library/datetime.rst:694 msgid "" "The ISO year consists of 52 or 53 full weeks, and where a week starts on a " "Monday and ends on a Sunday. The first week of an ISO year is the first " @@ -965,17 +969,17 @@ msgid "" "Gregorian year." msgstr "" -#: ../../library/datetime.rst:695 +#: ../../library/datetime.rst:699 msgid "" "For example, 2004 begins on a Thursday, so the first week of ISO year 2004 " "begins on Monday, 29 Dec 2003 and ends on Sunday, 4 Jan 2004::" msgstr "" -#: ../../library/datetime.rst:704 +#: ../../library/datetime.rst:708 msgid "Result changed from a tuple to a :term:`named tuple`." msgstr "" -#: ../../library/datetime.rst:709 +#: ../../library/datetime.rst:713 msgid "" "Return a string representing the date in ISO 8601 format, ``YYYY-MM-DD``::" msgstr "" @@ -983,29 +987,29 @@ msgstr "" "\n" "::" -#: ../../library/datetime.rst:717 +#: ../../library/datetime.rst:721 msgid "For a date *d*, ``str(d)`` is equivalent to ``d.isoformat()``." msgstr "" -#: ../../library/datetime.rst:722 +#: ../../library/datetime.rst:726 msgid "Return a string representing the date::" msgstr "" -#: ../../library/datetime.rst:728 ../../library/datetime.rst:1511 +#: ../../library/datetime.rst:732 ../../library/datetime.rst:1515 msgid "``d.ctime()`` is equivalent to::" msgstr "" "``d.ctime()`` 等價於:\n" "\n" "::" -#: ../../library/datetime.rst:732 +#: ../../library/datetime.rst:736 msgid "" "on platforms where the native C :c:func:`ctime` function (which :func:`time." "ctime` invokes, but which :meth:`date.ctime` does not invoke) conforms to " "the C standard." msgstr "" -#: ../../library/datetime.rst:739 +#: ../../library/datetime.rst:743 msgid "" "Return a string representing the date, controlled by an explicit format " "string. Format codes referring to hours, minutes or seconds will see 0 " @@ -1013,7 +1017,7 @@ msgid "" "isoformat`." msgstr "" -#: ../../library/datetime.rst:746 +#: ../../library/datetime.rst:750 msgid "" "Same as :meth:`.date.strftime`. This makes it possible to specify a format " "string for a :class:`.date` object in :ref:`formatted string literals 0, or backward if ``timedelta.days`` < 0. " @@ -1443,7 +1447,7 @@ msgid "" "the input is an aware object." msgstr "" -#: ../../library/datetime.rst:1163 +#: ../../library/datetime.rst:1167 msgid "" "Computes the datetime2 such that datetime2 + timedelta == datetime1. As for " "addition, the result has the same :attr:`~.datetime.tzinfo` attribute as the " @@ -1451,14 +1455,14 @@ msgid "" "aware." msgstr "" -#: ../../library/datetime.rst:1168 +#: ../../library/datetime.rst:1172 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:1172 +#: ../../library/datetime.rst:1176 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 " @@ -1466,7 +1470,7 @@ msgid "" "datetime1``. No time zone adjustments are done in this case." msgstr "" -#: ../../library/datetime.rst:1177 +#: ../../library/datetime.rst:1181 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 " @@ -1475,20 +1479,20 @@ msgid "" "overflows." msgstr "" -#: ../../library/datetime.rst:1183 +#: ../../library/datetime.rst:1187 msgid "" "*datetime1* is considered less than *datetime2* when *datetime1* precedes " "*datetime2* in time." msgstr "" -#: ../../library/datetime.rst:1186 +#: ../../library/datetime.rst:1190 msgid "" "If one comparand is naive and the other is aware, :exc:`TypeError` is raised " "if an order comparison is attempted. For equality comparisons, naive " "instances are never equal to aware instances." msgstr "" -#: ../../library/datetime.rst:1190 +#: ../../library/datetime.rst:1194 msgid "" "If both comparands are aware, and have the same :attr:`~.datetime.tzinfo` " "attribute, the common :attr:`~.datetime.tzinfo` attribute is ignored and the " @@ -1498,13 +1502,13 @@ msgid "" "utcoffset()``)." msgstr "" -#: ../../library/datetime.rst:1196 +#: ../../library/datetime.rst:1200 msgid "" "Equality comparisons between aware and naive :class:`.datetime` instances " "don't raise :exc:`TypeError`." msgstr "" -#: ../../library/datetime.rst:1202 +#: ../../library/datetime.rst:1206 msgid "" "In order to stop comparison from falling back to the default scheme of " "comparing object addresses, datetime comparison normally raises :exc:" @@ -1517,27 +1521,27 @@ msgid "" "cases return :const:`False` or :const:`True`, respectively." msgstr "" -#: ../../library/datetime.rst:1216 +#: ../../library/datetime.rst:1220 msgid "Return :class:`date` object with same year, month and day." msgstr "" -#: ../../library/datetime.rst:1221 +#: ../../library/datetime.rst:1225 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:1224 ../../library/datetime.rst:1233 +#: ../../library/datetime.rst:1228 ../../library/datetime.rst:1237 msgid "The fold value is copied to the returned :class:`.time` object." msgstr "" -#: ../../library/datetime.rst:1230 +#: ../../library/datetime.rst:1234 msgid "" "Return :class:`.time` object with same hour, minute, second, microsecond, " "fold, and tzinfo attributes. See also method :meth:`time`." msgstr "" -#: ../../library/datetime.rst:1241 +#: ../../library/datetime.rst:1245 msgid "" "Return a datetime with the same attributes, except for those attributes " "given new values by whichever keyword arguments are specified. Note that " @@ -1545,21 +1549,21 @@ msgid "" "datetime with no conversion of date and time data." msgstr "" -#: ../../library/datetime.rst:1252 +#: ../../library/datetime.rst:1256 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:1256 +#: ../../library/datetime.rst:1260 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 timezone." msgstr "" -#: ../../library/datetime.rst:1260 +#: ../../library/datetime.rst:1264 msgid "" "If called without arguments (or with ``tz=None``) the system local timezone " "is assumed for the target timezone. The ``.tzinfo`` attribute of the " @@ -1567,7 +1571,7 @@ msgid "" "with the zone name and offset obtained from the OS." msgstr "" -#: ../../library/datetime.rst:1265 +#: ../../library/datetime.rst:1269 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 " @@ -1576,7 +1580,7 @@ msgid "" "date and time data as ``dt - dt.utcoffset()``." msgstr "" -#: ../../library/datetime.rst:1271 +#: ../../library/datetime.rst:1275 msgid "" "If you merely want to attach a time zone object *tz* to a datetime *dt* " "without adjustment of date and time data, use ``dt.replace(tzinfo=tz)``. If " @@ -1584,56 +1588,56 @@ msgid "" "without conversion of date and time data, use ``dt.replace(tzinfo=None)``." msgstr "" -#: ../../library/datetime.rst:1276 +#: ../../library/datetime.rst:1280 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:1288 +#: ../../library/datetime.rst:1292 msgid "*tz* now can be omitted." msgstr "" -#: ../../library/datetime.rst:1291 +#: ../../library/datetime.rst:1295 msgid "" "The :meth:`astimezone` method can now be called on naive instances that are " "presumed to represent system local time." msgstr "" -#: ../../library/datetime.rst:1298 +#: ../../library/datetime.rst:1302 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:1302 ../../library/datetime.rst:1895 -#: ../../library/datetime.rst:2001 ../../library/datetime.rst:2246 -#: ../../library/datetime.rst:2258 ../../library/datetime.rst:2568 +#: ../../library/datetime.rst:1306 ../../library/datetime.rst:1899 +#: ../../library/datetime.rst:2005 ../../library/datetime.rst:2250 +#: ../../library/datetime.rst:2262 ../../library/datetime.rst:2574 msgid "The UTC offset is not restricted to a whole number of minutes." msgstr "" -#: ../../library/datetime.rst:1308 +#: ../../library/datetime.rst:1312 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:1312 ../../library/datetime.rst:1905 -#: ../../library/datetime.rst:2055 +#: ../../library/datetime.rst:1316 ../../library/datetime.rst:1909 +#: ../../library/datetime.rst:2059 msgid "The DST offset is not restricted to a whole number of minutes." msgstr "" -#: ../../library/datetime.rst:1318 +#: ../../library/datetime.rst:1322 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:1333 +#: ../../library/datetime.rst:1337 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 :" @@ -1643,14 +1647,14 @@ msgid "" "attr:`tm_isdst` is set to ``1``; else :attr:`tm_isdst` is set to ``0``." msgstr "" -#: ../../library/datetime.rst:1344 +#: ../../library/datetime.rst:1348 msgid "" "If :class:`.datetime` instance *d* is naive, this is the same as ``d." "timetuple()`` except that :attr:`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:1348 +#: ../../library/datetime.rst:1352 msgid "" "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 " @@ -1659,7 +1663,7 @@ msgid "" "spills over a year boundary." msgstr "" -#: ../../library/datetime.rst:1357 +#: ../../library/datetime.rst:1361 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 " @@ -1669,20 +1673,20 @@ msgid "" "meth:`.datetime.timetuple`." msgstr "" -#: ../../library/datetime.rst:1366 +#: ../../library/datetime.rst:1370 msgid "" "Return the proleptic Gregorian ordinal of the date. The same as ``self." "date().toordinal()``." msgstr "" -#: ../../library/datetime.rst:1371 +#: ../../library/datetime.rst:1375 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:1375 +#: ../../library/datetime.rst:1379 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 " @@ -1692,18 +1696,18 @@ msgid "" "future." msgstr "" -#: ../../library/datetime.rst:1382 +#: ../../library/datetime.rst:1386 msgid "" "For aware :class:`.datetime` instances, the return value is computed as::" msgstr "" -#: ../../library/datetime.rst:1389 +#: ../../library/datetime.rst:1393 msgid "" "The :meth:`timestamp` method uses the :attr:`.fold` attribute to " "disambiguate the times during a repeated interval." msgstr "" -#: ../../library/datetime.rst:1395 +#: ../../library/datetime.rst:1399 msgid "" "There is no method to obtain the POSIX timestamp directly from a naive :" "class:`.datetime` instance representing UTC time. If your application uses " @@ -1711,49 +1715,49 @@ msgid "" "the POSIX timestamp by supplying ``tzinfo=timezone.utc``::" msgstr "" -#: ../../library/datetime.rst:1403 +#: ../../library/datetime.rst:1407 msgid "or by calculating the timestamp directly::" msgstr "" -#: ../../library/datetime.rst:1409 +#: ../../library/datetime.rst:1413 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:1415 +#: ../../library/datetime.rst:1419 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:1422 +#: ../../library/datetime.rst:1426 msgid "" "Return a :term:`named tuple` with three components: ``year``, ``week`` and " "``weekday``. The same as ``self.date().isocalendar()``." msgstr "" -#: ../../library/datetime.rst:1428 +#: ../../library/datetime.rst:1432 msgid "Return a string representing the date and time in ISO 8601 format:" msgstr "" -#: ../../library/datetime.rst:1430 +#: ../../library/datetime.rst:1434 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:1431 +#: ../../library/datetime.rst:1435 msgid "``YYYY-MM-DDTHH:MM:SS``, if :attr:`microsecond` is 0" msgstr "``YYYY-MM-DDTHH:MM:SS``,如果 :attr:`microsecond` 是 0" -#: ../../library/datetime.rst:1433 +#: ../../library/datetime.rst:1437 msgid "" "If :meth:`utcoffset` does not return ``None``, a string is appended, giving " "the UTC offset:" msgstr "" "如果 :meth:`utcoffset` 没有回傳 ``None``,則會附加一个字串,給出 UTC 偏移:" -#: ../../library/datetime.rst:1436 +#: ../../library/datetime.rst:1440 msgid "" "``YYYY-MM-DDTHH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` " "is not 0" @@ -1761,99 +1765,99 @@ msgstr "" "``YYYY-MM-DDTHH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``,如果 :attr:`microsecond` " "不是 0" -#: ../../library/datetime.rst:1438 +#: ../../library/datetime.rst:1442 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:1448 +#: ../../library/datetime.rst:1452 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:1462 ../../library/datetime.rst:1835 +#: ../../library/datetime.rst:1466 ../../library/datetime.rst:1839 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:1466 ../../library/datetime.rst:1839 +#: ../../library/datetime.rst:1470 ../../library/datetime.rst:1843 msgid "" "``'auto'``: Same as ``'seconds'`` if :attr:`microsecond` is 0, same as " "``'microseconds'`` otherwise." msgstr "" -#: ../../library/datetime.rst:1468 ../../library/datetime.rst:1841 +#: ../../library/datetime.rst:1472 ../../library/datetime.rst:1845 msgid "``'hours'``: Include the :attr:`hour` in the two-digit ``HH`` format." msgstr "" -#: ../../library/datetime.rst:1469 ../../library/datetime.rst:1842 +#: ../../library/datetime.rst:1473 ../../library/datetime.rst:1846 msgid "" "``'minutes'``: Include :attr:`hour` and :attr:`minute` in ``HH:MM`` format." msgstr "" -#: ../../library/datetime.rst:1470 ../../library/datetime.rst:1843 +#: ../../library/datetime.rst:1474 ../../library/datetime.rst:1847 msgid "" "``'seconds'``: Include :attr:`hour`, :attr:`minute`, and :attr:`second` in " "``HH:MM:SS`` format." msgstr "" -#: ../../library/datetime.rst:1472 ../../library/datetime.rst:1845 +#: ../../library/datetime.rst:1476 ../../library/datetime.rst:1849 msgid "" "``'milliseconds'``: Include full time, but truncate fractional second part " "to milliseconds. ``HH:MM:SS.sss`` format." msgstr "" -#: ../../library/datetime.rst:1474 ../../library/datetime.rst:1847 +#: ../../library/datetime.rst:1478 ../../library/datetime.rst:1851 msgid "``'microseconds'``: Include full time in ``HH:MM:SS.ffffff`` format." msgstr "" -#: ../../library/datetime.rst:1478 ../../library/datetime.rst:1851 +#: ../../library/datetime.rst:1482 ../../library/datetime.rst:1855 msgid "Excluded time components are truncated, not rounded." msgstr "" -#: ../../library/datetime.rst:1480 +#: ../../library/datetime.rst:1484 msgid ":exc:`ValueError` will be raised on an invalid *timespec* argument::" msgstr "" -#: ../../library/datetime.rst:1490 ../../library/datetime.rst:1866 +#: ../../library/datetime.rst:1494 ../../library/datetime.rst:1870 msgid "Added the *timespec* argument." msgstr "新增 *timespec* 引數。" -#: ../../library/datetime.rst:1496 +#: ../../library/datetime.rst:1500 msgid "" "For a :class:`.datetime` instance *d*, ``str(d)`` is equivalent to ``d." "isoformat(' ')``." msgstr "" -#: ../../library/datetime.rst:1502 +#: ../../library/datetime.rst:1506 msgid "Return a string representing the date and time::" msgstr "" -#: ../../library/datetime.rst:1508 +#: ../../library/datetime.rst:1512 msgid "" "The output string will *not* include time zone information, regardless of " "whether the input is aware or naive." msgstr "" -#: ../../library/datetime.rst:1515 +#: ../../library/datetime.rst:1519 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:1522 +#: ../../library/datetime.rst:1526 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:1529 +#: ../../library/datetime.rst:1533 msgid "" "Same as :meth:`.datetime.strftime`. This makes it possible to specify a " "format string for a :class:`.datetime` object in :ref:`formatted string " @@ -1861,70 +1865,70 @@ msgid "" "`strftime-strptime-behavior` and :meth:`datetime.isoformat`." msgstr "" -#: ../../library/datetime.rst:1536 +#: ../../library/datetime.rst:1540 msgid "Examples of Usage: :class:`.datetime`" msgstr "" -#: ../../library/datetime.rst:1538 +#: ../../library/datetime.rst:1542 msgid "Examples of working with :class:`~datetime.datetime` objects:" msgstr "" -#: ../../library/datetime.rst:1591 +#: ../../library/datetime.rst:1595 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:1638 +#: ../../library/datetime.rst:1642 msgid "Usage of ``KabulTz`` from above::" msgstr "" -#: ../../library/datetime.rst:1664 +#: ../../library/datetime.rst:1668 msgid ":class:`.time` Objects" msgstr ":class:`.time` 物件" -#: ../../library/datetime.rst:1666 +#: ../../library/datetime.rst:1670 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:1671 +#: ../../library/datetime.rst:1675 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:1681 +#: ../../library/datetime.rst:1685 msgid "" "If an argument outside those ranges is given, :exc:`ValueError` is raised. " "All default to ``0`` except *tzinfo*, which defaults to :const:`None`." msgstr "" -#: ../../library/datetime.rst:1689 +#: ../../library/datetime.rst:1693 msgid "The earliest representable :class:`.time`, ``time(0, 0, 0, 0)``." msgstr "" -#: ../../library/datetime.rst:1694 +#: ../../library/datetime.rst:1698 msgid "The latest representable :class:`.time`, ``time(23, 59, 59, 999999)``." msgstr "" -#: ../../library/datetime.rst:1699 +#: ../../library/datetime.rst:1703 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:1728 +#: ../../library/datetime.rst:1732 msgid "" "The object passed as the tzinfo argument to the :class:`.time` constructor, " "or ``None`` if none was passed." msgstr "" -#: ../../library/datetime.rst:1742 +#: ../../library/datetime.rst:1746 msgid "" ":class:`.time` objects support comparison of :class:`.time` to :class:`." "time`, where *a* is considered less than *b* when *a* precedes *b* in time. " @@ -1933,7 +1937,7 @@ msgid "" "instances are never equal to aware instances." msgstr "" -#: ../../library/datetime.rst:1748 +#: ../../library/datetime.rst:1752 msgid "" "If both comparands are aware, and have the same :attr:`~time.tzinfo` " "attribute, the common :attr:`~time.tzinfo` attribute is ignored and the base " @@ -1947,18 +1951,18 @@ msgid "" "respectively." msgstr "" -#: ../../library/datetime.rst:1758 +#: ../../library/datetime.rst:1762 msgid "" "Equality comparisons between aware and naive :class:`~datetime.time` " "instances don't raise :exc:`TypeError`." msgstr "" -#: ../../library/datetime.rst:1762 +#: ../../library/datetime.rst:1766 msgid "" "In Boolean contexts, a :class:`.time` object is always considered to be true." msgstr "" -#: ../../library/datetime.rst:1764 +#: ../../library/datetime.rst:1768 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-" @@ -1966,35 +1970,35 @@ msgid "" "details." msgstr "" -#: ../../library/datetime.rst:1771 +#: ../../library/datetime.rst:1775 msgid "Other constructor:" msgstr "" -#: ../../library/datetime.rst:1775 +#: ../../library/datetime.rst:1779 msgid "" "Return a :class:`.time` corresponding to a *time_string* in any valid ISO " "8601 format, with the following exceptions:" msgstr "" -#: ../../library/datetime.rst:1779 +#: ../../library/datetime.rst:1783 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:1781 +#: ../../library/datetime.rst:1785 msgid "" "Fractional seconds may have any number of digits (anything beyond 6 will be " "truncated)." msgstr "" -#: ../../library/datetime.rst:1807 +#: ../../library/datetime.rst:1811 msgid "" "Previously, this method only supported formats that could be emitted by :" "meth:`time.isoformat()`." msgstr "" -#: ../../library/datetime.rst:1817 +#: ../../library/datetime.rst:1821 msgid "" "Return a :class:`.time` with the same value, except for those attributes " "given new values by whichever keyword arguments are specified. Note that " @@ -2002,46 +2006,46 @@ msgid "" "aware :class:`.time`, without conversion of the time data." msgstr "" -#: ../../library/datetime.rst:1828 +#: ../../library/datetime.rst:1832 msgid "Return a string representing the time in ISO 8601 format, one of:" msgstr "" -#: ../../library/datetime.rst:1830 +#: ../../library/datetime.rst:1834 msgid "``HH:MM:SS.ffffff``, if :attr:`microsecond` is not 0" msgstr "" -#: ../../library/datetime.rst:1831 +#: ../../library/datetime.rst:1835 msgid "``HH:MM:SS``, if :attr:`microsecond` is 0" msgstr "" -#: ../../library/datetime.rst:1832 +#: ../../library/datetime.rst:1836 msgid "" "``HH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``, if :meth:`utcoffset` does not " "return ``None``" msgstr "" -#: ../../library/datetime.rst:1833 +#: ../../library/datetime.rst:1837 msgid "" "``HH:MM:SS+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` is 0 and :meth:" "`utcoffset` does not return ``None``" msgstr "" -#: ../../library/datetime.rst:1853 +#: ../../library/datetime.rst:1857 msgid ":exc:`ValueError` will be raised on an invalid *timespec* argument." msgstr "" -#: ../../library/datetime.rst:1872 +#: ../../library/datetime.rst:1876 msgid "For a time *t*, ``str(t)`` is equivalent to ``t.isoformat()``." msgstr "" -#: ../../library/datetime.rst:1877 +#: ../../library/datetime.rst:1881 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:1883 +#: ../../library/datetime.rst:1887 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 ` file there are some examples of :class:`tzinfo` classes:" msgstr "" -#: ../../library/datetime.rst:2138 +#: ../../library/datetime.rst:2142 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 " @@ -2311,7 +2315,7 @@ msgid "" "ends the minute after 1:59 (EDT) on the first Sunday in November::" msgstr "" -#: ../../library/datetime.rst:2152 +#: ../../library/datetime.rst:2156 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, " @@ -2320,7 +2324,7 @@ msgid "" "get::" msgstr "" -#: ../../library/datetime.rst:2171 +#: ../../library/datetime.rst:2175 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 " @@ -2335,13 +2339,13 @@ msgid "" "transition of 2016, we get::" msgstr "" -#: ../../library/datetime.rst:2193 +#: ../../library/datetime.rst:2197 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:2196 +#: ../../library/datetime.rst:2200 msgid "" "Applications that can't bear wall-time ambiguities should explicitly check " "the value of the :attr:`~datetime.fold` attribute or avoid using hybrid :" @@ -2351,28 +2355,28 @@ msgid "" "offset -4 hours))." msgstr "" -#: ../../library/datetime.rst:2210 +#: ../../library/datetime.rst:2214 msgid ":mod:`zoneinfo`" msgstr ":mod:`zoneinfo`" -#: ../../library/datetime.rst:2205 +#: ../../library/datetime.rst:2209 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 timezone instance)." msgstr "" -#: ../../library/datetime.rst:2209 +#: ../../library/datetime.rst:2213 msgid "" "``zoneinfo`` brings the *IANA timezone database* (also known as the Olson " "database) to Python, and its usage is recommended." msgstr "" -#: ../../library/datetime.rst:2216 +#: ../../library/datetime.rst:2220 msgid "`IANA timezone database `_" msgstr "`IANA 時區資料庫 `_" -#: ../../library/datetime.rst:2213 +#: ../../library/datetime.rst:2217 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 " @@ -2381,24 +2385,24 @@ msgid "" "saving rules." msgstr "" -#: ../../library/datetime.rst:2223 +#: ../../library/datetime.rst:2227 msgid ":class:`timezone` Objects" msgstr ":class:`timezone` 物件" -#: ../../library/datetime.rst:2225 +#: ../../library/datetime.rst:2229 msgid "" "The :class:`timezone` class is a subclass of :class:`tzinfo`, each instance " "of which represents a timezone defined by a fixed offset from UTC." msgstr "" -#: ../../library/datetime.rst:2229 +#: ../../library/datetime.rst:2233 msgid "" "Objects of this class cannot be used to represent timezone 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:2236 +#: ../../library/datetime.rst:2240 msgid "" "The *offset* argument must be specified as a :class:`timedelta` object " "representing the difference between the local time and UTC. It must be " @@ -2406,25 +2410,25 @@ msgid "" "otherwise :exc:`ValueError` is raised." msgstr "" -#: ../../library/datetime.rst:2241 +#: ../../library/datetime.rst:2245 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:2252 ../../library/datetime.rst:2263 +#: ../../library/datetime.rst:2256 ../../library/datetime.rst:2267 msgid "" "Return the fixed value specified when the :class:`timezone` instance is " "constructed." msgstr "" -#: ../../library/datetime.rst:2255 +#: ../../library/datetime.rst:2259 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:2266 +#: ../../library/datetime.rst:2270 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 " @@ -2433,144 +2437,144 @@ msgid "" "are two digits of ``offset.hours`` and ``offset.minutes`` respectively." msgstr "" -#: ../../library/datetime.rst:2272 +#: ../../library/datetime.rst:2276 msgid "" "Name generated from ``offset=timedelta(0)`` is now plain ``'UTC'``, not " "``'UTC+00:00'``." msgstr "" -#: ../../library/datetime.rst:2279 +#: ../../library/datetime.rst:2283 msgid "Always returns ``None``." msgstr "" -#: ../../library/datetime.rst:2283 +#: ../../library/datetime.rst:2287 msgid "" "Return ``dt + offset``. The *dt* argument must be an aware :class:`." "datetime` instance, with ``tzinfo`` set to ``self``." msgstr "" -#: ../../library/datetime.rst:2290 +#: ../../library/datetime.rst:2294 msgid "The UTC timezone, ``timezone(timedelta(0))``." msgstr "" -#: ../../library/datetime.rst:2299 +#: ../../library/datetime.rst:2303 msgid ":meth:`strftime` and :meth:`strptime` Behavior" msgstr ":meth:`strftime` 與 :meth:`strptime` 的行為" -#: ../../library/datetime.rst:2301 +#: ../../library/datetime.rst:2305 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:2305 +#: ../../library/datetime.rst:2309 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:2309 +#: ../../library/datetime.rst:2313 msgid "" "The table below provides a high-level comparison of :meth:`strftime` versus :" "meth:`strptime`:" msgstr "" -#: ../../library/datetime.rst:2313 +#: ../../library/datetime.rst:2317 msgid "``strftime``" msgstr "``strftime``" -#: ../../library/datetime.rst:2313 +#: ../../library/datetime.rst:2317 msgid "``strptime``" msgstr "``strptime``" -#: ../../library/datetime.rst:2315 +#: ../../library/datetime.rst:2319 msgid "Usage" msgstr "用法" -#: ../../library/datetime.rst:2315 +#: ../../library/datetime.rst:2319 msgid "Convert object to a string according to a given format" msgstr "" -#: ../../library/datetime.rst:2315 +#: ../../library/datetime.rst:2319 msgid "" "Parse a string into a :class:`.datetime` object given a corresponding format" msgstr "" -#: ../../library/datetime.rst:2317 +#: ../../library/datetime.rst:2321 msgid "Type of method" msgstr "" -#: ../../library/datetime.rst:2317 +#: ../../library/datetime.rst:2321 msgid "Instance method" msgstr "實例方法" -#: ../../library/datetime.rst:2317 +#: ../../library/datetime.rst:2321 msgid "Class method" msgstr "類別方法" -#: ../../library/datetime.rst:2319 +#: ../../library/datetime.rst:2323 msgid "Method of" msgstr "" -#: ../../library/datetime.rst:2319 +#: ../../library/datetime.rst:2323 msgid ":class:`date`; :class:`.datetime`; :class:`.time`" msgstr "" -#: ../../library/datetime.rst:2319 +#: ../../library/datetime.rst:2323 msgid ":class:`.datetime`" msgstr ":class:`.datetime`" -#: ../../library/datetime.rst:2321 +#: ../../library/datetime.rst:2325 msgid "Signature" msgstr "" -#: ../../library/datetime.rst:2321 +#: ../../library/datetime.rst:2325 msgid "``strftime(format)``" msgstr "``strftime(format)``" -#: ../../library/datetime.rst:2321 +#: ../../library/datetime.rst:2325 msgid "``strptime(date_string, format)``" msgstr "``strptime(date_string, format)``" -#: ../../library/datetime.rst:2326 +#: ../../library/datetime.rst:2332 msgid ":meth:`strftime` and :meth:`strptime` Format Codes" msgstr "" -#: ../../library/datetime.rst:2328 +#: ../../library/datetime.rst:2334 msgid "" "These methods accept format codes that can be used to parse and format " "dates::" msgstr "" -#: ../../library/datetime.rst:2336 +#: ../../library/datetime.rst:2342 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:2340 ../../library/datetime.rst:2443 +#: ../../library/datetime.rst:2346 ../../library/datetime.rst:2449 msgid "Directive" msgstr "" -#: ../../library/datetime.rst:2340 ../../library/datetime.rst:2443 +#: ../../library/datetime.rst:2346 ../../library/datetime.rst:2449 msgid "Meaning" msgstr "" -#: ../../library/datetime.rst:2340 ../../library/datetime.rst:2443 +#: ../../library/datetime.rst:2346 ../../library/datetime.rst:2449 msgid "Example" msgstr "範例" -#: ../../library/datetime.rst:2340 ../../library/datetime.rst:2443 +#: ../../library/datetime.rst:2346 ../../library/datetime.rst:2449 msgid "Notes" msgstr "註解" -#: ../../library/datetime.rst:2342 +#: ../../library/datetime.rst:2348 msgid "``%a``" msgstr "``%a``" -#: ../../library/datetime.rst:2342 +#: ../../library/datetime.rst:2348 msgid "Weekday as locale's abbreviated name." msgstr "" @@ -2582,11 +2586,11 @@ msgstr "" msgid "So, Mo, ..., Sa (de_DE)" msgstr "" -#: ../../library/datetime.rst:2347 +#: ../../library/datetime.rst:2353 msgid "``%A``" msgstr "``%A``" -#: ../../library/datetime.rst:2347 +#: ../../library/datetime.rst:2353 msgid "Weekday as locale's full name." msgstr "" @@ -2598,42 +2602,42 @@ msgstr "" msgid "Sonntag, Montag, ..., Samstag (de_DE)" msgstr "" -#: ../../library/datetime.rst:2352 +#: ../../library/datetime.rst:2358 msgid "``%w``" msgstr "``%w``" -#: ../../library/datetime.rst:2352 +#: ../../library/datetime.rst:2358 msgid "Weekday as a decimal number, where 0 is Sunday and 6 is Saturday." msgstr "" -#: ../../library/datetime.rst:2352 +#: ../../library/datetime.rst:2358 msgid "0, 1, ..., 6" msgstr "0, 1, ..., 6" -#: ../../library/datetime.rst:2356 +#: ../../library/datetime.rst:2362 msgid "``%d``" msgstr "``%d``" -#: ../../library/datetime.rst:2356 +#: ../../library/datetime.rst:2362 msgid "Day of the month as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2356 +#: ../../library/datetime.rst:2362 msgid "01, 02, ..., 31" msgstr "01, 02, ..., 31" -#: ../../library/datetime.rst:2356 ../../library/datetime.rst:2369 -#: ../../library/datetime.rst:2372 ../../library/datetime.rst:2378 -#: ../../library/datetime.rst:2381 ../../library/datetime.rst:2387 -#: ../../library/datetime.rst:2405 +#: ../../library/datetime.rst:2362 ../../library/datetime.rst:2375 +#: ../../library/datetime.rst:2378 ../../library/datetime.rst:2384 +#: ../../library/datetime.rst:2387 ../../library/datetime.rst:2393 +#: ../../library/datetime.rst:2411 msgid "\\(9)" msgstr "\\(9)" -#: ../../library/datetime.rst:2359 +#: ../../library/datetime.rst:2365 msgid "``%b``" msgstr "``%b``" -#: ../../library/datetime.rst:2359 +#: ../../library/datetime.rst:2365 msgid "Month as locale's abbreviated name." msgstr "" @@ -2645,11 +2649,11 @@ msgstr "" msgid "Jan, Feb, ..., Dez (de_DE)" msgstr "" -#: ../../library/datetime.rst:2364 +#: ../../library/datetime.rst:2370 msgid "``%B``" msgstr "``%B``" -#: ../../library/datetime.rst:2364 +#: ../../library/datetime.rst:2370 msgid "Month as locale's full name." msgstr "" @@ -2661,67 +2665,67 @@ msgstr "" msgid "Januar, Februar, ..., Dezember (de_DE)" msgstr "" -#: ../../library/datetime.rst:2369 +#: ../../library/datetime.rst:2375 msgid "``%m``" msgstr "``%m``" -#: ../../library/datetime.rst:2369 +#: ../../library/datetime.rst:2375 msgid "Month as a zero-padded decimal number." msgstr "以零填充的並以十進位數字表示的月份。" -#: ../../library/datetime.rst:2369 ../../library/datetime.rst:2381 +#: ../../library/datetime.rst:2375 ../../library/datetime.rst:2387 msgid "01, 02, ..., 12" msgstr "01, 02, ..., 12" -#: ../../library/datetime.rst:2372 +#: ../../library/datetime.rst:2378 msgid "``%y``" msgstr "``%y``" -#: ../../library/datetime.rst:2372 +#: ../../library/datetime.rst:2378 msgid "Year without century as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2372 +#: ../../library/datetime.rst:2378 msgid "00, 01, ..., 99" msgstr "00, 01, ..., 99" -#: ../../library/datetime.rst:2375 +#: ../../library/datetime.rst:2381 msgid "``%Y``" msgstr "``%Y``" -#: ../../library/datetime.rst:2375 +#: ../../library/datetime.rst:2381 msgid "Year with century as a decimal number." msgstr "" -#: ../../library/datetime.rst:2375 ../../library/datetime.rst:2445 +#: ../../library/datetime.rst:2381 ../../library/datetime.rst:2451 msgid "0001, 0002, ..., 2013, 2014, ..., 9998, 9999" msgstr "0001, 0002, ..., 2013, 2014, ..., 9998, 9999" -#: ../../library/datetime.rst:2378 +#: ../../library/datetime.rst:2384 msgid "``%H``" msgstr "``%H``" -#: ../../library/datetime.rst:2378 +#: ../../library/datetime.rst:2384 msgid "Hour (24-hour clock) as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2378 +#: ../../library/datetime.rst:2384 msgid "00, 01, ..., 23" msgstr "00, 01, ..., 23" -#: ../../library/datetime.rst:2381 +#: ../../library/datetime.rst:2387 msgid "``%I``" msgstr "``%I``" -#: ../../library/datetime.rst:2381 +#: ../../library/datetime.rst:2387 msgid "Hour (12-hour clock) as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2384 +#: ../../library/datetime.rst:2390 msgid "``%p``" msgstr "``%p``" -#: ../../library/datetime.rst:2384 +#: ../../library/datetime.rst:2390 msgid "Locale's equivalent of either AM or PM." msgstr "" @@ -2733,128 +2737,128 @@ msgstr "AM, PM (en_US);" msgid "am, pm (de_DE)" msgstr "am, pm (de_DE)" -#: ../../library/datetime.rst:2384 +#: ../../library/datetime.rst:2390 msgid "\\(1), \\(3)" msgstr "\\(1), \\(3)" -#: ../../library/datetime.rst:2387 +#: ../../library/datetime.rst:2393 msgid "``%M``" msgstr "``%M``" -#: ../../library/datetime.rst:2387 +#: ../../library/datetime.rst:2393 msgid "Minute as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2387 ../../library/datetime.rst:2390 +#: ../../library/datetime.rst:2393 ../../library/datetime.rst:2396 msgid "00, 01, ..., 59" msgstr "00, 01, ..., 59" -#: ../../library/datetime.rst:2390 +#: ../../library/datetime.rst:2396 msgid "``%S``" msgstr "``%S``" -#: ../../library/datetime.rst:2390 +#: ../../library/datetime.rst:2396 msgid "Second as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2390 +#: ../../library/datetime.rst:2396 msgid "\\(4), \\(9)" msgstr "\\(4), \\(9)" -#: ../../library/datetime.rst:2393 +#: ../../library/datetime.rst:2399 msgid "``%f``" msgstr "``%f``" -#: ../../library/datetime.rst:2393 +#: ../../library/datetime.rst:2399 msgid "Microsecond as a decimal number, zero-padded to 6 digits." msgstr "" -#: ../../library/datetime.rst:2393 +#: ../../library/datetime.rst:2399 msgid "000000, 000001, ..., 999999" msgstr "000000, 000001, ..., 999999" -#: ../../library/datetime.rst:2393 +#: ../../library/datetime.rst:2399 msgid "\\(5)" msgstr "\\(5)" -#: ../../library/datetime.rst:2397 ../../library/datetime.rst:2566 +#: ../../library/datetime.rst:2403 ../../library/datetime.rst:2572 msgid "``%z``" msgstr "``%z``" -#: ../../library/datetime.rst:2397 +#: ../../library/datetime.rst:2403 msgid "" "UTC offset in the form ``±HHMM[SS[.ffffff]]`` (empty string if the object is " "naive)." msgstr "" -#: ../../library/datetime.rst:2397 +#: ../../library/datetime.rst:2403 msgid "(empty), +0000, -0400, +1030, +063415, -030712.345216" msgstr "" -#: ../../library/datetime.rst:2397 ../../library/datetime.rst:2402 -#: ../../library/datetime.rst:2459 +#: ../../library/datetime.rst:2403 ../../library/datetime.rst:2408 +#: ../../library/datetime.rst:2465 msgid "\\(6)" msgstr "\\(6)" -#: ../../library/datetime.rst:2402 ../../library/datetime.rst:2594 +#: ../../library/datetime.rst:2408 ../../library/datetime.rst:2600 msgid "``%Z``" msgstr "``%Z``" -#: ../../library/datetime.rst:2402 +#: ../../library/datetime.rst:2408 msgid "Time zone name (empty string if the object is naive)." msgstr "" -#: ../../library/datetime.rst:2402 +#: ../../library/datetime.rst:2408 msgid "(empty), UTC, GMT" msgstr "" -#: ../../library/datetime.rst:2405 +#: ../../library/datetime.rst:2411 msgid "``%j``" msgstr "``%j``" -#: ../../library/datetime.rst:2405 +#: ../../library/datetime.rst:2411 msgid "Day of the year as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2405 +#: ../../library/datetime.rst:2411 msgid "001, 002, ..., 366" msgstr "001, 002, ..., 366" -#: ../../library/datetime.rst:2408 +#: ../../library/datetime.rst:2414 msgid "``%U``" msgstr "``%U``" -#: ../../library/datetime.rst:2408 +#: ../../library/datetime.rst:2414 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:2408 ../../library/datetime.rst:2416 +#: ../../library/datetime.rst:2414 ../../library/datetime.rst:2422 msgid "00, 01, ..., 53" msgstr "00, 01, ..., 53" -#: ../../library/datetime.rst:2408 ../../library/datetime.rst:2416 +#: ../../library/datetime.rst:2414 ../../library/datetime.rst:2422 msgid "\\(7), \\(9)" msgstr "\\(7), \\(9)" -#: ../../library/datetime.rst:2416 +#: ../../library/datetime.rst:2422 msgid "``%W``" msgstr "``%W``" -#: ../../library/datetime.rst:2416 +#: ../../library/datetime.rst:2422 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:2424 +#: ../../library/datetime.rst:2430 msgid "``%c``" msgstr "``%c``" -#: ../../library/datetime.rst:2424 +#: ../../library/datetime.rst:2430 msgid "Locale's appropriate date and time representation." msgstr "" @@ -2866,11 +2870,11 @@ msgstr "" msgid "Di 16 Aug 21:30:00 1988 (de_DE)" msgstr "" -#: ../../library/datetime.rst:2429 +#: ../../library/datetime.rst:2435 msgid "``%x``" msgstr "``%x``" -#: ../../library/datetime.rst:2429 +#: ../../library/datetime.rst:2435 msgid "Locale's appropriate date representation." msgstr "" @@ -2886,11 +2890,11 @@ msgstr "" msgid "16.08.1988 (de_DE)" msgstr "" -#: ../../library/datetime.rst:2433 +#: ../../library/datetime.rst:2439 msgid "``%X``" msgstr "``%X``" -#: ../../library/datetime.rst:2433 +#: ../../library/datetime.rst:2439 msgid "Locale's appropriate time representation." msgstr "" @@ -2902,83 +2906,83 @@ msgstr "" msgid "21:30:00 (de_DE)" msgstr "" -#: ../../library/datetime.rst:2436 +#: ../../library/datetime.rst:2442 msgid "``%%``" msgstr "``%%``" -#: ../../library/datetime.rst:2436 +#: ../../library/datetime.rst:2442 msgid "A literal ``'%'`` character." msgstr "" -#: ../../library/datetime.rst:2436 +#: ../../library/datetime.rst:2442 msgid "%" msgstr "%" -#: ../../library/datetime.rst:2439 +#: ../../library/datetime.rst:2445 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:2445 +#: ../../library/datetime.rst:2451 msgid "``%G``" msgstr "``%G``" -#: ../../library/datetime.rst:2445 +#: ../../library/datetime.rst:2451 msgid "" "ISO 8601 year with century representing the year that contains the greater " "part of the ISO week (``%V``)." msgstr "" -#: ../../library/datetime.rst:2445 +#: ../../library/datetime.rst:2451 msgid "\\(8)" msgstr "\\(8)" -#: ../../library/datetime.rst:2450 +#: ../../library/datetime.rst:2456 msgid "``%u``" msgstr "``%u``" -#: ../../library/datetime.rst:2450 +#: ../../library/datetime.rst:2456 msgid "ISO 8601 weekday as a decimal number where 1 is Monday." msgstr "" -#: ../../library/datetime.rst:2450 +#: ../../library/datetime.rst:2456 msgid "1, 2, ..., 7" msgstr "1, 2, ..., 7" -#: ../../library/datetime.rst:2453 +#: ../../library/datetime.rst:2459 msgid "``%V``" msgstr "``%V``" -#: ../../library/datetime.rst:2453 +#: ../../library/datetime.rst:2459 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:2453 +#: ../../library/datetime.rst:2459 msgid "01, 02, ..., 53" msgstr "01, 02, ..., 53" -#: ../../library/datetime.rst:2453 +#: ../../library/datetime.rst:2459 msgid "\\(8), \\(9)" msgstr "\\(8), \\(9)" -#: ../../library/datetime.rst:2459 ../../library/datetime.rst:2580 +#: ../../library/datetime.rst:2465 ../../library/datetime.rst:2586 msgid "``%:z``" msgstr "``%:z``" -#: ../../library/datetime.rst:2459 +#: ../../library/datetime.rst:2465 msgid "" "UTC offset in the form ``±HH:MM[:SS[.ffffff]]`` (empty string if the object " "is naive)." msgstr "" -#: ../../library/datetime.rst:2459 +#: ../../library/datetime.rst:2465 msgid "(empty), +00:00, -04:00, +10:30, +06:34:15, -03:07:12.345216" msgstr "" -#: ../../library/datetime.rst:2465 +#: ../../library/datetime.rst:2471 msgid "" "These may not be available on all platforms when used with the :meth:" "`strftime` method. The ISO 8601 year and ISO 8601 week directives are not " @@ -2987,7 +2991,7 @@ msgid "" "a :exc:`ValueError`." msgstr "" -#: ../../library/datetime.rst:2470 +#: ../../library/datetime.rst:2476 msgid "" "The full set of format codes supported varies across platforms, because " "Python calls the platform C library's :func:`strftime` function, and " @@ -2997,37 +3001,37 @@ msgid "" "unsupported format specifiers." msgstr "" -#: ../../library/datetime.rst:2476 +#: ../../library/datetime.rst:2482 msgid "``%G``, ``%u`` and ``%V`` were added." msgstr "新增 ``%G``\\ 、\\ ``%u`` 與 ``%V``\\ 。" -#: ../../library/datetime.rst:2479 +#: ../../library/datetime.rst:2485 msgid "``%:z`` was added." msgstr "" -#: ../../library/datetime.rst:2483 +#: ../../library/datetime.rst:2489 msgid "Technical Detail" msgstr "技術細節" -#: ../../library/datetime.rst:2485 +#: ../../library/datetime.rst:2491 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:`timetuple` method." msgstr "" -#: ../../library/datetime.rst:2489 +#: ../../library/datetime.rst:2495 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:2493 +#: ../../library/datetime.rst:2499 msgid "Using ``datetime.strptime(date_string, format)`` is equivalent to::" msgstr "" -#: ../../library/datetime.rst:2497 +#: ../../library/datetime.rst:2503 msgid "" "except when the format includes sub-second components or timezone offset " "information, which are supported in ``datetime.strptime`` but are discarded " @@ -3035,7 +3039,7 @@ msgid "" msgstr "" # format code 在這份文件第一次出現的地方是 ../../library/datetime.rst:739,應該要改成在那邊註記 (format code) -#: ../../library/datetime.rst:2501 +#: ../../library/datetime.rst:2507 #, fuzzy msgid "" "For :class:`.time` objects, the format codes for year, month, and day should " @@ -3047,7 +3051,7 @@ msgstr "" "為 :class:`time` 物件並沒有這些值。如果使用這些格式碼,年份會以 ``1900`` 代" "替、月及日會以 ``1`` 代替。" -#: ../../library/datetime.rst:2505 +#: ../../library/datetime.rst:2511 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 " @@ -3056,7 +3060,7 @@ msgstr "" "對 :class:`.date` 物件來說,不應該使用時、分、秒、微秒的格式碼,因為 :class:" "`date` 物件並沒有這些值。如果使用這些格式碼,這些值都會以 ``0`` 代替。" -#: ../../library/datetime.rst:2509 +#: ../../library/datetime.rst:2515 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 " @@ -3065,7 +3069,7 @@ msgid "" "`UnicodeError` or return an empty string instead." msgstr "" -#: ../../library/datetime.rst:2518 +#: ../../library/datetime.rst:2524 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 " @@ -3073,37 +3077,37 @@ msgid "" "contain non-ASCII characters." msgstr "" -#: ../../library/datetime.rst:2524 +#: ../../library/datetime.rst:2530 msgid "" "The :meth:`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:2527 +#: ../../library/datetime.rst:2533 msgid "" "In previous versions, :meth:`strftime` method was restricted to years >= " "1900." msgstr "" -#: ../../library/datetime.rst:2531 +#: ../../library/datetime.rst:2537 msgid "" "In version 3.2, :meth:`strftime` method was restricted to years >= 1000." msgstr "" -#: ../../library/datetime.rst:2536 +#: ../../library/datetime.rst:2542 msgid "" "When used with the :meth:`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:2540 +#: ../../library/datetime.rst:2546 msgid "" "Unlike the :mod:`time` module, the :mod:`datetime` module does not support " "leap seconds." msgstr "" -#: ../../library/datetime.rst:2544 +#: ../../library/datetime.rst:2550 msgid "" "When used with the :meth:`strptime` method, the ``%f`` directive accepts " "from one to six digits and zero pads on the right. ``%f`` is an extension to " @@ -3111,17 +3115,17 @@ msgid "" "in datetime objects, and therefore always available)." msgstr "" -#: ../../library/datetime.rst:2551 +#: ../../library/datetime.rst:2557 msgid "" "For a naive object, the ``%z``, ``%:z`` and ``%Z`` format codes are replaced " "by empty strings." msgstr "" -#: ../../library/datetime.rst:2554 +#: ../../library/datetime.rst:2560 msgid "For an aware object:" msgstr "" -#: ../../library/datetime.rst:2557 +#: ../../library/datetime.rst:2563 msgid "" ":meth:`utcoffset` is transformed into a string of the form ``±HHMM[SS[." "ffffff]]``, where ``HH`` is a 2-digit string giving the number of UTC offset " @@ -3135,7 +3139,7 @@ msgid "" "``'-0330'``." msgstr "" -#: ../../library/datetime.rst:2571 +#: ../../library/datetime.rst:2577 msgid "" "When the ``%z`` directive is provided to the :meth:`strptime` method, the " "UTC offsets can have a colon as a separator between hours, minutes and " @@ -3143,53 +3147,53 @@ msgid "" "hour. In addition, providing ``'Z'`` is identical to ``'+00:00'``." msgstr "" -#: ../../library/datetime.rst:2579 +#: ../../library/datetime.rst:2585 msgid "" "Behaves exactly as ``%z``, but has a colon separator added between hours, " "minutes and seconds." msgstr "" -#: ../../library/datetime.rst:2583 +#: ../../library/datetime.rst:2589 msgid "" "In :meth:`strftime`, ``%Z`` is replaced by an empty string if :meth:`tzname` " "returns ``None``; otherwise ``%Z`` is replaced by the returned value, which " "must be a string." msgstr "" -#: ../../library/datetime.rst:2587 +#: ../../library/datetime.rst:2593 msgid ":meth:`strptime` only accepts certain values for ``%Z``:" msgstr "" -#: ../../library/datetime.rst:2589 +#: ../../library/datetime.rst:2595 msgid "any value in ``time.tzname`` for your machine's locale" msgstr "" -#: ../../library/datetime.rst:2590 +#: ../../library/datetime.rst:2596 msgid "the hard-coded values ``UTC`` and ``GMT``" msgstr "" -#: ../../library/datetime.rst:2592 +#: ../../library/datetime.rst:2598 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:2596 +#: ../../library/datetime.rst:2602 msgid "" "When the ``%z`` directive is provided to the :meth:`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:2602 +#: ../../library/datetime.rst:2608 msgid "" "When used with the :meth:`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:2607 +#: ../../library/datetime.rst:2613 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:" @@ -3197,22 +3201,22 @@ msgid "" "interchangeable." msgstr "" -#: ../../library/datetime.rst:2613 +#: ../../library/datetime.rst:2619 msgid "" "When used with the :meth:`strptime` method, the leading zero is optional " "for formats ``%d``, ``%m``, ``%H``, ``%I``, ``%M``, ``%S``, ``%j``, ``%U``, " "``%W``, and ``%V``. Format ``%y`` does require a leading zero." msgstr "" -#: ../../library/datetime.rst:2618 +#: ../../library/datetime.rst:2624 msgid "Footnotes" msgstr "註解" -#: ../../library/datetime.rst:2619 +#: ../../library/datetime.rst:2625 msgid "If, that is, we ignore the effects of Relativity" msgstr "也就是說,我們會忽略相對論的效應" -#: ../../library/datetime.rst:2621 +#: ../../library/datetime.rst:2627 msgid "" "This matches the definition of the \"proleptic Gregorian\" calendar in " "Dershowitz and Reingold's book *Calendrical Calculations*, where it's the " @@ -3221,23 +3225,23 @@ msgid "" "systems." msgstr "" -#: ../../library/datetime.rst:2627 +#: ../../library/datetime.rst:2633 msgid "" "See R. H. van Gent's `guide to the mathematics of the ISO 8601 calendar " "`_ for a good explanation." msgstr "" -#: ../../library/datetime.rst:2631 +#: ../../library/datetime.rst:2637 msgid "" "Passing ``datetime.strptime('Feb 29', '%b %d')`` will fail since ``1900`` is " "not a leap year." msgstr "" -#: ../../library/datetime.rst:2293 +#: ../../library/datetime.rst:2297 msgid "% (percent)" msgstr "% (百分號)" -#: ../../library/datetime.rst:2293 +#: ../../library/datetime.rst:2297 msgid "datetime format" msgstr "datetime format(日期時間格式)" diff --git a/library/enum.po b/library/enum.po index 3c8abf841a..84d1026bc1 100644 --- a/library/enum.po +++ b/library/enum.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-08-23 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:01+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -417,43 +417,47 @@ msgstr "" msgid "Returns each member in *cls* in reverse definition order::" msgstr "" -#: ../../library/enum.rst:247 -msgid "*Enum* is the base class for all *enum* enumerations." +#: ../../library/enum.rst:246 +msgid "Before 3.11 ``enum`` used ``EnumMeta`` type, which is kept as an alias." msgstr "" #: ../../library/enum.rst:251 +msgid "*Enum* is the base class for all *enum* enumerations." +msgstr "" + +#: ../../library/enum.rst:255 msgid "The name used to define the ``Enum`` member::" msgstr "" -#: ../../library/enum.rst:258 +#: ../../library/enum.rst:262 msgid "The value given to the ``Enum`` member::" msgstr "" -#: ../../library/enum.rst:263 +#: ../../library/enum.rst:267 msgid "Enum member values" msgstr "" -#: ../../library/enum.rst:265 +#: ../../library/enum.rst:269 msgid "" "Member values can be anything: :class:`int`, :class:`str`, etc. If the " "exact value is unimportant you may use :class:`auto` instances and an " "appropriate value will be chosen for you. See :class:`auto` for the details." msgstr "" -#: ../../library/enum.rst:272 +#: ../../library/enum.rst:276 msgid "" "``_ignore_`` is only used during creation and is removed from the " "enumeration once creation is complete." msgstr "" -#: ../../library/enum.rst:275 +#: ../../library/enum.rst:279 msgid "" "``_ignore_`` is a list of names that will not become members, and whose " "names will also be removed from the completed enumeration. See :ref:" "`TimePeriod ` for an example." msgstr "" -#: ../../library/enum.rst:281 +#: ../../library/enum.rst:285 msgid "" "Returns ``['__class__', '__doc__', '__module__', 'name', 'value']`` and any " "public methods defined on *self.__class__*::" @@ -463,11 +467,11 @@ msgstr "" msgid "name" msgstr "" -#: ../../library/enum.rst:302 +#: ../../library/enum.rst:306 msgid "The name of the member being defined (e.g. 'RED')." msgstr "" -#: ../../library/enum.rst:303 +#: ../../library/enum.rst:307 msgid "The start value for the Enum; the default is 1." msgstr "" @@ -475,7 +479,7 @@ msgstr "" msgid "count" msgstr "" -#: ../../library/enum.rst:304 +#: ../../library/enum.rst:308 msgid "The number of members currently defined, not including this one." msgstr "" @@ -483,57 +487,57 @@ msgstr "" msgid "last_values" msgstr "" -#: ../../library/enum.rst:305 +#: ../../library/enum.rst:309 msgid "A list of the previous values." msgstr "" -#: ../../library/enum.rst:307 +#: ../../library/enum.rst:311 msgid "" "A *staticmethod* that is used to determine the next value returned by :class:" "`auto`::" msgstr "" -#: ../../library/enum.rst:323 +#: ../../library/enum.rst:327 msgid "" "A *classmethod* that is used to further configure subsequent subclasses. By " "default, does nothing." msgstr "" -#: ../../library/enum.rst:328 +#: ../../library/enum.rst:332 msgid "" "A *classmethod* for looking up values not found in *cls*. By default it " "does nothing, but can be overridden to implement custom search behavior::" msgstr "" -#: ../../library/enum.rst:350 +#: ../../library/enum.rst:354 msgid "" "Returns the string used for *repr()* calls. By default, returns the *Enum* " "name, member name, and value, but can be overridden::" msgstr "" -#: ../../library/enum.rst:366 +#: ../../library/enum.rst:370 msgid "" "Returns the string used for *str()* calls. By default, returns the *Enum* " "name and member name, but can be overridden::" msgstr "" -#: ../../library/enum.rst:381 +#: ../../library/enum.rst:385 msgid "" "Returns the string used for *format()* and *f-string* calls. By default, " "returns :meth:`__str__` return value, but can be overridden::" msgstr "" -#: ../../library/enum.rst:396 +#: ../../library/enum.rst:400 msgid "" "Using :class:`auto` with :class:`Enum` results in integers of increasing " "value, starting with ``1``." msgstr "" -#: ../../library/enum.rst:399 +#: ../../library/enum.rst:403 msgid "Added :ref:`enum-dataclass-support`" msgstr "新增 :ref:`enum-dataclass-support`" -#: ../../library/enum.rst:404 +#: ../../library/enum.rst:408 msgid "" "*IntEnum* is the same as *Enum*, but its members are also integers and can " "be used anywhere that an integer can be used. If any integer operation is " @@ -541,20 +545,20 @@ msgid "" "enumeration status." msgstr "" -#: ../../library/enum.rst:425 +#: ../../library/enum.rst:429 msgid "" "Using :class:`auto` with :class:`IntEnum` results in integers of increasing " "value, starting with ``1``." msgstr "" -#: ../../library/enum.rst:428 +#: ../../library/enum.rst:432 msgid "" ":meth:`~object.__str__` is now :meth:`!int.__str__` to better support the " "*replacement of existing constants* use-case. :meth:`~object.__format__` was " "already :meth:`!int.__format__` for that same reason." msgstr "" -#: ../../library/enum.rst:435 +#: ../../library/enum.rst:439 msgid "" "*StrEnum* is the same as *Enum*, but its members are also strings and can be " "used in most of the same places that a string can be used. The result of " @@ -562,7 +566,7 @@ msgid "" "the enumeration." msgstr "" -#: ../../library/enum.rst:441 +#: ../../library/enum.rst:445 msgid "" "There are places in the stdlib that check for an exact :class:`str` instead " "of a :class:`str` subclass (i.e. ``type(unknown) == str`` instead of " @@ -570,285 +574,285 @@ msgid "" "``str(StrEnum.member)``." msgstr "" -#: ../../library/enum.rst:448 +#: ../../library/enum.rst:452 msgid "" "Using :class:`auto` with :class:`StrEnum` results in the lower-cased member " "name as the value." msgstr "" -#: ../../library/enum.rst:453 +#: ../../library/enum.rst:457 msgid "" ":meth:`~object.__str__` is :meth:`!str.__str__` to better support the " "*replacement of existing constants* use-case. :meth:`~object.__format__` is " "likewise :meth:`!str.__format__` for that same reason." msgstr "" -#: ../../library/enum.rst:461 +#: ../../library/enum.rst:465 msgid "" "*Flag* members support the bitwise operators ``&`` (*AND*), ``|`` (*OR*), " "``^`` (*XOR*), and ``~`` (*INVERT*); the results of those operators are " "members of the enumeration." msgstr "" -#: ../../library/enum.rst:467 +#: ../../library/enum.rst:471 msgid "Returns *True* if value is in self::" msgstr "" -#: ../../library/enum.rst:488 +#: ../../library/enum.rst:492 msgid "Returns all contained non-alias members::" msgstr "" -#: ../../library/enum.rst:497 +#: ../../library/enum.rst:501 msgid "Aliases are no longer returned during iteration." msgstr "" -#: ../../library/enum.rst:501 +#: ../../library/enum.rst:505 msgid "Returns number of members in flag::" msgstr "" -#: ../../library/enum.rst:510 +#: ../../library/enum.rst:514 msgid "Returns *True* if any members in flag, *False* otherwise::" msgstr "" -#: ../../library/enum.rst:522 +#: ../../library/enum.rst:526 msgid "Returns current flag binary or'ed with other::" msgstr "" -#: ../../library/enum.rst:529 +#: ../../library/enum.rst:533 msgid "Returns current flag binary and'ed with other::" msgstr "" -#: ../../library/enum.rst:538 +#: ../../library/enum.rst:542 msgid "Returns current flag binary xor'ed with other::" msgstr "" -#: ../../library/enum.rst:547 +#: ../../library/enum.rst:551 msgid "Returns all the flags in *type(self)* that are not in self::" msgstr "" -#: ../../library/enum.rst:558 +#: ../../library/enum.rst:562 msgid "" "Function used to format any remaining unnamed numeric values. Default is " "the value's repr; common choices are :func:`hex` and :func:`oct`." msgstr "" -#: ../../library/enum.rst:563 +#: ../../library/enum.rst:567 msgid "" "Using :class:`auto` with :class:`Flag` results in integers that are powers " "of two, starting with ``1``." msgstr "" -#: ../../library/enum.rst:566 +#: ../../library/enum.rst:570 msgid "The *repr()* of zero-valued flags has changed. It is now::" msgstr "" -#: ../../library/enum.rst:574 +#: ../../library/enum.rst:578 msgid "" "*IntFlag* is the same as *Flag*, but its members are also integers and can " "be used anywhere that an integer can be used." msgstr "" -#: ../../library/enum.rst:588 +#: ../../library/enum.rst:592 msgid "" "If any integer operation is performed with an *IntFlag* member, the result " "is not an *IntFlag*::" msgstr "" -#: ../../library/enum.rst:594 +#: ../../library/enum.rst:598 msgid "If a *Flag* operation is performed with an *IntFlag* member and:" msgstr "" -#: ../../library/enum.rst:596 +#: ../../library/enum.rst:600 msgid "the result is a valid *IntFlag*: an *IntFlag* is returned" msgstr "" -#: ../../library/enum.rst:597 +#: ../../library/enum.rst:601 msgid "" "the result is not a valid *IntFlag*: the result depends on the " "*FlagBoundary* setting" msgstr "" -#: ../../library/enum.rst:599 +#: ../../library/enum.rst:603 msgid "The *repr()* of unnamed zero-valued flags has changed. It is now:" msgstr "" -#: ../../library/enum.rst:606 +#: ../../library/enum.rst:610 msgid "" "Using :class:`auto` with :class:`IntFlag` results in integers that are " "powers of two, starting with ``1``." msgstr "" -#: ../../library/enum.rst:611 +#: ../../library/enum.rst:615 msgid "" ":meth:`~object.__str__` is now :meth:`!int.__str__` to better support the " "*replacement of existing constants* use-case. :meth:`~object.__format__` " "was already :meth:`!int.__format__` for that same reason." msgstr "" -#: ../../library/enum.rst:615 +#: ../../library/enum.rst:619 msgid "" "Inversion of an :class:`!IntFlag` now returns a positive value that is the " "union of all flags not in the given flag, rather than a negative value. This " "matches the existing :class:`Flag` behavior." msgstr "" -#: ../../library/enum.rst:621 +#: ../../library/enum.rst:625 msgid "" ":class:`!ReprEnum` uses the :meth:`repr() ` of :class:`Enum`, " "but the :class:`str() ` of the mixed-in data type:" msgstr "" -#: ../../library/enum.rst:624 +#: ../../library/enum.rst:628 msgid ":meth:`!int.__str__` for :class:`IntEnum` and :class:`IntFlag`" msgstr "" -#: ../../library/enum.rst:625 +#: ../../library/enum.rst:629 msgid ":meth:`!str.__str__` for :class:`StrEnum`" msgstr "" -#: ../../library/enum.rst:627 +#: ../../library/enum.rst:631 msgid "" "Inherit from :class:`!ReprEnum` to keep the :class:`str() ` / :func:" "`format` of the mixed-in data type instead of using the :class:`Enum`-" "default :meth:`str() `." msgstr "" -#: ../../library/enum.rst:636 +#: ../../library/enum.rst:640 msgid "" "*EnumCheck* contains the options used by the :func:`verify` decorator to " "ensure various constraints; failed constraints result in a :exc:`ValueError`." msgstr "" -#: ../../library/enum.rst:641 +#: ../../library/enum.rst:645 msgid "Ensure that each value has only one name::" msgstr "" -#: ../../library/enum.rst:657 +#: ../../library/enum.rst:661 msgid "" "Ensure that there are no missing values between the lowest-valued member and " "the highest-valued member::" msgstr "" -#: ../../library/enum.rst:672 +#: ../../library/enum.rst:676 msgid "" "Ensure that any flag groups/masks contain only named flags -- useful when " "values are specified instead of being generated by :func:`auto`::" msgstr "" -#: ../../library/enum.rst:689 +#: ../../library/enum.rst:693 msgid "" "CONTINUOUS and NAMED_FLAGS are designed to work with integer-valued members." msgstr "" -#: ../../library/enum.rst:695 +#: ../../library/enum.rst:699 msgid "" "*FlagBoundary* controls how out-of-range values are handled in *Flag* and " "its subclasses." msgstr "" -#: ../../library/enum.rst:700 +#: ../../library/enum.rst:704 msgid "" "Out-of-range values cause a :exc:`ValueError` to be raised. This is the " "default for :class:`Flag`::" msgstr "" -#: ../../library/enum.rst:718 +#: ../../library/enum.rst:722 msgid "" "Out-of-range values have invalid values removed, leaving a valid *Flag* " "value::" msgstr "" -#: ../../library/enum.rst:732 +#: ../../library/enum.rst:736 msgid "" "Out-of-range values lose their *Flag* membership and revert to :class:`int`." msgstr "" -#: ../../library/enum.rst:745 +#: ../../library/enum.rst:749 msgid "" "Out-of-range values are kept, and the *Flag* membership is kept. This is the " "default for :class:`IntFlag`::" msgstr "" -#: ../../library/enum.rst:762 +#: ../../library/enum.rst:766 msgid "Supported ``__dunder__`` names" msgstr "" -#: ../../library/enum.rst:764 +#: ../../library/enum.rst:768 msgid "" ":attr:`~EnumType.__members__` is a read-only ordered mapping of " "``member_name``:``member`` items. It is only available on the class." msgstr "" -#: ../../library/enum.rst:767 +#: ../../library/enum.rst:771 msgid "" ":meth:`~object.__new__`, if specified, must create and return the enum " "members; it is also a very good idea to set the member's :attr:`!_value_` " "appropriately. Once all the members are created it is no longer used." msgstr "" -#: ../../library/enum.rst:773 +#: ../../library/enum.rst:777 msgid "Supported ``_sunder_`` names" msgstr "" -#: ../../library/enum.rst:775 +#: ../../library/enum.rst:779 msgid "``_name_`` -- name of the member" msgstr "" -#: ../../library/enum.rst:776 +#: ../../library/enum.rst:780 msgid "" "``_value_`` -- value of the member; can be set / modified in ``__new__``" msgstr "" -#: ../../library/enum.rst:778 +#: ../../library/enum.rst:782 msgid "" "``_missing_`` -- a lookup function used when a value is not found; may be " "overridden" msgstr "" -#: ../../library/enum.rst:780 +#: ../../library/enum.rst:784 msgid "" "``_ignore_`` -- a list of names, either as a :class:`list` or a :class:" "`str`, that will not be transformed into members, and will be removed from " "the final class" msgstr "" -#: ../../library/enum.rst:783 +#: ../../library/enum.rst:787 msgid "" "``_order_`` -- used in Python 2/3 code to ensure member order is consistent " "(class attribute, removed during class creation)" msgstr "" -#: ../../library/enum.rst:785 +#: ../../library/enum.rst:789 msgid "" "``_generate_next_value_`` -- used to get an appropriate value for an enum " "member; may be overridden" msgstr "" -#: ../../library/enum.rst:790 +#: ../../library/enum.rst:794 msgid "" "For standard :class:`Enum` classes the next value chosen is the last value " "seen incremented by one." msgstr "" -#: ../../library/enum.rst:793 +#: ../../library/enum.rst:797 msgid "" "For :class:`Flag` classes the next value chosen will be the next highest " "power-of-two, regardless of the last value seen." msgstr "" -#: ../../library/enum.rst:796 +#: ../../library/enum.rst:800 msgid "``_missing_``, ``_order_``, ``_generate_next_value_``" msgstr "``_missing_``\\ 、\\ ``_order_``\\ 、\\ ``_generate_next_value_``" -#: ../../library/enum.rst:797 +#: ../../library/enum.rst:801 msgid "``_ignore_``" msgstr "``_ignore_``" -#: ../../library/enum.rst:802 +#: ../../library/enum.rst:806 msgid "Utilities and Decorators" msgstr "" -#: ../../library/enum.rst:806 +#: ../../library/enum.rst:810 msgid "" "*auto* can be used in place of a value. If used, the *Enum* machinery will " "call an *Enum*'s :meth:`~Enum._generate_next_value_` to get an appropriate " @@ -859,58 +863,58 @@ msgid "" "manually specified values." msgstr "" -#: ../../library/enum.rst:814 +#: ../../library/enum.rst:818 msgid "" "*auto* instances are only resolved when at the top level of an assignment:" msgstr "" -#: ../../library/enum.rst:816 +#: ../../library/enum.rst:820 msgid "``FIRST = auto()`` will work (auto() is replaced with ``1``);" msgstr "" -#: ../../library/enum.rst:817 +#: ../../library/enum.rst:821 msgid "" "``SECOND = auto(), -2`` will work (auto is replaced with ``2``, so ``2, -2`` " "is" msgstr "" -#: ../../library/enum.rst:818 +#: ../../library/enum.rst:822 msgid "used to create the ``SECOND`` enum member;" msgstr "" -#: ../../library/enum.rst:819 +#: ../../library/enum.rst:823 msgid "" "``THREE = [auto(), -3]`` will *not* work (``, -3`` is used to " "create the ``THREE`` enum member)" msgstr "" -#: ../../library/enum.rst:824 +#: ../../library/enum.rst:828 msgid "" "In prior versions, ``auto()`` had to be the only thing on the assignment " "line to work properly." msgstr "" -#: ../../library/enum.rst:827 +#: ../../library/enum.rst:831 msgid "" "``_generate_next_value_`` can be overridden to customize the values used by " "*auto*." msgstr "" -#: ../../library/enum.rst:830 +#: ../../library/enum.rst:834 msgid "" "in 3.13 the default ``_generate_next_value_`` will always return the highest " "member value incremented by 1, and will fail if any member is an " "incompatible type." msgstr "" -#: ../../library/enum.rst:836 +#: ../../library/enum.rst:840 msgid "" "A decorator similar to the built-in *property*, but specifically for " "enumerations. It allows member attributes to have the same names as members " "themselves." msgstr "" -#: ../../library/enum.rst:840 +#: ../../library/enum.rst:844 msgid "" "the *property* and the member must be defined in separate classes; for " "example, the *value* and *name* attributes are defined in the *Enum* class, " @@ -918,29 +922,29 @@ msgid "" "``name``." msgstr "" -#: ../../library/enum.rst:849 +#: ../../library/enum.rst:853 msgid "" "A :keyword:`class` decorator specifically for enumerations. It searches an " "enumeration's :attr:`~EnumType.__members__`, gathering any aliases it finds; " "if any are found :exc:`ValueError` is raised with the details::" msgstr "" -#: ../../library/enum.rst:867 +#: ../../library/enum.rst:871 msgid "" "A :keyword:`class` decorator specifically for enumerations. Members from :" "class:`EnumCheck` are used to specify which constraints should be checked on " "the decorated enumeration." msgstr "" -#: ../../library/enum.rst:875 +#: ../../library/enum.rst:879 msgid "A decorator for use in enums: its target will become a member." msgstr "" -#: ../../library/enum.rst:881 +#: ../../library/enum.rst:885 msgid "A decorator for use in enums: its target will not become a member." msgstr "" -#: ../../library/enum.rst:887 +#: ../../library/enum.rst:891 msgid "" "A decorator to change the :class:`str() ` and :func:`repr` of an enum " "to show its members as belonging to the module instead of its class. Should " @@ -948,41 +952,41 @@ msgid "" "namespace (see :class:`re.RegexFlag` for an example)." msgstr "" -#: ../../library/enum.rst:897 +#: ../../library/enum.rst:901 msgid "Return a list of all power-of-two integers contained in a flag *value*." msgstr "" -#: ../../library/enum.rst:904 +#: ../../library/enum.rst:908 msgid "Notes" msgstr "" -#: ../../library/enum.rst:906 +#: ../../library/enum.rst:910 msgid ":class:`IntEnum`, :class:`StrEnum`, and :class:`IntFlag`" msgstr "" -#: ../../library/enum.rst:908 +#: ../../library/enum.rst:912 msgid "" "These three enum types are designed to be drop-in replacements for existing " "integer- and string-based values; as such, they have extra limitations:" msgstr "" -#: ../../library/enum.rst:911 +#: ../../library/enum.rst:915 msgid "``__str__`` uses the value and not the name of the enum member" msgstr "" -#: ../../library/enum.rst:913 +#: ../../library/enum.rst:917 msgid "" "``__format__``, because it uses ``__str__``, will also use the value of the " "enum member instead of its name" msgstr "" -#: ../../library/enum.rst:916 +#: ../../library/enum.rst:920 msgid "" "If you do not need/want those limitations, you can either create your own " "base class by mixing in the ``int`` or ``str`` type yourself::" msgstr "" -#: ../../library/enum.rst:923 +#: ../../library/enum.rst:927 msgid "or you can reassign the appropriate :meth:`str`, etc., in your enum::" msgstr "" diff --git a/library/errno.po b/library/errno.po index 31b37592c1..c4eacd920d 100644 --- a/library/errno.po +++ b/library/errno.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:17+0000\n" +"POT-Creation-Date: 2023-08-27 18:15+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-" @@ -452,137 +452,153 @@ msgid "Operation not supported on transport endpoint" msgstr "" #: ../../library/errno.rst:516 +msgid "Operation not supported" +msgstr "" + +#: ../../library/errno.rst:523 msgid "Protocol family not supported" msgstr "" -#: ../../library/errno.rst:521 +#: ../../library/errno.rst:528 msgid "Address family not supported by protocol" msgstr "" -#: ../../library/errno.rst:526 +#: ../../library/errno.rst:533 msgid "Address already in use" msgstr "" -#: ../../library/errno.rst:531 +#: ../../library/errno.rst:538 msgid "Cannot assign requested address" msgstr "" -#: ../../library/errno.rst:536 +#: ../../library/errno.rst:543 msgid "Network is down" msgstr "" -#: ../../library/errno.rst:541 +#: ../../library/errno.rst:548 msgid "Network is unreachable" msgstr "" -#: ../../library/errno.rst:546 +#: ../../library/errno.rst:553 msgid "Network dropped connection because of reset" msgstr "" -#: ../../library/errno.rst:551 +#: ../../library/errno.rst:558 msgid "" "Software caused connection abort. This error is mapped to the exception :exc:" "`ConnectionAbortedError`." msgstr "" -#: ../../library/errno.rst:557 +#: ../../library/errno.rst:564 msgid "" "Connection reset by peer. This error is mapped to the exception :exc:" "`ConnectionResetError`." msgstr "" -#: ../../library/errno.rst:563 +#: ../../library/errno.rst:570 msgid "No buffer space available" msgstr "" -#: ../../library/errno.rst:568 +#: ../../library/errno.rst:575 msgid "Transport endpoint is already connected" msgstr "" -#: ../../library/errno.rst:573 +#: ../../library/errno.rst:580 msgid "Transport endpoint is not connected" msgstr "" -#: ../../library/errno.rst:578 +#: ../../library/errno.rst:585 msgid "" "Cannot send after transport endpoint shutdown. This error is mapped to the " "exception :exc:`BrokenPipeError`." msgstr "" -#: ../../library/errno.rst:584 +#: ../../library/errno.rst:591 msgid "Too many references: cannot splice" msgstr "" -#: ../../library/errno.rst:589 +#: ../../library/errno.rst:596 msgid "" "Connection timed out. This error is mapped to the exception :exc:" "`TimeoutError`." msgstr "" -#: ../../library/errno.rst:595 +#: ../../library/errno.rst:602 msgid "" "Connection refused. This error is mapped to the exception :exc:" "`ConnectionRefusedError`." msgstr "" -#: ../../library/errno.rst:601 +#: ../../library/errno.rst:608 msgid "Host is down" msgstr "" -#: ../../library/errno.rst:606 +#: ../../library/errno.rst:613 msgid "No route to host" msgstr "" -#: ../../library/errno.rst:611 +#: ../../library/errno.rst:618 msgid "" "Operation already in progress. This error is mapped to the exception :exc:" "`BlockingIOError`." msgstr "" -#: ../../library/errno.rst:617 +#: ../../library/errno.rst:624 msgid "" "Operation now in progress. This error is mapped to the exception :exc:" "`BlockingIOError`." msgstr "" -#: ../../library/errno.rst:623 +#: ../../library/errno.rst:630 msgid "Stale NFS file handle" msgstr "" -#: ../../library/errno.rst:628 +#: ../../library/errno.rst:635 msgid "Structure needs cleaning" msgstr "" -#: ../../library/errno.rst:633 +#: ../../library/errno.rst:640 msgid "Not a XENIX named type file" msgstr "" -#: ../../library/errno.rst:638 +#: ../../library/errno.rst:645 msgid "No XENIX semaphores available" msgstr "" -#: ../../library/errno.rst:643 +#: ../../library/errno.rst:650 msgid "Is a named type file" msgstr "" -#: ../../library/errno.rst:648 +#: ../../library/errno.rst:655 msgid "Remote I/O error" msgstr "" -#: ../../library/errno.rst:653 +#: ../../library/errno.rst:660 msgid "Quota exceeded" msgstr "" -#: ../../library/errno.rst:657 +#: ../../library/errno.rst:664 msgid "Interface output queue is full" msgstr "" -#: ../../library/errno.rst:663 +#: ../../library/errno.rst:670 msgid "" "Capabilities insufficient. This error is mapped to the exception :exc:" "`PermissionError`." msgstr "" -#: ../../library/errno.rst:666 +#: ../../library/errno.rst:673 msgid ":ref:`Availability `: WASI, FreeBSD" msgstr ":ref:`適用 `:WASI, FreeBSD" + +#: ../../library/errno.rst:680 +msgid "Operation canceled" +msgstr "" + +#: ../../library/errno.rst:687 +msgid "Owner died" +msgstr "" + +#: ../../library/errno.rst:694 +msgid "State not recoverable" +msgstr "" diff --git a/library/io.po b/library/io.po index c203f3ad5a..4c42b73fc0 100644 --- a/library/io.po +++ b/library/io.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-18 18:13+0000\n" +"POT-Creation-Date: 2023-08-23 00:03+0000\n" "PO-Revision-Date: 2023-08-01 12:20+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -77,7 +77,7 @@ msgstr "" "原本會引發 :exc:`IOError` 的操作,現在將改成引發 :exc:`OSError`。因為 :exc:" "`IOError` 現在是 :exc:`OSError` 的別名。" -#: ../../library/io.rst:51 ../../library/io.rst:856 ../../library/io.rst:1123 +#: ../../library/io.rst:51 ../../library/io.rst:856 ../../library/io.rst:1139 msgid "Text I/O" msgstr "文字 I/O" @@ -115,7 +115,7 @@ msgid "" "`TextIOBase`." msgstr "文字資料串流 API 的詳細說明在 :class:`TextIOBase` 文件當中。" -#: ../../library/io.rst:72 ../../library/io.rst:1111 +#: ../../library/io.rst:72 ../../library/io.rst:1127 msgid "Binary I/O" msgstr "二進位 (Binary) I/O" @@ -1493,18 +1493,50 @@ msgstr "" msgid "The method supports ``encoding=\"locale\"`` option." msgstr "" -#: ../../library/io.rst:1050 +#: ../../library/io.rst:1049 +msgid "" +"Set the stream position. Return the new stream position as an :class:`int`." +msgstr "" + +#: ../../library/io.rst:1052 +msgid "" +"Four operations are supported, given by the following argument combinations:" +msgstr "" + +#: ../../library/io.rst:1055 +msgid "``seek(0, SEEK_SET)``: Rewind to the start of the stream." +msgstr "" + +#: ../../library/io.rst:1056 +msgid "" +"``seek(cookie, SEEK_SET)``: Restore a previous position; *cookie* **must " +"be** a number returned by :meth:`!tell`." +msgstr "" + +#: ../../library/io.rst:1058 +msgid "``seek(0, SEEK_END)``: Fast-forward to the end of the stream." +msgstr "" + +#: ../../library/io.rst:1059 +msgid "``seek(0, SEEK_CUR)``: Leave the current stream position unchanged." +msgstr "" + +#: ../../library/io.rst:1061 +msgid "Any other argument combinations are invalid, and may raise exceptions." +msgstr "" + +#: ../../library/io.rst:1066 msgid "" "A text stream using an in-memory text buffer. It inherits :class:" "`TextIOBase`." msgstr "" -#: ../../library/io.rst:1053 +#: ../../library/io.rst:1069 msgid "" "The text buffer is discarded when the :meth:`~IOBase.close` method is called." msgstr "" -#: ../../library/io.rst:1056 +#: ../../library/io.rst:1072 msgid "" "The initial value of the buffer can be set by providing *initial_value*. If " "newline translation is enabled, newlines will be encoded as if by :meth:" @@ -1516,50 +1548,50 @@ msgid "" "at the end of the buffer." msgstr "" -#: ../../library/io.rst:1065 +#: ../../library/io.rst:1081 msgid "" "The *newline* argument works like that of :class:`TextIOWrapper`, except " "that when writing output to the stream, if *newline* is ``None``, newlines " "are written as ``\\n`` on all platforms." msgstr "" -#: ../../library/io.rst:1069 +#: ../../library/io.rst:1085 msgid "" ":class:`StringIO` provides this method in addition to those from :class:" "`TextIOBase` and :class:`IOBase`:" msgstr "" -#: ../../library/io.rst:1074 +#: ../../library/io.rst:1090 msgid "" "Return a :class:`str` containing the entire contents of the buffer. Newlines " "are decoded as if by :meth:`~TextIOBase.read`, although the stream position " "is not changed." msgstr "" -#: ../../library/io.rst:1078 +#: ../../library/io.rst:1094 msgid "Example usage::" msgstr "" "使用範例:\n" "\n" "::" -#: ../../library/io.rst:1100 +#: ../../library/io.rst:1116 msgid "" "A helper codec that decodes newlines for :term:`universal newlines` mode. It " "inherits :class:`codecs.IncrementalDecoder`." msgstr "" -#: ../../library/io.rst:1105 +#: ../../library/io.rst:1121 msgid "Performance" msgstr "" -#: ../../library/io.rst:1107 +#: ../../library/io.rst:1123 msgid "" "This section discusses the performance of the provided concrete I/O " "implementations." msgstr "" -#: ../../library/io.rst:1113 +#: ../../library/io.rst:1129 msgid "" "By reading and writing only large chunks of data even when the user asks for " "a single byte, buffered I/O hides any inefficiency in calling and executing " @@ -1572,7 +1604,7 @@ msgid "" "data." msgstr "" -#: ../../library/io.rst:1125 +#: ../../library/io.rst:1141 msgid "" "Text I/O over a binary storage (such as a file) is significantly slower than " "binary I/O over the same storage, because it requires conversions between " @@ -1582,24 +1614,24 @@ msgid "" "the reconstruction algorithm used." msgstr "" -#: ../../library/io.rst:1132 +#: ../../library/io.rst:1148 msgid "" ":class:`StringIO`, however, is a native in-memory unicode container and will " "exhibit similar speed to :class:`BytesIO`." msgstr "" -#: ../../library/io.rst:1136 +#: ../../library/io.rst:1152 msgid "Multi-threading" msgstr "" -#: ../../library/io.rst:1138 +#: ../../library/io.rst:1154 msgid "" ":class:`FileIO` objects are thread-safe to the extent that the operating " "system calls (such as :manpage:`read(2)` under Unix) they wrap are thread-" "safe too." msgstr "" -#: ../../library/io.rst:1141 +#: ../../library/io.rst:1157 msgid "" "Binary buffered objects (instances of :class:`BufferedReader`, :class:" "`BufferedWriter`, :class:`BufferedRandom` and :class:`BufferedRWPair`) " @@ -1607,15 +1639,15 @@ msgid "" "them from multiple threads at once." msgstr "" -#: ../../library/io.rst:1146 +#: ../../library/io.rst:1162 msgid ":class:`TextIOWrapper` objects are not thread-safe." msgstr "" -#: ../../library/io.rst:1149 +#: ../../library/io.rst:1165 msgid "Reentrancy" msgstr "" -#: ../../library/io.rst:1151 +#: ../../library/io.rst:1167 msgid "" "Binary buffered objects (instances of :class:`BufferedReader`, :class:" "`BufferedWriter`, :class:`BufferedRandom` and :class:`BufferedRWPair`) are " @@ -1626,7 +1658,7 @@ msgid "" "from entering the buffered object." msgstr "" -#: ../../library/io.rst:1159 +#: ../../library/io.rst:1175 msgid "" "The above implicitly extends to text files, since the :func:`open()` " "function will wrap a buffered object inside a :class:`TextIOWrapper`. This " @@ -1642,7 +1674,7 @@ msgstr "file object(檔案物件)" msgid "io module" msgstr "io 模組" -#: ../../library/io.rst:971 ../../library/io.rst:1095 +#: ../../library/io.rst:971 ../../library/io.rst:1111 msgid "universal newlines" msgstr "universal newlines" @@ -1650,6 +1682,6 @@ msgstr "universal newlines" msgid "io.TextIOWrapper class" msgstr "io.TextIOWrapper 類別" -#: ../../library/io.rst:1095 +#: ../../library/io.rst:1111 msgid "io.IncrementalNewlineDecoder class" msgstr "io.IncrementalNewlineDecoder 類別" diff --git a/library/logging.po b/library/logging.po index 48729d0e13..f2ebe0de95 100644 --- a/library/logging.po +++ b/library/logging.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-14 13:46+0000\n" +"POT-Creation-Date: 2023-08-22 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -278,7 +278,7 @@ msgid "" "information." msgstr "" -#: ../../library/logging.rst:201 ../../library/logging.rst:1106 +#: ../../library/logging.rst:201 ../../library/logging.rst:1116 msgid "" "The second optional keyword argument is *stack_info*, which defaults to " "``False``. If true, stack information is added to the logging message, " @@ -290,14 +290,14 @@ msgid "" "handlers." msgstr "" -#: ../../library/logging.rst:210 ../../library/logging.rst:1115 +#: ../../library/logging.rst:210 ../../library/logging.rst:1125 msgid "" "You can specify *stack_info* independently of *exc_info*, e.g. to just show " "how you got to a certain point in your code, even when no exceptions were " "raised. The stack frames are printed following a header line which says:" msgstr "" -#: ../../library/logging.rst:218 ../../library/logging.rst:1123 +#: ../../library/logging.rst:218 ../../library/logging.rst:1133 msgid "" "This mimics the ``Traceback (most recent call last):`` which is used when " "displaying exception frames." @@ -346,7 +346,7 @@ msgid "" "dictionary with these keys." msgstr "" -#: ../../library/logging.rst:258 ../../library/logging.rst:1154 +#: ../../library/logging.rst:258 ../../library/logging.rst:1164 msgid "" "While this might be annoying, this feature is intended for use in " "specialized circumstances, such as multi-threaded servers where the same " @@ -364,7 +364,7 @@ msgid "" "will be sent to the handler set on :attr:`lastResort`." msgstr "" -#: ../../library/logging.rst:269 ../../library/logging.rst:1165 +#: ../../library/logging.rst:269 ../../library/logging.rst:1175 msgid "The *stack_info* parameter was added." msgstr "新增 *stack_info* 參數。" @@ -584,7 +584,7 @@ msgstr "" msgid "" "Handlers have the following attributes and methods. Note that :class:" "`Handler` is never instantiated directly; this class acts as a base for more " -"useful subclasses. However, the :meth:`__init__` method in subclasses needs " +"useful subclasses. However, the :meth:`!__init__` method in subclasses needs " "to call :meth:`Handler.__init__`." msgstr "" @@ -1119,11 +1119,11 @@ msgstr "" msgid "Attribute name" msgstr "" -#: ../../library/logging.rst:915 ../../library/logging.rst:1323 +#: ../../library/logging.rst:915 ../../library/logging.rst:1333 msgid "Format" msgstr "格式" -#: ../../library/logging.rst:915 ../../library/logging.rst:1323 +#: ../../library/logging.rst:915 ../../library/logging.rst:1333 msgid "Description" msgstr "描述" @@ -1441,7 +1441,15 @@ msgid "" "(possibly modified) versions of the arguments passed in." msgstr "" -#: ../../library/logging.rst:1018 +#: ../../library/logging.rst:1020 +msgid "Delegates to the underlying :attr:`!manager`` on *logger*." +msgstr "" + +#: ../../library/logging.rst:1024 +msgid "Delegates to the underlying :meth:`!_log`` method on *logger*." +msgstr "" + +#: ../../library/logging.rst:1026 msgid "" "In addition to the above, :class:`LoggerAdapter` supports the following " "methods of :class:`Logger`: :meth:`~Logger.debug`, :meth:`~Logger.info`, :" @@ -1453,24 +1461,24 @@ msgid "" "interchangeably." msgstr "" -#: ../../library/logging.rst:1027 +#: ../../library/logging.rst:1037 msgid "" "The :meth:`~Logger.isEnabledFor`, :meth:`~Logger.getEffectiveLevel`, :meth:" "`~Logger.setLevel` and :meth:`~Logger.hasHandlers` methods were added to :" "class:`LoggerAdapter`. These methods delegate to the underlying logger." msgstr "" -#: ../../library/logging.rst:1032 +#: ../../library/logging.rst:1043 msgid "" -"Attribute :attr:`manager` and method :meth:`_log` were added, which delegate " -"to the underlying logger and allow adapters to be nested." +"Attribute :attr:`!manager` and method :meth:`!_log` were added, which " +"delegate to the underlying logger and allow adapters to be nested." msgstr "" -#: ../../library/logging.rst:1038 +#: ../../library/logging.rst:1048 msgid "Thread Safety" msgstr "" -#: ../../library/logging.rst:1040 +#: ../../library/logging.rst:1050 msgid "" "The logging module is intended to be thread-safe without any special work " "needing to be done by its clients. It achieves this though using threading " @@ -1479,7 +1487,7 @@ msgid "" "O." msgstr "" -#: ../../library/logging.rst:1045 +#: ../../library/logging.rst:1055 msgid "" "If you are implementing asynchronous signal handlers using the :mod:`signal` " "module, you may not be able to use logging from within such handlers. This " @@ -1487,17 +1495,17 @@ msgid "" "always re-entrant, and so cannot be invoked from such signal handlers." msgstr "" -#: ../../library/logging.rst:1052 +#: ../../library/logging.rst:1062 msgid "Module-Level Functions" msgstr "" -#: ../../library/logging.rst:1054 +#: ../../library/logging.rst:1064 msgid "" "In addition to the classes described above, there are a number of module-" "level functions." msgstr "" -#: ../../library/logging.rst:1060 +#: ../../library/logging.rst:1070 msgid "" "Return a logger with the specified name or, if name is ``None``, return a " "logger which is the root logger of the hierarchy. If specified, the name is " @@ -1506,14 +1514,14 @@ msgid "" "logging." msgstr "" -#: ../../library/logging.rst:1065 +#: ../../library/logging.rst:1075 msgid "" "All calls to this function with a given name return the same logger " "instance. This means that logger instances never need to be passed between " "different parts of an application." msgstr "" -#: ../../library/logging.rst:1072 +#: ../../library/logging.rst:1082 msgid "" "Return either the standard :class:`Logger` class, or the last class passed " "to :func:`setLoggerClass`. This function may be called from within a new " @@ -1522,24 +1530,24 @@ msgid "" "example::" msgstr "" -#: ../../library/logging.rst:1083 +#: ../../library/logging.rst:1093 msgid "Return a callable which is used to create a :class:`LogRecord`." msgstr "" -#: ../../library/logging.rst:1085 +#: ../../library/logging.rst:1095 msgid "" "This function has been provided, along with :func:`setLogRecordFactory`, to " "allow developers more control over how the :class:`LogRecord` representing a " "logging event is constructed." msgstr "" -#: ../../library/logging.rst:1090 +#: ../../library/logging.rst:1100 msgid "" "See :func:`setLogRecordFactory` for more information about the how the " "factory is called." msgstr "" -#: ../../library/logging.rst:1095 +#: ../../library/logging.rst:1105 msgid "" "Logs a message with level :const:`DEBUG` on the root logger. The *msg* is " "the message format string, and the *args* are the arguments which are merged " @@ -1548,7 +1556,7 @@ msgid "" "argument.)" msgstr "" -#: ../../library/logging.rst:1100 +#: ../../library/logging.rst:1110 msgid "" "There are three keyword arguments in *kwargs* which are inspected: " "*exc_info* which, if it does not evaluate as false, causes exception " @@ -1558,7 +1566,7 @@ msgid "" "exception information." msgstr "" -#: ../../library/logging.rst:1126 +#: ../../library/logging.rst:1136 msgid "" "The third optional keyword argument is *extra* which can be used to pass a " "dictionary which is used to populate the __dict__ of the LogRecord created " @@ -1567,18 +1575,18 @@ msgid "" "logged messages. For example::" msgstr "" -#: ../../library/logging.rst:1137 +#: ../../library/logging.rst:1147 msgid "would print something like:" msgstr "" -#: ../../library/logging.rst:1143 +#: ../../library/logging.rst:1153 msgid "" "The keys in the dictionary passed in *extra* should not clash with the keys " "used by the logging system. (See the :class:`Formatter` documentation for " "more information on which keys are used by the logging system.)" msgstr "" -#: ../../library/logging.rst:1147 +#: ../../library/logging.rst:1157 msgid "" "If you choose to use these attributes in logged messages, you need to " "exercise some care. In the above example, for instance, the :class:" @@ -1589,58 +1597,58 @@ msgid "" "dictionary with these keys." msgstr "" -#: ../../library/logging.rst:1161 +#: ../../library/logging.rst:1171 msgid "" "This function (as well as :func:`info`, :func:`warning`, :func:`error` and :" "func:`critical`) will call :func:`basicConfig` if the root logger doesn't " "have any handler attached." msgstr "" -#: ../../library/logging.rst:1170 +#: ../../library/logging.rst:1180 msgid "" "Logs a message with level :const:`INFO` on the root logger. The arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1176 +#: ../../library/logging.rst:1186 msgid "" "Logs a message with level :const:`WARNING` on the root logger. The arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1179 +#: ../../library/logging.rst:1189 msgid "" "There is an obsolete function ``warn`` which is functionally identical to " "``warning``. As ``warn`` is deprecated, please do not use it - use " "``warning`` instead." msgstr "" -#: ../../library/logging.rst:1186 +#: ../../library/logging.rst:1196 msgid "" "Logs a message with level :const:`ERROR` on the root logger. The arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1192 +#: ../../library/logging.rst:1202 msgid "" "Logs a message with level :const:`CRITICAL` on the root logger. The " "arguments are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1198 +#: ../../library/logging.rst:1208 msgid "" "Logs a message with level :const:`ERROR` on the root logger. The arguments " "are interpreted as for :func:`debug`. Exception info is added to the logging " "message. This function should only be called from an exception handler." msgstr "" -#: ../../library/logging.rst:1204 +#: ../../library/logging.rst:1214 msgid "" "Logs a message with level *level* on the root logger. The other arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1209 +#: ../../library/logging.rst:1219 msgid "" "Provides an overriding level *level* for all loggers which takes precedence " "over the logger's own level. When the need arises to temporarily throttle " @@ -1654,7 +1662,7 @@ msgid "" "individual loggers." msgstr "" -#: ../../library/logging.rst:1220 +#: ../../library/logging.rst:1230 msgid "" "Note that if you have defined any custom logging level higher than " "``CRITICAL`` (this is not recommended), you won't be able to rely on the " @@ -1662,13 +1670,13 @@ msgid "" "a suitable value." msgstr "" -#: ../../library/logging.rst:1225 +#: ../../library/logging.rst:1235 msgid "" "The *level* parameter was defaulted to level ``CRITICAL``. See :issue:" "`28524` for more information about this change." msgstr "" -#: ../../library/logging.rst:1231 +#: ../../library/logging.rst:1241 msgid "" "Associates level *level* with text *levelName* in an internal dictionary, " "which is used to map numeric levels to a textual representation, for example " @@ -1678,24 +1686,24 @@ msgid "" "and they should increase in increasing order of severity." msgstr "" -#: ../../library/logging.rst:1238 +#: ../../library/logging.rst:1248 msgid "" "If you are thinking of defining your own levels, please see the section on :" "ref:`custom-levels`." msgstr "" -#: ../../library/logging.rst:1243 +#: ../../library/logging.rst:1253 msgid "" "Returns a mapping from level names to their corresponding logging levels. " "For example, the string \"CRITICAL\" maps to :const:`CRITICAL`. The returned " "mapping is copied from an internal mapping on each call to this function." msgstr "" -#: ../../library/logging.rst:1251 +#: ../../library/logging.rst:1261 msgid "Returns the textual or numeric representation of logging level *level*." msgstr "" -#: ../../library/logging.rst:1253 +#: ../../library/logging.rst:1263 msgid "" "If *level* is one of the predefined levels :const:`CRITICAL`, :const:" "`ERROR`, :const:`WARNING`, :const:`INFO` or :const:`DEBUG` then you get the " @@ -1705,20 +1713,20 @@ msgid "" "the corresponding string representation is returned." msgstr "" -#: ../../library/logging.rst:1260 +#: ../../library/logging.rst:1270 msgid "" "The *level* parameter also accepts a string representation of the level such " "as 'INFO'. In such cases, this functions returns the corresponding numeric " "value of the level." msgstr "" -#: ../../library/logging.rst:1264 +#: ../../library/logging.rst:1274 msgid "" "If no matching numeric or string value is passed in, the string 'Level %s' % " "level is returned." msgstr "" -#: ../../library/logging.rst:1267 +#: ../../library/logging.rst:1277 msgid "" "Levels are internally integers (as they need to be compared in the logging " "logic). This function is used to convert between an integer level and the " @@ -1727,7 +1735,7 @@ msgid "" "vice versa." msgstr "" -#: ../../library/logging.rst:1273 +#: ../../library/logging.rst:1283 msgid "" "In Python versions earlier than 3.4, this function could also be passed a " "text level, and would return the corresponding numeric value of the level. " @@ -1735,17 +1743,17 @@ msgid "" "Python 3.4, but reinstated in 3.4.2 due to retain backward compatibility." msgstr "" -#: ../../library/logging.rst:1281 +#: ../../library/logging.rst:1291 msgid "" "Returns a handler with the specified *name*, or ``None`` if there is no " "handler with that name." msgstr "" -#: ../../library/logging.rst:1288 +#: ../../library/logging.rst:1298 msgid "Returns an immutable set of all known handler names." msgstr "" -#: ../../library/logging.rst:1294 +#: ../../library/logging.rst:1304 msgid "" "Creates and returns a new :class:`LogRecord` instance whose attributes are " "defined by *attrdict*. This function is useful for taking a pickled :class:" @@ -1753,7 +1761,7 @@ msgid "" "as a :class:`LogRecord` instance at the receiving end." msgstr "" -#: ../../library/logging.rst:1302 +#: ../../library/logging.rst:1312 msgid "" "Does basic configuration for the logging system by creating a :class:" "`StreamHandler` with a default :class:`Formatter` and adding it to the root " @@ -1762,13 +1770,13 @@ msgid "" "no handlers are defined for the root logger." msgstr "" -#: ../../library/logging.rst:1308 +#: ../../library/logging.rst:1318 msgid "" "This function does nothing if the root logger already has handlers " "configured, unless the keyword argument *force* is set to ``True``." msgstr "" -#: ../../library/logging.rst:1311 +#: ../../library/logging.rst:1321 msgid "" "This function should be called from the main thread before other threads are " "started. In versions of Python prior to 2.7.1 and 3.2, if this function is " @@ -1777,54 +1785,54 @@ msgid "" "unexpected results such as messages being duplicated in the log." msgstr "" -#: ../../library/logging.rst:1318 +#: ../../library/logging.rst:1328 msgid "The following keyword arguments are supported." msgstr "" -#: ../../library/logging.rst:1325 +#: ../../library/logging.rst:1335 msgid "*filename*" msgstr "*filename*" -#: ../../library/logging.rst:1325 +#: ../../library/logging.rst:1335 msgid "" "Specifies that a :class:`FileHandler` be created, using the specified " "filename, rather than a :class:`StreamHandler`." msgstr "" -#: ../../library/logging.rst:1329 +#: ../../library/logging.rst:1339 msgid "*filemode*" msgstr "*filemode*" -#: ../../library/logging.rst:1329 +#: ../../library/logging.rst:1339 msgid "" "If *filename* is specified, open the file in this :ref:`mode `. " "Defaults to ``'a'``." msgstr "" -#: ../../library/logging.rst:1333 +#: ../../library/logging.rst:1343 msgid "*format*" msgstr "*format*" -#: ../../library/logging.rst:1333 +#: ../../library/logging.rst:1343 msgid "" "Use the specified format string for the handler. Defaults to attributes " "``levelname``, ``name`` and ``message`` separated by colons." msgstr "" -#: ../../library/logging.rst:1338 +#: ../../library/logging.rst:1348 msgid "*datefmt*" msgstr "*datefmt*" -#: ../../library/logging.rst:1338 +#: ../../library/logging.rst:1348 msgid "" "Use the specified date/time format, as accepted by :func:`time.strftime`." msgstr "" -#: ../../library/logging.rst:1341 +#: ../../library/logging.rst:1351 msgid "*style*" msgstr "*style*" -#: ../../library/logging.rst:1341 +#: ../../library/logging.rst:1351 msgid "" "If *format* is specified, use this style for the format string. One of " "``'%'``, ``'{'`` or ``'$'`` for :ref:`printf-style `." msgstr "" -#: ../../library/logging.rst:1352 +#: ../../library/logging.rst:1362 msgid "*stream*" msgstr "*stream*" -#: ../../library/logging.rst:1352 +#: ../../library/logging.rst:1362 msgid "" "Use the specified stream to initialize the :class:`StreamHandler`. Note that " "this argument is incompatible with *filename* - if both are present, a " "``ValueError`` is raised." msgstr "" -#: ../../library/logging.rst:1358 +#: ../../library/logging.rst:1368 msgid "*handlers*" msgstr "*handlers*" -#: ../../library/logging.rst:1358 +#: ../../library/logging.rst:1368 msgid "" "If specified, this should be an iterable of already created handlers to add " "to the root logger. Any handlers which don't already have a formatter set " @@ -1864,33 +1872,33 @@ msgid "" "present, a ``ValueError`` is raised." msgstr "" -#: ../../library/logging.rst:1367 +#: ../../library/logging.rst:1377 msgid "*force*" msgstr "*force*" -#: ../../library/logging.rst:1367 +#: ../../library/logging.rst:1377 msgid "" "If this keyword argument is specified as true, any existing handlers " "attached to the root logger are removed and closed, before carrying out the " "configuration as specified by the other arguments." msgstr "" -#: ../../library/logging.rst:1373 +#: ../../library/logging.rst:1383 msgid "*encoding*" msgstr "*encoding*" -#: ../../library/logging.rst:1373 +#: ../../library/logging.rst:1383 msgid "" "If this keyword argument is specified along with *filename*, its value is " "used when the :class:`FileHandler` is created, and thus used when opening " "the output file." msgstr "" -#: ../../library/logging.rst:1378 +#: ../../library/logging.rst:1388 msgid "*errors*" msgstr "*errors*" -#: ../../library/logging.rst:1378 +#: ../../library/logging.rst:1388 msgid "" "If this keyword argument is specified along with *filename*, its value is " "used when the :class:`FileHandler` is created, and thus used when opening " @@ -1899,43 +1907,43 @@ msgid "" "`open`, which means that it will be treated the same as passing 'errors'." msgstr "" -#: ../../library/logging.rst:1389 +#: ../../library/logging.rst:1399 msgid "The *style* argument was added." msgstr "新增 *style* 引數。" -#: ../../library/logging.rst:1392 +#: ../../library/logging.rst:1402 msgid "" "The *handlers* argument was added. Additional checks were added to catch " "situations where incompatible arguments are specified (e.g. *handlers* " "together with *stream* or *filename*, or *stream* together with *filename*)." msgstr "" -#: ../../library/logging.rst:1398 +#: ../../library/logging.rst:1408 msgid "The *force* argument was added." msgstr "新增 *force* 引數。" -#: ../../library/logging.rst:1401 +#: ../../library/logging.rst:1411 msgid "The *encoding* and *errors* arguments were added." msgstr "新增 *encoding* 與 *errors* 引數。" -#: ../../library/logging.rst:1406 +#: ../../library/logging.rst:1416 msgid "" "Informs the logging system to perform an orderly shutdown by flushing and " "closing all handlers. This should be called at application exit and no " "further use of the logging system should be made after this call." msgstr "" -#: ../../library/logging.rst:1410 +#: ../../library/logging.rst:1420 msgid "" "When the logging module is imported, it registers this function as an exit " "handler (see :mod:`atexit`), so normally there's no need to do that manually." msgstr "" -#: ../../library/logging.rst:1417 +#: ../../library/logging.rst:1427 msgid "" "Tells the logging system to use the class *klass* when instantiating a " -"logger. The class should define :meth:`__init__` such that only a name " -"argument is required, and the :meth:`__init__` should call :meth:`Logger." +"logger. The class should define :meth:`!__init__` such that only a name " +"argument is required, and the :meth:`!__init__` should call :meth:`!Logger." "__init__`. This function is typically called before any loggers are " "instantiated by applications which need to use custom logger behavior. After " "this call, as at any other time, do not instantiate loggers directly using " @@ -1943,32 +1951,32 @@ msgid "" "loggers." msgstr "" -#: ../../library/logging.rst:1428 +#: ../../library/logging.rst:1438 msgid "Set a callable which is used to create a :class:`LogRecord`." msgstr "" -#: ../../library/logging.rst:1430 +#: ../../library/logging.rst:1440 msgid "The factory callable to be used to instantiate a log record." msgstr "" -#: ../../library/logging.rst:1432 +#: ../../library/logging.rst:1442 msgid "" "This function has been provided, along with :func:`getLogRecordFactory`, to " "allow developers more control over how the :class:`LogRecord` representing a " "logging event is constructed." msgstr "" -#: ../../library/logging.rst:1437 +#: ../../library/logging.rst:1447 msgid "The factory has the following signature:" msgstr "" -#: ../../library/logging.rst:1439 +#: ../../library/logging.rst:1449 msgid "" "``factory(name, level, fn, lno, msg, args, exc_info, func=None, sinfo=None, " "**kwargs)``" msgstr "" -#: ../../library/logging.rst:1441 +#: ../../library/logging.rst:1451 msgid "The logger name." msgstr "" @@ -1976,7 +1984,7 @@ msgstr "" msgid "level" msgstr "" -#: ../../library/logging.rst:1442 +#: ../../library/logging.rst:1452 msgid "The logging level (numeric)." msgstr "" @@ -1984,7 +1992,7 @@ msgstr "" msgid "fn" msgstr "fn" -#: ../../library/logging.rst:1443 +#: ../../library/logging.rst:1453 msgid "The full pathname of the file where the logging call was made." msgstr "" @@ -1992,19 +2000,19 @@ msgstr "" msgid "lno" msgstr "lno" -#: ../../library/logging.rst:1444 +#: ../../library/logging.rst:1454 msgid "The line number in the file where the logging call was made." msgstr "" -#: ../../library/logging.rst:1445 +#: ../../library/logging.rst:1455 msgid "The logging message." msgstr "" -#: ../../library/logging.rst:1446 +#: ../../library/logging.rst:1456 msgid "The arguments for the logging message." msgstr "" -#: ../../library/logging.rst:1447 +#: ../../library/logging.rst:1457 msgid "An exception tuple, or ``None``." msgstr "" @@ -2012,7 +2020,7 @@ msgstr "" msgid "func" msgstr "func" -#: ../../library/logging.rst:1448 +#: ../../library/logging.rst:1458 msgid "The name of the function or method which invoked the logging call." msgstr "" @@ -2020,7 +2028,7 @@ msgstr "" msgid "sinfo" msgstr "sinfo" -#: ../../library/logging.rst:1450 +#: ../../library/logging.rst:1460 msgid "" "A stack traceback such as is provided by :func:`traceback.print_stack`, " "showing the call hierarchy." @@ -2030,15 +2038,15 @@ msgstr "" msgid "kwargs" msgstr "kwargs" -#: ../../library/logging.rst:1452 +#: ../../library/logging.rst:1462 msgid "Additional keyword arguments." msgstr "額外的關鍵字引數。" -#: ../../library/logging.rst:1456 +#: ../../library/logging.rst:1466 msgid "Module-Level Attributes" msgstr "" -#: ../../library/logging.rst:1460 +#: ../../library/logging.rst:1470 msgid "" "A \"handler of last resort\" is available through this attribute. This is a :" "class:`StreamHandler` writing to ``sys.stderr`` with a level of ``WARNING``, " @@ -2049,22 +2057,22 @@ msgid "" "reason, ``lastResort`` can be set to ``None``." msgstr "" -#: ../../library/logging.rst:1471 +#: ../../library/logging.rst:1481 msgid "Integration with the warnings module" msgstr "" -#: ../../library/logging.rst:1473 +#: ../../library/logging.rst:1483 msgid "" "The :func:`captureWarnings` function can be used to integrate :mod:`logging` " "with the :mod:`warnings` module." msgstr "" -#: ../../library/logging.rst:1478 +#: ../../library/logging.rst:1488 msgid "" "This function is used to turn the capture of warnings by logging on and off." msgstr "" -#: ../../library/logging.rst:1481 +#: ../../library/logging.rst:1491 msgid "" "If *capture* is ``True``, warnings issued by the :mod:`warnings` module will " "be redirected to the logging system. Specifically, a warning will be " @@ -2073,46 +2081,46 @@ msgid "" "`WARNING`." msgstr "" -#: ../../library/logging.rst:1486 +#: ../../library/logging.rst:1496 msgid "" "If *capture* is ``False``, the redirection of warnings to the logging system " "will stop, and warnings will be redirected to their original destinations (i." "e. those in effect before ``captureWarnings(True)`` was called)." msgstr "" -#: ../../library/logging.rst:1494 +#: ../../library/logging.rst:1504 msgid "Module :mod:`logging.config`" msgstr "" -#: ../../library/logging.rst:1494 +#: ../../library/logging.rst:1504 msgid "Configuration API for the logging module." msgstr "" -#: ../../library/logging.rst:1497 +#: ../../library/logging.rst:1507 msgid "Module :mod:`logging.handlers`" msgstr "" -#: ../../library/logging.rst:1497 +#: ../../library/logging.rst:1507 msgid "Useful handlers included with the logging module." msgstr "" -#: ../../library/logging.rst:1501 +#: ../../library/logging.rst:1511 msgid ":pep:`282` - A Logging System" msgstr "" -#: ../../library/logging.rst:1500 +#: ../../library/logging.rst:1510 msgid "" "The proposal which described this feature for inclusion in the Python " "standard library." msgstr "" -#: ../../library/logging.rst:1506 +#: ../../library/logging.rst:1516 msgid "" "`Original Python logging package `_" msgstr "" -#: ../../library/logging.rst:1504 +#: ../../library/logging.rst:1514 msgid "" "This is the original source for the :mod:`logging` package. The version of " "the package available from this site is suitable for use with Python 1.5.2, " diff --git a/library/re.po b/library/re.po index e55587d2b6..66510021f6 100644 --- a/library/re.po +++ b/library/re.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-08-27 00:04+0000\n" "PO-Revision-Date: 2023-05-20 13:44+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -147,7 +147,7 @@ msgstr "" msgid "The special characters are:" msgstr "" -#: ../../library/re.rst:104 ../../library/re.rst:1545 +#: ../../library/re.rst:104 ../../library/re.rst:1552 msgid "``.``" msgstr "``.``" @@ -1126,41 +1126,40 @@ msgstr "" #: ../../library/re.rst:858 msgid "" "Scan through *string* looking for the first location where the regular " -"expression *pattern* produces a match, and return a corresponding :ref:" -"`match object `. Return ``None`` if no position in the " -"string matches the pattern; note that this is different from finding a zero-" -"length match at some point in the string." +"expression *pattern* produces a match, and return a corresponding :class:" +"`~re.Match`. Return ``None`` if no position in the string matches the " +"pattern; note that this is different from finding a zero-length match at " +"some point in the string." msgstr "" -#: ../../library/re.rst:867 +#: ../../library/re.rst:866 msgid "" "If zero or more characters at the beginning of *string* match the regular " -"expression *pattern*, return a corresponding :ref:`match object `. Return ``None`` if the string does not match the pattern; note " -"that this is different from a zero-length match." +"expression *pattern*, return a corresponding :class:`~re.Match`. Return " +"``None`` if the string does not match the pattern; note that this is " +"different from a zero-length match." msgstr "" -#: ../../library/re.rst:872 +#: ../../library/re.rst:871 msgid "" "Note that even in :const:`MULTILINE` mode, :func:`re.match` will only match " "at the beginning of the string and not at the beginning of each line." msgstr "" -#: ../../library/re.rst:875 +#: ../../library/re.rst:874 msgid "" "If you want to locate a match anywhere in *string*, use :func:`search` " "instead (see also :ref:`search-vs-match`)." msgstr "" -#: ../../library/re.rst:881 +#: ../../library/re.rst:880 msgid "" "If the whole *string* matches the regular expression *pattern*, return a " -"corresponding :ref:`match object `. Return ``None`` if the " -"string does not match the pattern; note that this is different from a zero-" -"length match." +"corresponding :class:`~re.Match`. Return ``None`` if the string does not " +"match the pattern; note that this is different from a zero-length match." msgstr "" -#: ../../library/re.rst:891 +#: ../../library/re.rst:889 msgid "" "Split *string* by the occurrences of *pattern*. If capturing parentheses " "are used in *pattern*, then the text of all groups in the pattern are also " @@ -1169,42 +1168,42 @@ msgid "" "final element of the list. ::" msgstr "" -#: ../../library/re.rst:906 +#: ../../library/re.rst:904 msgid "" "If there are capturing groups in the separator and it matches at the start " "of the string, the result will start with an empty string. The same holds " "for the end of the string::" msgstr "" -#: ../../library/re.rst:913 +#: ../../library/re.rst:911 msgid "" "That way, separator components are always found at the same relative indices " "within the result list." msgstr "" -#: ../../library/re.rst:916 +#: ../../library/re.rst:914 msgid "" "Empty matches for the pattern split the string only when not adjacent to a " "previous empty match." msgstr "" -#: ../../library/re.rst:926 ../../library/re.rst:1017 ../../library/re.rst:1046 +#: ../../library/re.rst:924 ../../library/re.rst:1015 ../../library/re.rst:1044 msgid "Added the optional flags argument." msgstr "新增可選的旗標引數。" -#: ../../library/re.rst:929 +#: ../../library/re.rst:927 msgid "" "Added support of splitting on a pattern that could match an empty string." msgstr "" -#: ../../library/re.rst:935 +#: ../../library/re.rst:933 msgid "" "Return all non-overlapping matches of *pattern* in *string*, as a list of " "strings or tuples. The *string* is scanned left-to-right, and matches are " "returned in the order found. Empty matches are included in the result." msgstr "" -#: ../../library/re.rst:939 +#: ../../library/re.rst:937 msgid "" "The result depends on the number of capturing groups in the pattern. If " "there are no groups, return a list of strings matching the whole pattern. " @@ -1214,19 +1213,19 @@ msgid "" "result." msgstr "" -#: ../../library/re.rst:951 ../../library/re.rst:962 +#: ../../library/re.rst:949 ../../library/re.rst:960 msgid "Non-empty matches can now start just after a previous empty match." msgstr "" -#: ../../library/re.rst:957 +#: ../../library/re.rst:955 msgid "" -"Return an :term:`iterator` yielding :ref:`match objects ` " -"over all non-overlapping matches for the RE *pattern* in *string*. The " -"*string* is scanned left-to-right, and matches are returned in the order " -"found. Empty matches are included in the result." +"Return an :term:`iterator` yielding :class:`~re.Match` objects over all non-" +"overlapping matches for the RE *pattern* in *string*. The *string* is " +"scanned left-to-right, and matches are returned in the order found. Empty " +"matches are included in the result." msgstr "" -#: ../../library/re.rst:968 +#: ../../library/re.rst:966 msgid "" "Return the string obtained by replacing the leftmost non-overlapping " "occurrences of *pattern* in *string* by the replacement *repl*. If the " @@ -1240,18 +1239,18 @@ msgid "" "For example::" msgstr "" -#: ../../library/re.rst:984 +#: ../../library/re.rst:982 msgid "" "If *repl* is a function, it is called for every non-overlapping occurrence " -"of *pattern*. The function takes a single :ref:`match object ` argument, and returns the replacement string. For example::" +"of *pattern*. The function takes a single :class:`~re.Match` argument, and " +"returns the replacement string. For example::" msgstr "" -#: ../../library/re.rst:997 -msgid "The pattern may be a string or a :ref:`pattern object `." +#: ../../library/re.rst:995 +msgid "The pattern may be a string or a :class:`~re.Pattern`." msgstr "" -#: ../../library/re.rst:999 +#: ../../library/re.rst:997 msgid "" "The optional argument *count* is the maximum number of pattern occurrences " "to be replaced; *count* must be a non-negative integer. If omitted or zero, " @@ -1260,7 +1259,7 @@ msgid "" "'abxd')`` returns ``'-a-b--d-'``." msgstr "" -#: ../../library/re.rst:1007 +#: ../../library/re.rst:1005 msgid "" "In string-type *repl* arguments, in addition to the character escapes and " "backreferences described above, ``\\g`` will use the substring matched " @@ -1273,60 +1272,60 @@ msgid "" "RE." msgstr "" -#: ../../library/re.rst:1020 ../../library/re.rst:1049 -#: ../../library/re.rst:1283 +#: ../../library/re.rst:1018 ../../library/re.rst:1047 +#: ../../library/re.rst:1290 msgid "Unmatched groups are replaced with an empty string." msgstr "" -#: ../../library/re.rst:1023 +#: ../../library/re.rst:1021 msgid "" "Unknown escapes in *pattern* consisting of ``'\\'`` and an ASCII letter now " "are errors." msgstr "" -#: ../../library/re.rst:1027 +#: ../../library/re.rst:1025 msgid "" "Unknown escapes in *repl* consisting of ``'\\'`` and an ASCII letter now are " "errors." msgstr "" -#: ../../library/re.rst:1031 +#: ../../library/re.rst:1029 msgid "" "Empty matches for the pattern are replaced when adjacent to a previous non-" "empty match." msgstr "" -#: ../../library/re.rst:1035 +#: ../../library/re.rst:1033 msgid "" "Group *id* can only contain ASCII digits. In :class:`bytes` replacement " "strings, group *name* can only contain bytes in the ASCII range " "(``b'\\x00'``-``b'\\x7f'``)." msgstr "" -#: ../../library/re.rst:1043 +#: ../../library/re.rst:1041 msgid "" "Perform the same operation as :func:`sub`, but return a tuple ``(new_string, " "number_of_subs_made)``." msgstr "" -#: ../../library/re.rst:1055 +#: ../../library/re.rst:1053 msgid "" "Escape special characters in *pattern*. This is useful if you want to match " "an arbitrary literal string that may have regular expression metacharacters " "in it. For example::" msgstr "" -#: ../../library/re.rst:1070 +#: ../../library/re.rst:1068 msgid "" "This function must not be used for the replacement string in :func:`sub` " "and :func:`subn`, only backslashes should be escaped. For example::" msgstr "" -#: ../../library/re.rst:1078 +#: ../../library/re.rst:1076 msgid "The ``'_'`` character is no longer escaped." msgstr "" -#: ../../library/re.rst:1081 +#: ../../library/re.rst:1079 msgid "" "Only characters that can have special meaning in a regular expression are " "escaped. As a result, ``'!'``, ``'\"'``, ``'%'``, ``\"'\"``, ``','``, " @@ -1334,15 +1333,15 @@ msgid "" "are no longer escaped." msgstr "" -#: ../../library/re.rst:1090 +#: ../../library/re.rst:1088 msgid "Clear the regular expression cache." msgstr "" -#: ../../library/re.rst:1094 +#: ../../library/re.rst:1092 msgid "Exceptions" msgstr "" -#: ../../library/re.rst:1098 +#: ../../library/re.rst:1096 msgid "" "Exception raised when a string passed to one of the functions here is not a " "valid regular expression (for example, it might contain unmatched " @@ -1351,50 +1350,54 @@ msgid "" "pattern. The error instance has the following additional attributes:" msgstr "" -#: ../../library/re.rst:1106 +#: ../../library/re.rst:1104 msgid "The unformatted error message." msgstr "" -#: ../../library/re.rst:1110 +#: ../../library/re.rst:1108 msgid "The regular expression pattern." msgstr "" -#: ../../library/re.rst:1114 +#: ../../library/re.rst:1112 msgid "The index in *pattern* where compilation failed (may be ``None``)." msgstr "" -#: ../../library/re.rst:1118 +#: ../../library/re.rst:1116 msgid "The line corresponding to *pos* (may be ``None``)." msgstr "" -#: ../../library/re.rst:1122 +#: ../../library/re.rst:1120 msgid "The column corresponding to *pos* (may be ``None``)." msgstr "" -#: ../../library/re.rst:1124 +#: ../../library/re.rst:1122 msgid "Added additional attributes." msgstr "新增額外屬性。" -#: ../../library/re.rst:1130 +#: ../../library/re.rst:1128 msgid "Regular Expression Objects" msgstr "" #: ../../library/re.rst:1132 +msgid "Compiled regular expression object returned by :func:`re.compile`." +msgstr "" + +#: ../../library/re.rst:1134 msgid "" -"Compiled regular expression objects support the following methods and " -"attributes:" +":py:class:`re.Pattern` supports ``[]`` to indicate a Unicode (str) or bytes " +"pattern. See :ref:`types-genericalias`." msgstr "" -#: ../../library/re.rst:1137 +#: ../../library/re.rst:1140 msgid "" "Scan through *string* looking for the first location where this regular " -"expression produces a match, and return a corresponding :ref:`match object " -"`. Return ``None`` if no position in the string matches the " -"pattern; note that this is different from finding a zero-length match at " -"some point in the string." +"expression produces a match, and return a corresponding :class:`~re.Match`. " +"Return ``None`` if no position in the string matches the pattern; note that " +"this is different from finding a zero-length match at some point in the " +"string." msgstr "" -#: ../../library/re.rst:1143 +#: ../../library/re.rst:1145 msgid "" "The optional second parameter *pos* gives an index in the string where the " "search is to start; it defaults to ``0``. This is not completely equivalent " @@ -1403,7 +1406,7 @@ msgid "" "necessarily at the index where the search is to start." msgstr "" -#: ../../library/re.rst:1149 +#: ../../library/re.rst:1151 msgid "" "The optional parameter *endpos* limits how far the string will be searched; " "it will be as if the string is *endpos* characters long, so only the " @@ -1413,104 +1416,109 @@ msgid "" "equivalent to ``rx.search(string[:50], 0)``. ::" msgstr "" -#: ../../library/re.rst:1164 +#: ../../library/re.rst:1166 msgid "" "If zero or more characters at the *beginning* of *string* match this regular " -"expression, return a corresponding :ref:`match object `. " -"Return ``None`` if the string does not match the pattern; note that this is " -"different from a zero-length match." +"expression, return a corresponding :class:`~re.Match`. Return ``None`` if " +"the string does not match the pattern; note that this is different from a " +"zero-length match." msgstr "" -#: ../../library/re.rst:1169 ../../library/re.rst:1187 +#: ../../library/re.rst:1171 ../../library/re.rst:1189 msgid "" "The optional *pos* and *endpos* parameters have the same meaning as for the :" "meth:`~Pattern.search` method. ::" msgstr "" -#: ../../library/re.rst:1177 +#: ../../library/re.rst:1179 msgid "" "If you want to locate a match anywhere in *string*, use :meth:`~Pattern." "search` instead (see also :ref:`search-vs-match`)." msgstr "" -#: ../../library/re.rst:1183 +#: ../../library/re.rst:1185 msgid "" "If the whole *string* matches this regular expression, return a " -"corresponding :ref:`match object `. Return ``None`` if the " -"string does not match the pattern; note that this is different from a zero-" -"length match." +"corresponding :class:`~re.Match`. Return ``None`` if the string does not " +"match the pattern; note that this is different from a zero-length match." msgstr "" -#: ../../library/re.rst:1201 +#: ../../library/re.rst:1203 msgid "Identical to the :func:`split` function, using the compiled pattern." msgstr "" -#: ../../library/re.rst:1206 +#: ../../library/re.rst:1208 msgid "" "Similar to the :func:`findall` function, using the compiled pattern, but " "also accepts optional *pos* and *endpos* parameters that limit the search " "region like for :meth:`search`." msgstr "" -#: ../../library/re.rst:1213 +#: ../../library/re.rst:1215 msgid "" "Similar to the :func:`finditer` function, using the compiled pattern, but " "also accepts optional *pos* and *endpos* parameters that limit the search " "region like for :meth:`search`." msgstr "" -#: ../../library/re.rst:1220 +#: ../../library/re.rst:1222 msgid "Identical to the :func:`sub` function, using the compiled pattern." msgstr "" -#: ../../library/re.rst:1225 +#: ../../library/re.rst:1227 msgid "Identical to the :func:`subn` function, using the compiled pattern." msgstr "" -#: ../../library/re.rst:1230 +#: ../../library/re.rst:1232 msgid "" "The regex matching flags. This is a combination of the flags given to :func:" "`.compile`, any ``(?...)`` inline flags in the pattern, and implicit flags " "such as :data:`UNICODE` if the pattern is a Unicode string." msgstr "" -#: ../../library/re.rst:1237 +#: ../../library/re.rst:1239 msgid "The number of capturing groups in the pattern." msgstr "" -#: ../../library/re.rst:1242 +#: ../../library/re.rst:1244 msgid "" "A dictionary mapping any symbolic group names defined by ``(?P)`` to " "group numbers. The dictionary is empty if no symbolic groups were used in " "the pattern." msgstr "" -#: ../../library/re.rst:1249 +#: ../../library/re.rst:1251 msgid "The pattern string from which the pattern object was compiled." msgstr "" -#: ../../library/re.rst:1252 +#: ../../library/re.rst:1254 msgid "" "Added support of :func:`copy.copy` and :func:`copy.deepcopy`. Compiled " "regular expression objects are considered atomic." msgstr "" -#: ../../library/re.rst:1260 +#: ../../library/re.rst:1262 msgid "Match Objects" msgstr "" -#: ../../library/re.rst:1262 +#: ../../library/re.rst:1264 msgid "" "Match objects always have a boolean value of ``True``. Since :meth:`~Pattern." "match` and :meth:`~Pattern.search` return ``None`` when there is no match, " "you can test whether there was a match with a simple ``if`` statement::" msgstr "" -#: ../../library/re.rst:1271 -msgid "Match objects support the following methods and attributes:" +#: ../../library/re.rst:1275 +msgid "Match object returned by successful ``match``\\ es and ``search``\\ es." msgstr "" -#: ../../library/re.rst:1276 +#: ../../library/re.rst:1277 +msgid "" +":py:class:`re.Match` supports ``[]`` to indicate a Unicode (str) or bytes " +"match. See :ref:`types-genericalias`." +msgstr "" + +#: ../../library/re.rst:1283 msgid "" "Return the string obtained by doing backslash substitution on the template " "string *template*, as done by the :meth:`~Pattern.sub` method. Escapes such " @@ -1519,7 +1527,7 @@ msgid "" "``\\g``) are replaced by the contents of the corresponding group." msgstr "" -#: ../../library/re.rst:1288 +#: ../../library/re.rst:1295 msgid "" "Returns one or more subgroups of the match. If there is a single argument, " "the result is a single string; if there are multiple arguments, the result " @@ -1534,7 +1542,7 @@ msgid "" "the pattern that matched multiple times, the last match is returned. ::" msgstr "" -#: ../../library/re.rst:1310 +#: ../../library/re.rst:1317 msgid "" "If the regular expression uses the ``(?P...)`` syntax, the *groupN* " "arguments may also be strings identifying groups by their group name. If a " @@ -1542,57 +1550,57 @@ msgid "" "`IndexError` exception is raised." msgstr "" -#: ../../library/re.rst:1315 +#: ../../library/re.rst:1322 msgid "A moderately complicated example::" msgstr "" -#: ../../library/re.rst:1323 +#: ../../library/re.rst:1330 msgid "Named groups can also be referred to by their index::" msgstr "" -#: ../../library/re.rst:1330 +#: ../../library/re.rst:1337 msgid "If a group matches multiple times, only the last match is accessible::" msgstr "" -#: ../../library/re.rst:1339 +#: ../../library/re.rst:1346 msgid "" "This is identical to ``m.group(g)``. This allows easier access to an " "individual group from a match::" msgstr "" -#: ../../library/re.rst:1350 +#: ../../library/re.rst:1357 msgid "Named groups are supported as well::" msgstr "" -#: ../../library/re.rst:1363 +#: ../../library/re.rst:1370 msgid "" "Return a tuple containing all the subgroups of the match, from 1 up to " "however many groups are in the pattern. The *default* argument is used for " "groups that did not participate in the match; it defaults to ``None``." msgstr "" -#: ../../library/re.rst:1367 ../../library/re.rst:1592 +#: ../../library/re.rst:1374 ../../library/re.rst:1599 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/re.rst:1373 +#: ../../library/re.rst:1380 msgid "" "If we make the decimal place and everything after it optional, not all " "groups might participate in the match. These groups will default to " "``None`` unless the *default* argument is given::" msgstr "" -#: ../../library/re.rst:1386 +#: ../../library/re.rst:1393 msgid "" "Return a dictionary containing all the *named* subgroups of the match, keyed " "by the subgroup name. The *default* argument is used for groups that did " "not participate in the match; it defaults to ``None``. For example::" msgstr "" -#: ../../library/re.rst:1398 +#: ../../library/re.rst:1405 msgid "" "Return the indices of the start and end of the substring matched by *group*; " "*group* defaults to zero (meaning the whole matched substring). Return " @@ -1601,7 +1609,7 @@ msgid "" "matched by group *g* (equivalent to ``m.group(g)``) is ::" msgstr "" -#: ../../library/re.rst:1406 +#: ../../library/re.rst:1413 msgid "" "Note that ``m.start(group)`` will equal ``m.end(group)`` if *group* matched " "a null string. For example, after ``m = re.search('b(c?)', 'cba')``, ``m." @@ -1609,32 +1617,32 @@ msgid "" "2, and ``m.start(2)`` raises an :exc:`IndexError` exception." msgstr "" -#: ../../library/re.rst:1411 +#: ../../library/re.rst:1418 msgid "An example that will remove *remove_this* from email addresses::" msgstr "" -#: ../../library/re.rst:1421 +#: ../../library/re.rst:1428 msgid "" "For a match *m*, return the 2-tuple ``(m.start(group), m.end(group))``. Note " "that if *group* did not contribute to the match, this is ``(-1, -1)``. " "*group* defaults to zero, the entire match." msgstr "" -#: ../../library/re.rst:1428 +#: ../../library/re.rst:1435 msgid "" "The value of *pos* which was passed to the :meth:`~Pattern.search` or :meth:" "`~Pattern.match` method of a :ref:`regex object `. This is the " "index into the string at which the RE engine started looking for a match." msgstr "" -#: ../../library/re.rst:1435 +#: ../../library/re.rst:1442 msgid "" "The value of *endpos* which was passed to the :meth:`~Pattern.search` or :" "meth:`~Pattern.match` method of a :ref:`regex object `. This is " "the index into the string beyond which the RE engine will not go." msgstr "" -#: ../../library/re.rst:1442 +#: ../../library/re.rst:1449 msgid "" "The integer index of the last matched capturing group, or ``None`` if no " "group was matched at all. For example, the expressions ``(a)b``, ``((a)" @@ -1643,43 +1651,43 @@ msgid "" "applied to the same string." msgstr "" -#: ../../library/re.rst:1451 +#: ../../library/re.rst:1458 msgid "" "The name of the last matched capturing group, or ``None`` if the group " "didn't have a name, or if no group was matched at all." msgstr "" -#: ../../library/re.rst:1457 +#: ../../library/re.rst:1464 msgid "" "The :ref:`regular expression object ` whose :meth:`~Pattern." "match` or :meth:`~Pattern.search` method produced this match instance." msgstr "" -#: ../../library/re.rst:1463 +#: ../../library/re.rst:1470 msgid "The string passed to :meth:`~Pattern.match` or :meth:`~Pattern.search`." msgstr "" -#: ../../library/re.rst:1466 +#: ../../library/re.rst:1473 msgid "" "Added support of :func:`copy.copy` and :func:`copy.deepcopy`. Match objects " "are considered atomic." msgstr "" -#: ../../library/re.rst:1474 +#: ../../library/re.rst:1481 msgid "Regular Expression Examples" msgstr "" -#: ../../library/re.rst:1478 +#: ../../library/re.rst:1485 msgid "Checking for a Pair" msgstr "" -#: ../../library/re.rst:1480 +#: ../../library/re.rst:1487 msgid "" "In this example, we'll use the following helper function to display match " "objects a little more gracefully::" msgstr "" -#: ../../library/re.rst:1488 +#: ../../library/re.rst:1495 msgid "" "Suppose you are writing a poker program where a player's hand is represented " "as a 5-character string with each character representing a card, \"a\" for " @@ -1687,28 +1695,28 @@ msgid "" "\"2\" through \"9\" representing the card with that value." msgstr "" -#: ../../library/re.rst:1493 +#: ../../library/re.rst:1500 msgid "To see if a given string is a valid hand, one could do the following::" msgstr "" -#: ../../library/re.rst:1503 +#: ../../library/re.rst:1510 msgid "" "That last hand, ``\"727ak\"``, contained a pair, or two of the same valued " "cards. To match this with a regular expression, one could use backreferences " "as such::" msgstr "" -#: ../../library/re.rst:1513 +#: ../../library/re.rst:1520 msgid "" "To find out what card the pair consists of, one could use the :meth:`~Match." "group` method of the match object in the following manner::" msgstr "" -#: ../../library/re.rst:1532 +#: ../../library/re.rst:1539 msgid "Simulating scanf()" msgstr "" -#: ../../library/re.rst:1536 +#: ../../library/re.rst:1543 msgid "" "Python does not currently have an equivalent to :c:func:`!scanf`. Regular " "expressions are generally more powerful, though also more verbose, than :c:" @@ -1717,124 +1725,124 @@ msgid "" "expressions." msgstr "" -#: ../../library/re.rst:1543 +#: ../../library/re.rst:1550 msgid ":c:func:`!scanf` Token" msgstr "" -#: ../../library/re.rst:1543 +#: ../../library/re.rst:1550 msgid "Regular Expression" msgstr "" -#: ../../library/re.rst:1545 +#: ../../library/re.rst:1552 msgid "``%c``" msgstr "``%c``" -#: ../../library/re.rst:1547 +#: ../../library/re.rst:1554 msgid "``%5c``" msgstr "``%5c``" -#: ../../library/re.rst:1547 +#: ../../library/re.rst:1554 msgid "``.{5}``" msgstr "``.{5}``" -#: ../../library/re.rst:1549 +#: ../../library/re.rst:1556 msgid "``%d``" msgstr "``%d``" -#: ../../library/re.rst:1549 +#: ../../library/re.rst:1556 msgid "``[-+]?\\d+``" msgstr "``[-+]?\\d+``" -#: ../../library/re.rst:1551 +#: ../../library/re.rst:1558 msgid "``%e``, ``%E``, ``%f``, ``%g``" msgstr "``%e``, ``%E``, ``%f``, ``%g``" -#: ../../library/re.rst:1551 +#: ../../library/re.rst:1558 msgid "``[-+]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?``" msgstr "``[-+]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?``" -#: ../../library/re.rst:1553 +#: ../../library/re.rst:1560 msgid "``%i``" msgstr "``%i``" -#: ../../library/re.rst:1553 +#: ../../library/re.rst:1560 msgid "``[-+]?(0[xX][\\dA-Fa-f]+|0[0-7]*|\\d+)``" msgstr "``[-+]?(0[xX][\\dA-Fa-f]+|0[0-7]*|\\d+)``" -#: ../../library/re.rst:1555 +#: ../../library/re.rst:1562 msgid "``%o``" msgstr "``%o``" -#: ../../library/re.rst:1555 +#: ../../library/re.rst:1562 msgid "``[-+]?[0-7]+``" msgstr "``[-+]?[0-7]+``" -#: ../../library/re.rst:1557 +#: ../../library/re.rst:1564 msgid "``%s``" msgstr "``%s``" -#: ../../library/re.rst:1557 +#: ../../library/re.rst:1564 msgid "``\\S+``" msgstr "``\\S+``" -#: ../../library/re.rst:1559 +#: ../../library/re.rst:1566 msgid "``%u``" msgstr "``%u``" -#: ../../library/re.rst:1559 +#: ../../library/re.rst:1566 msgid "``\\d+``" msgstr "``\\d+``" -#: ../../library/re.rst:1561 +#: ../../library/re.rst:1568 msgid "``%x``, ``%X``" msgstr "``%x``\\ 、\\ ``%X``" -#: ../../library/re.rst:1561 +#: ../../library/re.rst:1568 msgid "``[-+]?(0[xX])?[\\dA-Fa-f]+``" msgstr "``[-+]?(0[xX])?[\\dA-Fa-f]+``" -#: ../../library/re.rst:1564 +#: ../../library/re.rst:1571 msgid "To extract the filename and numbers from a string like ::" msgstr "" -#: ../../library/re.rst:1568 +#: ../../library/re.rst:1575 msgid "you would use a :c:func:`!scanf` format like ::" msgstr "" -#: ../../library/re.rst:1572 +#: ../../library/re.rst:1579 msgid "The equivalent regular expression would be ::" msgstr "" -#: ../../library/re.rst:1580 +#: ../../library/re.rst:1587 msgid "search() vs. match()" msgstr "" -#: ../../library/re.rst:1584 +#: ../../library/re.rst:1591 msgid "" "Python offers different primitive operations based on regular expressions:" msgstr "" -#: ../../library/re.rst:1586 +#: ../../library/re.rst:1593 msgid ":func:`re.match` checks for a match only at the beginning of the string" msgstr "" -#: ../../library/re.rst:1587 +#: ../../library/re.rst:1594 msgid "" ":func:`re.search` checks for a match anywhere in the string (this is what " "Perl does by default)" msgstr "" -#: ../../library/re.rst:1589 +#: ../../library/re.rst:1596 msgid ":func:`re.fullmatch` checks for entire string to be a match" msgstr "" -#: ../../library/re.rst:1601 +#: ../../library/re.rst:1608 msgid "" "Regular expressions beginning with ``'^'`` can be used with :func:`search` " "to restrict the match at the beginning of the string::" msgstr "" -#: ../../library/re.rst:1609 +#: ../../library/re.rst:1616 msgid "" "Note however that in :const:`MULTILINE` mode :func:`match` only matches at " "the beginning of the string, whereas using :func:`search` with a regular " @@ -1842,11 +1850,11 @@ msgid "" "line. ::" msgstr "" -#: ../../library/re.rst:1619 +#: ../../library/re.rst:1626 msgid "Making a Phonebook" msgstr "" -#: ../../library/re.rst:1621 +#: ../../library/re.rst:1628 msgid "" ":func:`split` splits a string into a list delimited by the passed pattern. " "The method is invaluable for converting textual data into data structures " @@ -1854,37 +1862,37 @@ msgid "" "following example that creates a phonebook." msgstr "" -#: ../../library/re.rst:1626 +#: ../../library/re.rst:1633 msgid "" "First, here is the input. Normally it may come from a file, here we are " "using triple-quoted string syntax" msgstr "" -#: ../../library/re.rst:1639 +#: ../../library/re.rst:1646 msgid "" "The entries are separated by one or more newlines. Now we convert the string " "into a list with each nonempty line having its own entry:" msgstr "" -#: ../../library/re.rst:1652 +#: ../../library/re.rst:1659 msgid "" "Finally, split each entry into a list with first name, last name, telephone " "number, and address. We use the ``maxsplit`` parameter of :func:`split` " "because the address has spaces, our splitting pattern, in it:" msgstr "" -#: ../../library/re.rst:1665 +#: ../../library/re.rst:1672 msgid "" "The ``:?`` pattern matches the colon after the last name, so that it does " "not occur in the result list. With a ``maxsplit`` of ``4``, we could " "separate the house number from the street name:" msgstr "" -#: ../../library/re.rst:1680 +#: ../../library/re.rst:1687 msgid "Text Munging" msgstr "" -#: ../../library/re.rst:1682 +#: ../../library/re.rst:1689 msgid "" ":func:`sub` replaces every occurrence of a pattern with a string or the " "result of a function. This example demonstrates using :func:`sub` with a " @@ -1892,11 +1900,11 @@ msgid "" "each word of a sentence except for the first and last characters::" msgstr "" -#: ../../library/re.rst:1700 +#: ../../library/re.rst:1707 msgid "Finding all Adverbs" msgstr "" -#: ../../library/re.rst:1702 +#: ../../library/re.rst:1709 msgid "" ":func:`findall` matches *all* occurrences of a pattern, not just the first " "one as :func:`search` does. For example, if a writer wanted to find all of " @@ -1904,24 +1912,24 @@ msgid "" "manner::" msgstr "" -#: ../../library/re.rst:1713 +#: ../../library/re.rst:1720 msgid "Finding all Adverbs and their Positions" msgstr "" -#: ../../library/re.rst:1715 +#: ../../library/re.rst:1722 msgid "" "If one wants more information about all matches of a pattern than the " -"matched text, :func:`finditer` is useful as it provides :ref:`match objects " -"` instead of strings. Continuing with the previous example, " -"if a writer wanted to find all of the adverbs *and their positions* in some " -"text, they would use :func:`finditer` in the following manner::" +"matched text, :func:`finditer` is useful as it provides :class:`~re.Match` " +"objects instead of strings. Continuing with the previous example, if a " +"writer wanted to find all of the adverbs *and their positions* in some text, " +"they would use :func:`finditer` in the following manner::" msgstr "" -#: ../../library/re.rst:1729 +#: ../../library/re.rst:1736 msgid "Raw String Notation" msgstr "" -#: ../../library/re.rst:1731 +#: ../../library/re.rst:1738 msgid "" "Raw string notation (``r\"text\"``) keeps regular expressions sane. Without " "it, every backslash (``'\\'``) in a regular expression would have to be " @@ -1929,7 +1937,7 @@ msgid "" "lines of code are functionally identical::" msgstr "" -#: ../../library/re.rst:1741 +#: ../../library/re.rst:1748 msgid "" "When one wants to match a literal backslash, it must be escaped in the " "regular expression. With raw string notation, this means ``r\"\\\\\"``. " @@ -1937,29 +1945,29 @@ msgid "" "following lines of code functionally identical::" msgstr "" -#: ../../library/re.rst:1753 +#: ../../library/re.rst:1760 msgid "Writing a Tokenizer" msgstr "" -#: ../../library/re.rst:1755 +#: ../../library/re.rst:1762 msgid "" "A `tokenizer or scanner `_ " "analyzes a string to categorize groups of characters. This is a useful " "first step in writing a compiler or interpreter." msgstr "" -#: ../../library/re.rst:1759 +#: ../../library/re.rst:1766 msgid "" "The text categories are specified with regular expressions. The technique " "is to combine those into a single master regular expression and to loop over " "successive matches::" msgstr "" -#: ../../library/re.rst:1815 +#: ../../library/re.rst:1822 msgid "The tokenizer produces the following output::" msgstr "" -#: ../../library/re.rst:1838 +#: ../../library/re.rst:1845 msgid "" "Friedl, Jeffrey. Mastering Regular Expressions. 3rd ed., O'Reilly Media, " "2009. The third edition of the book no longer covers Python at all, but the " @@ -1984,7 +1992,7 @@ msgstr ". (點)" #: ../../library/re.rst:555 ../../library/re.rst:567 ../../library/re.rst:574 #: ../../library/re.rst:588 ../../library/re.rst:595 ../../library/re.rst:609 #: ../../library/re.rst:618 ../../library/re.rst:623 ../../library/re.rst:798 -#: ../../library/re.rst:1005 +#: ../../library/re.rst:1003 msgid "in regular expressions" msgstr "於正規表示式中" @@ -2184,10 +2192,10 @@ msgstr "\\\\" msgid "# (hash)" msgstr "# (井字號)" -#: ../../library/re.rst:1005 +#: ../../library/re.rst:1003 msgid "\\g" msgstr "\\g" -#: ../../library/re.rst:1534 +#: ../../library/re.rst:1541 msgid "scanf()" msgstr "scanf()" diff --git a/library/stringprep.po b/library/stringprep.po index 5114ad1eb7..748e2b6f3a 100644 --- a/library/stringprep.po +++ b/library/stringprep.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-20 18:08+0800\n" +"POT-Creation-Date: 2023-08-27 18:15+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-" @@ -51,8 +51,8 @@ msgstr "" #: ../../library/stringprep.rst:29 msgid "" "The module :mod:`stringprep` only exposes the tables from :rfc:`3454`. As " -"these tables would be very large to represent them as dictionaries or lists, " -"the module uses the Unicode character database internally. The module source " +"these tables would be very large to represent as dictionaries or lists, the " +"module uses the Unicode character database internally. The module source " "code itself was generated using the ``mkstringprep.py`` utility." msgstr "" diff --git a/library/sys.po b/library/sys.po index c8381f9521..bf8dcc3cde 100644 --- a/library/sys.po +++ b/library/sys.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-20 00:03+0000\n" +"POT-Creation-Date: 2023-08-21 00:03+0000\n" "PO-Revision-Date: 2023-04-26 02:54+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -368,8 +368,8 @@ msgstr "" msgid "Integer specifying the handle of the Python DLL." msgstr "" -#: ../../library/sys.rst:282 ../../library/sys.rst:940 -#: ../../library/sys.rst:1677 ../../library/sys.rst:1914 +#: ../../library/sys.rst:282 ../../library/sys.rst:972 +#: ../../library/sys.rst:1717 ../../library/sys.rst:1953 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" @@ -414,31 +414,13 @@ msgid "" "in the future." msgstr "" -#: ../../library/sys.rst:339 ../../library/sys.rst:1087 -#: ../../library/sys.rst:1793 -msgid "Attribute" -msgstr "屬性" - -#: ../../library/sys.rst:339 ../../library/sys.rst:1087 -#: ../../library/sys.rst:1793 -msgid "Explanation" -msgstr "解釋" - -#: ../../library/sys.rst:341 -msgid ":const:`emscripten_version`" -msgstr ":const:`emscripten_version`" - -#: ../../library/sys.rst:341 +#: ../../library/sys.rst:338 msgid "" "Emscripten version as tuple of ints (major, minor, micro), e.g. ``(3, 1, " "8)``." msgstr "" -#: ../../library/sys.rst:344 -msgid ":const:`runtime`" -msgstr ":const:`runtime`" - -#: ../../library/sys.rst:344 +#: ../../library/sys.rst:342 msgid "" "Runtime string, e.g. browser user agent, ``'Node.js v14.18.2'``, or " "``'UNKNOWN'``." @@ -446,27 +428,19 @@ msgstr "" "運行環境字串,例如瀏覽器使用者代理 (browser user agent) ``'Node.js " "v14.18.2'`` 或 ``'UNKNOWN'``。" -#: ../../library/sys.rst:347 -msgid ":const:`pthreads`" -msgstr ":const:`pthreads`" - -#: ../../library/sys.rst:347 +#: ../../library/sys.rst:346 msgid "``True`` if Python is compiled with Emscripten pthreads support." msgstr "" -#: ../../library/sys.rst:350 -msgid ":const:`shared_memory`" -msgstr ":const:`shared_memory`" - #: ../../library/sys.rst:350 msgid "``True`` if Python is compiled with shared memory support." msgstr "" -#: ../../library/sys.rst:354 +#: ../../library/sys.rst:352 msgid ":ref:`Availability `: Emscripten." msgstr ":ref:`適用 `:Emscripten。" -#: ../../library/sys.rst:361 +#: ../../library/sys.rst:359 msgid "" "If this is set (not ``None``), Python will write bytecode-cache ``.pyc`` " "files to (and read them from) a parallel directory tree rooted at this " @@ -477,12 +451,12 @@ msgid "" "with the same pycache prefix (if any) that you will use at runtime." msgstr "" -#: ../../library/sys.rst:369 +#: ../../library/sys.rst:367 msgid "" "A relative path is interpreted relative to the current working directory." msgstr "" -#: ../../library/sys.rst:371 +#: ../../library/sys.rst:369 msgid "" "This value is initially set based on the value of the :option:`-X` " "``pycache_prefix=PATH`` command-line option or the :envvar:" @@ -490,12 +464,12 @@ msgid "" "If neither are set, it is ``None``." msgstr "" -#: ../../library/sys.rst:381 +#: ../../library/sys.rst:379 msgid "" "This function prints out a given traceback and exception to ``sys.stderr``." msgstr "" -#: ../../library/sys.rst:383 +#: ../../library/sys.rst:381 msgid "" "When an exception is raised and uncaught, the interpreter calls ``sys." "excepthook`` with three arguments, the exception class, exception instance, " @@ -506,7 +480,7 @@ msgid "" "excepthook``." msgstr "" -#: ../../library/sys.rst:390 +#: ../../library/sys.rst:388 msgid "" "Raises an :ref:`auditing event ` ``sys.excepthook`` with arguments " "``hook``, ``type``, ``value``, ``traceback``." @@ -514,7 +488,7 @@ msgstr "" "引發一個附帶引數 ``hook``、``type``、``value``、``traceback`` 的\\ :ref:`稽核" "事件 ` ``sys.excepthook``。" -#: ../../library/sys.rst:392 +#: ../../library/sys.rst:390 msgid "" "Raise an auditing event ``sys.excepthook`` with arguments ``hook``, " "``type``, ``value``, ``traceback`` when an uncaught exception occurs. If no " @@ -524,14 +498,14 @@ msgid "" "excepthook`` will be called." msgstr "" -#: ../../library/sys.rst:401 +#: ../../library/sys.rst:399 msgid "" "The :func:`sys.unraisablehook` function handles unraisable exceptions and " "the :func:`threading.excepthook` function handles exception raised by :func:" "`threading.Thread.run`." msgstr "" -#: ../../library/sys.rst:411 +#: ../../library/sys.rst:409 msgid "" "These objects contain the original values of ``breakpointhook``, " "``displayhook``, ``excepthook``, and ``unraisablehook`` at the start of the " @@ -540,15 +514,15 @@ msgid "" "get replaced with broken or alternative objects." msgstr "" -#: ../../library/sys.rst:417 +#: ../../library/sys.rst:415 msgid "__breakpointhook__" msgstr "__breakpointhook__" -#: ../../library/sys.rst:420 +#: ../../library/sys.rst:418 msgid "__unraisablehook__" msgstr "__unraisablehook__" -#: ../../library/sys.rst:426 +#: ../../library/sys.rst:424 msgid "" "This function, when called while an exception handler is executing (such as " "an ``except`` or ``except*`` clause), returns the exception instance that " @@ -556,11 +530,11 @@ msgid "" "another, only the exception handled by the innermost handler is accessible." msgstr "" -#: ../../library/sys.rst:431 +#: ../../library/sys.rst:429 msgid "If no exception handler is executing, this function returns ``None``." msgstr "" -#: ../../library/sys.rst:438 +#: ../../library/sys.rst:436 msgid "" "This function returns the old-style representation of the handled exception. " "If an exception ``e`` is currently handled (so :func:`exception` would " @@ -571,13 +545,13 @@ msgid "" "stack at the point where the exception last occurred." msgstr "" -#: ../../library/sys.rst:449 +#: ../../library/sys.rst:447 msgid "" "If no exception is being handled anywhere on the stack, this function return " "a tuple containing three ``None`` values." msgstr "" -#: ../../library/sys.rst:452 +#: ../../library/sys.rst:450 msgid "" "The ``type`` and ``traceback`` fields are now derived from the ``value`` " "(the exception instance), so when an exception is modified while it is being " @@ -585,7 +559,7 @@ msgid "" "func:`exc_info`." msgstr "" -#: ../../library/sys.rst:460 +#: ../../library/sys.rst:458 msgid "" "A string giving the site-specific directory prefix where the platform-" "dependent Python files are installed; by default, this is also ``'/usr/" @@ -597,7 +571,7 @@ msgid "" "is the version number of Python, for example ``3.2``." msgstr "" -#: ../../library/sys.rst:471 +#: ../../library/sys.rst:469 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 " @@ -605,7 +579,7 @@ msgid "" "`base_exec_prefix`." msgstr "" -#: ../../library/sys.rst:479 +#: ../../library/sys.rst:477 msgid "" "A string giving the absolute path of the executable binary for the Python " "interpreter, on systems where this makes sense. If Python is unable to " @@ -613,13 +587,13 @@ msgid "" "empty string or ``None``." msgstr "" -#: ../../library/sys.rst:487 +#: ../../library/sys.rst:485 msgid "" "Raise a :exc:`SystemExit` exception, signaling an intention to exit the " "interpreter." msgstr "" -#: ../../library/sys.rst:489 +#: ../../library/sys.rst:487 msgid "" "The optional argument *arg* can be an integer giving the exit status " "(defaulting to zero), or another type of object. If it is an integer, zero " @@ -635,7 +609,7 @@ msgid "" "way to exit a program when an error occurs." msgstr "" -#: ../../library/sys.rst:502 +#: ../../library/sys.rst:500 msgid "" "Since :func:`exit` ultimately \"only\" raises an exception, it will only " "exit the process when called from the main thread, and the exception is not " @@ -644,194 +618,113 @@ msgid "" "an outer level." msgstr "" -#: ../../library/sys.rst:507 +#: ../../library/sys.rst:505 msgid "" "If an error occurs in the cleanup after the Python interpreter has caught :" "exc:`SystemExit` (such as an error flushing buffered data in the standard " "streams), the exit status is changed to 120." msgstr "" -#: ../../library/sys.rst:515 +#: ../../library/sys.rst:513 msgid "" "The :term:`named tuple` *flags* exposes the status of command line flags. " "The attributes are read only." msgstr "" -#: ../../library/sys.rst:519 ../../library/sys.rst:580 -#: ../../library/sys.rst:986 -msgid "attribute" -msgstr "屬性" - #: ../../library/sys.rst:519 -msgid "flag" -msgstr "旗標" - -#: ../../library/sys.rst:521 -msgid ":const:`debug`" -msgstr ":const:`debug`" - -#: ../../library/sys.rst:521 msgid ":option:`-d`" msgstr ":option:`-d`" -#: ../../library/sys.rst:522 -msgid ":const:`inspect`" -msgstr ":const:`inspect`" - -#: ../../library/sys.rst:522 ../../library/sys.rst:523 +#: ../../library/sys.rst:522 ../../library/sys.rst:525 msgid ":option:`-i`" msgstr ":option:`-i`" -#: ../../library/sys.rst:523 -msgid ":const:`interactive`" -msgstr ":const:`interactive`" - -#: ../../library/sys.rst:524 -msgid ":const:`isolated`" -msgstr ":const:`isolated`" - -#: ../../library/sys.rst:524 +#: ../../library/sys.rst:528 msgid ":option:`-I`" msgstr ":option:`-I`" -#: ../../library/sys.rst:525 -msgid ":const:`optimize`" -msgstr ":const:`optimize`" - -#: ../../library/sys.rst:525 +#: ../../library/sys.rst:531 msgid ":option:`-O` or :option:`-OO`" msgstr ":option:`-O` 或 :option:`-OO`" -#: ../../library/sys.rst:526 -msgid ":const:`dont_write_bytecode`" -msgstr ":const:`dont_write_bytecode`" - -#: ../../library/sys.rst:526 +#: ../../library/sys.rst:534 msgid ":option:`-B`" msgstr ":option:`-B`" -#: ../../library/sys.rst:527 -msgid ":const:`no_user_site`" -msgstr ":const:`no_user_site`" - -#: ../../library/sys.rst:527 +#: ../../library/sys.rst:537 msgid ":option:`-s`" msgstr ":option:`-s`" -#: ../../library/sys.rst:528 -msgid ":const:`no_site`" -msgstr ":const:`no_site`" - -#: ../../library/sys.rst:528 +#: ../../library/sys.rst:540 msgid ":option:`-S`" msgstr ":option:`-S`" -#: ../../library/sys.rst:529 -msgid ":const:`ignore_environment`" -msgstr ":const:`ignore_environment`" - -#: ../../library/sys.rst:529 +#: ../../library/sys.rst:543 msgid ":option:`-E`" msgstr ":option:`-E`" -#: ../../library/sys.rst:530 -msgid ":const:`verbose`" -msgstr ":const:`verbose`" - -#: ../../library/sys.rst:530 +#: ../../library/sys.rst:546 msgid ":option:`-v`" msgstr ":option:`-v`" -#: ../../library/sys.rst:531 -msgid ":const:`bytes_warning`" -msgstr ":const:`bytes_warning`" - -#: ../../library/sys.rst:531 +#: ../../library/sys.rst:549 msgid ":option:`-b`" msgstr ":option:`-b`" -#: ../../library/sys.rst:532 -msgid ":const:`quiet`" -msgstr ":const:`quiet`" - -#: ../../library/sys.rst:532 +#: ../../library/sys.rst:552 msgid ":option:`-q`" msgstr ":option:`-q`" -#: ../../library/sys.rst:533 -msgid ":const:`hash_randomization`" -msgstr ":const:`hash_randomization`" - -#: ../../library/sys.rst:533 +#: ../../library/sys.rst:555 msgid ":option:`-R`" msgstr ":option:`-R`" -#: ../../library/sys.rst:534 -msgid ":const:`dev_mode`" -msgstr ":const:`dev_mode`" - -#: ../../library/sys.rst:534 +#: ../../library/sys.rst:558 msgid ":option:`-X dev <-X>` (:ref:`Python Development Mode `)" msgstr ":option:`-X dev <-X>` (:ref:`Python 開發模式 `)" -#: ../../library/sys.rst:535 -msgid ":const:`utf8_mode`" -msgstr ":const:`utf8_mode`" - -#: ../../library/sys.rst:535 +#: ../../library/sys.rst:561 msgid ":option:`-X utf8 <-X>`" msgstr ":option:`-X utf8 <-X>`" -#: ../../library/sys.rst:536 -msgid ":const:`safe_path`" -msgstr ":const:`safe_path`" - -#: ../../library/sys.rst:536 +#: ../../library/sys.rst:564 msgid ":option:`-P`" msgstr ":option:`-P`" -#: ../../library/sys.rst:537 -msgid ":const:`int_max_str_digits`" -msgstr ":const:`int_max_str_digits`" - -#: ../../library/sys.rst:537 +#: ../../library/sys.rst:567 msgid "" ":option:`-X int_max_str_digits <-X>` (:ref:`integer string conversion length " "limitation `)" msgstr "" -#: ../../library/sys.rst:538 -msgid ":const:`warn_default_encoding`" -msgstr ":const:`warn_default_encoding`" - -#: ../../library/sys.rst:538 +#: ../../library/sys.rst:571 msgid ":option:`-X warn_default_encoding <-X>`" msgstr ":option:`-X warn_default_encoding <-X>`" -#: ../../library/sys.rst:541 +#: ../../library/sys.rst:573 msgid "Added ``quiet`` attribute for the new :option:`-q` flag." msgstr "新增 ``quiet`` 屬性,用於新的 :option:`-q` 旗標。" -#: ../../library/sys.rst:544 +#: ../../library/sys.rst:576 msgid "The ``hash_randomization`` attribute." msgstr "``hash_randomization`` 屬性。" -#: ../../library/sys.rst:547 +#: ../../library/sys.rst:579 msgid "Removed obsolete ``division_warning`` attribute." msgstr "移除過時的 ``division_warning`` 屬性。" -#: ../../library/sys.rst:550 +#: ../../library/sys.rst:582 msgid "Added ``isolated`` attribute for :option:`-I` ``isolated`` flag." msgstr "新增 ``isolated`` 屬性,用於 :option:`-I` ``isolated`` 旗標。" -#: ../../library/sys.rst:553 +#: ../../library/sys.rst:585 msgid "" "Added the ``dev_mode`` attribute for the new :ref:`Python Development Mode " "` and the ``utf8_mode`` attribute for the new :option:`-X` " "``utf8`` flag." msgstr "" -#: ../../library/sys.rst:558 +#: ../../library/sys.rst:590 msgid "" "Added ``warn_default_encoding`` attribute for :option:`-X` " "``warn_default_encoding`` flag." @@ -839,15 +732,15 @@ msgstr "" "新增 ``warn_default_encoding`` 屬性,用於 :option:`-X` " "``warn_default_encoding`` 旗標。" -#: ../../library/sys.rst:561 +#: ../../library/sys.rst:593 msgid "Added the ``safe_path`` attribute for :option:`-P` option." msgstr "新增 ``safe_path`` 屬性,用於 :option:`-P` 選項。" -#: ../../library/sys.rst:564 +#: ../../library/sys.rst:596 msgid "Added the ``int_max_str_digits`` attribute." msgstr "新增 ``int_max_str_digits`` 屬性。" -#: ../../library/sys.rst:570 +#: ../../library/sys.rst:602 msgid "" "A :term:`named tuple` holding information about the float type. It contains " "low level information about the precision and internal representation. The " @@ -857,157 +750,161 @@ msgid "" "floating types', for details." msgstr "" -#: ../../library/sys.rst:577 +#: ../../library/sys.rst:609 msgid "Attributes of the :data:`!float_info` :term:`named tuple`" msgstr "" -#: ../../library/sys.rst:581 +#: ../../library/sys.rst:612 +msgid "attribute" +msgstr "屬性" + +#: ../../library/sys.rst:613 msgid "float.h macro" msgstr "float.h macro" -#: ../../library/sys.rst:582 ../../library/sys.rst:986 +#: ../../library/sys.rst:614 msgid "explanation" msgstr "解釋" -#: ../../library/sys.rst:585 +#: ../../library/sys.rst:617 msgid ":c:macro:`!DBL_EPSILON`" msgstr ":c:macro:`!DBL_EPSILON`" -#: ../../library/sys.rst:586 +#: ../../library/sys.rst:618 msgid "" "difference between 1.0 and the least value greater than 1.0 that is " "representable as a float." msgstr "" -#: ../../library/sys.rst:589 +#: ../../library/sys.rst:621 msgid "See also :func:`math.ulp`." msgstr "另請參閱 :func:`math.ulp`。" -#: ../../library/sys.rst:592 +#: ../../library/sys.rst:624 msgid ":c:macro:`!DBL_DIG`" msgstr ":c:macro:`!DBL_DIG`" -#: ../../library/sys.rst:593 +#: ../../library/sys.rst:625 msgid "" "The maximum number of decimal digits that can be faithfully represented in a " "float; see below." msgstr "" -#: ../../library/sys.rst:597 +#: ../../library/sys.rst:629 msgid ":c:macro:`!DBL_MANT_DIG`" msgstr ":c:macro:`!DBL_MANT_DIG`" -#: ../../library/sys.rst:598 +#: ../../library/sys.rst:630 msgid "" "Float precision: the number of base-``radix`` digits in the significand of a " "float." msgstr "" -#: ../../library/sys.rst:602 +#: ../../library/sys.rst:634 msgid ":c:macro:`!DBL_MAX`" msgstr ":c:macro:`!DBL_MAX`" -#: ../../library/sys.rst:603 +#: ../../library/sys.rst:635 msgid "The maximum representable positive finite float." msgstr "" -#: ../../library/sys.rst:606 +#: ../../library/sys.rst:638 msgid ":c:macro:`!DBL_MAX_EXP`" msgstr ":c:macro:`!DBL_MAX_EXP`" -#: ../../library/sys.rst:607 +#: ../../library/sys.rst:639 msgid "" "The maximum integer *e* such that ``radix**(e-1)`` is a representable finite " "float." msgstr "" -#: ../../library/sys.rst:611 +#: ../../library/sys.rst:643 msgid ":c:macro:`!DBL_MAX_10_EXP`" msgstr ":c:macro:`!DBL_MAX_10_EXP`" -#: ../../library/sys.rst:612 +#: ../../library/sys.rst:644 msgid "" "The maximum integer *e* such that ``10**e`` is in the range of representable " "finite floats." msgstr "" -#: ../../library/sys.rst:616 +#: ../../library/sys.rst:648 msgid ":c:macro:`!DBL_MIN`" msgstr ":c:macro:`!DBL_MIN`" -#: ../../library/sys.rst:617 +#: ../../library/sys.rst:649 msgid "The minimum representable positive *normalized* float." msgstr "" -#: ../../library/sys.rst:619 +#: ../../library/sys.rst:651 msgid "" "Use :func:`math.ulp(0.0) ` to get the smallest positive " "*denormalized* representable float." msgstr "" -#: ../../library/sys.rst:623 +#: ../../library/sys.rst:655 msgid ":c:macro:`!DBL_MIN_EXP`" msgstr ":c:macro:`!DBL_MIN_EXP`" -#: ../../library/sys.rst:624 +#: ../../library/sys.rst:656 msgid "" "The minimum integer *e* such that ``radix**(e-1)`` is a normalized float." msgstr "" -#: ../../library/sys.rst:628 +#: ../../library/sys.rst:660 msgid ":c:macro:`!DBL_MIN_10_EXP`" msgstr ":c:macro:`!DBL_MIN_10_EXP`" -#: ../../library/sys.rst:629 +#: ../../library/sys.rst:661 msgid "The minimum integer *e* such that ``10**e`` is a normalized float." msgstr "" -#: ../../library/sys.rst:632 +#: ../../library/sys.rst:664 msgid ":c:macro:`!FLT_RADIX`" msgstr ":c:macro:`!FLT_RADIX`" -#: ../../library/sys.rst:633 +#: ../../library/sys.rst:665 msgid "The radix of exponent representation." msgstr "" -#: ../../library/sys.rst:636 +#: ../../library/sys.rst:668 msgid ":c:macro:`!FLT_ROUNDS`" msgstr ":c:macro:`!FLT_ROUNDS`" -#: ../../library/sys.rst:637 +#: ../../library/sys.rst:669 msgid "" "An integer representing the rounding mode for floating-point arithmetic. " "This reflects the value of the system :c:macro:`!FLT_ROUNDS` macro at " "interpreter startup time:" msgstr "" -#: ../../library/sys.rst:641 +#: ../../library/sys.rst:673 msgid "``-1``: indeterminable" msgstr "" -#: ../../library/sys.rst:642 +#: ../../library/sys.rst:674 msgid "``0``: toward zero" msgstr "" -#: ../../library/sys.rst:643 +#: ../../library/sys.rst:675 msgid "``1``: to nearest" msgstr "" -#: ../../library/sys.rst:644 +#: ../../library/sys.rst:676 msgid "``2``: toward positive infinity" msgstr "" -#: ../../library/sys.rst:645 +#: ../../library/sys.rst:677 msgid "``3``: toward negative infinity" msgstr "" -#: ../../library/sys.rst:647 +#: ../../library/sys.rst:679 msgid "" "All other values for :c:macro:`!FLT_ROUNDS` characterize implementation-" "defined rounding behavior." msgstr "" -#: ../../library/sys.rst:650 +#: ../../library/sys.rst:682 msgid "" "The attribute :attr:`sys.float_info.dig` needs further explanation. If " "``s`` is any string representing a decimal number with at most :attr:`!sys." @@ -1015,13 +912,13 @@ msgid "" "back again will recover a string representing the same decimal value::" msgstr "" -#: ../../library/sys.rst:663 +#: ../../library/sys.rst:695 msgid "" "But for strings with more than :attr:`sys.float_info.dig` significant " "digits, this isn't always true::" msgstr "" -#: ../../library/sys.rst:672 +#: ../../library/sys.rst:704 msgid "" "A string indicating how the :func:`repr` function behaves for floats. If " "the string has value ``'short'`` then for a finite float ``x``, ``repr(x)`` " @@ -1031,7 +928,7 @@ msgid "" "same way as it did in versions of Python prior to 3.1." msgstr "" -#: ../../library/sys.rst:685 +#: ../../library/sys.rst:717 msgid "" "Return the number of memory blocks currently allocated by the interpreter, " "regardless of their size. This function is mainly useful for tracking and " @@ -1041,42 +938,42 @@ msgid "" "results." msgstr "" -#: ../../library/sys.rst:692 +#: ../../library/sys.rst:724 msgid "" "If a Python build or implementation cannot reasonably compute this " "information, :func:`getallocatedblocks()` is allowed to return 0 instead." msgstr "" -#: ../../library/sys.rst:700 +#: ../../library/sys.rst:732 msgid "Return the number of unicode objects that have been interned." msgstr "" -#: ../../library/sys.rst:707 +#: ../../library/sys.rst:739 msgid "Return the build time API version of Android as an integer." msgstr "" -#: ../../library/sys.rst:709 +#: ../../library/sys.rst:741 msgid ":ref:`Availability `: Android." msgstr ":ref:`適用 `:Android。" -#: ../../library/sys.rst:716 +#: ../../library/sys.rst:748 msgid "" "Return the name of the current default string encoding used by the Unicode " "implementation." msgstr "" -#: ../../library/sys.rst:722 +#: ../../library/sys.rst:754 msgid "" "Return the current value of the flags that are used for :c:func:`dlopen` " "calls. Symbolic names for the flag values can be found in the :mod:`os` " "module (``RTLD_xxx`` constants, e.g. :const:`os.RTLD_LAZY`)." msgstr "" -#: ../../library/sys.rst:727 ../../library/sys.rst:1407 +#: ../../library/sys.rst:759 ../../library/sys.rst:1447 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" -#: ../../library/sys.rst:732 +#: ../../library/sys.rst:764 msgid "" "Get the :term:`filesystem encoding `: " "the encoding used with the :term:`filesystem error handler ` is enabled." msgstr "" -#: ../../library/sys.rst:765 +#: ../../library/sys.rst:797 msgid "" "Get the :term:`filesystem error handler `: the error handler used with the :term:`filesystem encoding " @@ -1131,20 +1028,20 @@ msgid "" "func:`getfilesystemencoding`." msgstr "" -#: ../../library/sys.rst:783 +#: ../../library/sys.rst:815 msgid "" "Returns the current value for the :ref:`integer string conversion length " "limitation `. See also :func:`set_int_max_str_digits`." msgstr "" -#: ../../library/sys.rst:790 +#: ../../library/sys.rst:822 msgid "" "Return the reference count of the *object*. The count returned is generally " "one higher than you might expect, because it includes the (temporary) " "reference as an argument to :func:`getrefcount`." msgstr "" -#: ../../library/sys.rst:794 +#: ../../library/sys.rst:826 msgid "" "Note that the returned value may not actually reflect how many references to " "the object are actually held. For example, some objects are \"immortal\" " @@ -1153,13 +1050,13 @@ msgid "" "other than a value of 0 or 1." msgstr "" -#: ../../library/sys.rst:800 +#: ../../library/sys.rst:832 msgid "" "Immortal objects have very large refcounts that do not match the actual " "number of references to the object." msgstr "" -#: ../../library/sys.rst:806 +#: ../../library/sys.rst:838 msgid "" "Return the current value of the recursion limit, the maximum depth of the " "Python interpreter stack. This limit prevents infinite recursion from " @@ -1167,46 +1064,46 @@ msgid "" "func:`setrecursionlimit`." msgstr "" -#: ../../library/sys.rst:814 +#: ../../library/sys.rst:846 msgid "" "Return the size of an object in bytes. The object can be any type of object. " "All built-in objects will return correct results, but this does not have to " "hold true for third-party extensions as it is implementation specific." msgstr "" -#: ../../library/sys.rst:819 +#: ../../library/sys.rst:851 msgid "" "Only the memory consumption directly attributed to the object is accounted " "for, not the memory consumption of objects it refers to." msgstr "" -#: ../../library/sys.rst:822 +#: ../../library/sys.rst:854 msgid "" "If given, *default* will be returned if the object does not provide means to " "retrieve the size. Otherwise a :exc:`TypeError` will be raised." msgstr "" -#: ../../library/sys.rst:825 +#: ../../library/sys.rst:857 msgid "" ":func:`getsizeof` calls the object's ``__sizeof__`` method and adds an " "additional garbage collector overhead if the object is managed by the " "garbage collector." msgstr "" -#: ../../library/sys.rst:829 +#: ../../library/sys.rst:861 msgid "" "See `recursive sizeof recipe `_ for an example of using :func:`getsizeof` recursively to find the size " "of containers and all their contents." msgstr "" -#: ../../library/sys.rst:835 +#: ../../library/sys.rst:867 msgid "" "Return the interpreter's \"thread switch interval\"; see :func:" "`setswitchinterval`." msgstr "" -#: ../../library/sys.rst:843 +#: ../../library/sys.rst:875 msgid "" "Return a frame object from the call stack. If optional integer *depth* is " "given, return the frame object that many calls below the top of the stack. " @@ -1215,7 +1112,7 @@ msgid "" "stack." msgstr "" -#: ../../library/sys.rst:848 +#: ../../library/sys.rst:880 msgid "" "Raises an :ref:`auditing event ` ``sys._getframe`` with argument " "``frame``." @@ -1223,13 +1120,13 @@ msgstr "" "引發一個附帶引數 ``frame`` 的\\ :ref:`稽核事件 ` ``sys." "_getframe``。" -#: ../../library/sys.rst:852 ../../library/sys.rst:868 +#: ../../library/sys.rst:884 ../../library/sys.rst:900 msgid "" "This function should be used for internal and specialized purposes only. It " "is not guaranteed to exist in all implementations of Python." msgstr "" -#: ../../library/sys.rst:858 +#: ../../library/sys.rst:890 msgid "" "Return the name of a module from the call stack. If optional integer " "*depth* is given, return the module that many calls below the top of the " @@ -1238,7 +1135,7 @@ msgid "" "returning the module at the top of the call stack." msgstr "" -#: ../../library/sys.rst:864 +#: ../../library/sys.rst:896 msgid "" "Raises an :ref:`auditing event ` ``sys._getframemodulename`` with " "argument ``depth``." @@ -1246,15 +1143,15 @@ msgstr "" "引發一個附帶引數 ``depth`` 的\\ :ref:`稽核事件 ` ``sys." "_getframemodulename``。" -#: ../../library/sys.rst:878 +#: ../../library/sys.rst:910 msgid "Get the profiler function as set by :func:`setprofile`." msgstr "" -#: ../../library/sys.rst:887 +#: ../../library/sys.rst:919 msgid "Get the trace function as set by :func:`settrace`." msgstr "" -#: ../../library/sys.rst:891 +#: ../../library/sys.rst:923 msgid "" "The :func:`gettrace` function is intended only for implementing debuggers, " "profilers, coverage tools and the like. Its behavior is part of the " @@ -1262,7 +1159,7 @@ msgid "" "thus may not be available in all Python implementations." msgstr "" -#: ../../library/sys.rst:899 +#: ../../library/sys.rst:931 msgid "" "Return a named tuple describing the Windows version currently running. The " "named elements are *major*, *minor*, *build*, *platform*, *service_pack*, " @@ -1274,54 +1171,54 @@ msgid "" "first 5 elements are retrievable by indexing." msgstr "" -#: ../../library/sys.rst:910 +#: ../../library/sys.rst:942 msgid "*platform* will be ``2`` (VER_PLATFORM_WIN32_NT)." msgstr "" -#: ../../library/sys.rst:912 +#: ../../library/sys.rst:944 msgid "*product_type* may be one of the following values:" msgstr "" -#: ../../library/sys.rst:915 +#: ../../library/sys.rst:947 msgid "Constant" msgstr "" -#: ../../library/sys.rst:915 +#: ../../library/sys.rst:947 msgid "Meaning" msgstr "" -#: ../../library/sys.rst:917 +#: ../../library/sys.rst:949 msgid "``1`` (VER_NT_WORKSTATION)" msgstr "``1`` (VER_NT_WORKSTATION)" -#: ../../library/sys.rst:917 +#: ../../library/sys.rst:949 msgid "The system is a workstation." msgstr "" -#: ../../library/sys.rst:919 +#: ../../library/sys.rst:951 msgid "``2`` (VER_NT_DOMAIN_CONTROLLER)" msgstr "``2`` (VER_NT_DOMAIN_CONTROLLER)" -#: ../../library/sys.rst:919 +#: ../../library/sys.rst:951 msgid "The system is a domain controller." msgstr "" -#: ../../library/sys.rst:922 +#: ../../library/sys.rst:954 msgid "``3`` (VER_NT_SERVER)" msgstr "``3`` (VER_NT_SERVER)" -#: ../../library/sys.rst:922 +#: ../../library/sys.rst:954 msgid "The system is a server, but not a domain controller." msgstr "" -#: ../../library/sys.rst:926 +#: ../../library/sys.rst:958 msgid "" -"This function wraps the Win32 :c:func:`GetVersionEx` function; see the " -"Microsoft documentation on :c:func:`OSVERSIONINFOEX` for more information " +"This function wraps the Win32 :c:func:`!GetVersionEx` function; see the " +"Microsoft documentation on :c:func:`!OSVERSIONINFOEX` for more information " "about these fields." msgstr "" -#: ../../library/sys.rst:930 +#: ../../library/sys.rst:962 msgid "" "*platform_version* returns the major version, minor version and build number " "of the current operating system, rather than the version that is being " @@ -1329,24 +1226,24 @@ msgid "" "feature detection." msgstr "" -#: ../../library/sys.rst:936 +#: ../../library/sys.rst:968 msgid "" "*platform_version* derives the version from kernel32.dll which can be of a " "different version than the OS version. Please use :mod:`platform` module for " "achieving accurate OS version." msgstr "" -#: ../../library/sys.rst:942 +#: ../../library/sys.rst:974 msgid "" "Changed to a named tuple and added *service_pack_minor*, " "*service_pack_major*, *suite_mask*, and *product_type*." msgstr "" -#: ../../library/sys.rst:946 +#: ../../library/sys.rst:978 msgid "Added *platform_version*" msgstr "新增 *platform_version*" -#: ../../library/sys.rst:952 +#: ../../library/sys.rst:984 msgid "" "Returns an *asyncgen_hooks* object, which is similar to a :class:" "`~collections.namedtuple` of the form ``(firstiter, finalizer)``, where " @@ -1356,103 +1253,71 @@ msgid "" "loop." msgstr "" -#: ../../library/sys.rst:959 +#: ../../library/sys.rst:991 msgid "See :pep:`525` for more details." msgstr "更多細節請見 :pep:`525`\\ 。" -#: ../../library/sys.rst:963 ../../library/sys.rst:1609 +#: ../../library/sys.rst:995 ../../library/sys.rst:1649 msgid "" "This function has been added on a provisional basis (see :pep:`411` for " "details.)" msgstr "" -#: ../../library/sys.rst:969 +#: ../../library/sys.rst:1001 msgid "" "Get the current coroutine origin tracking depth, as set by :func:" "`set_coroutine_origin_tracking_depth`." msgstr "" -#: ../../library/sys.rst:975 ../../library/sys.rst:1630 +#: ../../library/sys.rst:1007 ../../library/sys.rst:1670 msgid "" "This function has been added on a provisional basis (see :pep:`411` for " "details.) Use it only for debugging purposes." msgstr "" -#: ../../library/sys.rst:981 +#: ../../library/sys.rst:1013 msgid "" "A :term:`named tuple` giving parameters of the numeric hash implementation. " "For more details about hashing of numeric types, see :ref:`numeric-hash`." msgstr "" -#: ../../library/sys.rst:988 -msgid ":const:`width`" -msgstr ":const:`width`" - -#: ../../library/sys.rst:988 -msgid "width in bits used for hash values" +#: ../../library/sys.rst:1019 +msgid "The width in bits used for hash values" msgstr "" -#: ../../library/sys.rst:990 -msgid ":const:`modulus`" -msgstr ":const:`modulus`" - -#: ../../library/sys.rst:990 -msgid "prime modulus P used for numeric hash scheme" +#: ../../library/sys.rst:1023 +msgid "The prime modulus P used for numeric hash scheme" msgstr "" -#: ../../library/sys.rst:992 -msgid ":const:`inf`" -msgstr ":const:`inf`" - -#: ../../library/sys.rst:992 -msgid "hash value returned for a positive infinity" +#: ../../library/sys.rst:1027 +msgid "The hash value returned for a positive infinity" msgstr "" -#: ../../library/sys.rst:994 -msgid ":const:`nan`" -msgstr ":const:`nan`" - -#: ../../library/sys.rst:994 -msgid "(this attribute is no longer used)" +#: ../../library/sys.rst:1031 +msgid "(This attribute is no longer used)" msgstr "" -#: ../../library/sys.rst:996 -msgid ":const:`imag`" -msgstr ":const:`imag`" - -#: ../../library/sys.rst:996 -msgid "multiplier used for the imaginary part of a complex number" +#: ../../library/sys.rst:1035 +msgid "The multiplier used for the imaginary part of a complex number" msgstr "" -#: ../../library/sys.rst:999 -msgid ":const:`algorithm`" -msgstr ":const:`algorithm`" - -#: ../../library/sys.rst:999 -msgid "name of the algorithm for hashing of str, bytes, and memoryview" +#: ../../library/sys.rst:1039 +msgid "The name of the algorithm for hashing of str, bytes, and memoryview" msgstr "" -#: ../../library/sys.rst:1002 -msgid ":const:`hash_bits`" -msgstr ":const:`hash_bits`" - -#: ../../library/sys.rst:1002 -msgid "internal output size of the hash algorithm" +#: ../../library/sys.rst:1043 +msgid "The internal output size of the hash algorithm" msgstr "" -#: ../../library/sys.rst:1004 -msgid ":const:`seed_bits`" -msgstr ":const:`seed_bits`" - -#: ../../library/sys.rst:1004 -msgid "size of the seed key of the hash algorithm" +#: ../../library/sys.rst:1047 +msgid "The size of the seed key of the hash algorithm" msgstr "" -#: ../../library/sys.rst:1010 +#: ../../library/sys.rst:1051 msgid "Added *algorithm*, *hash_bits* and *seed_bits*" msgstr "新增 *algorithm*\\ 、\\ *hash_bits* 與 *seed_bits*" -#: ../../library/sys.rst:1016 +#: ../../library/sys.rst:1057 msgid "" "The version number encoded as a single integer. This is guaranteed to " "increase with each version, including proper support for non-production " @@ -1460,7 +1325,7 @@ msgid "" "version 1.5.2, use::" msgstr "" -#: ../../library/sys.rst:1027 +#: ../../library/sys.rst:1068 msgid "" "This is called ``hexversion`` since it only really looks meaningful when " "viewed as the result of passing it to the built-in :func:`hex` function. " @@ -1468,25 +1333,25 @@ msgid "" "human-friendly encoding of the same information." msgstr "" -#: ../../library/sys.rst:1032 +#: ../../library/sys.rst:1073 msgid "More details of ``hexversion`` can be found at :ref:`apiabiversion`." msgstr "" -#: ../../library/sys.rst:1037 +#: ../../library/sys.rst:1078 msgid "" "An object containing information about the implementation of the currently " "running Python interpreter. The following attributes are required to exist " "in all Python implementations." msgstr "" -#: ../../library/sys.rst:1041 +#: ../../library/sys.rst:1082 msgid "" "*name* is the implementation's identifier, e.g. ``'cpython'``. The actual " "string is defined by the Python implementation, but it is guaranteed to be " "lower case." msgstr "" -#: ../../library/sys.rst:1045 +#: ../../library/sys.rst:1086 msgid "" "*version* is a named tuple, in the same format as :data:`sys.version_info`. " "It represents the version of the Python *implementation*. This has a " @@ -1498,13 +1363,13 @@ msgid "" "the same value, since it is the reference implementation." msgstr "" -#: ../../library/sys.rst:1055 +#: ../../library/sys.rst:1096 msgid "" "*hexversion* is the implementation version in hexadecimal format, like :data:" "`sys.hexversion`." msgstr "" -#: ../../library/sys.rst:1058 +#: ../../library/sys.rst:1099 msgid "" "*cache_tag* is the tag used by the import machinery in the filenames of " "cached modules. By convention, it would be a composite of the " @@ -1513,7 +1378,7 @@ msgid "" "set to ``None``, it indicates that module caching should be disabled." msgstr "" -#: ../../library/sys.rst:1065 +#: ../../library/sys.rst:1106 msgid "" ":data:`sys.implementation` may contain additional attributes specific to the " "Python implementation. These non-standard attributes must start with an " @@ -1523,61 +1388,49 @@ msgid "" "versions, however.) See :pep:`421` for more information." msgstr "" -#: ../../library/sys.rst:1076 +#: ../../library/sys.rst:1117 msgid "" "The addition of new required attributes must go through the normal PEP " "process. See :pep:`421` for more information." msgstr "" -#: ../../library/sys.rst:1081 +#: ../../library/sys.rst:1122 msgid "" "A :term:`named tuple` that holds information about Python's internal " "representation of integers. The attributes are read only." msgstr "" -#: ../../library/sys.rst:1089 -msgid ":const:`bits_per_digit`" -msgstr ":const:`bits_per_digit`" - -#: ../../library/sys.rst:1089 +#: ../../library/sys.rst:1127 msgid "" -"number of bits held in each digit. Python integers are stored internally in " -"base ``2**int_info.bits_per_digit``" +"The number of bits held in each digit. Python integers are stored internally " +"in base ``2**int_info.bits_per_digit``." msgstr "" -#: ../../library/sys.rst:1093 -msgid ":const:`sizeof_digit`" -msgstr ":const:`sizeof_digit`" - -#: ../../library/sys.rst:1093 -msgid "size in bytes of the C type used to represent a digit" +#: ../../library/sys.rst:1132 +msgid "The size in bytes of the C type used to represent a digit." msgstr "" -#: ../../library/sys.rst:1096 -msgid ":const:`default_max_str_digits`" -msgstr ":const:`default_max_str_digits`" - -#: ../../library/sys.rst:1096 +#: ../../library/sys.rst:1136 msgid "" -"default value for :func:`sys.get_int_max_str_digits` when it is not " +"The default value for :func:`sys.get_int_max_str_digits` when it is not " "otherwise explicitly configured." msgstr "" -#: ../../library/sys.rst:1100 -msgid ":const:`str_digits_check_threshold`" -msgstr ":const:`str_digits_check_threshold`" - -#: ../../library/sys.rst:1100 +#: ../../library/sys.rst:1141 msgid "" -"minimum non-zero value for :func:`sys.set_int_max_str_digits`, :envvar:" +"The minimum non-zero value for :func:`sys.set_int_max_str_digits`, :envvar:" "`PYTHONINTMAXSTRDIGITS`, or :option:`-X int_max_str_digits <-X>`." msgstr "" -#: ../../library/sys.rst:1108 -msgid "Added ``default_max_str_digits`` and ``str_digits_check_threshold``." -msgstr "新增 ``default_max_str_digits`` 和 ``str_digits_check_threshold``。" +#: ../../library/sys.rst:1148 +msgid "" +"Added :attr:`~int_info.default_max_str_digits` and :attr:`~int_info." +"str_digits_check_threshold`." +msgstr "" +"新增 :attr:`~int_info.default_max_str_digits` 和 :attr:`~int_info." +"str_digits_check_threshold`。" -#: ../../library/sys.rst:1114 +#: ../../library/sys.rst:1154 msgid "" "When this attribute exists, its value is automatically called (with no " "arguments) when the interpreter is launched in :ref:`interactive mode `." msgstr "" -#: ../../library/sys.rst:1120 +#: ../../library/sys.rst:1160 msgid "" "Raises an :ref:`auditing event ` ``cpython.run_interactivehook`` " "with argument ``hook``." @@ -1594,13 +1447,13 @@ msgstr "" "引發一個附帶引數 ``hook`` 的\\ :ref:`稽核事件 ` ``cpython." "run_interactivehook``。" -#: ../../library/sys.rst:1122 +#: ../../library/sys.rst:1162 msgid "" "Raises an :ref:`auditing event ` ``cpython.run_interactivehook`` " "with the hook object as the argument when the hook is called on startup." msgstr "" -#: ../../library/sys.rst:1131 +#: ../../library/sys.rst:1171 msgid "" "Enter *string* in the table of \"interned\" strings and return the interned " "string -- which is *string* itself or a copy. Interning strings is useful to " @@ -1612,19 +1465,19 @@ msgid "" "attributes have interned keys." msgstr "" -#: ../../library/sys.rst:1139 +#: ../../library/sys.rst:1179 msgid "" "Interned strings are not immortal; you must keep a reference to the return " "value of :func:`intern` around to benefit from it." msgstr "" -#: ../../library/sys.rst:1145 +#: ../../library/sys.rst:1185 msgid "" "Return :const:`True` if the Python interpreter is :term:`shutting down " "`, :const:`False` otherwise." msgstr "" -#: ../../library/sys.rst:1152 +#: ../../library/sys.rst:1192 msgid "" "This variable is not always defined; it is set to the exception instance " "when an exception is not handled and the interpreter prints an error message " @@ -1635,34 +1488,34 @@ msgid "" "more information.)" msgstr "" -#: ../../library/sys.rst:1166 +#: ../../library/sys.rst:1206 msgid "" "These three variables are deprecated; use :data:`sys.last_exc` instead. They " "hold the legacy representation of ``sys.last_exc``, as returned from :func:" "`exc_info` above." msgstr "" -#: ../../library/sys.rst:1172 +#: ../../library/sys.rst:1212 msgid "" "An integer giving the maximum value a variable of type :c:type:`Py_ssize_t` " "can take. It's usually ``2**31 - 1`` on a 32-bit platform and ``2**63 - 1`` " "on a 64-bit platform." msgstr "" -#: ../../library/sys.rst:1179 +#: ../../library/sys.rst:1219 msgid "" "An integer giving the value of the largest Unicode code point, i.e. " "``1114111`` (``0x10FFFF`` in hexadecimal)." msgstr "" -#: ../../library/sys.rst:1182 +#: ../../library/sys.rst:1222 msgid "" "Before :pep:`393`, ``sys.maxunicode`` used to be either ``0xFFFF`` or " "``0x10FFFF``, depending on the configuration option that specified whether " "Unicode characters were stored as UCS-2 or UCS-4." msgstr "" -#: ../../library/sys.rst:1190 +#: ../../library/sys.rst:1230 msgid "" "A list of :term:`meta path finder` objects that have their :meth:`~importlib." "abc.MetaPathFinder.find_spec` methods called to see if one of the objects " @@ -1675,27 +1528,27 @@ msgid "" "if the module cannot be found." msgstr "" -#: ../../library/sys.rst:1203 +#: ../../library/sys.rst:1243 msgid ":class:`importlib.abc.MetaPathFinder`" msgstr ":class:`importlib.abc.MetaPathFinder`" -#: ../../library/sys.rst:1203 +#: ../../library/sys.rst:1243 msgid "" "The abstract base class defining the interface of finder objects on :data:" "`meta_path`." msgstr "" -#: ../../library/sys.rst:1207 +#: ../../library/sys.rst:1247 msgid ":class:`importlib.machinery.ModuleSpec`" msgstr ":class:`importlib.machinery.ModuleSpec`" -#: ../../library/sys.rst:1206 +#: ../../library/sys.rst:1246 msgid "" "The concrete class which :meth:`~importlib.abc.MetaPathFinder.find_spec` " "should return instances of." msgstr "" -#: ../../library/sys.rst:1212 +#: ../../library/sys.rst:1252 msgid "" ":term:`Module specs ` were introduced in Python 3.4, by :pep:" "`451`. Earlier versions of Python looked for a method called :meth:`!" @@ -1703,7 +1556,7 @@ msgid "" "entry doesn't have a :meth:`~importlib.abc.MetaPathFinder.find_spec` method." msgstr "" -#: ../../library/sys.rst:1220 +#: ../../library/sys.rst:1260 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 " @@ -1715,78 +1568,78 @@ msgid "" "other threads." msgstr "" -#: ../../library/sys.rst:1232 +#: ../../library/sys.rst:1272 msgid "" "The list of the original command line arguments passed to the Python " "executable." msgstr "" -#: ../../library/sys.rst:1235 +#: ../../library/sys.rst:1275 msgid "See also :data:`sys.argv`." msgstr "另請參閱 :data:`sys.argv`\\ 。" -#: ../../library/sys.rst:1244 +#: ../../library/sys.rst:1284 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:1248 +#: ../../library/sys.rst:1288 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:1252 +#: ../../library/sys.rst:1292 msgid "" "``python -m module`` command line: prepend the current working directory." msgstr "" -#: ../../library/sys.rst:1254 +#: ../../library/sys.rst:1294 msgid "" "``python script.py`` command line: prepend the script's directory. If it's a " "symbolic link, resolve symbolic links." msgstr "" -#: ../../library/sys.rst:1256 +#: ../../library/sys.rst:1296 msgid "" "``python -c code`` and ``python`` (REPL) command lines: prepend an empty " "string, which means the current working directory." msgstr "" -#: ../../library/sys.rst:1259 +#: ../../library/sys.rst:1299 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:1262 +#: ../../library/sys.rst:1302 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:1268 +#: ../../library/sys.rst:1308 msgid "" "Module :mod:`site` This describes how to use .pth files to extend :data:`sys." "path`." msgstr "" -#: ../../library/sys.rst:1273 +#: ../../library/sys.rst:1313 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:1277 ../../library/sys.rst:1288 +#: ../../library/sys.rst:1317 ../../library/sys.rst:1328 msgid "Originally specified in :pep:`302`." msgstr "" -#: ../../library/sys.rst:1282 +#: ../../library/sys.rst:1322 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 " @@ -1794,13 +1647,13 @@ msgid "" "is found on :data:`sys.path_hooks` then ``None`` is stored." msgstr "" -#: ../../library/sys.rst:1293 +#: ../../library/sys.rst:1333 msgid "" "This string contains a platform identifier that can be used to append " "platform-specific components to :data:`sys.path`, for instance." msgstr "" -#: ../../library/sys.rst:1296 +#: ../../library/sys.rst:1336 msgid "" "For Unix systems, except on Linux and AIX, this is the lowercased OS name as " "returned by ``uname -s`` with the first part of the version as returned by " @@ -1809,75 +1662,75 @@ msgid "" "version, it is therefore recommended to use the following idiom::" msgstr "" -#: ../../library/sys.rst:1309 +#: ../../library/sys.rst:1349 msgid "For other systems, the values are:" msgstr "" -#: ../../library/sys.rst:1312 +#: ../../library/sys.rst:1352 msgid "System" msgstr "" -#: ../../library/sys.rst:1312 +#: ../../library/sys.rst:1352 msgid "``platform`` value" msgstr "" -#: ../../library/sys.rst:1314 +#: ../../library/sys.rst:1354 msgid "AIX" msgstr "AIX" -#: ../../library/sys.rst:1314 +#: ../../library/sys.rst:1354 msgid "``'aix'``" msgstr "``'aix'``" -#: ../../library/sys.rst:1315 +#: ../../library/sys.rst:1355 msgid "Emscripten" msgstr "Emscripten" -#: ../../library/sys.rst:1315 +#: ../../library/sys.rst:1355 msgid "``'emscripten'``" msgstr "``'emscripten'``" -#: ../../library/sys.rst:1316 +#: ../../library/sys.rst:1356 msgid "Linux" msgstr "Linux" -#: ../../library/sys.rst:1316 +#: ../../library/sys.rst:1356 msgid "``'linux'``" msgstr "``'linux'``" -#: ../../library/sys.rst:1317 +#: ../../library/sys.rst:1357 msgid "WASI" msgstr "WASI" -#: ../../library/sys.rst:1317 +#: ../../library/sys.rst:1357 msgid "``'wasi'``" msgstr "``'wasi'``" -#: ../../library/sys.rst:1318 +#: ../../library/sys.rst:1358 msgid "Windows" msgstr "Windows" -#: ../../library/sys.rst:1318 +#: ../../library/sys.rst:1358 msgid "``'win32'``" msgstr "``'win32'``" -#: ../../library/sys.rst:1319 +#: ../../library/sys.rst:1359 msgid "Windows/Cygwin" msgstr "Windows/Cygwin" -#: ../../library/sys.rst:1319 +#: ../../library/sys.rst:1359 msgid "``'cygwin'``" msgstr "``'cygwin'``" -#: ../../library/sys.rst:1320 +#: ../../library/sys.rst:1360 msgid "macOS" msgstr "macOS" -#: ../../library/sys.rst:1320 +#: ../../library/sys.rst:1360 msgid "``'darwin'``" msgstr "``'darwin'``" -#: ../../library/sys.rst:1323 +#: ../../library/sys.rst:1363 msgid "" "On Linux, :data:`sys.platform` doesn't contain the major version anymore. It " "is always ``'linux'``, instead of ``'linux2'`` or ``'linux3'``. Since older " @@ -1885,7 +1738,7 @@ msgid "" "the ``startswith`` idiom presented above." msgstr "" -#: ../../library/sys.rst:1329 +#: ../../library/sys.rst:1369 msgid "" "On AIX, :data:`sys.platform` doesn't contain the major version anymore. It " "is always ``'aix'``, instead of ``'aix5'`` or ``'aix7'``. Since older " @@ -1893,57 +1746,57 @@ msgid "" "the ``startswith`` idiom presented above." msgstr "" -#: ../../library/sys.rst:1337 +#: ../../library/sys.rst:1377 msgid "" ":data:`os.name` has a coarser granularity. :func:`os.uname` gives system-" "dependent version information." msgstr "" -#: ../../library/sys.rst:1340 +#: ../../library/sys.rst:1380 msgid "" "The :mod:`platform` module provides detailed checks for the system's " "identity." msgstr "" -#: ../../library/sys.rst:1346 +#: ../../library/sys.rst:1386 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:1349 +#: ../../library/sys.rst:1389 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:1353 +#: ../../library/sys.rst:1393 msgid "" "``/usr/lib64/pythonX.Y/``: Standard library (like ``os.py`` of the :mod:`os` " "module)" msgstr "" -#: ../../library/sys.rst:1355 +#: ../../library/sys.rst:1395 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:1358 +#: ../../library/sys.rst:1398 msgid "" "``/usr/lib/pythonX.Y/site-packages/`` (always use ``lib``, not :data:`sys." "platlibdir`): Third-party modules" msgstr "" -#: ../../library/sys.rst:1360 +#: ../../library/sys.rst:1400 msgid "" "``/usr/lib64/pythonX.Y/site-packages/``: C extension modules of third-party " "packages" msgstr "" -#: ../../library/sys.rst:1368 +#: ../../library/sys.rst:1408 msgid "" "A string giving the site-specific directory prefix where the platform " "independent Python files are installed; on Unix, the default is :file:`/usr/" @@ -1952,14 +1805,14 @@ msgid "" "derived paths." msgstr "" -#: ../../library/sys.rst:1374 +#: ../../library/sys.rst:1414 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:1389 +#: ../../library/sys.rst:1429 msgid "" "Strings specifying the primary and secondary prompt of the interpreter. " "These are only defined if the interpreter is in interactive mode. Their " @@ -1969,7 +1822,7 @@ msgid "" "used to implement a dynamic prompt." msgstr "" -#: ../../library/sys.rst:1399 +#: ../../library/sys.rst:1439 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 " @@ -1980,14 +1833,14 @@ msgid "" "const:`os.RTLD_LAZY`)." msgstr "" -#: ../../library/sys.rst:1411 +#: ../../library/sys.rst:1451 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:1423 +#: ../../library/sys.rst:1463 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 " @@ -2002,7 +1855,7 @@ msgid "" "in the profile function will cause itself unset." msgstr "" -#: ../../library/sys.rst:1434 +#: ../../library/sys.rst:1474 msgid "" "Profile functions should have three arguments: *frame*, *event*, and *arg*. " "*frame* is the current stack frame. *event* is a string: ``'call'``, " @@ -2010,71 +1863,71 @@ msgid "" "depends on the event type." msgstr "" -#: ../../library/sys.rst:1439 +#: ../../library/sys.rst:1479 msgid "" "Raises an :ref:`auditing event ` ``sys.setprofile`` with no " "arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys.setprofile``。" -#: ../../library/sys.rst:1441 ../../library/sys.rst:1522 +#: ../../library/sys.rst:1481 ../../library/sys.rst:1562 msgid "The events have the following meaning:" msgstr "" -#: ../../library/sys.rst:1445 ../../library/sys.rst:1527 +#: ../../library/sys.rst:1485 ../../library/sys.rst:1567 msgid "``'call'``" msgstr "``'call'``" -#: ../../library/sys.rst:1444 +#: ../../library/sys.rst:1484 msgid "" "A function is called (or some other code block entered). The profile " "function is called; *arg* is ``None``." msgstr "" -#: ../../library/sys.rst:1450 ../../library/sys.rst:1542 +#: ../../library/sys.rst:1490 ../../library/sys.rst:1582 msgid "``'return'``" msgstr "``'return'``" -#: ../../library/sys.rst:1448 +#: ../../library/sys.rst:1488 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:1454 +#: ../../library/sys.rst:1494 msgid "``'c_call'``" msgstr "``'c_call'``" -#: ../../library/sys.rst:1453 +#: ../../library/sys.rst:1493 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:1457 +#: ../../library/sys.rst:1497 msgid "``'c_return'``" msgstr "``'c_return'``" -#: ../../library/sys.rst:1457 +#: ../../library/sys.rst:1497 msgid "A C function has returned. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1459 +#: ../../library/sys.rst:1499 msgid "``'c_exception'``" msgstr "``'c_exception'``" -#: ../../library/sys.rst:1460 +#: ../../library/sys.rst:1500 msgid "A C function has raised an exception. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1464 +#: ../../library/sys.rst:1504 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:1468 +#: ../../library/sys.rst:1508 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 " @@ -2082,19 +1935,19 @@ msgid "" "because a too-high limit can lead to a crash." msgstr "" -#: ../../library/sys.rst:1473 +#: ../../library/sys.rst:1513 msgid "" "If the new limit is too low at the current recursion depth, a :exc:" "`RecursionError` exception is raised." msgstr "" -#: ../../library/sys.rst:1476 +#: ../../library/sys.rst:1516 msgid "" "A :exc:`RecursionError` exception is now raised if the new limit is too low " "at the current recursion depth." msgstr "" -#: ../../library/sys.rst:1483 +#: ../../library/sys.rst:1523 msgid "" "Set the interpreter's thread switch interval (in seconds). This floating-" "point value determines the ideal duration of the \"timeslices\" allocated to " @@ -2105,7 +1958,7 @@ msgid "" "scheduler." msgstr "" -#: ../../library/sys.rst:1500 +#: ../../library/sys.rst:1540 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 " @@ -2114,7 +1967,7 @@ msgid "" "`threading.settrace`." msgstr "" -#: ../../library/sys.rst:1505 +#: ../../library/sys.rst:1545 msgid "" "Trace functions should have three arguments: *frame*, *event*, and *arg*. " "*frame* is the current stack frame. *event* is a string: ``'call'``, " @@ -2122,7 +1975,7 @@ msgid "" "the event type." msgstr "" -#: ../../library/sys.rst:1510 +#: ../../library/sys.rst:1550 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 " @@ -2130,41 +1983,41 @@ msgid "" "traced." msgstr "" -#: ../../library/sys.rst:1515 +#: ../../library/sys.rst:1555 msgid "" "The local trace function should return a reference to itself (or to another " "function for further tracing in that scope), or ``None`` to turn off tracing " "in that scope." msgstr "" -#: ../../library/sys.rst:1519 +#: ../../library/sys.rst:1559 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:1525 +#: ../../library/sys.rst:1565 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:1536 +#: ../../library/sys.rst:1576 msgid "``'line'``" msgstr "``'line'``" -#: ../../library/sys.rst:1530 +#: ../../library/sys.rst:1570 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``; " "the return value specifies the new local trace function. See :file:`Objects/" "lnotab_notes.txt` for a detailed explanation of how this works. Per-line " -"events may be disabled for a frame by setting :attr:`f_trace_lines` to :" -"const:`False` on that frame." +"events may be disabled for a frame by setting :attr:`!f_trace_lines` to :" +"const:`False` on that :ref:`frame `." msgstr "" -#: ../../library/sys.rst:1539 +#: ../../library/sys.rst:1579 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 " @@ -2172,37 +2025,37 @@ msgid "" "return value is ignored." msgstr "" -#: ../../library/sys.rst:1547 +#: ../../library/sys.rst:1587 msgid "``'exception'``" msgstr "``'exception'``" -#: ../../library/sys.rst:1545 +#: ../../library/sys.rst:1585 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:1555 +#: ../../library/sys.rst:1595 msgid "``'opcode'``" msgstr "``'opcode'``" -#: ../../library/sys.rst:1550 +#: ../../library/sys.rst:1590 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 " "value specifies the new local trace function. Per-opcode events are not " -"emitted by default: they must be explicitly requested by setting :attr:" -"`f_trace_opcodes` to :const:`True` on the frame." +"emitted by default: they must be explicitly requested by setting :attr:`!" +"f_trace_opcodes` to :const:`True` on the :ref:`frame `." msgstr "" -#: ../../library/sys.rst:1557 +#: ../../library/sys.rst:1597 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:1560 +#: ../../library/sys.rst:1600 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 " @@ -2216,17 +2069,17 @@ msgid "" "on each frame)." msgstr "" -#: ../../library/sys.rst:1571 +#: ../../library/sys.rst:1611 msgid "For more information on code and frame objects, refer to :ref:`types`." msgstr "" -#: ../../library/sys.rst:1573 +#: ../../library/sys.rst:1613 msgid "" "Raises an :ref:`auditing event ` ``sys.settrace`` with no " "arguments." msgstr "" -#: ../../library/sys.rst:1577 +#: ../../library/sys.rst:1617 msgid "" "The :func:`settrace` function is intended only for implementing debuggers, " "profilers, coverage tools and the like. Its behavior is part of the " @@ -2234,13 +2087,13 @@ msgid "" "thus may not be available in all Python implementations." msgstr "" -#: ../../library/sys.rst:1584 +#: ../../library/sys.rst:1624 msgid "" -"``'opcode'`` event type added; :attr:`f_trace_lines` and :attr:" -"`f_trace_opcodes` attributes added to frames" +"``'opcode'`` event type added; :attr:`!f_trace_lines` and :attr:`!" +"f_trace_opcodes` attributes added to frames" msgstr "" -#: ../../library/sys.rst:1589 +#: ../../library/sys.rst:1629 msgid "" "Accepts two optional keyword arguments which are callables that accept an :" "term:`asynchronous generator iterator` as an argument. The *firstiter* " @@ -2249,7 +2102,7 @@ msgid "" "about to be garbage collected." msgstr "" -#: ../../library/sys.rst:1595 +#: ../../library/sys.rst:1635 msgid "" "Raises an :ref:`auditing event ` ``sys." "set_asyncgen_hooks_firstiter`` with no arguments." @@ -2257,7 +2110,7 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys." "set_asyncgen_hooks_firstiter``。" -#: ../../library/sys.rst:1597 +#: ../../library/sys.rst:1637 msgid "" "Raises an :ref:`auditing event ` ``sys." "set_asyncgen_hooks_finalizer`` with no arguments." @@ -2265,20 +2118,20 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys." "set_asyncgen_hooks_finalizer``。" -#: ../../library/sys.rst:1599 +#: ../../library/sys.rst:1639 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:1602 +#: ../../library/sys.rst:1642 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:1614 +#: ../../library/sys.rst:1654 msgid "" "Allows enabling or disabling coroutine origin tracking. When enabled, the " "``cr_origin`` attribute on coroutine objects will contain a tuple of " @@ -2287,105 +2140,105 @@ msgid "" "disabled, ``cr_origin`` will be None." msgstr "" -#: ../../library/sys.rst:1621 +#: ../../library/sys.rst:1661 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:1625 +#: ../../library/sys.rst:1665 msgid "This setting is thread-specific." msgstr "" -#: ../../library/sys.rst:1635 +#: ../../library/sys.rst:1675 msgid "" "Activate the stack profiler trampoline *backend*. The only supported backend " "is ``\"perf\"``." msgstr "" -#: ../../library/sys.rst:1638 ../../library/sys.rst:1653 -#: ../../library/sys.rst:1661 +#: ../../library/sys.rst:1678 ../../library/sys.rst:1693 +#: ../../library/sys.rst:1701 msgid ":ref:`Availability `: Linux." msgstr ":ref:`適用 `:Linux。" -#: ../../library/sys.rst:1644 +#: ../../library/sys.rst:1684 msgid ":ref:`perf_profiling`" msgstr "" -#: ../../library/sys.rst:1645 +#: ../../library/sys.rst:1685 msgid "https://perf.wiki.kernel.org" msgstr "" -#: ../../library/sys.rst:1649 +#: ../../library/sys.rst:1689 msgid "Deactivate the current stack profiler trampoline backend." msgstr "" -#: ../../library/sys.rst:1651 +#: ../../library/sys.rst:1691 msgid "If no stack profiler is activated, this function has no effect." msgstr "" -#: ../../library/sys.rst:1659 +#: ../../library/sys.rst:1699 msgid "Return ``True`` if a stack profiler trampoline is active." msgstr "" -#: ../../library/sys.rst:1667 +#: ../../library/sys.rst:1707 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:1671 +#: ../../library/sys.rst:1711 msgid "" "This is equivalent to defining the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` " "environment variable before launching Python." msgstr "" -#: ../../library/sys.rst:1674 +#: ../../library/sys.rst:1714 msgid "" "See also :func:`sys.getfilesystemencoding` and :func:`sys." "getfilesystemencodeerrors`." msgstr "" -#: ../../library/sys.rst:1679 +#: ../../library/sys.rst:1719 msgid "See :pep:`529` for more details." msgstr "更多細節請見 :pep:`529`\\ 。" -#: ../../library/sys.rst:1686 +#: ../../library/sys.rst:1726 msgid "" ":term:`File objects ` used by the interpreter for standard " "input, output and errors:" msgstr "" -#: ../../library/sys.rst:1689 +#: ../../library/sys.rst:1729 msgid "" "``stdin`` is used for all interactive input (including calls to :func:" "`input`);" msgstr "" -#: ../../library/sys.rst:1691 +#: ../../library/sys.rst:1731 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:1693 +#: ../../library/sys.rst:1733 msgid "The interpreter's own prompts and its error messages go to ``stderr``." msgstr "" -#: ../../library/sys.rst:1695 +#: ../../library/sys.rst:1735 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:1699 +#: ../../library/sys.rst:1739 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:1702 +#: ../../library/sys.rst:1742 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 " @@ -2396,14 +2249,14 @@ msgid "" "initially attached to a console." msgstr "" -#: ../../library/sys.rst:1711 +#: ../../library/sys.rst:1751 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:1716 +#: ../../library/sys.rst:1756 msgid "" "Under all platforms, you can override the character encoding by setting the :" "envvar:`PYTHONIOENCODING` environment variable before starting Python or by " @@ -2412,7 +2265,7 @@ msgid "" "only applies when :envvar:`PYTHONLEGACYWINDOWSSTDIO` is also set." msgstr "" -#: ../../library/sys.rst:1723 +#: ../../library/sys.rst:1763 msgid "" "When interactive, the ``stdout`` stream is line-buffered. Otherwise, it is " "block-buffered like regular text files. The ``stderr`` stream is line-" @@ -2421,27 +2274,27 @@ msgid "" "`PYTHONUNBUFFERED` environment variable." msgstr "" -#: ../../library/sys.rst:1729 +#: ../../library/sys.rst:1769 msgid "" "Non-interactive ``stderr`` is now line-buffered instead of fully buffered." msgstr "" -#: ../../library/sys.rst:1735 +#: ../../library/sys.rst:1775 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:1739 +#: ../../library/sys.rst:1779 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 " "replaced with file-like objects like :class:`io.StringIO` which do not " -"support the :attr:`~io.BufferedIOBase.buffer` attribute." +"support the :attr:!buffer` attribute." msgstr "" -#: ../../library/sys.rst:1749 +#: ../../library/sys.rst:1789 msgid "" "These objects contain the original values of ``stdin``, ``stderr`` and " "``stdout`` at the start of the program. They are used during finalization, " @@ -2449,7 +2302,7 @@ msgid "" "``sys.std*`` object has been redirected." msgstr "" -#: ../../library/sys.rst:1754 +#: ../../library/sys.rst:1794 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, " @@ -2457,7 +2310,7 @@ msgid "" "before replacing it, and restore the saved object." msgstr "" -#: ../../library/sys.rst:1760 +#: ../../library/sys.rst:1800 msgid "" "Under some conditions ``stdin``, ``stdout`` and ``stderr`` as well as the " "original values ``__stdin__``, ``__stdout__`` and ``__stderr__`` can be " @@ -2465,12 +2318,12 @@ msgid "" "to a console and Python apps started with :program:`pythonw`." msgstr "" -#: ../../library/sys.rst:1768 +#: ../../library/sys.rst:1808 msgid "" "A frozenset of strings containing the names of standard library modules." msgstr "" -#: ../../library/sys.rst:1770 +#: ../../library/sys.rst:1810 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 " @@ -2478,7 +2331,7 @@ msgid "" "modules are excluded." msgstr "" -#: ../../library/sys.rst:1775 +#: ../../library/sys.rst:1815 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 " @@ -2486,72 +2339,62 @@ msgid "" "listed." msgstr "" -#: ../../library/sys.rst:1780 +#: ../../library/sys.rst:1820 msgid "See also the :data:`sys.builtin_module_names` list." msgstr "另請參閱 :attr:`sys.builtin_module_names` 清單。" -#: ../../library/sys.rst:1787 +#: ../../library/sys.rst:1827 msgid "" "A :term:`named tuple` holding information about the thread implementation." msgstr "" -#: ../../library/sys.rst:1795 -msgid ":const:`name`" -msgstr ":const:`name`" - -#: ../../library/sys.rst:1795 -msgid "Name of the thread implementation:" +#: ../../library/sys.rst:1832 +msgid "The name of the thread implementation:" msgstr "" -#: ../../library/sys.rst:1797 -msgid "``'nt'``: Windows threads" +#: ../../library/sys.rst:1834 +#, fuzzy +msgid "``\"nt\"``: Windows threads" msgstr "``'nt'``: Windows 執行緒" -#: ../../library/sys.rst:1798 -msgid "``'pthread'``: POSIX threads" +#: ../../library/sys.rst:1835 +#, fuzzy +msgid "``\"pthread\"``: POSIX threads" msgstr "``'pthread'``: POSIX 執行緒" -#: ../../library/sys.rst:1799 +#: ../../library/sys.rst:1836 msgid "" -"``'pthread-stubs'``: stub POSIX threads (on WebAssembly platforms without " +"``\"pthread-stubs\"``: stub POSIX threads (on WebAssembly platforms without " "threading support)" msgstr "" -#: ../../library/sys.rst:1801 -msgid "``'solaris'``: Solaris threads" +#: ../../library/sys.rst:1838 +msgid "``\"solaris\"``: Solaris threads" msgstr "" -#: ../../library/sys.rst:1803 -msgid ":const:`lock`" -msgstr ":const:`lock`" - -#: ../../library/sys.rst:1803 -msgid "Name of the lock implementation:" +#: ../../library/sys.rst:1842 +msgid "The name of the lock implementation:" msgstr "" -#: ../../library/sys.rst:1805 -msgid "``'semaphore'``: a lock uses a semaphore" +#: ../../library/sys.rst:1844 +msgid "``\"semaphore\"``: a lock uses a semaphore" msgstr "" -#: ../../library/sys.rst:1806 -msgid "``'mutex+cond'``: a lock uses a mutex and a condition variable" +#: ../../library/sys.rst:1845 +msgid "``\"mutex+cond\"``: a lock uses a mutex and a condition variable" msgstr "" -#: ../../library/sys.rst:1808 +#: ../../library/sys.rst:1846 msgid "``None`` if this information is unknown" msgstr "為 ``None`` 表示此資訊未知" -#: ../../library/sys.rst:1810 -msgid ":const:`version`" -msgstr ":const:`version`" - -#: ../../library/sys.rst:1810 +#: ../../library/sys.rst:1850 msgid "" -"Name and version of the thread library. It is a string, or ``None`` if this " -"information is unknown." +"The name and version of the thread library. It is a string, or ``None`` if " +"this information is unknown." msgstr "" -#: ../../library/sys.rst:1819 +#: ../../library/sys.rst:1858 msgid "" "When this variable is set to an integer value, it determines the maximum " "number of levels of traceback information printed when an unhandled " @@ -2560,73 +2403,73 @@ msgid "" "are printed." msgstr "" -#: ../../library/sys.rst:1827 +#: ../../library/sys.rst:1866 msgid "Handle an unraisable exception." msgstr "處理一個不可被引發的例外。" -#: ../../library/sys.rst:1829 +#: ../../library/sys.rst:1868 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:1833 +#: ../../library/sys.rst:1872 msgid "The *unraisable* argument has the following attributes:" msgstr "" -#: ../../library/sys.rst:1835 +#: ../../library/sys.rst:1874 msgid ":attr:`!exc_type`: Exception type." msgstr ":attr:`!exc_type`: 例外型別。" -#: ../../library/sys.rst:1836 +#: ../../library/sys.rst:1875 msgid ":attr:`!exc_value`: Exception value, can be ``None``." msgstr ":attr:`!exc_value`: 例外值,可以為 ``None``。" -#: ../../library/sys.rst:1837 +#: ../../library/sys.rst:1876 msgid ":attr:`!exc_traceback`: Exception traceback, can be ``None``." msgstr ":attr:`!exc_traceback`: 例外追蹤,可以為 ``None``。" -#: ../../library/sys.rst:1838 +#: ../../library/sys.rst:1877 msgid ":attr:`!err_msg`: Error message, can be ``None``." msgstr ":attr:`!err_msg`: 錯誤訊息,可以為 ``None``。" -#: ../../library/sys.rst:1839 +#: ../../library/sys.rst:1878 msgid ":attr:`!object`: Object causing the exception, can be ``None``." msgstr ":attr:`!object`: 導致例外的物件,可以為 ``None``。" -#: ../../library/sys.rst:1841 +#: ../../library/sys.rst:1880 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:1845 +#: ../../library/sys.rst:1884 msgid "" ":func:`sys.unraisablehook` can be overridden to control how unraisable " "exceptions are handled." msgstr "" -#: ../../library/sys.rst:1850 +#: ../../library/sys.rst:1889 msgid ":func:`excepthook` which handles uncaught exceptions." msgstr "處理未被捕捉到例外的 :func:`excepthook`。" -#: ../../library/sys.rst:1854 +#: ../../library/sys.rst:1893 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:1858 +#: ../../library/sys.rst:1897 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:1862 +#: ../../library/sys.rst:1901 #, fuzzy msgid "" "Raises an :ref:`auditing event ` ``sys.unraisablehook`` with " @@ -2635,7 +2478,7 @@ msgstr "" "引發一個附帶引數 ``hook``、``unraisable`` 的\\ :ref:`稽核事件 ` " "``sys.unraisablehook``。" -#: ../../library/sys.rst:1864 +#: ../../library/sys.rst:1903 msgid "" "Raise an auditing event ``sys.unraisablehook`` with arguments *hook*, " "*unraisable* when an exception that cannot be handled occurs. The " @@ -2643,7 +2486,7 @@ msgid "" "hook has been set, *hook* may be ``None``." msgstr "" -#: ../../library/sys.rst:1873 +#: ../../library/sys.rst:1912 msgid "" "A string containing the version number of the Python interpreter plus " "additional information on the build number and compiler used. This string " @@ -2652,13 +2495,13 @@ msgid "" "functions provided by the :mod:`platform` module." msgstr "" -#: ../../library/sys.rst:1882 +#: ../../library/sys.rst:1921 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:1888 +#: ../../library/sys.rst:1927 msgid "" "A tuple containing the five components of the version number: *major*, " "*minor*, *micro*, *releaselevel*, and *serial*. All values except " @@ -2669,18 +2512,18 @@ msgid "" "version_info.major`` and so on." msgstr "" -#: ../../library/sys.rst:1896 +#: ../../library/sys.rst:1935 msgid "Added named component attributes." msgstr "新增了附名的元件屬性。" -#: ../../library/sys.rst:1901 +#: ../../library/sys.rst:1940 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:1908 +#: ../../library/sys.rst:1947 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 " @@ -2689,25 +2532,25 @@ msgid "" "has no effect on the registry keys used by Python." msgstr "" -#: ../../library/sys.rst:1919 +#: ../../library/sys.rst:1958 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:1935 +#: ../../library/sys.rst:1974 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:1943 +#: ../../library/sys.rst:1982 msgid "Citations" msgstr "引用" -#: ../../library/sys.rst:1944 +#: ../../library/sys.rst:1983 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/" @@ -2720,58 +2563,178 @@ msgstr "" msgid "auditing" msgstr "" -#: ../../library/sys.rst:447 +#: ../../library/sys.rst:445 msgid "object" msgstr "object(物件)" -#: ../../library/sys.rst:447 +#: ../../library/sys.rst:445 msgid "traceback" msgstr "traceback" -#: ../../library/sys.rst:874 ../../library/sys.rst:1419 +#: ../../library/sys.rst:906 ../../library/sys.rst:1459 msgid "profile function" msgstr "" -#: ../../library/sys.rst:874 ../../library/sys.rst:1419 +#: ../../library/sys.rst:906 ../../library/sys.rst:1459 msgid "profiler" msgstr "" -#: ../../library/sys.rst:883 ../../library/sys.rst:1496 +#: ../../library/sys.rst:915 ../../library/sys.rst:1536 msgid "trace function" msgstr "" -#: ../../library/sys.rst:883 ../../library/sys.rst:1496 +#: ../../library/sys.rst:915 ../../library/sys.rst:1536 msgid "debugger" msgstr "debugger(除錯器)" -#: ../../library/sys.rst:1242 +#: ../../library/sys.rst:1282 msgid "module" msgstr "module(模組)" -#: ../../library/sys.rst:1242 +#: ../../library/sys.rst:1282 msgid "search" msgstr "search(搜尋)" -#: ../../library/sys.rst:1242 +#: ../../library/sys.rst:1282 msgid "path" msgstr "path(路徑)" -#: ../../library/sys.rst:1383 +#: ../../library/sys.rst:1423 msgid "interpreter prompts" msgstr "interpreter prompts(直譯器提示)" -#: ../../library/sys.rst:1383 +#: ../../library/sys.rst:1423 msgid "prompts, interpreter" msgstr "prompts, interpreter(提示、直譯器)" -#: ../../library/sys.rst:1383 +#: ../../library/sys.rst:1423 msgid ">>>" msgstr ">>>" -#: ../../library/sys.rst:1383 +#: ../../library/sys.rst:1423 msgid "interpreter prompt" msgstr "interpreter prompt(直譯器提示)" -#: ../../library/sys.rst:1383 +#: ../../library/sys.rst:1423 msgid "..." msgstr "..." + +#~ msgid "Attribute" +#~ msgstr "屬性" + +#~ msgid "Explanation" +#~ msgstr "解釋" + +#~ msgid ":const:`emscripten_version`" +#~ msgstr ":const:`emscripten_version`" + +#~ msgid ":const:`runtime`" +#~ msgstr ":const:`runtime`" + +#~ msgid ":const:`pthreads`" +#~ msgstr ":const:`pthreads`" + +#~ msgid ":const:`shared_memory`" +#~ msgstr ":const:`shared_memory`" + +#~ msgid "flag" +#~ msgstr "旗標" + +#~ msgid ":const:`debug`" +#~ msgstr ":const:`debug`" + +#~ msgid ":const:`inspect`" +#~ msgstr ":const:`inspect`" + +#~ msgid ":const:`interactive`" +#~ msgstr ":const:`interactive`" + +#~ msgid ":const:`isolated`" +#~ msgstr ":const:`isolated`" + +#~ msgid ":const:`optimize`" +#~ msgstr ":const:`optimize`" + +#~ msgid ":const:`dont_write_bytecode`" +#~ msgstr ":const:`dont_write_bytecode`" + +#~ msgid ":const:`no_user_site`" +#~ msgstr ":const:`no_user_site`" + +#~ msgid ":const:`no_site`" +#~ msgstr ":const:`no_site`" + +#~ msgid ":const:`ignore_environment`" +#~ msgstr ":const:`ignore_environment`" + +#~ msgid ":const:`verbose`" +#~ msgstr ":const:`verbose`" + +#~ msgid ":const:`bytes_warning`" +#~ msgstr ":const:`bytes_warning`" + +#~ msgid ":const:`quiet`" +#~ msgstr ":const:`quiet`" + +#~ msgid ":const:`hash_randomization`" +#~ msgstr ":const:`hash_randomization`" + +#~ msgid ":const:`dev_mode`" +#~ msgstr ":const:`dev_mode`" + +#~ msgid ":const:`utf8_mode`" +#~ msgstr ":const:`utf8_mode`" + +#~ msgid ":const:`safe_path`" +#~ msgstr ":const:`safe_path`" + +#~ msgid ":const:`int_max_str_digits`" +#~ msgstr ":const:`int_max_str_digits`" + +#~ msgid ":const:`warn_default_encoding`" +#~ msgstr ":const:`warn_default_encoding`" + +#~ msgid ":const:`width`" +#~ msgstr ":const:`width`" + +#~ msgid ":const:`modulus`" +#~ msgstr ":const:`modulus`" + +#~ msgid ":const:`inf`" +#~ msgstr ":const:`inf`" + +#~ msgid ":const:`nan`" +#~ msgstr ":const:`nan`" + +#~ msgid ":const:`imag`" +#~ msgstr ":const:`imag`" + +#~ msgid ":const:`algorithm`" +#~ msgstr ":const:`algorithm`" + +#~ msgid ":const:`hash_bits`" +#~ msgstr ":const:`hash_bits`" + +#~ msgid ":const:`seed_bits`" +#~ msgstr ":const:`seed_bits`" + +#~ msgid ":const:`bits_per_digit`" +#~ msgstr ":const:`bits_per_digit`" + +#~ msgid ":const:`sizeof_digit`" +#~ msgstr ":const:`sizeof_digit`" + +#~ msgid ":const:`default_max_str_digits`" +#~ msgstr ":const:`default_max_str_digits`" + +#~ msgid ":const:`str_digits_check_threshold`" +#~ msgstr ":const:`str_digits_check_threshold`" + +#~ msgid ":const:`name`" +#~ msgstr ":const:`name`" + +#~ msgid ":const:`lock`" +#~ msgstr ":const:`lock`" + +#~ msgid ":const:`version`" +#~ msgstr ":const:`version`" diff --git a/library/tarfile.po b/library/tarfile.po index b355c6558f..4accd94181 100644 --- a/library/tarfile.po +++ b/library/tarfile.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-08-22 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:12+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -988,8 +988,8 @@ msgid "" msgstr "" #: ../../library/tarfile.rst:708 ../../library/tarfile.rst:719 -#: ../../library/tarfile.rst:746 ../../library/tarfile.rst:757 -#: ../../library/tarfile.rst:768 ../../library/tarfile.rst:779 +#: ../../library/tarfile.rst:751 ../../library/tarfile.rst:762 +#: ../../library/tarfile.rst:773 ../../library/tarfile.rst:784 msgid "" "Can be set to ``None`` for :meth:`~TarFile.extract` and :meth:`~TarFile." "extractall`, causing extraction to skip applying this attribute." @@ -1014,87 +1014,94 @@ msgid "" "objects of type :const:`LNKTYPE` and :const:`SYMTYPE`." msgstr "" -#: ../../library/tarfile.rst:742 +#: ../../library/tarfile.rst:738 +msgid "" +"For symbolic links (``SYMTYPE``), the *linkname* is relative to the " +"directory that contains the link. For hard links (``LNKTYPE``), the " +"*linkname* is relative to the root of the archive." +msgstr "" + +#: ../../library/tarfile.rst:747 msgid "User ID of the user who originally stored this member." msgstr "" -#: ../../library/tarfile.rst:753 +#: ../../library/tarfile.rst:758 msgid "Group ID of the user who originally stored this member." msgstr "" -#: ../../library/tarfile.rst:764 +#: ../../library/tarfile.rst:769 msgid "User name." msgstr "" -#: ../../library/tarfile.rst:775 +#: ../../library/tarfile.rst:780 msgid "Group name." msgstr "" -#: ../../library/tarfile.rst:786 +#: ../../library/tarfile.rst:791 msgid "" "A dictionary containing key-value pairs of an associated pax extended header." msgstr "" -#: ../../library/tarfile.rst:794 +#: ../../library/tarfile.rst:799 msgid "" "Return a *new* copy of the :class:`!TarInfo` object with the given " "attributes changed. For example, to return a ``TarInfo`` with the group name " "set to ``'staff'``, use::" msgstr "" -#: ../../library/tarfile.rst:800 +#: ../../library/tarfile.rst:805 msgid "" "By default, a deep copy is made. If *deep* is false, the copy is shallow, i." "e. ``pax_headers`` and any custom attributes are shared with the original " "``TarInfo`` object." msgstr "" -#: ../../library/tarfile.rst:804 +#: ../../library/tarfile.rst:809 msgid "A :class:`TarInfo` object also provides some convenient query methods:" msgstr "" -#: ../../library/tarfile.rst:809 +#: ../../library/tarfile.rst:814 msgid "Return :const:`True` if the :class:`Tarinfo` object is a regular file." msgstr "" -#: ../../library/tarfile.rst:814 +#: ../../library/tarfile.rst:819 msgid "Same as :meth:`isfile`." msgstr "" -#: ../../library/tarfile.rst:819 +#: ../../library/tarfile.rst:824 msgid "Return :const:`True` if it is a directory." msgstr "" -#: ../../library/tarfile.rst:824 +#: ../../library/tarfile.rst:829 msgid "Return :const:`True` if it is a symbolic link." msgstr "" -#: ../../library/tarfile.rst:829 +#: ../../library/tarfile.rst:834 msgid "Return :const:`True` if it is a hard link." msgstr "" -#: ../../library/tarfile.rst:834 +#: ../../library/tarfile.rst:839 msgid "Return :const:`True` if it is a character device." msgstr "" -#: ../../library/tarfile.rst:839 +#: ../../library/tarfile.rst:844 msgid "Return :const:`True` if it is a block device." msgstr "" -#: ../../library/tarfile.rst:844 +#: ../../library/tarfile.rst:849 msgid "Return :const:`True` if it is a FIFO." msgstr "" -#: ../../library/tarfile.rst:849 +#: ../../library/tarfile.rst:854 msgid "" "Return :const:`True` if it is one of character device, block device or FIFO." msgstr "" -#: ../../library/tarfile.rst:855 +#: ../../library/tarfile.rst:860 msgid "Extraction filters" msgstr "" -#: ../../library/tarfile.rst:859 +#: ../../library/tarfile.rst:864 msgid "" "The *tar* format is designed to capture all details of a UNIX-like " "filesystem, which makes it very powerful. Unfortunately, the features make " @@ -1104,66 +1111,66 @@ msgid "" "components, or symlinks that affect later members)." msgstr "" -#: ../../library/tarfile.rst:867 +#: ../../library/tarfile.rst:872 msgid "" "In most cases, the full functionality is not needed. Therefore, *tarfile* " "supports extraction filters: a mechanism to limit functionality, and thus " "mitigate some of the security issues." msgstr "" -#: ../../library/tarfile.rst:873 +#: ../../library/tarfile.rst:878 msgid ":pep:`706`" msgstr "" -#: ../../library/tarfile.rst:874 +#: ../../library/tarfile.rst:879 msgid "Contains further motivation and rationale behind the design." msgstr "" -#: ../../library/tarfile.rst:876 +#: ../../library/tarfile.rst:881 msgid "" "The *filter* argument to :meth:`TarFile.extract` or :meth:`~TarFile." "extractall` can be:" msgstr "" -#: ../../library/tarfile.rst:879 +#: ../../library/tarfile.rst:884 msgid "" "the string ``'fully_trusted'``: Honor all metadata as specified in the " "archive. Should be used if the user trusts the archive completely, or " "implements their own complex verification." msgstr "" -#: ../../library/tarfile.rst:884 +#: ../../library/tarfile.rst:889 msgid "" "the string ``'tar'``: Honor most *tar*-specific features (i.e. features of " "UNIX-like filesystems), but block features that are very likely to be " "surprising or malicious. See :func:`tar_filter` for details." msgstr "" -#: ../../library/tarfile.rst:888 +#: ../../library/tarfile.rst:893 msgid "" "the string ``'data'``: Ignore or block most features specific to UNIX-like " "filesystems. Intended for extracting cross-platform data archives. See :func:" "`data_filter` for details." msgstr "" -#: ../../library/tarfile.rst:892 +#: ../../library/tarfile.rst:897 msgid "``None`` (default): Use :attr:`TarFile.extraction_filter`." msgstr "" -#: ../../library/tarfile.rst:894 +#: ../../library/tarfile.rst:899 msgid "" "If that is also ``None`` (the default), raise a ``DeprecationWarning``, and " "fall back to the ``'fully_trusted'`` filter, whose dangerous behavior " "matches previous versions of Python." msgstr "" -#: ../../library/tarfile.rst:898 +#: ../../library/tarfile.rst:903 msgid "" "In Python 3.14, the ``'data'`` filter will become the default instead. It's " "possible to switch earlier; see :attr:`TarFile.extraction_filter`." msgstr "" -#: ../../library/tarfile.rst:901 +#: ../../library/tarfile.rst:906 msgid "" "A callable which will be called for each extracted member with a :ref:" "`TarInfo ` describing the member and the destination path " @@ -1171,23 +1178,23 @@ msgid "" "members)::" msgstr "" -#: ../../library/tarfile.rst:908 +#: ../../library/tarfile.rst:913 msgid "" "The callable is called just before each member is extracted, so it can take " "the current state of the disk into account. It can:" msgstr "" -#: ../../library/tarfile.rst:912 +#: ../../library/tarfile.rst:917 msgid "" "return a :class:`TarInfo` object which will be used instead of the metadata " "in the archive, or" msgstr "" -#: ../../library/tarfile.rst:914 +#: ../../library/tarfile.rst:919 msgid "return ``None``, in which case the member will be skipped, or" msgstr "" -#: ../../library/tarfile.rst:915 +#: ../../library/tarfile.rst:920 msgid "" "raise an exception to abort the operation or skip the member, depending on :" "attr:`~TarFile.errorlevel`. Note that when extraction is aborted, :meth:" @@ -1195,118 +1202,118 @@ msgid "" "attempt to clean up." msgstr "" -#: ../../library/tarfile.rst:921 +#: ../../library/tarfile.rst:926 msgid "Default named filters" msgstr "" -#: ../../library/tarfile.rst:923 +#: ../../library/tarfile.rst:928 msgid "" "The pre-defined, named filters are available as functions, so they can be " "reused in custom filters:" msgstr "" -#: ../../library/tarfile.rst:928 +#: ../../library/tarfile.rst:933 msgid "Return *member* unchanged." msgstr "" -#: ../../library/tarfile.rst:930 +#: ../../library/tarfile.rst:935 msgid "This implements the ``'fully_trusted'`` filter." msgstr "" -#: ../../library/tarfile.rst:934 +#: ../../library/tarfile.rst:939 msgid "Implements the ``'tar'`` filter." msgstr "" -#: ../../library/tarfile.rst:936 +#: ../../library/tarfile.rst:941 msgid "Strip leading slashes (``/`` and :data:`os.sep`) from filenames." msgstr "" -#: ../../library/tarfile.rst:937 +#: ../../library/tarfile.rst:942 msgid "" ":ref:`Refuse ` to extract files with absolute " "paths (in case the name is absolute even after stripping slashes, e.g. ``C:/" "foo`` on Windows). This raises :class:`~tarfile.AbsolutePathError`." msgstr "" -#: ../../library/tarfile.rst:941 +#: ../../library/tarfile.rst:946 msgid "" ":ref:`Refuse ` to extract files whose absolute " "path (after following symlinks) would end up outside the destination. This " "raises :class:`~tarfile.OutsideDestinationError`." msgstr "" -#: ../../library/tarfile.rst:944 +#: ../../library/tarfile.rst:949 msgid "" "Clear high mode bits (setuid, setgid, sticky) and group/other write bits (:" "const:`~stat.S_IWGRP`|:const:`~stat.S_IWOTH`)." msgstr "" -#: ../../library/tarfile.rst:947 ../../library/tarfile.rst:980 +#: ../../library/tarfile.rst:952 ../../library/tarfile.rst:985 msgid "Return the modified ``TarInfo`` member." msgstr "" -#: ../../library/tarfile.rst:951 +#: ../../library/tarfile.rst:956 msgid "" "Implements the ``'data'`` filter. In addition to what ``tar_filter`` does:" msgstr "" -#: ../../library/tarfile.rst:954 +#: ../../library/tarfile.rst:959 msgid "" ":ref:`Refuse ` to extract links (hard or soft) " "that link to absolute paths, or ones that link outside the destination." msgstr "" -#: ../../library/tarfile.rst:957 +#: ../../library/tarfile.rst:962 msgid "" "This raises :class:`~tarfile.AbsoluteLinkError` or :class:`~tarfile." "LinkOutsideDestinationError`." msgstr "" -#: ../../library/tarfile.rst:960 +#: ../../library/tarfile.rst:965 msgid "" "Note that such files are refused even on platforms that do not support " "symbolic links." msgstr "" -#: ../../library/tarfile.rst:963 +#: ../../library/tarfile.rst:968 msgid "" ":ref:`Refuse ` to extract device files (including " "pipes). This raises :class:`~tarfile.SpecialFileError`." msgstr "" -#: ../../library/tarfile.rst:967 +#: ../../library/tarfile.rst:972 msgid "For regular files, including hard links:" msgstr "" -#: ../../library/tarfile.rst:969 +#: ../../library/tarfile.rst:974 msgid "" "Set the owner read and write permissions (:const:`~stat.S_IRUSR`|:const:" "`~stat.S_IWUSR`)." msgstr "" -#: ../../library/tarfile.rst:971 +#: ../../library/tarfile.rst:976 msgid "" "Remove the group & other executable permission (:const:`~stat.S_IXGRP`|:" "const:`~stat.S_IXOTH`) if the owner doesn’t have it (:const:`~stat.S_IXUSR`)." msgstr "" -#: ../../library/tarfile.rst:975 +#: ../../library/tarfile.rst:980 msgid "" "For other files (directories), set ``mode`` to ``None``, so that extraction " "methods skip applying permission bits." msgstr "" -#: ../../library/tarfile.rst:977 +#: ../../library/tarfile.rst:982 msgid "" "Set user and group info (``uid``, ``gid``, ``uname``, ``gname``) to " "``None``, so that extraction methods skip setting it." msgstr "" -#: ../../library/tarfile.rst:986 +#: ../../library/tarfile.rst:991 msgid "Filter errors" msgstr "" -#: ../../library/tarfile.rst:988 +#: ../../library/tarfile.rst:993 msgid "" "When a filter refuses to extract a file, it will raise an appropriate " "exception, a subclass of :class:`~tarfile.FilterError`. This will abort the " @@ -1315,11 +1322,11 @@ msgid "" "continue." msgstr "" -#: ../../library/tarfile.rst:996 +#: ../../library/tarfile.rst:1001 msgid "Hints for further verification" msgstr "" -#: ../../library/tarfile.rst:998 +#: ../../library/tarfile.rst:1003 msgid "" "Even with ``filter='data'``, *tarfile* is not suited for extracting " "untrusted files without prior inspection. Among other issues, the pre-" @@ -1327,69 +1334,69 @@ msgid "" "additional checks." msgstr "" -#: ../../library/tarfile.rst:1003 +#: ../../library/tarfile.rst:1008 msgid "Here is an incomplete list of things to consider:" msgstr "" -#: ../../library/tarfile.rst:1005 +#: ../../library/tarfile.rst:1010 msgid "" "Extract to a :func:`new temporary directory ` to prevent e." "g. exploiting pre-existing links, and to make it easier to clean up after a " "failed extraction." msgstr "" -#: ../../library/tarfile.rst:1008 +#: ../../library/tarfile.rst:1013 msgid "" "When working with untrusted data, use external (e.g. OS-level) limits on " "disk, memory and CPU usage." msgstr "" -#: ../../library/tarfile.rst:1010 +#: ../../library/tarfile.rst:1015 msgid "" "Check filenames against an allow-list of characters (to filter out control " "characters, confusables, foreign path separators, etc.)." msgstr "" -#: ../../library/tarfile.rst:1013 +#: ../../library/tarfile.rst:1018 msgid "" "Check that filenames have expected extensions (discouraging files that " "execute when you “click on them”, or extension-less files like Windows " "special device names)." msgstr "" -#: ../../library/tarfile.rst:1015 +#: ../../library/tarfile.rst:1020 msgid "" "Limit the number of extracted files, total size of extracted data, filename " "length (including symlink length), and size of individual files." msgstr "" -#: ../../library/tarfile.rst:1017 +#: ../../library/tarfile.rst:1022 msgid "Check for files that would be shadowed on case-insensitive filesystems." msgstr "" -#: ../../library/tarfile.rst:1019 +#: ../../library/tarfile.rst:1024 msgid "Also note that:" msgstr "" -#: ../../library/tarfile.rst:1021 +#: ../../library/tarfile.rst:1026 msgid "" "Tar files may contain multiple versions of the same file. Later ones are " "expected to overwrite any earlier ones. This feature is crucial to allow " "updating tape archives, but can be abused maliciously." msgstr "" -#: ../../library/tarfile.rst:1025 +#: ../../library/tarfile.rst:1030 msgid "" "*tarfile* does not protect against issues with “live” data, e.g. an attacker " "tinkering with the destination (or source) directory while extraction (or " "archiving) is in progress." msgstr "" -#: ../../library/tarfile.rst:1031 +#: ../../library/tarfile.rst:1036 msgid "Supporting older Python versions" msgstr "" -#: ../../library/tarfile.rst:1033 +#: ../../library/tarfile.rst:1038 msgid "" "Extraction filters were added to Python 3.12, but may be backported to older " "versions as security updates. To check whether the feature is available, use " @@ -1397,163 +1404,163 @@ msgid "" "version." msgstr "" -#: ../../library/tarfile.rst:1038 +#: ../../library/tarfile.rst:1043 msgid "" "The following examples show how to support Python versions with and without " "the feature. Note that setting ``extraction_filter`` will affect any " "subsequent operations." msgstr "" -#: ../../library/tarfile.rst:1042 +#: ../../library/tarfile.rst:1047 msgid "Fully trusted archive::" msgstr "" -#: ../../library/tarfile.rst:1047 +#: ../../library/tarfile.rst:1052 msgid "" "Use the ``'data'`` filter if available, but revert to Python 3.11 behavior " "(``'fully_trusted'``) if this feature is not available::" msgstr "" -#: ../../library/tarfile.rst:1054 +#: ../../library/tarfile.rst:1059 msgid "Use the ``'data'`` filter; *fail* if it is not available::" msgstr "" -#: ../../library/tarfile.rst:1058 +#: ../../library/tarfile.rst:1063 msgid "or::" msgstr "" -#: ../../library/tarfile.rst:1063 +#: ../../library/tarfile.rst:1068 msgid "Use the ``'data'`` filter; *warn* if it is not available::" msgstr "" -#: ../../library/tarfile.rst:1074 +#: ../../library/tarfile.rst:1079 msgid "Stateful extraction filter example" msgstr "" -#: ../../library/tarfile.rst:1076 +#: ../../library/tarfile.rst:1081 msgid "" "While *tarfile*'s extraction methods take a simple *filter* callable, custom " "filters may be more complex objects with an internal state. It may be useful " "to write these as context managers, to be used like this::" msgstr "" -#: ../../library/tarfile.rst:1083 +#: ../../library/tarfile.rst:1088 msgid "Such a filter can be written as, for example::" msgstr "" -#: ../../library/tarfile.rst:1105 +#: ../../library/tarfile.rst:1110 msgid "Command-Line Interface" msgstr "" -#: ../../library/tarfile.rst:1109 +#: ../../library/tarfile.rst:1114 msgid "" "The :mod:`tarfile` module provides a simple command-line interface to " "interact with tar archives." msgstr "" -#: ../../library/tarfile.rst:1112 +#: ../../library/tarfile.rst:1117 msgid "" "If you want to create a new tar archive, specify its name after the :option:" "`-c` option and then list the filename(s) that should be included:" msgstr "" -#: ../../library/tarfile.rst:1119 +#: ../../library/tarfile.rst:1124 msgid "Passing a directory is also acceptable:" msgstr "" -#: ../../library/tarfile.rst:1125 +#: ../../library/tarfile.rst:1130 msgid "" "If you want to extract a tar archive into the current directory, use the :" "option:`-e` option:" msgstr "" -#: ../../library/tarfile.rst:1132 +#: ../../library/tarfile.rst:1137 msgid "" "You can also extract a tar archive into a different directory by passing the " "directory's name:" msgstr "" -#: ../../library/tarfile.rst:1139 +#: ../../library/tarfile.rst:1144 msgid "For a list of the files in a tar archive, use the :option:`-l` option:" msgstr "" -#: ../../library/tarfile.rst:1147 +#: ../../library/tarfile.rst:1152 msgid "Command-line options" msgstr "" -#: ../../library/tarfile.rst:1152 +#: ../../library/tarfile.rst:1157 msgid "List files in a tarfile." msgstr "" -#: ../../library/tarfile.rst:1157 +#: ../../library/tarfile.rst:1162 msgid "Create tarfile from source files." msgstr "" -#: ../../library/tarfile.rst:1162 +#: ../../library/tarfile.rst:1167 msgid "" "Extract tarfile into the current directory if *output_dir* is not specified." msgstr "" -#: ../../library/tarfile.rst:1167 +#: ../../library/tarfile.rst:1172 msgid "Test whether the tarfile is valid or not." msgstr "" -#: ../../library/tarfile.rst:1171 +#: ../../library/tarfile.rst:1176 msgid "Verbose output." msgstr "" -#: ../../library/tarfile.rst:1175 +#: ../../library/tarfile.rst:1180 msgid "" "Specifies the *filter* for ``--extract``. See :ref:`tarfile-extraction-" "filter` for details. Only string names are accepted (that is, " "``fully_trusted``, ``tar``, and ``data``)." msgstr "" -#: ../../library/tarfile.rst:1183 +#: ../../library/tarfile.rst:1188 msgid "Examples" msgstr "範例" -#: ../../library/tarfile.rst:1185 +#: ../../library/tarfile.rst:1190 msgid "How to extract an entire tar archive to the current working directory::" msgstr "" -#: ../../library/tarfile.rst:1192 +#: ../../library/tarfile.rst:1197 msgid "" "How to extract a subset of a tar archive with :meth:`TarFile.extractall` " "using a generator function instead of a list::" msgstr "" -#: ../../library/tarfile.rst:1207 +#: ../../library/tarfile.rst:1212 msgid "How to create an uncompressed tar archive from a list of filenames::" msgstr "" -#: ../../library/tarfile.rst:1215 +#: ../../library/tarfile.rst:1220 msgid "The same example using the :keyword:`with` statement::" msgstr "" -#: ../../library/tarfile.rst:1222 +#: ../../library/tarfile.rst:1227 msgid "" "How to read a gzip compressed tar archive and display some member " "information::" msgstr "" -#: ../../library/tarfile.rst:1236 +#: ../../library/tarfile.rst:1241 msgid "" "How to create an archive and reset the user information using the *filter* " "parameter in :meth:`TarFile.add`::" msgstr "" -#: ../../library/tarfile.rst:1252 +#: ../../library/tarfile.rst:1257 msgid "Supported tar formats" msgstr "" -#: ../../library/tarfile.rst:1254 +#: ../../library/tarfile.rst:1259 msgid "" "There are three tar formats that can be created with the :mod:`tarfile` " "module:" msgstr "" -#: ../../library/tarfile.rst:1256 +#: ../../library/tarfile.rst:1261 msgid "" "The POSIX.1-1988 ustar format (:const:`USTAR_FORMAT`). It supports filenames " "up to a length of at best 256 characters and linknames up to 100 characters. " @@ -1561,7 +1568,7 @@ msgid "" "supported format." msgstr "" -#: ../../library/tarfile.rst:1261 +#: ../../library/tarfile.rst:1266 msgid "" "The GNU tar format (:const:`GNU_FORMAT`). It supports long filenames and " "linknames, files bigger than 8 GiB and sparse files. It is the de facto " @@ -1569,7 +1576,7 @@ msgid "" "extensions for long names, sparse file support is read-only." msgstr "" -#: ../../library/tarfile.rst:1266 +#: ../../library/tarfile.rst:1271 msgid "" "The POSIX.1-2001 pax format (:const:`PAX_FORMAT`). It is the most flexible " "format with virtually no limits. It supports long filenames and linknames, " @@ -1580,7 +1587,7 @@ msgid "" "*ustar* format. It is the current default format for new archives." msgstr "" -#: ../../library/tarfile.rst:1274 +#: ../../library/tarfile.rst:1279 msgid "" "It extends the existing *ustar* format with extra headers for information " "that cannot be stored otherwise. There are two flavours of pax headers: " @@ -1589,13 +1596,13 @@ msgid "" "in a pax header is encoded in *UTF-8* for portability reasons." msgstr "" -#: ../../library/tarfile.rst:1280 +#: ../../library/tarfile.rst:1285 msgid "" "There are some more variants of the tar format which can be read, but not " "created:" msgstr "" -#: ../../library/tarfile.rst:1283 +#: ../../library/tarfile.rst:1288 msgid "" "The ancient V7 format. This is the first tar format from Unix Seventh " "Edition, storing only regular files and directories. Names must not be " @@ -1604,17 +1611,17 @@ msgid "" "ASCII characters." msgstr "" -#: ../../library/tarfile.rst:1288 +#: ../../library/tarfile.rst:1293 msgid "" "The SunOS tar extended format. This format is a variant of the POSIX.1-2001 " "pax format, but is not compatible." msgstr "" -#: ../../library/tarfile.rst:1294 +#: ../../library/tarfile.rst:1299 msgid "Unicode issues" msgstr "" -#: ../../library/tarfile.rst:1296 +#: ../../library/tarfile.rst:1301 msgid "" "The tar format was originally conceived to make backups on tape drives with " "the main focus on preserving file system information. Nowadays tar archives " @@ -1629,13 +1636,13 @@ msgid "" "It stores non-ASCII metadata using the universal character encoding *UTF-8*." msgstr "" -#: ../../library/tarfile.rst:1308 +#: ../../library/tarfile.rst:1313 msgid "" "The details of character conversion in :mod:`tarfile` are controlled by the " "*encoding* and *errors* keyword arguments of the :class:`TarFile` class." msgstr "" -#: ../../library/tarfile.rst:1311 +#: ../../library/tarfile.rst:1316 msgid "" "*encoding* defines the character encoding to use for the metadata in the " "archive. The default value is :func:`sys.getfilesystemencoding` or " @@ -1644,7 +1651,7 @@ msgid "" "not set appropriately, this conversion may fail." msgstr "" -#: ../../library/tarfile.rst:1317 +#: ../../library/tarfile.rst:1322 msgid "" "The *errors* argument defines how characters are treated that cannot be " "converted. Possible values are listed in section :ref:`error-handlers`. The " @@ -1652,7 +1659,7 @@ msgid "" "system calls, see :ref:`os-filenames`." msgstr "" -#: ../../library/tarfile.rst:1322 +#: ../../library/tarfile.rst:1327 msgid "" "For :const:`PAX_FORMAT` archives (the default), *encoding* is generally not " "needed because all the metadata is stored using *UTF-8*. *encoding* is only " diff --git a/library/textwrap.po b/library/textwrap.po index 30be1a125a..b3e2baf799 100644 --- a/library/textwrap.po +++ b/library/textwrap.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 10:36+0000\n" +"POT-Creation-Date: 2023-08-21 00:03+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-" @@ -75,7 +75,7 @@ msgid "" "First the whitespace in *text* is collapsed (all whitespace is replaced by " "single spaces). If the result fits in the *width*, it is returned. " "Otherwise, enough words are dropped from the end so that the remaining words " -"plus the :attr:`.placeholder` fit within :attr:`.width`::" +"plus the *placeholder* fit within *width*::" msgstr "" #: ../../library/textwrap.rst:72 diff --git a/library/timeit.po b/library/timeit.po index d813034cd4..3682b031a4 100644 --- a/library/timeit.po +++ b/library/timeit.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-08-27 18:15+0000\n" "PO-Revision-Date: 2023-05-20 13:21+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -78,7 +78,7 @@ msgid "" msgstr "" #: ../../library/timeit.rst:72 ../../library/timeit.rst:83 -#: ../../library/timeit.rst:120 +#: ../../library/timeit.rst:122 msgid "The optional *globals* parameter was added." msgstr "新增 *globals* 選用參數。" @@ -90,23 +90,25 @@ msgid "" "namespace in which to execute the code." msgstr "" -#: ../../library/timeit.rst:86 ../../library/timeit.rst:181 +#: ../../library/timeit.rst:86 ../../library/timeit.rst:183 msgid "Default value of *repeat* changed from 3 to 5." msgstr "" -#: ../../library/timeit.rst:91 -msgid "The default timer, which is always :func:`time.perf_counter`." +#: ../../library/timeit.rst:92 +msgid "" +"The default timer, which is always time.perf_counter(), returns float " +"seconds. An alternative, time.perf_counter_ns, returns integer nanoseconds." msgstr "" -#: ../../library/timeit.rst:93 +#: ../../library/timeit.rst:95 msgid ":func:`time.perf_counter` is now the default timer." msgstr "" -#: ../../library/timeit.rst:99 +#: ../../library/timeit.rst:101 msgid "Class for timing execution speed of small code snippets." msgstr "" -#: ../../library/timeit.rst:101 +#: ../../library/timeit.rst:103 msgid "" "The constructor takes a statement to be timed, an additional statement used " "for setup, and a timer function. Both statements default to ``'pass'``; the " @@ -117,20 +119,20 @@ msgid "" "controlled by passing a namespace to *globals*." msgstr "" -#: ../../library/timeit.rst:109 +#: ../../library/timeit.rst:111 msgid "" "To measure the execution time of the first statement, use the :meth:`." "timeit` method. The :meth:`.repeat` and :meth:`.autorange` methods are " "convenience methods to call :meth:`.timeit` multiple times." msgstr "" -#: ../../library/timeit.rst:113 +#: ../../library/timeit.rst:115 msgid "" "The execution time of *setup* is excluded from the overall timed execution " "run." msgstr "" -#: ../../library/timeit.rst:115 +#: ../../library/timeit.rst:117 msgid "" "The *stmt* and *setup* parameters can also take objects that are callable " "without arguments. This will embed calls to them in a timer function that " @@ -138,17 +140,17 @@ msgid "" "a little larger in this case because of the extra function calls." msgstr "" -#: ../../library/timeit.rst:125 +#: ../../library/timeit.rst:127 msgid "" "Time *number* executions of the main statement. This executes the setup " "statement once, and then returns the time it takes to execute the main " -"statement a number of times, measured in seconds as a float. The argument is " -"the number of times through the loop, defaulting to one million. The main " -"statement, the setup statement and the timer function to be used are passed " -"to the constructor." +"statement a number of times. The default timer returns seconds as a float. " +"The argument is the number of times through the loop, defaulting to one " +"million. The main statement, the setup statement and the timer function to " +"be used are passed to the constructor." msgstr "" -#: ../../library/timeit.rst:134 +#: ../../library/timeit.rst:136 msgid "" "By default, :meth:`.timeit` temporarily turns off :term:`garbage collection` " "during the timing. The advantage of this approach is that it makes " @@ -158,11 +160,11 @@ msgid "" "example::" msgstr "" -#: ../../library/timeit.rst:146 +#: ../../library/timeit.rst:148 msgid "Automatically determine how many times to call :meth:`.timeit`." msgstr "" -#: ../../library/timeit.rst:148 +#: ../../library/timeit.rst:150 msgid "" "This is a convenience function that calls :meth:`.timeit` repeatedly so that " "the total time >= 0.2 second, returning the eventual (number of loops, time " @@ -171,17 +173,17 @@ msgid "" "at least 0.2 second." msgstr "" -#: ../../library/timeit.rst:154 +#: ../../library/timeit.rst:156 msgid "" "If *callback* is given and is not ``None``, it will be called after each " "trial with two arguments: ``callback(number, time_taken)``." msgstr "" -#: ../../library/timeit.rst:162 +#: ../../library/timeit.rst:164 msgid "Call :meth:`.timeit` a few times." msgstr "" -#: ../../library/timeit.rst:164 +#: ../../library/timeit.rst:166 msgid "" "This is a convenience function that calls the :meth:`.timeit` repeatedly, " "returning a list of results. The first argument specifies how many times to " @@ -189,7 +191,7 @@ msgid "" "for :meth:`.timeit`." msgstr "" -#: ../../library/timeit.rst:171 +#: ../../library/timeit.rst:173 msgid "" "It's tempting to calculate mean and standard deviation from the result " "vector and report these. However, this is not very useful. In a typical " @@ -201,67 +203,67 @@ msgid "" "entire vector and apply common sense rather than statistics." msgstr "" -#: ../../library/timeit.rst:187 +#: ../../library/timeit.rst:189 msgid "Helper to print a traceback from the timed code." msgstr "" -#: ../../library/timeit.rst:189 +#: ../../library/timeit.rst:191 msgid "Typical use::" msgstr "" -#: ../../library/timeit.rst:197 +#: ../../library/timeit.rst:199 msgid "" "The advantage over the standard traceback is that source lines in the " "compiled template will be displayed. The optional *file* argument directs " "where the traceback is sent; it defaults to :data:`sys.stderr`." msgstr "" -#: ../../library/timeit.rst:205 +#: ../../library/timeit.rst:207 msgid "Command-Line Interface" msgstr "命令執行列介面" -#: ../../library/timeit.rst:207 +#: ../../library/timeit.rst:209 msgid "" "When called as a program from the command line, the following form is used::" msgstr "" -#: ../../library/timeit.rst:211 +#: ../../library/timeit.rst:213 msgid "Where the following options are understood:" msgstr "" -#: ../../library/timeit.rst:217 +#: ../../library/timeit.rst:219 msgid "how many times to execute 'statement'" msgstr "" -#: ../../library/timeit.rst:221 +#: ../../library/timeit.rst:223 msgid "how many times to repeat the timer (default 5)" msgstr "" -#: ../../library/timeit.rst:225 +#: ../../library/timeit.rst:227 msgid "statement to be executed once initially (default ``pass``)" msgstr "" -#: ../../library/timeit.rst:229 +#: ../../library/timeit.rst:231 msgid "" "measure process time, not wallclock time, using :func:`time.process_time` " "instead of :func:`time.perf_counter`, which is the default" msgstr "" -#: ../../library/timeit.rst:236 +#: ../../library/timeit.rst:238 msgid "" "specify a time unit for timer output; can select ``nsec``, ``usec``, " "``msec``, or ``sec``" msgstr "" -#: ../../library/timeit.rst:242 +#: ../../library/timeit.rst:244 msgid "print raw timing results; repeat for more digits precision" msgstr "" -#: ../../library/timeit.rst:246 +#: ../../library/timeit.rst:248 msgid "print a short usage message and exit" msgstr "" -#: ../../library/timeit.rst:248 +#: ../../library/timeit.rst:250 msgid "" "A multi-line statement may be given by specifying each line as a separate " "statement argument; indented lines are possible by enclosing an argument in " @@ -269,14 +271,14 @@ msgid "" "similarly." msgstr "" -#: ../../library/timeit.rst:253 +#: ../../library/timeit.rst:255 msgid "" "If :option:`-n` is not given, a suitable number of loops is calculated by " "trying increasing numbers from the sequence 1, 2, 5, 10, 20, 50, ... until " "the total time is at least 0.2 seconds." msgstr "" -#: ../../library/timeit.rst:257 +#: ../../library/timeit.rst:259 msgid "" ":func:`default_timer` measurements can be affected by other programs running " "on the same machine, so the best thing to do when accurate timing is " @@ -286,7 +288,7 @@ msgid "" "measure CPU time." msgstr "" -#: ../../library/timeit.rst:265 +#: ../../library/timeit.rst:267 msgid "" "There is a certain baseline overhead associated with executing a pass " "statement. The code here doesn't try to hide it, but you should be aware of " @@ -294,17 +296,17 @@ msgid "" "arguments, and it might differ between Python versions." msgstr "" -#: ../../library/timeit.rst:274 +#: ../../library/timeit.rst:276 msgid "Examples" msgstr "範例" -#: ../../library/timeit.rst:276 +#: ../../library/timeit.rst:278 msgid "" "It is possible to provide a setup statement that is executed only once at " "the beginning:" msgstr "" -#: ../../library/timeit.rst:285 +#: ../../library/timeit.rst:287 msgid "" "In the output, there are three fields. The loop count, which tells you how " "many times the statement body was run per timing loop repetition. The " @@ -314,24 +316,24 @@ msgid "" "repetition took divided by the loop count." msgstr "" -#: ../../library/timeit.rst:300 +#: ../../library/timeit.rst:302 msgid "The same can be done using the :class:`Timer` class and its methods::" msgstr "" -#: ../../library/timeit.rst:310 +#: ../../library/timeit.rst:312 msgid "" "The following examples show how to time expressions that contain multiple " "lines. Here we compare the cost of using :func:`hasattr` vs. :keyword:`try`/:" "keyword:`except` to test for missing and present object attributes:" msgstr "" -#: ../../library/timeit.rst:356 +#: ../../library/timeit.rst:358 msgid "" "To give the :mod:`timeit` module access to functions you define, you can " "pass a *setup* parameter which contains an import statement::" msgstr "" -#: ../../library/timeit.rst:367 +#: ../../library/timeit.rst:369 msgid "" "Another option is to pass :func:`globals` to the *globals* parameter, which " "will cause the code to be executed within your current global namespace. " diff --git a/reference/datamodel.po b/reference/datamodel.po index fea062ec1b..45236e1665 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 10:36+0000\n" +"POT-Creation-Date: 2023-08-26 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -158,11 +158,11 @@ msgid "" "future." msgstr "" -#: ../../reference/datamodel.rst:145 ../../reference/datamodel.rst:150 +#: ../../reference/datamodel.rst:146 ../../reference/datamodel.rst:148 msgid "None" msgstr "" -#: ../../reference/datamodel.rst:147 +#: ../../reference/datamodel.rst:150 msgid "" "This type has a single value. There is a single object with this value. " "This object is accessed through the built-in name ``None``. It is used to " @@ -170,11 +170,11 @@ msgid "" "functions that don't explicitly return anything. Its truth value is false." msgstr "" -#: ../../reference/datamodel.rst:153 ../../reference/datamodel.rst:170 +#: ../../reference/datamodel.rst:157 ../../reference/datamodel.rst:159 msgid "NotImplemented" msgstr "NotImplemented" -#: ../../reference/datamodel.rst:155 +#: ../../reference/datamodel.rst:161 msgid "" "This type has a single value. There is a single object with this value. " "This object is accessed through the built-in name ``NotImplemented``. " @@ -184,33 +184,33 @@ msgid "" "the operator.) It should not be evaluated in a boolean context." msgstr "" -#: ../../reference/datamodel.rst:162 +#: ../../reference/datamodel.rst:168 msgid "See :ref:`implementing-the-arithmetic-operations` for more details." msgstr "更多細節請見 :ref:`implementing-the-arithmetic-operations`\\ 。" -#: ../../reference/datamodel.rst:166 +#: ../../reference/datamodel.rst:172 msgid "" "Evaluating ``NotImplemented`` in a boolean context is deprecated. While it " "currently evaluates as true, it will emit a :exc:`DeprecationWarning`. It " "will raise a :exc:`TypeError` in a future version of Python." msgstr "" -#: ../../reference/datamodel.rst:173 ../../reference/datamodel.rst:179 +#: ../../reference/datamodel.rst:179 ../../reference/datamodel.rst:180 msgid "Ellipsis" msgstr "" -#: ../../reference/datamodel.rst:177 +#: ../../reference/datamodel.rst:184 msgid "" "This type has a single value. There is a single object with this value. " "This object is accessed through the literal ``...`` or the built-in name " "``Ellipsis``. Its truth value is true." msgstr "" -#: ../../reference/datamodel.rst:266 +#: ../../reference/datamodel.rst:190 msgid ":class:`numbers.Number`" msgstr ":class:`numbers.Number`" -#: ../../reference/datamodel.rst:184 +#: ../../reference/datamodel.rst:194 msgid "" "These are created by numeric literals and returned as results by arithmetic " "operators and arithmetic built-in functions. Numeric objects are immutable; " @@ -219,64 +219,71 @@ msgid "" "numerical representation in computers." msgstr "" -#: ../../reference/datamodel.rst:190 +#: ../../reference/datamodel.rst:200 msgid "" "The string representations of the numeric classes, computed by :meth:" "`~object.__repr__` and :meth:`~object.__str__`, have the following " "properties:" msgstr "" -#: ../../reference/datamodel.rst:194 +#: ../../reference/datamodel.rst:204 msgid "" "They are valid numeric literals which, when passed to their class " "constructor, produce an object having the value of the original numeric." msgstr "" -#: ../../reference/datamodel.rst:198 +#: ../../reference/datamodel.rst:208 msgid "The representation is in base 10, when possible." msgstr "" -#: ../../reference/datamodel.rst:200 +#: ../../reference/datamodel.rst:210 msgid "" "Leading zeros, possibly excepting a single zero before a decimal point, are " "not shown." msgstr "" -#: ../../reference/datamodel.rst:203 +#: ../../reference/datamodel.rst:213 msgid "" "Trailing zeros, possibly excepting a single zero after a decimal point, are " "not shown." msgstr "" -#: ../../reference/datamodel.rst:206 +#: ../../reference/datamodel.rst:216 msgid "A sign is shown only when the number is negative." msgstr "" -#: ../../reference/datamodel.rst:208 +#: ../../reference/datamodel.rst:218 msgid "" "Python distinguishes between integers, floating point numbers, and complex " "numbers:" msgstr "" -#: ../../reference/datamodel.rst:241 +#: ../../reference/datamodel.rst:223 msgid ":class:`numbers.Integral`" msgstr ":class:`numbers.Integral`" -#: ../../reference/datamodel.rst:214 +#: ../../reference/datamodel.rst:227 msgid "" "These represent elements from the mathematical set of integers (positive and " "negative)." msgstr "" -#: ../../reference/datamodel.rst:217 +#: ../../reference/datamodel.rst:233 +msgid "" +"The rules for integer representation are intended to give the most " +"meaningful interpretation of shift and mask operations involving negative " +"integers." +msgstr "" + +#: ../../reference/datamodel.rst:236 msgid "There are two types of integers:" msgstr "" -#: ../../reference/datamodel.rst:224 +#: ../../reference/datamodel.rst:243 msgid "Integers (:class:`int`)" msgstr "" -#: ../../reference/datamodel.rst:220 +#: ../../reference/datamodel.rst:239 msgid "" "These represent numbers in an unlimited range, subject to available " "(virtual) memory only. For the purpose of shift and mask operations, a " @@ -285,11 +292,11 @@ msgid "" "sign bits extending to the left." msgstr "" -#: ../../reference/datamodel.rst:236 +#: ../../reference/datamodel.rst:256 msgid "Booleans (:class:`bool`)" msgstr "" -#: ../../reference/datamodel.rst:232 +#: ../../reference/datamodel.rst:251 msgid "" "These represent the truth values False and True. The two objects " "representing the values ``False`` and ``True`` are the only Boolean objects. " @@ -299,18 +306,11 @@ msgid "" "``\"True\"`` are returned, respectively." msgstr "" -#: ../../reference/datamodel.rst:240 -msgid "" -"The rules for integer representation are intended to give the most " -"meaningful interpretation of shift and mask operations involving negative " -"integers." -msgstr "" - -#: ../../reference/datamodel.rst:256 +#: ../../reference/datamodel.rst:259 msgid ":class:`numbers.Real` (:class:`float`)" msgstr ":class:`numbers.Real` (:class:`float`)" -#: ../../reference/datamodel.rst:250 +#: ../../reference/datamodel.rst:267 msgid "" "These represent machine-level double precision floating point numbers. You " "are at the mercy of the underlying machine architecture (and C or Java " @@ -321,11 +321,11 @@ msgid "" "complicate the language with two kinds of floating point numbers." msgstr "" -#: ../../reference/datamodel.rst:266 +#: ../../reference/datamodel.rst:277 msgid ":class:`numbers.Complex` (:class:`complex`)" msgstr ":class:`numbers.Complex` (:class:`complex`)" -#: ../../reference/datamodel.rst:263 +#: ../../reference/datamodel.rst:283 msgid "" "These represent complex numbers as a pair of machine-level double precision " "floating point numbers. The same caveats apply as for floating point " @@ -333,11 +333,11 @@ msgid "" "retrieved through the read-only attributes ``z.real`` and ``z.imag``." msgstr "" -#: ../../reference/datamodel.rst:383 +#: ../../reference/datamodel.rst:290 msgid "Sequences" msgstr "" -#: ../../reference/datamodel.rst:276 +#: ../../reference/datamodel.rst:299 msgid "" "These represent finite ordered sets indexed by non-negative numbers. The " "built-in function :func:`len` returns the number of items of a sequence. " @@ -345,7 +345,7 @@ msgid "" "1, ..., *n*-1. Item *i* of sequence *a* is selected by ``a[i]``." msgstr "" -#: ../../reference/datamodel.rst:283 +#: ../../reference/datamodel.rst:306 msgid "" "Sequences also support slicing: ``a[i:j]`` selects all items with index *k* " "such that *i* ``<=`` *k* ``<`` *j*. When used as an expression, a slice is " @@ -353,22 +353,22 @@ msgid "" "so that it starts at 0." msgstr "" -#: ../../reference/datamodel.rst:288 +#: ../../reference/datamodel.rst:311 msgid "" "Some sequences also support \"extended slicing\" with a third \"step\" " "parameter: ``a[i:j:k]`` selects all items of *a* with index *x* where ``x = " "i + n*k``, *n* ``>=`` ``0`` and *i* ``<=`` *x* ``<`` *j*." msgstr "" -#: ../../reference/datamodel.rst:292 +#: ../../reference/datamodel.rst:315 msgid "Sequences are distinguished according to their mutability:" msgstr "" -#: ../../reference/datamodel.rst:349 +#: ../../reference/datamodel.rst:319 msgid "Immutable sequences" msgstr "" -#: ../../reference/datamodel.rst:299 +#: ../../reference/datamodel.rst:325 msgid "" "An object of an immutable sequence type cannot change once it is created. " "(If the object contains references to other objects, these other objects may " @@ -376,15 +376,15 @@ msgid "" "referenced by an immutable object cannot change.)" msgstr "" -#: ../../reference/datamodel.rst:304 +#: ../../reference/datamodel.rst:330 msgid "The following types are immutable sequences:" msgstr "" -#: ../../reference/datamodel.rst:327 +#: ../../reference/datamodel.rst:353 msgid "Strings" msgstr "字串 (String)" -#: ../../reference/datamodel.rst:317 +#: ../../reference/datamodel.rst:343 msgid "" "A string is a sequence of values that represent Unicode code points. All the " "code points in the range ``U+0000 - U+10FFFF`` can be represented in a " @@ -398,11 +398,11 @@ msgid "" "to achieve the opposite." msgstr "" -#: ../../reference/datamodel.rst:340 +#: ../../reference/datamodel.rst:366 msgid "Tuples" msgstr "" -#: ../../reference/datamodel.rst:335 +#: ../../reference/datamodel.rst:361 msgid "" "The items of a tuple are arbitrary Python objects. Tuples of two or more " "items are formed by comma-separated lists of expressions. A tuple of one " @@ -412,11 +412,11 @@ msgid "" "empty pair of parentheses." msgstr "" -#: ../../reference/datamodel.rst:349 +#: ../../reference/datamodel.rst:376 msgid "Bytes" msgstr "" -#: ../../reference/datamodel.rst:345 +#: ../../reference/datamodel.rst:371 msgid "" "A bytes object is an immutable array. The items are 8-bit bytes, " "represented by integers in the range 0 <= x < 256. Bytes literals (like " @@ -425,37 +425,43 @@ msgid "" "the :meth:`~bytes.decode` method." msgstr "" -#: ../../reference/datamodel.rst:383 +#: ../../reference/datamodel.rst:379 msgid "Mutable sequences" msgstr "" -#: ../../reference/datamodel.rst:359 +#: ../../reference/datamodel.rst:388 msgid "" "Mutable sequences can be changed after they are created. The subscription " "and slicing notations can be used as the target of assignment and :keyword:" "`del` (delete) statements." msgstr "" -#: ../../reference/datamodel.rst:363 +#: ../../reference/datamodel.rst:396 +msgid "" +"The :mod:`collections` and :mod:`array` module provide additional examples " +"of mutable sequence types." +msgstr "" + +#: ../../reference/datamodel.rst:399 msgid "There are currently two intrinsic mutable sequence types:" msgstr "" -#: ../../reference/datamodel.rst:370 +#: ../../reference/datamodel.rst:406 msgid "Lists" msgstr "List(串列)" -#: ../../reference/datamodel.rst:368 +#: ../../reference/datamodel.rst:404 msgid "" "The items of a list are arbitrary Python objects. Lists are formed by " "placing a comma-separated list of expressions in square brackets. (Note that " "there are no special cases needed to form lists of length 0 or 1.)" msgstr "" -#: ../../reference/datamodel.rst:378 +#: ../../reference/datamodel.rst:415 msgid "Byte Arrays" msgstr "" -#: ../../reference/datamodel.rst:375 +#: ../../reference/datamodel.rst:411 msgid "" "A bytearray object is a mutable array. They are created by the built-in :" "func:`bytearray` constructor. Aside from being mutable (and hence " @@ -463,17 +469,11 @@ msgid "" "functionality as immutable :class:`bytes` objects." msgstr "" -#: ../../reference/datamodel.rst:382 -msgid "" -"The extension module :mod:`array` provides an additional example of a " -"mutable sequence type, as does the :mod:`collections` module." -msgstr "" - -#: ../../reference/datamodel.rst:417 +#: ../../reference/datamodel.rst:418 msgid "Set types" msgstr "" -#: ../../reference/datamodel.rst:390 +#: ../../reference/datamodel.rst:424 msgid "" "These represent unordered, finite sets of unique, immutable objects. As " "such, they cannot be indexed by any subscript. However, they can be iterated " @@ -483,7 +483,7 @@ msgid "" "union, difference, and symmetric difference." msgstr "" -#: ../../reference/datamodel.rst:397 +#: ../../reference/datamodel.rst:431 msgid "" "For set elements, the same immutability rules apply as for dictionary keys. " "Note that numeric types obey the normal rules for numeric comparison: if two " @@ -491,37 +491,37 @@ msgid "" "contained in a set." msgstr "" -#: ../../reference/datamodel.rst:402 +#: ../../reference/datamodel.rst:436 msgid "There are currently two intrinsic set types:" msgstr "" -#: ../../reference/datamodel.rst:409 +#: ../../reference/datamodel.rst:445 msgid "Sets" msgstr "" -#: ../../reference/datamodel.rst:407 +#: ../../reference/datamodel.rst:442 msgid "" "These represent a mutable set. They are created by the built-in :func:`set` " "constructor and can be modified afterwards by several methods, such as :meth:" "`~set.add`." msgstr "" -#: ../../reference/datamodel.rst:417 +#: ../../reference/datamodel.rst:454 msgid "Frozen sets" msgstr "" -#: ../../reference/datamodel.rst:414 +#: ../../reference/datamodel.rst:450 msgid "" "These represent an immutable set. They are created by the built-in :func:" "`frozenset` constructor. As a frozenset is immutable and :term:`hashable`, " "it can be used again as an element of another set, or as a dictionary key." msgstr "" -#: ../../reference/datamodel.rst:464 +#: ../../reference/datamodel.rst:457 msgid "Mappings" msgstr "" -#: ../../reference/datamodel.rst:425 +#: ../../reference/datamodel.rst:464 msgid "" "These represent finite sets of objects indexed by arbitrary index sets. The " "subscript notation ``a[k]`` selects the item indexed by ``k`` from the " @@ -530,15 +530,15 @@ msgid "" "returns the number of items in a mapping." msgstr "" -#: ../../reference/datamodel.rst:431 +#: ../../reference/datamodel.rst:470 msgid "There is currently a single intrinsic mapping type:" msgstr "" -#: ../../reference/datamodel.rst:464 +#: ../../reference/datamodel.rst:474 msgid "Dictionaries" msgstr "字典" -#: ../../reference/datamodel.rst:436 +#: ../../reference/datamodel.rst:478 msgid "" "These represent finite sets of objects indexed by nearly arbitrary values. " "The only types of values not acceptable as keys are values containing lists " @@ -550,7 +550,7 @@ msgid "" "interchangeably to index the same dictionary entry." msgstr "" -#: ../../reference/datamodel.rst:445 +#: ../../reference/datamodel.rst:487 msgid "" "Dictionaries preserve insertion order, meaning that keys will be produced in " "the same order they were added sequentially over the dictionary. Replacing " @@ -558,159 +558,159 @@ msgid "" "inserting it will add it to the end instead of keeping its old place." msgstr "" -#: ../../reference/datamodel.rst:450 +#: ../../reference/datamodel.rst:492 msgid "" "Dictionaries are mutable; they can be created by the ``{...}`` notation (see " "section :ref:`dict`)." msgstr "" -#: ../../reference/datamodel.rst:457 +#: ../../reference/datamodel.rst:499 msgid "" "The extension modules :mod:`dbm.ndbm` and :mod:`dbm.gnu` provide additional " "examples of mapping types, as does the :mod:`collections` module." msgstr "" -#: ../../reference/datamodel.rst:461 +#: ../../reference/datamodel.rst:503 msgid "" "Dictionaries did not preserve insertion order in versions of Python before " "3.6. In CPython 3.6, insertion order was preserved, but it was considered an " "implementation detail at that time rather than a language guarantee." msgstr "" -#: ../../reference/datamodel.rst:733 +#: ../../reference/datamodel.rst:510 msgid "Callable types" msgstr "" -#: ../../reference/datamodel.rst:473 +#: ../../reference/datamodel.rst:518 msgid "" "These are the types to which the function call operation (see section :ref:" "`calls`) can be applied:" msgstr "" -#: ../../reference/datamodel.rst:586 +#: ../../reference/datamodel.rst:523 msgid "User-defined functions" msgstr "" -#: ../../reference/datamodel.rst:482 +#: ../../reference/datamodel.rst:530 msgid "" "A user-defined function object is created by a function definition (see " "section :ref:`function`). It should be called with an argument list " "containing the same number of items as the function's formal parameter list." msgstr "" -#: ../../reference/datamodel.rst:487 ../../reference/datamodel.rst:849 +#: ../../reference/datamodel.rst:535 ../../reference/datamodel.rst:926 msgid "Special attributes:" msgstr "" -#: ../../reference/datamodel.rst:506 +#: ../../reference/datamodel.rst:554 msgid "Attribute" msgstr "屬性" -#: ../../reference/datamodel.rst:506 +#: ../../reference/datamodel.rst:554 msgid "Meaning" msgstr "" -#: ../../reference/datamodel.rst:508 ../../reference/datamodel.rst:769 -#: ../../reference/datamodel.rst:865 +#: ../../reference/datamodel.rst:556 ../../reference/datamodel.rst:843 +#: ../../reference/datamodel.rst:942 msgid ":attr:`__doc__`" msgstr ":attr:`__doc__`" -#: ../../reference/datamodel.rst:508 +#: ../../reference/datamodel.rst:556 msgid "" "The function's documentation string, or ``None`` if unavailable; not " "inherited by subclasses." msgstr "" -#: ../../reference/datamodel.rst:508 ../../reference/datamodel.rst:513 -#: ../../reference/datamodel.rst:516 ../../reference/datamodel.rst:521 -#: ../../reference/datamodel.rst:525 ../../reference/datamodel.rst:531 -#: ../../reference/datamodel.rst:541 ../../reference/datamodel.rst:552 -#: ../../reference/datamodel.rst:562 ../../reference/datamodel.rst:565 +#: ../../reference/datamodel.rst:556 ../../reference/datamodel.rst:561 +#: ../../reference/datamodel.rst:564 ../../reference/datamodel.rst:569 +#: ../../reference/datamodel.rst:573 ../../reference/datamodel.rst:579 +#: ../../reference/datamodel.rst:589 ../../reference/datamodel.rst:600 +#: ../../reference/datamodel.rst:610 ../../reference/datamodel.rst:613 msgid "Writable" msgstr "" -#: ../../reference/datamodel.rst:513 +#: ../../reference/datamodel.rst:561 msgid ":attr:`~definition.\\ __name__`" msgstr ":attr:`~definition.\\ __name__`" -#: ../../reference/datamodel.rst:513 +#: ../../reference/datamodel.rst:561 msgid "The function's name." msgstr "" -#: ../../reference/datamodel.rst:516 +#: ../../reference/datamodel.rst:564 msgid ":attr:`~definition.\\ __qualname__`" msgstr ":attr:`~definition.\\ __qualname__`" -#: ../../reference/datamodel.rst:516 +#: ../../reference/datamodel.rst:564 msgid "The function's :term:`qualified name`." msgstr "" -#: ../../reference/datamodel.rst:521 ../../reference/datamodel.rst:855 +#: ../../reference/datamodel.rst:569 ../../reference/datamodel.rst:932 msgid ":attr:`__module__`" msgstr ":attr:`__module__`" -#: ../../reference/datamodel.rst:521 +#: ../../reference/datamodel.rst:569 msgid "" "The name of the module the function was defined in, or ``None`` if " "unavailable." msgstr "" -#: ../../reference/datamodel.rst:525 +#: ../../reference/datamodel.rst:573 msgid ":attr:`__defaults__`" msgstr ":attr:`__defaults__`" -#: ../../reference/datamodel.rst:525 +#: ../../reference/datamodel.rst:573 msgid "" "A tuple containing default argument values for those arguments that have " "defaults, or ``None`` if no arguments have a default value." msgstr "" -#: ../../reference/datamodel.rst:531 +#: ../../reference/datamodel.rst:579 msgid ":attr:`__code__`" msgstr ":attr:`__code__`" -#: ../../reference/datamodel.rst:531 +#: ../../reference/datamodel.rst:579 msgid "The code object representing the compiled function body." msgstr "" -#: ../../reference/datamodel.rst:534 +#: ../../reference/datamodel.rst:582 msgid ":attr:`__globals__`" msgstr ":attr:`__globals__`" -#: ../../reference/datamodel.rst:534 +#: ../../reference/datamodel.rst:582 msgid "" "A reference to the dictionary that holds the function's global variables --- " "the global namespace of the module in which the function was defined." msgstr "" -#: ../../reference/datamodel.rst:534 ../../reference/datamodel.rst:545 +#: ../../reference/datamodel.rst:582 ../../reference/datamodel.rst:593 msgid "Read-only" msgstr "" -#: ../../reference/datamodel.rst:541 ../../reference/datamodel.rst:858 +#: ../../reference/datamodel.rst:589 ../../reference/datamodel.rst:935 msgid ":attr:`~object.__dict__`" msgstr ":attr:`~object.__dict__`" -#: ../../reference/datamodel.rst:541 +#: ../../reference/datamodel.rst:589 msgid "The namespace supporting arbitrary function attributes." msgstr "" -#: ../../reference/datamodel.rst:545 +#: ../../reference/datamodel.rst:593 msgid ":attr:`__closure__`" msgstr ":attr:`__closure__`" -#: ../../reference/datamodel.rst:545 +#: ../../reference/datamodel.rst:593 msgid "" "``None`` or a tuple of cells that contain bindings for the function's free " "variables. See below for information on the ``cell_contents`` attribute." msgstr "" -#: ../../reference/datamodel.rst:552 ../../reference/datamodel.rst:784 -#: ../../reference/datamodel.rst:872 +#: ../../reference/datamodel.rst:600 ../../reference/datamodel.rst:858 +#: ../../reference/datamodel.rst:949 msgid ":attr:`__annotations__`" msgstr ":attr:`__annotations__`" -#: ../../reference/datamodel.rst:552 +#: ../../reference/datamodel.rst:600 msgid "" "A dict containing annotations of parameters. The keys of the dict are the " "parameter names, and ``'return'`` for the return annotation, if provided. " @@ -718,31 +718,31 @@ msgid "" "howto`." msgstr "" -#: ../../reference/datamodel.rst:562 +#: ../../reference/datamodel.rst:610 msgid ":attr:`__kwdefaults__`" msgstr ":attr:`__kwdefaults__`" -#: ../../reference/datamodel.rst:562 +#: ../../reference/datamodel.rst:610 msgid "A dict containing defaults for keyword-only parameters." msgstr "" -#: ../../reference/datamodel.rst:565 ../../reference/datamodel.rst:876 +#: ../../reference/datamodel.rst:613 ../../reference/datamodel.rst:954 msgid ":attr:`__type_params__`" msgstr ":attr:`__type_params__`" -#: ../../reference/datamodel.rst:565 +#: ../../reference/datamodel.rst:613 msgid "" "A tuple containing the :ref:`type parameters ` of a :ref:" "`generic function `." msgstr "" -#: ../../reference/datamodel.rst:572 +#: ../../reference/datamodel.rst:620 msgid "" "Most of the attributes labelled \"Writable\" check the type of the assigned " "value." msgstr "" -#: ../../reference/datamodel.rst:574 +#: ../../reference/datamodel.rst:622 msgid "" "Function objects also support getting and setting arbitrary attributes, " "which can be used, for example, to attach metadata to functions. Regular " @@ -752,30 +752,30 @@ msgid "" "future.*" msgstr "" -#: ../../reference/datamodel.rst:580 +#: ../../reference/datamodel.rst:628 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:583 +#: ../../reference/datamodel.rst:631 msgid "" "Additional information about a function's definition can be retrieved from " "its code object; see the description of internal types below. The :data:" "`cell ` type can be accessed in the :mod:`types` module." msgstr "" -#: ../../reference/datamodel.rst:649 +#: ../../reference/datamodel.rst:638 msgid "Instance methods" msgstr "" -#: ../../reference/datamodel.rst:594 +#: ../../reference/datamodel.rst:645 msgid "" "An instance method object combines a class, a class instance and any " "callable object (normally a user-defined function)." msgstr "" -#: ../../reference/datamodel.rst:604 +#: ../../reference/datamodel.rst:655 msgid "" "Special read-only attributes: :attr:`__self__` is the class instance " "object, :attr:`__func__` is the function object; :attr:`__doc__` is the " @@ -785,20 +785,20 @@ msgid "" "``None`` if unavailable." msgstr "" -#: ../../reference/datamodel.rst:610 +#: ../../reference/datamodel.rst:661 msgid "" "Methods also support accessing (but not setting) the arbitrary function " "attributes on the underlying function object." msgstr "" -#: ../../reference/datamodel.rst:613 +#: ../../reference/datamodel.rst:664 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-" "defined function object or a class method object." msgstr "" -#: ../../reference/datamodel.rst:617 +#: ../../reference/datamodel.rst:668 msgid "" "When an instance method object is created by retrieving a user-defined " "function object from a class via one of its instances, its :attr:`__self__` " @@ -806,7 +806,7 @@ msgid "" "new method's :attr:`__func__` attribute is the original function object." msgstr "" -#: ../../reference/datamodel.rst:623 +#: ../../reference/datamodel.rst:674 msgid "" "When an instance method object is created by retrieving a class method " "object from a class or instance, its :attr:`__self__` attribute is the class " @@ -814,7 +814,7 @@ msgid "" "the class method." msgstr "" -#: ../../reference/datamodel.rst:628 +#: ../../reference/datamodel.rst:679 msgid "" "When an instance method object is called, the underlying function (:attr:" "`__func__`) is called, inserting the class instance (:attr:`__self__`) in " @@ -823,7 +823,7 @@ msgid "" "class:`C`, calling ``x.f(1)`` is equivalent to calling ``C.f(x, 1)``." msgstr "" -#: ../../reference/datamodel.rst:635 +#: ../../reference/datamodel.rst:686 msgid "" "When an instance method object is derived from a class method object, the " "\"class instance\" stored in :attr:`__self__` will actually be the class " @@ -831,7 +831,7 @@ msgid "" "calling ``f(C,1)`` where ``f`` is the underlying function." msgstr "" -#: ../../reference/datamodel.rst:640 +#: ../../reference/datamodel.rst:691 msgid "" "Note that the transformation from function object to instance method object " "happens each time the attribute is retrieved from the instance. In some " @@ -844,11 +844,11 @@ msgid "" "the function is an attribute of the class." msgstr "" -#: ../../reference/datamodel.rst:664 +#: ../../reference/datamodel.rst:704 msgid "Generator functions" msgstr "" -#: ../../reference/datamodel.rst:656 +#: ../../reference/datamodel.rst:710 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 " @@ -861,11 +861,11 @@ msgid "" "values to be returned." msgstr "" -#: ../../reference/datamodel.rst:674 +#: ../../reference/datamodel.rst:722 msgid "Coroutine functions" msgstr "" -#: ../../reference/datamodel.rst:670 +#: ../../reference/datamodel.rst:727 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:" @@ -874,11 +874,11 @@ msgid "" "ref:`coroutine-objects` section." msgstr "" -#: ../../reference/datamodel.rst:694 +#: ../../reference/datamodel.rst:735 msgid "Asynchronous generator functions" msgstr "" -#: ../../reference/datamodel.rst:681 +#: ../../reference/datamodel.rst:741 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 " @@ -887,7 +887,7 @@ msgid "" "execute the body of the function." msgstr "" -#: ../../reference/datamodel.rst:687 +#: ../../reference/datamodel.rst:747 msgid "" "Calling the asynchronous iterator's :meth:`aiterator.__anext__ ` method will return an :term:`awaitable` which when awaited will " @@ -898,11 +898,11 @@ msgid "" "yielded." msgstr "" -#: ../../reference/datamodel.rst:709 +#: ../../reference/datamodel.rst:758 msgid "Built-in functions" msgstr "" -#: ../../reference/datamodel.rst:702 +#: ../../reference/datamodel.rst:765 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 " @@ -914,11 +914,11 @@ msgid "" "module the function was defined in or ``None`` if unavailable." msgstr "" -#: ../../reference/datamodel.rst:721 +#: ../../reference/datamodel.rst:776 msgid "Built-in methods" msgstr "" -#: ../../reference/datamodel.rst:717 +#: ../../reference/datamodel.rst:783 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 " @@ -927,11 +927,11 @@ msgid "" "attr:`__self__` is set to the object denoted by *alist*." msgstr "" -#: ../../reference/datamodel.rst:728 +#: ../../reference/datamodel.rst:791 msgid "Classes" msgstr "" -#: ../../reference/datamodel.rst:724 +#: ../../reference/datamodel.rst:793 msgid "" "Classes are callable. These objects normally act as factories for new " "instances of themselves, but variations are possible for class types that " @@ -940,21 +940,21 @@ msgid "" "initialize the new instance." msgstr "" -#: ../../reference/datamodel.rst:733 +#: ../../reference/datamodel.rst:801 msgid "Class Instances" msgstr "" -#: ../../reference/datamodel.rst:731 +#: ../../reference/datamodel.rst:803 msgid "" "Instances of arbitrary classes can be made callable by defining a :meth:" "`~object.__call__` method in their class." msgstr "" -#: ../../reference/datamodel.rst:796 +#: ../../reference/datamodel.rst:808 msgid "Modules" msgstr "模組" -#: ../../reference/datamodel.rst:740 +#: ../../reference/datamodel.rst:814 msgid "" "Modules are a basic organizational unit of Python code, and are created by " "the :ref:`import system ` as invoked either by the :keyword:" @@ -968,33 +968,33 @@ msgid "" "needed once the initialization is done)." msgstr "" -#: ../../reference/datamodel.rst:752 +#: ../../reference/datamodel.rst:826 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:762 +#: ../../reference/datamodel.rst:836 msgid "Predefined (writable) attributes:" msgstr "" -#: ../../reference/datamodel.rst:765 +#: ../../reference/datamodel.rst:839 msgid ":attr:`__name__`" msgstr ":attr:`__name__`" -#: ../../reference/datamodel.rst:765 +#: ../../reference/datamodel.rst:839 msgid "The module's name." msgstr "" -#: ../../reference/datamodel.rst:768 +#: ../../reference/datamodel.rst:842 msgid "The module's documentation string, or ``None`` if unavailable." msgstr "" -#: ../../reference/datamodel.rst:778 +#: ../../reference/datamodel.rst:852 msgid ":attr:`__file__`" msgstr ":attr:`__file__`" -#: ../../reference/datamodel.rst:772 +#: ../../reference/datamodel.rst:846 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 " @@ -1003,20 +1003,20 @@ msgid "" "library, it's the pathname of the shared library file." msgstr "" -#: ../../reference/datamodel.rst:781 +#: ../../reference/datamodel.rst:855 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:788 +#: ../../reference/datamodel.rst:862 msgid "" "Special read-only attribute: :attr:`~object.__dict__` is the module's " "namespace as a dictionary object." msgstr "" -#: ../../reference/datamodel.rst:793 +#: ../../reference/datamodel.rst:867 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 " @@ -1024,11 +1024,11 @@ msgid "" "module around while using its dictionary directly." msgstr "" -#: ../../reference/datamodel.rst:876 +#: ../../reference/datamodel.rst:874 msgid "Custom classes" msgstr "" -#: ../../reference/datamodel.rst:799 +#: ../../reference/datamodel.rst:876 msgid "" "Custom class types are typically created by class definitions (see section :" "ref:`class`). A class has a namespace implemented by a dictionary object. " @@ -1044,7 +1044,7 @@ msgid "" "python.org/download/releases/2.3/mro/." msgstr "" -#: ../../reference/datamodel.rst:823 +#: ../../reference/datamodel.rst:900 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 :" @@ -1055,66 +1055,66 @@ msgid "" "in its :attr:`~object.__dict__`." msgstr "" -#: ../../reference/datamodel.rst:833 +#: ../../reference/datamodel.rst:910 msgid "" "Class attribute assignments update the class's dictionary, never the " "dictionary of a base class." msgstr "" -#: ../../reference/datamodel.rst:838 +#: ../../reference/datamodel.rst:915 msgid "" "A class object can be called (see above) to yield a class instance (see " "below)." msgstr "" -#: ../../reference/datamodel.rst:852 +#: ../../reference/datamodel.rst:929 msgid ":attr:`~definition.__name__`" msgstr ":attr:`~definition.__name__`" -#: ../../reference/datamodel.rst:852 +#: ../../reference/datamodel.rst:929 msgid "The class name." msgstr "" -#: ../../reference/datamodel.rst:855 +#: ../../reference/datamodel.rst:932 msgid "The name of the module in which the class was defined." msgstr "" -#: ../../reference/datamodel.rst:858 +#: ../../reference/datamodel.rst:935 msgid "The dictionary containing the class's namespace." msgstr "" -#: ../../reference/datamodel.rst:862 +#: ../../reference/datamodel.rst:939 msgid ":attr:`~class.__bases__`" msgstr ":attr:`~class.__bases__`" -#: ../../reference/datamodel.rst:861 +#: ../../reference/datamodel.rst:938 msgid "" "A tuple containing the base classes, in the order of their occurrence in the " "base class list." msgstr "" -#: ../../reference/datamodel.rst:865 +#: ../../reference/datamodel.rst:942 msgid "The class's documentation string, or ``None`` if undefined." msgstr "" -#: ../../reference/datamodel.rst:868 +#: ../../reference/datamodel.rst:945 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:875 +#: ../../reference/datamodel.rst:952 msgid "" "A tuple containing the :ref:`type parameters ` of a :ref:" "`generic class `." msgstr "" -#: ../../reference/datamodel.rst:919 +#: ../../reference/datamodel.rst:957 msgid "Class instances" msgstr "" -#: ../../reference/datamodel.rst:885 +#: ../../reference/datamodel.rst:965 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 " @@ -1131,7 +1131,7 @@ msgid "" "__getattr__` method, that is called to satisfy the lookup." msgstr "" -#: ../../reference/datamodel.rst:901 +#: ../../reference/datamodel.rst:981 msgid "" "Attribute assignments and deletions update the instance's dictionary, never " "a class's dictionary. If the class has a :meth:`~object.__setattr__` or :" @@ -1139,23 +1139,23 @@ msgid "" "instance dictionary directly." msgstr "" -#: ../../reference/datamodel.rst:911 +#: ../../reference/datamodel.rst:991 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:918 +#: ../../reference/datamodel.rst:998 msgid "" "Special attributes: :attr:`~object.__dict__` is the attribute dictionary; :" "attr:`~instance.__class__` is the instance's class." msgstr "" -#: ../../reference/datamodel.rst:945 +#: ../../reference/datamodel.rst:1003 msgid "I/O objects (also known as file objects)" msgstr "" -#: ../../reference/datamodel.rst:935 +#: ../../reference/datamodel.rst:1018 msgid "" "A :term:`file object` represents an open file. Various shortcuts are " "available to create file objects: the :func:`open` built-in function, and " @@ -1164,7 +1164,7 @@ msgid "" "methods provided by extension modules)." msgstr "" -#: ../../reference/datamodel.rst:941 +#: ../../reference/datamodel.rst:1024 msgid "" "The objects ``sys.stdin``, ``sys.stdout`` and ``sys.stderr`` are initialized " "to file objects corresponding to the interpreter's standard input, output " @@ -1172,22 +1172,22 @@ msgid "" "interface defined by the :class:`io.TextIOBase` abstract class." msgstr "" -#: ../../reference/datamodel.rst:1233 +#: ../../reference/datamodel.rst:1032 msgid "Internal types" msgstr "" -#: ../../reference/datamodel.rst:952 +#: ../../reference/datamodel.rst:1038 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:1063 +#: ../../reference/datamodel.rst:1046 msgid "Code objects" msgstr "" -#: ../../reference/datamodel.rst:959 +#: ../../reference/datamodel.rst:1048 msgid "" "Code objects represent *byte-compiled* executable Python code, or :term:" "`bytecode`. The difference between a code object and a function object is " @@ -1199,7 +1199,7 @@ msgid "" "no references (directly or indirectly) to mutable objects." msgstr "" -#: ../../reference/datamodel.rst:987 +#: ../../reference/datamodel.rst:1076 msgid "" "Special read-only attributes: :attr:`co_name` gives the function name; :attr:" "`co_qualname` gives the fully qualified function name; :attr:`co_argcount` " @@ -1225,7 +1225,7 @@ msgid "" "flags for the interpreter." msgstr "" -#: ../../reference/datamodel.rst:1013 +#: ../../reference/datamodel.rst:1102 msgid "" "The following flag bits are defined for :attr:`co_flags`: bit ``0x04`` is " "set if the function uses the ``*arguments`` syntax to accept an arbitrary " @@ -1234,7 +1234,7 @@ msgid "" "set if the function is a generator." msgstr "" -#: ../../reference/datamodel.rst:1019 +#: ../../reference/datamodel.rst:1108 msgid "" "Future feature declarations (``from __future__ import division``) also use " "bits in :attr:`co_flags` to indicate whether a code object was compiled with " @@ -1243,23 +1243,23 @@ msgid "" "used in earlier versions of Python." msgstr "" -#: ../../reference/datamodel.rst:1025 +#: ../../reference/datamodel.rst:1114 msgid "Other bits in :attr:`co_flags` are reserved for internal use." msgstr "" -#: ../../reference/datamodel.rst:1029 +#: ../../reference/datamodel.rst:1118 msgid "" "If a code object represents a function, the first item in :attr:`co_consts` " "is the documentation string of the function, or ``None`` if undefined." msgstr "" -#: ../../reference/datamodel.rst:1034 +#: ../../reference/datamodel.rst:1123 msgid "" "Returns an iterable over the source code positions of each bytecode " "instruction in the code object." msgstr "" -#: ../../reference/datamodel.rst:1037 +#: ../../reference/datamodel.rst:1126 msgid "" "The iterator returns tuples containing the ``(start_line, end_line, " "start_column, end_column)``. The *i-th* tuple corresponds to the position of " @@ -1267,37 +1267,37 @@ msgid "" "is 0-indexed utf-8 byte offsets on the given source line." msgstr "" -#: ../../reference/datamodel.rst:1043 +#: ../../reference/datamodel.rst:1132 msgid "" "This positional information can be missing. A non-exhaustive lists of cases " "where this may happen:" msgstr "" -#: ../../reference/datamodel.rst:1046 +#: ../../reference/datamodel.rst:1135 msgid "Running the interpreter with :option:`-X` ``no_debug_ranges``." msgstr "" -#: ../../reference/datamodel.rst:1047 +#: ../../reference/datamodel.rst:1136 msgid "" "Loading a pyc file compiled while using :option:`-X` ``no_debug_ranges``." msgstr "" -#: ../../reference/datamodel.rst:1048 +#: ../../reference/datamodel.rst:1137 msgid "Position tuples corresponding to artificial instructions." msgstr "" -#: ../../reference/datamodel.rst:1049 +#: ../../reference/datamodel.rst:1138 msgid "" "Line and column numbers that can't be represented due to implementation " "specific limitations." msgstr "" -#: ../../reference/datamodel.rst:1052 +#: ../../reference/datamodel.rst:1141 msgid "" "When this occurs, some or all of the tuple elements can be :const:`None`." msgstr "" -#: ../../reference/datamodel.rst:1058 +#: ../../reference/datamodel.rst:1147 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 " @@ -1307,17 +1307,17 @@ msgid "" "environment variable can be used." msgstr "" -#: ../../reference/datamodel.rst:1125 +#: ../../reference/datamodel.rst:1158 msgid "Frame objects" msgstr "" -#: ../../reference/datamodel.rst:1070 +#: ../../reference/datamodel.rst:1162 msgid "" "Frame objects represent execution frames. They may occur in traceback " "objects (see below), and are also passed to registered trace functions." msgstr "" -#: ../../reference/datamodel.rst:1081 +#: ../../reference/datamodel.rst:1173 msgid "" "Special read-only attributes: :attr:`f_back` is to the previous stack frame " "(towards the caller), or ``None`` if this is the bottom stack frame; :attr:" @@ -1328,7 +1328,7 @@ msgid "" "the bytecode string of the code object)." msgstr "" -#: ../../reference/datamodel.rst:1089 +#: ../../reference/datamodel.rst:1181 msgid "" "Accessing ``f_code`` raises an :ref:`auditing event ` ``object." "__getattr__`` with arguments ``obj`` and ``\"f_code\"``." @@ -1336,7 +1336,7 @@ msgstr "" "存取 ``f_code`` 會引發一個附帶引數 ``obj`` 與 ``\"f_code\"`` 的\\ :ref:`稽核" "事件 ` ``object.__getattr__``。" -#: ../../reference/datamodel.rst:1098 +#: ../../reference/datamodel.rst:1190 msgid "" "Special writable attributes: :attr:`f_trace`, if not ``None``, is a function " "called for various events during code execution (this is used by the " @@ -1344,7 +1344,7 @@ msgid "" "can be disabled by setting :attr:`f_trace_lines` to :const:`False`." msgstr "" -#: ../../reference/datamodel.rst:1103 +#: ../../reference/datamodel.rst:1195 msgid "" "Implementations *may* allow per-opcode events to be requested by setting :" "attr:`f_trace_opcodes` to :const:`True`. Note that this may lead to " @@ -1352,7 +1352,7 @@ msgid "" "escape to the function being traced." msgstr "" -#: ../../reference/datamodel.rst:1108 +#: ../../reference/datamodel.rst:1200 msgid "" ":attr:`f_lineno` is the current line number of the frame --- writing to this " "from within a trace function jumps to the given line (only for the bottom-" @@ -1360,11 +1360,11 @@ msgid "" "Statement) by writing to f_lineno." msgstr "" -#: ../../reference/datamodel.rst:1113 +#: ../../reference/datamodel.rst:1205 msgid "Frame objects support one method:" msgstr "" -#: ../../reference/datamodel.rst:1117 +#: ../../reference/datamodel.rst:1209 msgid "" "This method clears all references to local variables held by the frame. " "Also, if the frame belonged to a generator, the generator is finalized. " @@ -1372,22 +1372,22 @@ msgid "" "catching an exception and storing its traceback for later use)." msgstr "" -#: ../../reference/datamodel.rst:1123 +#: ../../reference/datamodel.rst:1215 msgid ":exc:`RuntimeError` is raised if the frame is currently executing." msgstr "" -#: ../../reference/datamodel.rst:1189 +#: ../../reference/datamodel.rst:1223 msgid "Traceback objects" msgstr "" -#: ../../reference/datamodel.rst:1141 +#: ../../reference/datamodel.rst:1236 msgid "" "Traceback objects represent a stack trace of an 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:1145 +#: ../../reference/datamodel.rst:1240 msgid "" "For implicitly created tracebacks, when the search for an exception handler " "unwinds the execution stack, at each unwound level a traceback object is " @@ -1397,21 +1397,21 @@ msgid "" "exc_info()``, and as the ``__traceback__`` attribute of the caught exception." msgstr "" -#: ../../reference/datamodel.rst:1153 +#: ../../reference/datamodel.rst:1248 msgid "" "When the program contains no suitable handler, the stack trace is written " "(nicely formatted) to the standard error stream; if the interpreter is " "interactive, it is also made available to the user as ``sys.last_traceback``." msgstr "" -#: ../../reference/datamodel.rst:1158 +#: ../../reference/datamodel.rst:1253 msgid "" "For explicitly created tracebacks, it is up to the creator of the traceback " "to determine how the ``tb_next`` attributes should be linked to form a full " "stack trace." msgstr "" -#: ../../reference/datamodel.rst:1168 +#: ../../reference/datamodel.rst:1263 msgid "" "Special read-only attributes: :attr:`tb_frame` points to the execution frame " "of the current level; :attr:`tb_lineno` gives the line number where the " @@ -1421,7 +1421,7 @@ msgid "" "statement with no matching except clause or with a finally clause." msgstr "" -#: ../../reference/datamodel.rst:1177 +#: ../../reference/datamodel.rst:1272 msgid "" "Accessing ``tb_frame`` raises an :ref:`auditing event ` ``object." "__getattr__`` with arguments ``obj`` and ``\"tb_frame\"``." @@ -1429,41 +1429,41 @@ msgstr "" "存取 ``tb_frame`` 會引發一個附帶引數 ``obj`` 與 ``\"tb_frame\"`` 的\\ :ref:`" "稽核事件 ` ``object.__getattr__``。" -#: ../../reference/datamodel.rst:1183 +#: ../../reference/datamodel.rst:1278 msgid "" "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:1187 +#: ../../reference/datamodel.rst:1282 msgid "" "Traceback objects can now be explicitly instantiated from Python code, and " "the ``tb_next`` attribute of existing instances can be updated." msgstr "" -#: ../../reference/datamodel.rst:1216 +#: ../../reference/datamodel.rst:1288 msgid "Slice objects" msgstr "" -#: ../../reference/datamodel.rst:1194 +#: ../../reference/datamodel.rst:1292 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:1203 +#: ../../reference/datamodel.rst:1301 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:1207 +#: ../../reference/datamodel.rst:1305 msgid "Slice objects support one method:" msgstr "" -#: ../../reference/datamodel.rst:1211 +#: ../../reference/datamodel.rst:1309 msgid "" "This method takes a single integer argument *length* and computes " "information about the slice that the slice object would describe if applied " @@ -1473,11 +1473,11 @@ msgid "" "a manner consistent with regular slices." msgstr "" -#: ../../reference/datamodel.rst:1225 +#: ../../reference/datamodel.rst:1318 msgid "Static method objects" msgstr "" -#: ../../reference/datamodel.rst:1219 +#: ../../reference/datamodel.rst:1320 msgid "" "Static method objects provide a way of defeating the transformation of " "function objects to method objects described above. A static method object " @@ -1488,11 +1488,11 @@ msgid "" "method objects are created by the built-in :func:`staticmethod` constructor." msgstr "" -#: ../../reference/datamodel.rst:1233 +#: ../../reference/datamodel.rst:1330 msgid "Class method objects" msgstr "" -#: ../../reference/datamodel.rst:1228 +#: ../../reference/datamodel.rst:1332 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 " @@ -1501,11 +1501,11 @@ msgid "" "objects are created by the built-in :func:`classmethod` constructor." msgstr "" -#: ../../reference/datamodel.rst:1238 +#: ../../reference/datamodel.rst:1342 msgid "Special method names" msgstr "" -#: ../../reference/datamodel.rst:1244 +#: ../../reference/datamodel.rst:1348 msgid "" "A class can implement certain operations that are invoked by special syntax " "(such as arithmetic operations or subscripting and slicing) by defining " @@ -1519,7 +1519,7 @@ msgid "" "`TypeError`)." msgstr "" -#: ../../reference/datamodel.rst:1255 +#: ../../reference/datamodel.rst:1359 msgid "" "Setting a special method to ``None`` indicates that the corresponding " "operation is not available. For example, if a class sets :meth:`~object." @@ -1528,7 +1528,7 @@ msgid "" "`~object.__getitem__`). [#]_" msgstr "" -#: ../../reference/datamodel.rst:1261 +#: ../../reference/datamodel.rst:1365 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 " @@ -1538,11 +1538,11 @@ msgid "" "the W3C's Document Object Model.)" msgstr "" -#: ../../reference/datamodel.rst:1272 +#: ../../reference/datamodel.rst:1376 msgid "Basic customization" msgstr "" -#: ../../reference/datamodel.rst:1278 +#: ../../reference/datamodel.rst:1382 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 " @@ -1552,7 +1552,7 @@ msgid "" "new object instance (usually an instance of *cls*)." msgstr "" -#: ../../reference/datamodel.rst:1285 +#: ../../reference/datamodel.rst:1389 msgid "" "Typical implementations create a new instance of the class by invoking the " "superclass's :meth:`__new__` method using ``super().__new__(cls[, ...])`` " @@ -1560,7 +1560,7 @@ msgid "" "necessary before returning it." msgstr "" -#: ../../reference/datamodel.rst:1290 +#: ../../reference/datamodel.rst:1394 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 " @@ -1569,13 +1569,13 @@ msgid "" "constructor." msgstr "" -#: ../../reference/datamodel.rst:1295 +#: ../../reference/datamodel.rst:1399 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:1298 +#: ../../reference/datamodel.rst:1402 msgid "" ":meth:`__new__` is intended mainly to allow subclasses of immutable types " "(like int, str, or tuple) to customize instance creation. It is also " @@ -1583,7 +1583,7 @@ msgid "" "creation." msgstr "" -#: ../../reference/datamodel.rst:1307 +#: ../../reference/datamodel.rst:1411 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 " @@ -1593,7 +1593,7 @@ msgid "" "example: ``super().__init__([args...])``." msgstr "" -#: ../../reference/datamodel.rst:1314 +#: ../../reference/datamodel.rst:1418 msgid "" "Because :meth:`__new__` and :meth:`__init__` work together in constructing " "objects (:meth:`__new__` to create it, and :meth:`__init__` to customize " @@ -1601,7 +1601,7 @@ msgid "" "will cause a :exc:`TypeError` to be raised at runtime." msgstr "" -#: ../../reference/datamodel.rst:1327 +#: ../../reference/datamodel.rst:1431 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:" @@ -1610,7 +1610,7 @@ msgid "" "instance." msgstr "" -#: ../../reference/datamodel.rst:1333 +#: ../../reference/datamodel.rst:1437 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. " @@ -1620,20 +1620,20 @@ msgid "" "it once." msgstr "" -#: ../../reference/datamodel.rst:1340 +#: ../../reference/datamodel.rst:1444 msgid "" "It is not guaranteed that :meth:`__del__` methods are called for objects " "that still exist when the interpreter exits." msgstr "" -#: ../../reference/datamodel.rst:1345 +#: ../../reference/datamodel.rst:1449 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:1350 +#: ../../reference/datamodel.rst:1454 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 " @@ -1644,18 +1644,18 @@ msgid "" "caught in the traceback." msgstr "" -#: ../../reference/datamodel.rst:1360 +#: ../../reference/datamodel.rst:1464 msgid "Documentation for the :mod:`gc` module." msgstr "" -#: ../../reference/datamodel.rst:1364 +#: ../../reference/datamodel.rst:1468 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:1368 +#: ../../reference/datamodel.rst:1472 msgid "" ":meth:`__del__` can be invoked when arbitrary code is being executed, " "including from any arbitrary thread. If :meth:`__del__` needs to take a " @@ -1664,7 +1664,7 @@ msgid "" "`__del__`." msgstr "" -#: ../../reference/datamodel.rst:1374 +#: ../../reference/datamodel.rst:1478 msgid "" ":meth:`__del__` can be executed during interpreter shutdown. As a " "consequence, the global variables it needs to access (including other " @@ -1675,7 +1675,7 @@ msgid "" "still available at the time when the :meth:`__del__` method is called." msgstr "" -#: ../../reference/datamodel.rst:1389 +#: ../../reference/datamodel.rst:1493 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 " @@ -1687,13 +1687,13 @@ msgid "" "an \"informal\" string representation of instances of that class is required." msgstr "" -#: ../../reference/datamodel.rst:1398 +#: ../../reference/datamodel.rst:1502 msgid "" "This is typically used for debugging, so it is important that the " "representation is information-rich and unambiguous." msgstr "" -#: ../../reference/datamodel.rst:1409 +#: ../../reference/datamodel.rst:1513 msgid "" "Called by :func:`str(object) ` and the built-in functions :func:" "`format` and :func:`print` to compute the \"informal\" or nicely printable " @@ -1701,26 +1701,26 @@ msgid "" "` object." msgstr "" -#: ../../reference/datamodel.rst:1414 +#: ../../reference/datamodel.rst:1518 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:1418 +#: ../../reference/datamodel.rst:1522 msgid "" "The default implementation defined by the built-in type :class:`object` " "calls :meth:`object.__repr__`." msgstr "" -#: ../../reference/datamodel.rst:1428 +#: ../../reference/datamodel.rst:1532 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:1439 +#: ../../reference/datamodel.rst:1543 msgid "" "Called by the :func:`format` built-in function, and by extension, evaluation " "of :ref:`formatted string literals ` and the :meth:`str.format` " @@ -1732,28 +1732,28 @@ msgid "" "formatting option syntax." msgstr "" -#: ../../reference/datamodel.rst:1449 +#: ../../reference/datamodel.rst:1553 msgid "" "See :ref:`formatspec` for a description of the standard formatting syntax." msgstr "" -#: ../../reference/datamodel.rst:1451 +#: ../../reference/datamodel.rst:1555 msgid "The return value must be a string object." msgstr "" -#: ../../reference/datamodel.rst:1453 +#: ../../reference/datamodel.rst:1557 msgid "" "The __format__ method of ``object`` itself raises a :exc:`TypeError` if " "passed any non-empty string." msgstr "" -#: ../../reference/datamodel.rst:1457 +#: ../../reference/datamodel.rst:1561 msgid "" "``object.__format__(x, '')`` is now equivalent to ``str(x)`` rather than " "``format(str(x), '')``." msgstr "" -#: ../../reference/datamodel.rst:1473 +#: ../../reference/datamodel.rst:1577 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:1562 +#: ../../reference/datamodel.rst:1666 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 " @@ -1872,7 +1872,7 @@ msgid "" "``isinstance(obj, collections.abc.Hashable)`` call." msgstr "" -#: ../../reference/datamodel.rst:1571 +#: ../../reference/datamodel.rst:1675 msgid "" "By default, the :meth:`__hash__` values of str and bytes objects are " "\"salted\" with an unpredictable random value. Although they remain " @@ -1880,7 +1880,7 @@ msgid "" "between repeated invocations of Python." msgstr "" -#: ../../reference/datamodel.rst:1576 +#: ../../reference/datamodel.rst:1680 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 " @@ -1888,22 +1888,22 @@ msgid "" "ocert-2011-003.html for details." msgstr "" -#: ../../reference/datamodel.rst:1581 +#: ../../reference/datamodel.rst:1685 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:1585 +#: ../../reference/datamodel.rst:1689 msgid "See also :envvar:`PYTHONHASHSEED`." msgstr "另請參閱 :envvar:`PYTHONHASHSEED`\\ 。" -#: ../../reference/datamodel.rst:1587 +#: ../../reference/datamodel.rst:1691 msgid "Hash randomization is enabled by default." msgstr "" -#: ../../reference/datamodel.rst:1595 +#: ../../reference/datamodel.rst:1699 msgid "" "Called to implement truth value testing and the built-in operation " "``bool()``; should return ``False`` or ``True``. When this method is not " @@ -1912,18 +1912,18 @@ msgid "" "meth:`!__len__` nor :meth:`!__bool__`, all its instances are considered true." msgstr "" -#: ../../reference/datamodel.rst:1606 +#: ../../reference/datamodel.rst:1710 msgid "Customizing attribute access" msgstr "" -#: ../../reference/datamodel.rst:1608 +#: ../../reference/datamodel.rst:1712 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:1616 +#: ../../reference/datamodel.rst:1720 msgid "" "Called when the default attribute access fails with an :exc:`AttributeError` " "(either :meth:`__getattribute__` raises an :exc:`AttributeError` because " @@ -1933,7 +1933,7 @@ msgid "" "attribute value or raise an :exc:`AttributeError` exception." msgstr "" -#: ../../reference/datamodel.rst:1623 +#: ../../reference/datamodel.rst:1727 msgid "" "Note that if the attribute is found through the normal mechanism, :meth:" "`__getattr__` is not called. (This is an intentional asymmetry between :" @@ -1946,7 +1946,7 @@ msgid "" "actually get total control over attribute access." msgstr "" -#: ../../reference/datamodel.rst:1636 +#: ../../reference/datamodel.rst:1740 msgid "" "Called unconditionally to implement attribute accesses for instances of the " "class. If the class also defines :meth:`__getattr__`, the latter will not be " @@ -1958,14 +1958,14 @@ msgid "" "example, ``object.__getattribute__(self, name)``." msgstr "" -#: ../../reference/datamodel.rst:1647 +#: ../../reference/datamodel.rst:1751 msgid "" "This method may still be bypassed when looking up special methods as the " "result of implicit invocation via language syntax or built-in functions. " "See :ref:`special-lookup`." msgstr "" -#: ../../reference/datamodel.rst:1651 +#: ../../reference/datamodel.rst:1755 msgid "" "Raises an :ref:`auditing event ` ``object.__getattr__`` with " "arguments ``obj``, ``name``." @@ -1973,27 +1973,27 @@ msgstr "" "引發一個附帶引數 ``obj``、``name`` 的\\ :ref:`稽核事件 ` ``object." "__getattr__``。" -#: ../../reference/datamodel.rst:1653 +#: ../../reference/datamodel.rst:1757 msgid "" "For certain sensitive attribute accesses, raises an :ref:`auditing event " "` ``object.__getattr__`` with arguments ``obj`` and ``name``." msgstr "" -#: ../../reference/datamodel.rst:1660 +#: ../../reference/datamodel.rst:1764 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:1664 +#: ../../reference/datamodel.rst:1768 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:1668 +#: ../../reference/datamodel.rst:1772 msgid "" "Raises an :ref:`auditing event ` ``object.__setattr__`` with " "arguments ``obj``, ``name``, ``value``." @@ -2001,21 +2001,21 @@ msgstr "" "引發一個附帶引數 ``obj``、``name``、``value`` 的\\ :ref:`稽核事件 " "` ``object.__setattr__``。" -#: ../../reference/datamodel.rst:1670 +#: ../../reference/datamodel.rst:1774 msgid "" "For certain sensitive attribute assignments, raises an :ref:`auditing event " "` ``object.__setattr__`` with arguments ``obj``, ``name``, " "``value``." msgstr "" -#: ../../reference/datamodel.rst:1677 +#: ../../reference/datamodel.rst:1781 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:1680 +#: ../../reference/datamodel.rst:1784 msgid "" "Raises an :ref:`auditing event ` ``object.__delattr__`` with " "arguments ``obj``, ``name``." @@ -2023,23 +2023,23 @@ msgstr "" "引發一個附帶引數 ``obj``、``name`` 的\\ :ref:`稽核事件 ` ``object." "__delattr__``。" -#: ../../reference/datamodel.rst:1682 +#: ../../reference/datamodel.rst:1786 msgid "" "For certain sensitive attribute deletions, raises an :ref:`auditing event " "` ``object.__delattr__`` with arguments ``obj`` and ``name``." msgstr "" -#: ../../reference/datamodel.rst:1689 +#: ../../reference/datamodel.rst:1793 msgid "" "Called when :func:`dir` is called on the object. A sequence must be " "returned. :func:`dir` converts the returned sequence to a list and sorts it." msgstr "" -#: ../../reference/datamodel.rst:1694 +#: ../../reference/datamodel.rst:1798 msgid "Customizing module attribute access" msgstr "" -#: ../../reference/datamodel.rst:1701 +#: ../../reference/datamodel.rst:1805 msgid "" "Special names ``__getattr__`` and ``__dir__`` can be also used to customize " "access to module attributes. The ``__getattr__`` function at the module " @@ -2051,21 +2051,21 @@ msgid "" "with the attribute name and the result is returned." msgstr "" -#: ../../reference/datamodel.rst:1710 +#: ../../reference/datamodel.rst:1814 msgid "" "The ``__dir__`` function should accept no arguments, and return a sequence " "of strings that represents the names accessible on module. If present, this " "function overrides the standard :func:`dir` search on a module." msgstr "" -#: ../../reference/datamodel.rst:1714 +#: ../../reference/datamodel.rst:1818 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:1732 +#: ../../reference/datamodel.rst:1836 msgid "" "Defining module ``__getattr__`` and setting module ``__class__`` only affect " "lookups made using the attribute access syntax -- directly accessing the " @@ -2073,27 +2073,27 @@ msgid "" "module's globals dictionary) is unaffected." msgstr "" -#: ../../reference/datamodel.rst:1737 +#: ../../reference/datamodel.rst:1841 msgid "``__class__`` module attribute is now writable." msgstr "" -#: ../../reference/datamodel.rst:1740 +#: ../../reference/datamodel.rst:1844 msgid "``__getattr__`` and ``__dir__`` module attributes." msgstr "" -#: ../../reference/datamodel.rst:1745 +#: ../../reference/datamodel.rst:1849 msgid ":pep:`562` - Module __getattr__ and __dir__" msgstr ":pep:`562` - 模組 __getattr__ 和 __dir__" -#: ../../reference/datamodel.rst:1746 +#: ../../reference/datamodel.rst:1850 msgid "Describes the ``__getattr__`` and ``__dir__`` functions on modules." msgstr "" -#: ../../reference/datamodel.rst:1752 +#: ../../reference/datamodel.rst:1856 msgid "Implementing Descriptors" msgstr "" -#: ../../reference/datamodel.rst:1754 +#: ../../reference/datamodel.rst:1858 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 " @@ -2103,7 +2103,7 @@ msgid "" "the owner class' :attr:`~object.__dict__`." msgstr "" -#: ../../reference/datamodel.rst:1764 +#: ../../reference/datamodel.rst:1868 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 " @@ -2112,13 +2112,13 @@ msgid "" "accessed through the *owner*." msgstr "" -#: ../../reference/datamodel.rst:1770 +#: ../../reference/datamodel.rst:1874 msgid "" "This method should return the computed attribute value or raise an :exc:" "`AttributeError` exception." msgstr "" -#: ../../reference/datamodel.rst:1773 +#: ../../reference/datamodel.rst:1877 msgid "" ":PEP:`252` specifies that :meth:`__get__` is callable with one or two " "arguments. Python's own built-in descriptors support this specification; " @@ -2128,25 +2128,25 @@ msgid "" "not." msgstr "" -#: ../../reference/datamodel.rst:1782 +#: ../../reference/datamodel.rst:1886 msgid "" "Called to set the attribute on an instance *instance* of the owner class to " "a new value, *value*." msgstr "" -#: ../../reference/datamodel.rst:1785 +#: ../../reference/datamodel.rst:1889 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:1791 +#: ../../reference/datamodel.rst:1895 msgid "" "Called to delete the attribute on an instance *instance* of the owner class." msgstr "" -#: ../../reference/datamodel.rst:1794 +#: ../../reference/datamodel.rst:1898 msgid "" "The attribute :attr:`__objclass__` is interpreted by the :mod:`inspect` " "module as specifying the class where this object was defined (setting this " @@ -2157,11 +2157,11 @@ msgid "" "are implemented in C)." msgstr "" -#: ../../reference/datamodel.rst:1805 +#: ../../reference/datamodel.rst:1909 msgid "Invoking Descriptors" msgstr "" -#: ../../reference/datamodel.rst:1807 +#: ../../reference/datamodel.rst:1911 msgid "" "In general, a descriptor is an object attribute with \"binding behavior\", " "one whose attribute access has been overridden by methods in the descriptor " @@ -2170,7 +2170,7 @@ msgid "" "is said to be a descriptor." msgstr "" -#: ../../reference/datamodel.rst:1813 +#: ../../reference/datamodel.rst:1917 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 " @@ -2178,7 +2178,7 @@ msgid "" "continuing through the base classes of ``type(a)`` excluding metaclasses." msgstr "" -#: ../../reference/datamodel.rst:1818 +#: ../../reference/datamodel.rst:1922 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 " @@ -2186,54 +2186,54 @@ msgid "" "depends on which descriptor methods were defined and how they were called." msgstr "" -#: ../../reference/datamodel.rst:1823 +#: ../../reference/datamodel.rst:1927 msgid "" "The starting point for descriptor invocation is a binding, ``a.x``. How the " "arguments are assembled depends on ``a``:" msgstr "" -#: ../../reference/datamodel.rst:1828 +#: ../../reference/datamodel.rst:1932 msgid "Direct Call" msgstr "" -#: ../../reference/datamodel.rst:1827 +#: ../../reference/datamodel.rst:1931 msgid "" "The simplest and least common call is when user code directly invokes a " "descriptor method: ``x.__get__(a)``." msgstr "" -#: ../../reference/datamodel.rst:1832 +#: ../../reference/datamodel.rst:1936 msgid "Instance Binding" msgstr "" -#: ../../reference/datamodel.rst:1831 +#: ../../reference/datamodel.rst:1935 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:1836 +#: ../../reference/datamodel.rst:1940 msgid "Class Binding" msgstr "" -#: ../../reference/datamodel.rst:1835 +#: ../../reference/datamodel.rst:1939 msgid "" "If binding to a class, ``A.x`` is transformed into the call: ``A." "__dict__['x'].__get__(None, A)``." msgstr "" -#: ../../reference/datamodel.rst:1842 +#: ../../reference/datamodel.rst:1946 msgid "Super Binding" msgstr "" -#: ../../reference/datamodel.rst:1839 +#: ../../reference/datamodel.rst:1943 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:1876 +#: ../../reference/datamodel.rst:1980 msgid "" "For instance bindings, the precedence of descriptor invocation depends on " "which descriptor methods are defined. A descriptor can define any " @@ -2250,7 +2250,7 @@ msgid "" "can be overridden by instances." msgstr "" -#: ../../reference/datamodel.rst:1890 +#: ../../reference/datamodel.rst:1994 msgid "" "Python methods (including those decorated with :func:`@staticmethod " "` and :func:`@classmethod `) are implemented as " @@ -2259,30 +2259,30 @@ msgid "" "from other instances of the same class." msgstr "" -#: ../../reference/datamodel.rst:1896 +#: ../../reference/datamodel.rst:2000 msgid "" "The :func:`property` function is implemented as a data descriptor. " "Accordingly, instances cannot override the behavior of a property." msgstr "" -#: ../../reference/datamodel.rst:1903 +#: ../../reference/datamodel.rst:2007 msgid "__slots__" msgstr "__slots__" -#: ../../reference/datamodel.rst:1905 +#: ../../reference/datamodel.rst:2009 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:1909 +#: ../../reference/datamodel.rst:2013 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:1914 +#: ../../reference/datamodel.rst:2018 msgid "" "This class variable can be assigned a string, iterable, or sequence of " "strings with variable names used by instances. *__slots__* reserves space " @@ -2290,18 +2290,18 @@ msgid "" "`~object.__dict__` and *__weakref__* for each instance." msgstr "" -#: ../../reference/datamodel.rst:1924 -msgid "Notes on using *__slots__*" +#: ../../reference/datamodel.rst:2027 +msgid "Notes on using *__slots__*:" msgstr "" -#: ../../reference/datamodel.rst:1926 +#: ../../reference/datamodel.rst:2029 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:1930 +#: ../../reference/datamodel.rst:2033 msgid "" "Without a :attr:`~object.__dict__` variable, instances cannot be assigned " "new variables not listed in the *__slots__* definition. Attempts to assign " @@ -2310,7 +2310,7 @@ msgid "" "sequence of strings in the *__slots__* declaration." msgstr "" -#: ../../reference/datamodel.rst:1937 +#: ../../reference/datamodel.rst:2040 msgid "" "Without a *__weakref__* variable for each instance, classes defining " "*__slots__* do not support :mod:`weak references ` to its " @@ -2318,7 +2318,7 @@ msgid "" "to the sequence of strings in the *__slots__* declaration." msgstr "" -#: ../../reference/datamodel.rst:1943 +#: ../../reference/datamodel.rst:2046 msgid "" "*__slots__* are implemented at the class level by creating :ref:`descriptors " "` for each variable name. As a result, class attributes cannot " @@ -2326,7 +2326,7 @@ msgid "" "otherwise, the class attribute would overwrite the descriptor assignment." msgstr "" -#: ../../reference/datamodel.rst:1949 +#: ../../reference/datamodel.rst:2052 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. " @@ -2335,7 +2335,7 @@ msgid "" "names of any *additional* slots)." msgstr "" -#: ../../reference/datamodel.rst:1955 +#: ../../reference/datamodel.rst:2058 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 " @@ -2344,7 +2344,7 @@ msgid "" "prevent this." msgstr "" -#: ../../reference/datamodel.rst:1960 +#: ../../reference/datamodel.rst:2063 msgid "" ":exc:`TypeError` will be raised if nonempty *__slots__* are defined for a " "class derived from a :c:member:`\"variable-length\" built-in type " @@ -2352,11 +2352,11 @@ msgid "" "`tuple`." msgstr "" -#: ../../reference/datamodel.rst:1965 +#: ../../reference/datamodel.rst:2068 msgid "Any non-string :term:`iterable` may be assigned to *__slots__*." msgstr "" -#: ../../reference/datamodel.rst:1967 +#: ../../reference/datamodel.rst:2070 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 " @@ -2364,13 +2364,13 @@ msgid "" "func:`inspect.getdoc` and displayed in the output of :func:`help`." msgstr "" -#: ../../reference/datamodel.rst:1972 +#: ../../reference/datamodel.rst:2075 msgid "" ":attr:`~instance.__class__` assignment works only if both classes have the " "same *__slots__*." msgstr "" -#: ../../reference/datamodel.rst:1975 +#: ../../reference/datamodel.rst:2078 msgid "" ":ref:`Multiple inheritance ` with multiple slotted parent " "classes can be used, but only one parent is allowed to have attributes " @@ -2378,18 +2378,18 @@ msgid "" "raise :exc:`TypeError`." msgstr "" -#: ../../reference/datamodel.rst:1981 +#: ../../reference/datamodel.rst:2084 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:1989 +#: ../../reference/datamodel.rst:2092 msgid "Customizing class creation" msgstr "" -#: ../../reference/datamodel.rst:1991 +#: ../../reference/datamodel.rst:2094 msgid "" "Whenever a class inherits from another class, :meth:`~object." "__init_subclass__` is called on the parent class. This way, it is possible " @@ -2399,14 +2399,14 @@ msgid "" "future subclasses of the class defining the method." msgstr "" -#: ../../reference/datamodel.rst:2000 +#: ../../reference/datamodel.rst:2103 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:2004 +#: ../../reference/datamodel.rst:2107 msgid "" "Keyword arguments which are given to a new class are passed to the parent's " "class ``__init_subclass__``. For compatibility with other classes using " @@ -2414,13 +2414,13 @@ msgid "" "pass the others over to the base class, as in::" msgstr "" -#: ../../reference/datamodel.rst:2018 +#: ../../reference/datamodel.rst:2121 msgid "" "The default implementation ``object.__init_subclass__`` does nothing, but " "raises an error if it is called with any arguments." msgstr "" -#: ../../reference/datamodel.rst:2023 +#: ../../reference/datamodel.rst:2126 msgid "" "The metaclass hint ``metaclass`` is consumed by the rest of the type " "machinery, and is never passed to ``__init_subclass__`` implementations. The " @@ -2428,41 +2428,41 @@ msgid "" "``type(cls)``." msgstr "" -#: ../../reference/datamodel.rst:2031 +#: ../../reference/datamodel.rst:2134 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:2036 +#: ../../reference/datamodel.rst:2139 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:2042 +#: ../../reference/datamodel.rst:2145 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:2053 +#: ../../reference/datamodel.rst:2156 msgid "See :ref:`class-object-creation` for more details." msgstr "更多細節請見 :ref:`class-object-creation`\\ 。" -#: ../../reference/datamodel.rst:2061 +#: ../../reference/datamodel.rst:2164 msgid "Metaclasses" msgstr "" -#: ../../reference/datamodel.rst:2068 +#: ../../reference/datamodel.rst:2171 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:2072 +#: ../../reference/datamodel.rst:2175 msgid "" "The class creation process can be customized by passing the ``metaclass`` " "keyword argument in the class definition line, or by inheriting from an " @@ -2470,41 +2470,41 @@ msgid "" "both ``MyClass`` and ``MySubclass`` are instances of ``Meta``::" msgstr "" -#: ../../reference/datamodel.rst:2086 +#: ../../reference/datamodel.rst:2189 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:2089 +#: ../../reference/datamodel.rst:2192 msgid "When a class definition is executed, the following steps occur:" msgstr "" -#: ../../reference/datamodel.rst:2091 +#: ../../reference/datamodel.rst:2194 msgid "MRO entries are resolved;" msgstr "" -#: ../../reference/datamodel.rst:2092 +#: ../../reference/datamodel.rst:2195 msgid "the appropriate metaclass is determined;" msgstr "" -#: ../../reference/datamodel.rst:2093 +#: ../../reference/datamodel.rst:2196 msgid "the class namespace is prepared;" msgstr "" -#: ../../reference/datamodel.rst:2094 +#: ../../reference/datamodel.rst:2197 msgid "the class body is executed;" msgstr "" -#: ../../reference/datamodel.rst:2095 +#: ../../reference/datamodel.rst:2198 msgid "the class object is created." msgstr "" -#: ../../reference/datamodel.rst:2099 +#: ../../reference/datamodel.rst:2202 msgid "Resolving MRO entries" msgstr "" -#: ../../reference/datamodel.rst:2103 +#: ../../reference/datamodel.rst:2206 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 " @@ -2516,59 +2516,59 @@ msgid "" "is ignored." msgstr "" -#: ../../reference/datamodel.rst:2115 +#: ../../reference/datamodel.rst:2218 msgid ":func:`types.resolve_bases`" msgstr "" -#: ../../reference/datamodel.rst:2115 +#: ../../reference/datamodel.rst:2218 msgid "Dynamically resolve bases that are not instances of :class:`type`." msgstr "" -#: ../../reference/datamodel.rst:2119 +#: ../../reference/datamodel.rst:2222 msgid ":func:`types.get_original_bases`" msgstr "" -#: ../../reference/datamodel.rst:2118 +#: ../../reference/datamodel.rst:2221 msgid "" "Retrieve a class's \"original bases\" prior to modifications by :meth:" "`~object.__mro_entries__`." msgstr "" -#: ../../reference/datamodel.rst:2121 +#: ../../reference/datamodel.rst:2224 msgid ":pep:`560`" msgstr "" -#: ../../reference/datamodel.rst:2122 +#: ../../reference/datamodel.rst:2225 msgid "Core support for typing module and generic types." msgstr "" -#: ../../reference/datamodel.rst:2126 +#: ../../reference/datamodel.rst:2229 msgid "Determining the appropriate metaclass" msgstr "" -#: ../../reference/datamodel.rst:2130 +#: ../../reference/datamodel.rst:2233 msgid "" "The appropriate metaclass for a class definition is determined as follows:" msgstr "" -#: ../../reference/datamodel.rst:2132 +#: ../../reference/datamodel.rst:2235 msgid "" "if no bases and no explicit metaclass are given, then :func:`type` is used;" msgstr "" -#: ../../reference/datamodel.rst:2133 +#: ../../reference/datamodel.rst:2236 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:2135 +#: ../../reference/datamodel.rst:2238 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:2138 +#: ../../reference/datamodel.rst:2241 msgid "" "The most derived metaclass is selected from the explicitly specified " "metaclass (if any) and the metaclasses (i.e. ``type(cls)``) of all specified " @@ -2577,11 +2577,11 @@ msgid "" "that criterion, then the class definition will fail with ``TypeError``." msgstr "" -#: ../../reference/datamodel.rst:2148 +#: ../../reference/datamodel.rst:2251 msgid "Preparing the class namespace" msgstr "" -#: ../../reference/datamodel.rst:2153 +#: ../../reference/datamodel.rst:2256 msgid "" "Once the appropriate metaclass has been identified, then the class namespace " "is prepared. If the metaclass has a ``__prepare__`` attribute, it is called " @@ -2593,25 +2593,25 @@ msgid "" "copied into a new ``dict``." msgstr "" -#: ../../reference/datamodel.rst:2162 +#: ../../reference/datamodel.rst:2265 msgid "" "If the metaclass has no ``__prepare__`` attribute, then the class namespace " "is initialised as an empty ordered mapping." msgstr "" -#: ../../reference/datamodel.rst:2167 +#: ../../reference/datamodel.rst:2270 msgid ":pep:`3115` - Metaclasses in Python 3000" msgstr "" -#: ../../reference/datamodel.rst:2168 +#: ../../reference/datamodel.rst:2271 msgid "Introduced the ``__prepare__`` namespace hook" msgstr "" -#: ../../reference/datamodel.rst:2172 +#: ../../reference/datamodel.rst:2275 msgid "Executing the class body" msgstr "" -#: ../../reference/datamodel.rst:2177 +#: ../../reference/datamodel.rst:2280 msgid "" "The class body is executed (approximately) as ``exec(body, globals(), " "namespace)``. The key difference from a normal call to :func:`exec` is that " @@ -2620,7 +2620,7 @@ msgid "" "inside a function." msgstr "" -#: ../../reference/datamodel.rst:2183 +#: ../../reference/datamodel.rst:2286 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. " @@ -2629,11 +2629,11 @@ msgid "" "reference described in the next section." msgstr "" -#: ../../reference/datamodel.rst:2192 +#: ../../reference/datamodel.rst:2295 msgid "Creating the class object" msgstr "" -#: ../../reference/datamodel.rst:2199 +#: ../../reference/datamodel.rst:2302 msgid "" "Once the class namespace has been populated by executing the class body, the " "class object is created by calling ``metaclass(name, bases, namespace, " @@ -2641,7 +2641,7 @@ msgid "" "to ``__prepare__``)." msgstr "" -#: ../../reference/datamodel.rst:2204 +#: ../../reference/datamodel.rst:2307 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 " @@ -2652,7 +2652,7 @@ msgid "" "is identified based on the first argument passed to the method." msgstr "" -#: ../../reference/datamodel.rst:2214 +#: ../../reference/datamodel.rst:2317 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 " @@ -2661,39 +2661,39 @@ msgid "" "in Python 3.8." msgstr "" -#: ../../reference/datamodel.rst:2220 +#: ../../reference/datamodel.rst:2323 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:2224 +#: ../../reference/datamodel.rst:2327 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:2226 +#: ../../reference/datamodel.rst:2329 msgid "" "Those ``__set_name__`` methods are called with the class being defined and " "the assigned name of that particular attribute;" msgstr "" -#: ../../reference/datamodel.rst:2228 +#: ../../reference/datamodel.rst:2331 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:2231 +#: ../../reference/datamodel.rst:2334 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:2235 +#: ../../reference/datamodel.rst:2338 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 " @@ -2701,19 +2701,19 @@ msgid "" "becomes the :attr:`~object.__dict__` attribute of the class object." msgstr "" -#: ../../reference/datamodel.rst:2242 +#: ../../reference/datamodel.rst:2345 msgid ":pep:`3135` - New super" msgstr "" -#: ../../reference/datamodel.rst:2243 +#: ../../reference/datamodel.rst:2346 msgid "Describes the implicit ``__class__`` closure reference" msgstr "" -#: ../../reference/datamodel.rst:2247 +#: ../../reference/datamodel.rst:2350 msgid "Uses for metaclasses" msgstr "" -#: ../../reference/datamodel.rst:2249 +#: ../../reference/datamodel.rst:2352 msgid "" "The potential uses for metaclasses are boundless. Some ideas that have been " "explored include enum, logging, interface checking, automatic delegation, " @@ -2721,17 +2721,17 @@ msgid "" "locking/synchronization." msgstr "" -#: ../../reference/datamodel.rst:2256 +#: ../../reference/datamodel.rst:2359 msgid "Customizing instance and subclass checks" msgstr "" -#: ../../reference/datamodel.rst:2258 +#: ../../reference/datamodel.rst:2361 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:2261 +#: ../../reference/datamodel.rst:2364 msgid "" "In particular, the metaclass :class:`abc.ABCMeta` implements these methods " "in order to allow the addition of Abstract Base Classes (ABCs) as \"virtual " @@ -2739,21 +2739,21 @@ msgid "" "other ABCs." msgstr "" -#: ../../reference/datamodel.rst:2268 +#: ../../reference/datamodel.rst:2371 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:2275 +#: ../../reference/datamodel.rst:2378 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:2280 +#: ../../reference/datamodel.rst:2383 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 " @@ -2761,11 +2761,11 @@ msgid "" "only in this case the instance is itself a class." msgstr "" -#: ../../reference/datamodel.rst:2291 +#: ../../reference/datamodel.rst:2394 msgid ":pep:`3119` - Introducing Abstract Base Classes" msgstr "" -#: ../../reference/datamodel.rst:2288 +#: ../../reference/datamodel.rst:2391 msgid "" "Includes the specification for customizing :func:`isinstance` and :func:" "`issubclass` behavior through :meth:`~class.__instancecheck__` and :meth:" @@ -2774,11 +2774,11 @@ msgid "" "language." msgstr "" -#: ../../reference/datamodel.rst:2296 +#: ../../reference/datamodel.rst:2399 msgid "Emulating generic types" msgstr "" -#: ../../reference/datamodel.rst:2298 +#: ../../reference/datamodel.rst:2401 msgid "" "When using :term:`type annotations`, it is often useful to " "*parameterize* a :term:`generic type` using Python's square-brackets " @@ -2786,65 +2786,65 @@ msgid "" "a :class:`list` in which all the elements are of type :class:`int`." msgstr "" -#: ../../reference/datamodel.rst:2306 +#: ../../reference/datamodel.rst:2409 msgid ":pep:`484` - Type Hints" msgstr "" -#: ../../reference/datamodel.rst:2306 +#: ../../reference/datamodel.rst:2409 msgid "Introducing Python's framework for type annotations" msgstr "" -#: ../../reference/datamodel.rst:2309 +#: ../../reference/datamodel.rst:2412 msgid ":ref:`Generic Alias Types`" msgstr "" -#: ../../reference/datamodel.rst:2309 +#: ../../reference/datamodel.rst:2412 msgid "Documentation for objects representing parameterized generic classes" msgstr "" -#: ../../reference/datamodel.rst:2312 +#: ../../reference/datamodel.rst:2415 msgid "" ":ref:`Generics`, :ref:`user-defined generics` and :" "class:`typing.Generic`" msgstr "" -#: ../../reference/datamodel.rst:2312 +#: ../../reference/datamodel.rst:2415 msgid "" "Documentation on how to implement generic classes that can be parameterized " "at runtime and understood by static type-checkers." msgstr "" -#: ../../reference/datamodel.rst:2315 +#: ../../reference/datamodel.rst:2418 msgid "" "A class can *generally* only be parameterized if it defines the special " "class method ``__class_getitem__()``." msgstr "" -#: ../../reference/datamodel.rst:2320 +#: ../../reference/datamodel.rst:2423 msgid "" "Return an object representing the specialization of a generic class by type " "arguments found in *key*." msgstr "" -#: ../../reference/datamodel.rst:2323 +#: ../../reference/datamodel.rst:2426 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:2329 +#: ../../reference/datamodel.rst:2432 msgid "The purpose of *__class_getitem__*" msgstr "" -#: ../../reference/datamodel.rst:2331 +#: ../../reference/datamodel.rst:2434 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:2335 +#: ../../reference/datamodel.rst:2438 msgid "" "To implement custom generic classes that can be parameterized at runtime and " "understood by static type-checkers, users should either inherit from a " @@ -2853,7 +2853,7 @@ msgid "" "own implementation of ``__class_getitem__()``." msgstr "" -#: ../../reference/datamodel.rst:2341 +#: ../../reference/datamodel.rst:2444 msgid "" "Custom implementations of :meth:`~object.__class_getitem__` on classes " "defined outside of the standard library may not be understood by third-party " @@ -2861,11 +2861,11 @@ msgid "" "purposes other than type hinting is discouraged." msgstr "" -#: ../../reference/datamodel.rst:2351 +#: ../../reference/datamodel.rst:2454 msgid "*__class_getitem__* versus *__getitem__*" msgstr "" -#: ../../reference/datamodel.rst:2353 +#: ../../reference/datamodel.rst:2456 msgid "" "Usually, the :ref:`subscription` of an object using square " "brackets will call the :meth:`~object.__getitem__` instance method defined " @@ -2875,14 +2875,14 @@ msgid "" "genericalias>` object if it is properly defined." msgstr "" -#: ../../reference/datamodel.rst:2360 +#: ../../reference/datamodel.rst:2463 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:2388 +#: ../../reference/datamodel.rst:2491 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 " @@ -2892,40 +2892,40 @@ msgid "" "__class_getitem__` being called::" msgstr "" -#: ../../reference/datamodel.rst:2407 +#: ../../reference/datamodel.rst:2510 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:2432 +#: ../../reference/datamodel.rst:2535 msgid ":pep:`560` - Core Support for typing module and generic types" msgstr "" -#: ../../reference/datamodel.rst:2431 +#: ../../reference/datamodel.rst:2534 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:2439 +#: ../../reference/datamodel.rst:2542 msgid "Emulating callable objects" msgstr "" -#: ../../reference/datamodel.rst:2446 +#: ../../reference/datamodel.rst:2549 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:2453 +#: ../../reference/datamodel.rst:2556 msgid "Emulating container types" msgstr "" -#: ../../reference/datamodel.rst:2455 +#: ../../reference/datamodel.rst:2558 msgid "" "The following methods can be defined to implement container objects. " "Containers usually are :term:`sequences ` (such as :class:`lists " @@ -2961,7 +2961,7 @@ msgid "" "the values." msgstr "" -#: ../../reference/datamodel.rst:2495 +#: ../../reference/datamodel.rst:2598 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 " @@ -2969,7 +2969,7 @@ msgid "" "returns zero is considered to be false in a Boolean context." msgstr "" -#: ../../reference/datamodel.rst:2502 +#: ../../reference/datamodel.rst:2605 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:" @@ -2978,7 +2978,7 @@ msgid "" "`~object.__bool__` method." msgstr "" -#: ../../reference/datamodel.rst:2511 +#: ../../reference/datamodel.rst:2614 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). " @@ -2988,20 +2988,20 @@ msgid "" "never required for correctness." msgstr "" -#: ../../reference/datamodel.rst:2525 +#: ../../reference/datamodel.rst:2628 msgid "" "Slicing is done exclusively with the following three methods. A call like ::" msgstr "" -#: ../../reference/datamodel.rst:2529 +#: ../../reference/datamodel.rst:2632 msgid "is translated to ::" msgstr "" -#: ../../reference/datamodel.rst:2533 +#: ../../reference/datamodel.rst:2636 msgid "and so forth. Missing slice items are always filled in with ``None``." msgstr "" -#: ../../reference/datamodel.rst:2538 +#: ../../reference/datamodel.rst:2641 msgid "" "Called to implement evaluation of ``self[key]``. For :term:`sequence` types, " "the accepted keys should be integers and slice objects. Note that the " @@ -3014,20 +3014,20 @@ msgid "" "`KeyError` should be raised." msgstr "" -#: ../../reference/datamodel.rst:2550 +#: ../../reference/datamodel.rst:2653 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:2555 +#: ../../reference/datamodel.rst:2658 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:2563 +#: ../../reference/datamodel.rst:2666 msgid "" "Called to implement assignment to ``self[key]``. Same note as for :meth:" "`__getitem__`. This should only be implemented for mappings if the objects " @@ -3036,7 +3036,7 @@ msgid "" "for improper *key* values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:2572 +#: ../../reference/datamodel.rst:2675 msgid "" "Called to implement deletion of ``self[key]``. Same note as for :meth:" "`__getitem__`. This should only be implemented for mappings if the objects " @@ -3045,13 +3045,13 @@ msgid "" "values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:2581 +#: ../../reference/datamodel.rst:2684 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:2587 +#: ../../reference/datamodel.rst:2690 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 " @@ -3059,14 +3059,14 @@ msgid "" "of the container." msgstr "" -#: ../../reference/datamodel.rst:2595 +#: ../../reference/datamodel.rst:2698 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:2599 +#: ../../reference/datamodel.rst:2702 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 :" @@ -3075,7 +3075,7 @@ msgid "" "more efficient than the one provided by :func:`reversed`." msgstr "" -#: ../../reference/datamodel.rst:2606 +#: ../../reference/datamodel.rst:2709 msgid "" "The membership test operators (:keyword:`in` and :keyword:`not in`) are " "normally implemented as an iteration through a container. However, container " @@ -3083,14 +3083,14 @@ msgid "" "implementation, which also does not require the object be iterable." msgstr "" -#: ../../reference/datamodel.rst:2613 +#: ../../reference/datamodel.rst:2716 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:2617 +#: ../../reference/datamodel.rst:2720 msgid "" "For objects that don't define :meth:`__contains__`, the membership test " "first tries iteration via :meth:`__iter__`, then the old sequence iteration " @@ -3098,11 +3098,11 @@ msgid "" "reference `." msgstr "" -#: ../../reference/datamodel.rst:2626 +#: ../../reference/datamodel.rst:2729 msgid "Emulating numeric types" msgstr "" -#: ../../reference/datamodel.rst:2628 +#: ../../reference/datamodel.rst:2731 msgid "" "The following methods can be defined to emulate numeric objects. Methods " "corresponding to operations that are not supported by the particular kind of " @@ -3110,7 +3110,7 @@ msgid "" "should be left undefined." msgstr "" -#: ../../reference/datamodel.rst:2654 +#: ../../reference/datamodel.rst:2757 msgid "" "These methods are called to implement the binary arithmetic operations " "(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" @@ -3124,13 +3124,13 @@ msgid "" "function is to be supported." msgstr "" -#: ../../reference/datamodel.rst:2665 +#: ../../reference/datamodel.rst:2768 msgid "" "If one of those methods does not support the operation with the supplied " "arguments, it should return ``NotImplemented``." msgstr "" -#: ../../reference/datamodel.rst:2688 +#: ../../reference/datamodel.rst:2791 msgid "" "These methods are called to implement the binary arithmetic operations " "(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" @@ -3143,13 +3143,13 @@ msgid "" "*NotImplemented*." msgstr "" -#: ../../reference/datamodel.rst:2700 +#: ../../reference/datamodel.rst:2803 msgid "" "Note that ternary :func:`pow` will not try calling :meth:`__rpow__` (the " "coercion rules would become too complicated)." msgstr "" -#: ../../reference/datamodel.rst:2705 +#: ../../reference/datamodel.rst:2808 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 " @@ -3158,7 +3158,7 @@ msgid "" "ancestors' operations." msgstr "" -#: ../../reference/datamodel.rst:2726 +#: ../../reference/datamodel.rst:2829 msgid "" "These methods are called to implement the augmented arithmetic assignments " "(``+=``, ``-=``, ``*=``, ``@=``, ``/=``, ``//=``, ``%=``, ``**=``, ``<<=``, " @@ -3174,19 +3174,19 @@ msgid "" "fact part of the data model." msgstr "" -#: ../../reference/datamodel.rst:2747 +#: ../../reference/datamodel.rst:2850 msgid "" "Called to implement the unary arithmetic operations (``-``, ``+``, :func:" "`abs` and ``~``)." msgstr "" -#: ../../reference/datamodel.rst:2760 +#: ../../reference/datamodel.rst:2863 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:2767 +#: ../../reference/datamodel.rst:2870 msgid "" "Called to implement :func:`operator.index`, and whenever Python needs to " "losslessly convert the numeric object to an integer object (such as in " @@ -3195,14 +3195,14 @@ msgid "" "integer type. Must return an integer." msgstr "" -#: ../../reference/datamodel.rst:2773 +#: ../../reference/datamodel.rst:2876 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:2785 +#: ../../reference/datamodel.rst:2888 msgid "" "Called to implement the built-in function :func:`round` and :mod:`math` " "functions :func:`~math.trunc`, :func:`~math.floor` and :func:`~math.ceil`. " @@ -3211,21 +3211,21 @@ msgid "" "(typically an :class:`int`)." msgstr "" -#: ../../reference/datamodel.rst:2791 +#: ../../reference/datamodel.rst:2894 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:2794 +#: ../../reference/datamodel.rst:2897 msgid "The delegation of :func:`int` to :meth:`__trunc__` is deprecated." msgstr "" -#: ../../reference/datamodel.rst:2801 +#: ../../reference/datamodel.rst:2904 msgid "With Statement Context Managers" msgstr "" -#: ../../reference/datamodel.rst:2803 +#: ../../reference/datamodel.rst:2906 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 " @@ -3235,32 +3235,32 @@ msgid "" "can also be used by directly invoking their methods." msgstr "" -#: ../../reference/datamodel.rst:2814 +#: ../../reference/datamodel.rst:2917 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:2817 +#: ../../reference/datamodel.rst:2920 msgid "" "For more information on context managers, see :ref:`typecontextmanager`." msgstr "" -#: ../../reference/datamodel.rst:2822 +#: ../../reference/datamodel.rst:2925 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:2829 +#: ../../reference/datamodel.rst:2932 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:2833 +#: ../../reference/datamodel.rst:2936 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. " @@ -3268,27 +3268,27 @@ msgid "" "method." msgstr "" -#: ../../reference/datamodel.rst:2837 +#: ../../reference/datamodel.rst:2940 msgid "" "Note that :meth:`__exit__` methods should not reraise the passed-in " "exception; this is the caller's responsibility." msgstr "" -#: ../../reference/datamodel.rst:2844 +#: ../../reference/datamodel.rst:2947 msgid ":pep:`343` - The \"with\" statement" msgstr "" -#: ../../reference/datamodel.rst:2844 +#: ../../reference/datamodel.rst:2947 msgid "" "The specification, background, and examples for the Python :keyword:`with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:2851 +#: ../../reference/datamodel.rst:2954 msgid "Customizing positional arguments in class pattern matching" msgstr "" -#: ../../reference/datamodel.rst:2853 +#: ../../reference/datamodel.rst:2956 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 " @@ -3296,7 +3296,7 @@ msgid "" "pattern, the class needs to define a *__match_args__* attribute." msgstr "" -#: ../../reference/datamodel.rst:2860 +#: ../../reference/datamodel.rst:2963 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 " @@ -3305,7 +3305,7 @@ msgid "" "to setting it to ``()``." msgstr "" -#: ../../reference/datamodel.rst:2866 +#: ../../reference/datamodel.rst:2969 msgid "" "For example, if ``MyClass.__match_args__`` is ``(\"left\", \"center\", " "\"right\")`` that means that ``case MyClass(x, y)`` is equivalent to ``case " @@ -3315,19 +3315,19 @@ msgid "" "exc:`TypeError`." msgstr "" -#: ../../reference/datamodel.rst:2876 +#: ../../reference/datamodel.rst:2979 msgid ":pep:`634` - Structural Pattern Matching" msgstr "" -#: ../../reference/datamodel.rst:2877 +#: ../../reference/datamodel.rst:2980 msgid "The specification for the Python ``match`` statement." msgstr "" -#: ../../reference/datamodel.rst:2883 +#: ../../reference/datamodel.rst:2986 msgid "Emulating buffer types" msgstr "" -#: ../../reference/datamodel.rst:2885 +#: ../../reference/datamodel.rst:2988 msgid "" "The :ref:`buffer protocol ` provides a way for Python objects " "to expose efficient access to a low-level memory array. This protocol is " @@ -3335,13 +3335,13 @@ msgid "" "and third-party libraries may define additional buffer types." msgstr "" -#: ../../reference/datamodel.rst:2890 +#: ../../reference/datamodel.rst:2993 msgid "" "While buffer types are usually implemented in C, it is also possible to " "implement the protocol in Python." msgstr "" -#: ../../reference/datamodel.rst:2895 +#: ../../reference/datamodel.rst:2998 msgid "" "Called when a buffer is requested from *self* (for example, by the :class:" "`memoryview` constructor). The *flags* argument is an integer representing " @@ -3351,7 +3351,7 @@ msgid "" "`memoryview` object." msgstr "" -#: ../../reference/datamodel.rst:2904 +#: ../../reference/datamodel.rst:3007 msgid "" "Called when a buffer is no longer needed. The *buffer* argument is a :class:" "`memoryview` object that was previously returned by :meth:`~object." @@ -3360,28 +3360,28 @@ msgid "" "to perform any cleanup are not required to implement this method." msgstr "" -#: ../../reference/datamodel.rst:2916 +#: ../../reference/datamodel.rst:3019 msgid ":pep:`688` - Making the buffer protocol accessible in Python" msgstr "" -#: ../../reference/datamodel.rst:2916 +#: ../../reference/datamodel.rst:3019 msgid "" "Introduces the Python ``__buffer__`` and ``__release_buffer__`` methods." msgstr "" -#: ../../reference/datamodel.rst:2918 +#: ../../reference/datamodel.rst:3021 msgid ":class:`collections.abc.Buffer`" msgstr "" -#: ../../reference/datamodel.rst:2919 +#: ../../reference/datamodel.rst:3022 msgid "ABC for buffer types." msgstr "" -#: ../../reference/datamodel.rst:2924 +#: ../../reference/datamodel.rst:3027 msgid "Special method lookup" msgstr "" -#: ../../reference/datamodel.rst:2926 +#: ../../reference/datamodel.rst:3029 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 " @@ -3389,7 +3389,7 @@ msgid "" "following code raises an exception::" msgstr "" -#: ../../reference/datamodel.rst:2941 +#: ../../reference/datamodel.rst:3044 msgid "" "The rationale behind this behaviour lies with a number of special methods " "such as :meth:`~object.__hash__` and :meth:`~object.__repr__` that are " @@ -3398,21 +3398,21 @@ msgid "" "invoked on the type object itself::" msgstr "" -#: ../../reference/datamodel.rst:2955 +#: ../../reference/datamodel.rst:3058 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:2964 +#: ../../reference/datamodel.rst:3067 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:2990 +#: ../../reference/datamodel.rst:3093 msgid "" "Bypassing the :meth:`~object.__getattribute__` machinery in this fashion " "provides significant scope for speed optimisations within the interpreter, " @@ -3421,36 +3421,36 @@ msgid "" "consistently invoked by the interpreter)." msgstr "" -#: ../../reference/datamodel.rst:3001 +#: ../../reference/datamodel.rst:3104 msgid "Coroutines" msgstr "協程" -#: ../../reference/datamodel.rst:3005 +#: ../../reference/datamodel.rst:3108 msgid "Awaitable Objects" msgstr "" -#: ../../reference/datamodel.rst:3007 +#: ../../reference/datamodel.rst:3110 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:3013 +#: ../../reference/datamodel.rst:3116 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:3019 +#: ../../reference/datamodel.rst:3122 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:3025 +#: ../../reference/datamodel.rst:3128 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 " @@ -3458,15 +3458,15 @@ msgid "" "g. :mod:`asyncio`) that will be managing the :term:`awaitable` object." msgstr "" -#: ../../reference/datamodel.rst:3033 +#: ../../reference/datamodel.rst:3136 msgid ":pep:`492` for additional information about awaitable objects." msgstr "" -#: ../../reference/datamodel.rst:3039 +#: ../../reference/datamodel.rst:3142 msgid "Coroutine Objects" msgstr "" -#: ../../reference/datamodel.rst:3041 +#: ../../reference/datamodel.rst:3144 msgid "" ":term:`Coroutine objects ` are :term:`awaitable` objects. A " "coroutine's execution can be controlled by calling :meth:`~object.__await__` " @@ -3477,18 +3477,18 @@ msgid "" "should not directly raise unhandled :exc:`StopIteration` exceptions." msgstr "" -#: ../../reference/datamodel.rst:3049 +#: ../../reference/datamodel.rst:3152 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:3053 +#: ../../reference/datamodel.rst:3156 msgid "It is a :exc:`RuntimeError` to await on a coroutine more than once." msgstr "" -#: ../../reference/datamodel.rst:3059 +#: ../../reference/datamodel.rst:3162 msgid "" "Starts or resumes execution of the coroutine. If *value* is ``None``, this " "is equivalent to advancing the iterator returned by :meth:`~object." @@ -3499,7 +3499,7 @@ msgid "" "value, described above." msgstr "" -#: ../../reference/datamodel.rst:3070 +#: ../../reference/datamodel.rst:3173 msgid "" "Raises the specified exception in the coroutine. This method delegates to " "the :meth:`~generator.throw` method of the iterator that caused the " @@ -3510,13 +3510,13 @@ msgid "" "not caught in the coroutine, it propagates back to the caller." msgstr "" -#: ../../reference/datamodel.rst:3081 +#: ../../reference/datamodel.rst:3184 msgid "" "The second signature \\(type\\[, value\\[, traceback\\]\\]\\) is deprecated " "and may be removed in a future version of Python." msgstr "" -#: ../../reference/datamodel.rst:3086 +#: ../../reference/datamodel.rst:3189 msgid "" "Causes the coroutine to clean itself up and exit. If the coroutine is " "suspended, this method first delegates to the :meth:`~generator.close` " @@ -3526,99 +3526,99 @@ msgid "" "is marked as having finished executing, even if it was never started." msgstr "" -#: ../../reference/datamodel.rst:3094 +#: ../../reference/datamodel.rst:3197 msgid "" "Coroutine objects are automatically closed using the above process when they " "are about to be destroyed." msgstr "" -#: ../../reference/datamodel.rst:3100 +#: ../../reference/datamodel.rst:3203 msgid "Asynchronous Iterators" msgstr "" -#: ../../reference/datamodel.rst:3102 +#: ../../reference/datamodel.rst:3205 msgid "" "An *asynchronous iterator* can call asynchronous code in its ``__anext__`` " "method." msgstr "" -#: ../../reference/datamodel.rst:3105 +#: ../../reference/datamodel.rst:3208 msgid "" "Asynchronous iterators can be used in an :keyword:`async for` statement." msgstr "" -#: ../../reference/datamodel.rst:3109 +#: ../../reference/datamodel.rst:3212 msgid "Must return an *asynchronous iterator* object." msgstr "" -#: ../../reference/datamodel.rst:3113 +#: ../../reference/datamodel.rst:3216 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:3116 +#: ../../reference/datamodel.rst:3219 msgid "An example of an asynchronous iterable object::" msgstr "" -#: ../../reference/datamodel.rst:3133 +#: ../../reference/datamodel.rst:3236 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:3138 +#: ../../reference/datamodel.rst:3241 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:3146 +#: ../../reference/datamodel.rst:3249 msgid "Asynchronous Context Managers" msgstr "" -#: ../../reference/datamodel.rst:3148 +#: ../../reference/datamodel.rst:3251 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:3151 +#: ../../reference/datamodel.rst:3254 msgid "" "Asynchronous context managers can be used in an :keyword:`async with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:3155 +#: ../../reference/datamodel.rst:3258 msgid "" "Semantically similar to :meth:`__enter__`, the only difference being that it " "must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3160 +#: ../../reference/datamodel.rst:3263 msgid "" "Semantically similar to :meth:`__exit__`, the only difference being that it " "must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3163 +#: ../../reference/datamodel.rst:3266 msgid "An example of an asynchronous context manager class::" msgstr "" -#: ../../reference/datamodel.rst:3176 +#: ../../reference/datamodel.rst:3279 msgid "Footnotes" msgstr "註解" -#: ../../reference/datamodel.rst:3177 +#: ../../reference/datamodel.rst:3280 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:3181 +#: ../../reference/datamodel.rst:3284 msgid "" "The :meth:`~object.__hash__`, :meth:`~object.__iter__`, :meth:`~object." "__reversed__`, and :meth:`~object.__contains__` methods have special " @@ -3626,7 +3626,7 @@ msgid "" "by relying on the behavior that ``None`` is not callable." msgstr "" -#: ../../reference/datamodel.rst:3187 +#: ../../reference/datamodel.rst:3290 msgid "" "\"Does not support\" here means that the class has no such method, or the " "method returns ``NotImplemented``. Do not set the method to ``None`` if you " @@ -3634,30 +3634,30 @@ msgid "" "instead have the opposite effect of explicitly *blocking* such fallback." msgstr "" -#: ../../reference/datamodel.rst:3193 +#: ../../reference/datamodel.rst:3296 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 " "operation is not supported, which is why the reflected method is not called." msgstr "" -#: ../../reference/datamodel.rst:14 ../../reference/datamodel.rst:145 -#: ../../reference/datamodel.rst:153 ../../reference/datamodel.rst:173 -#: ../../reference/datamodel.rst:182 ../../reference/datamodel.rst:212 -#: ../../reference/datamodel.rst:227 ../../reference/datamodel.rst:244 -#: ../../reference/datamodel.rst:259 ../../reference/datamodel.rst:269 -#: ../../reference/datamodel.rst:295 ../../reference/datamodel.rst:330 -#: ../../reference/datamodel.rst:352 ../../reference/datamodel.rst:366 -#: ../../reference/datamodel.rst:386 ../../reference/datamodel.rst:405 -#: ../../reference/datamodel.rst:412 ../../reference/datamodel.rst:420 -#: ../../reference/datamodel.rst:434 ../../reference/datamodel.rst:467 -#: ../../reference/datamodel.rst:477 ../../reference/datamodel.rst:589 -#: ../../reference/datamodel.rst:697 ../../reference/datamodel.rst:712 -#: ../../reference/datamodel.rst:736 ../../reference/datamodel.rst:814 -#: ../../reference/datamodel.rst:879 ../../reference/datamodel.rst:906 -#: ../../reference/datamodel.rst:956 ../../reference/datamodel.rst:1011 -#: ../../reference/datamodel.rst:1068 ../../reference/datamodel.rst:1130 -#: ../../reference/datamodel.rst:1512 ../../reference/datamodel.rst:2521 +#: ../../reference/datamodel.rst:14 ../../reference/datamodel.rst:148 +#: ../../reference/datamodel.rst:159 ../../reference/datamodel.rst:180 +#: ../../reference/datamodel.rst:192 ../../reference/datamodel.rst:225 +#: ../../reference/datamodel.rst:246 ../../reference/datamodel.rst:261 +#: ../../reference/datamodel.rst:279 ../../reference/datamodel.rst:292 +#: ../../reference/datamodel.rst:321 ../../reference/datamodel.rst:356 +#: ../../reference/datamodel.rst:381 ../../reference/datamodel.rst:402 +#: ../../reference/datamodel.rst:420 ../../reference/datamodel.rst:440 +#: ../../reference/datamodel.rst:448 ../../reference/datamodel.rst:459 +#: ../../reference/datamodel.rst:476 ../../reference/datamodel.rst:512 +#: ../../reference/datamodel.rst:525 ../../reference/datamodel.rst:640 +#: ../../reference/datamodel.rst:760 ../../reference/datamodel.rst:778 +#: ../../reference/datamodel.rst:810 ../../reference/datamodel.rst:891 +#: ../../reference/datamodel.rst:959 ../../reference/datamodel.rst:986 +#: ../../reference/datamodel.rst:1042 ../../reference/datamodel.rst:1100 +#: ../../reference/datamodel.rst:1160 ../../reference/datamodel.rst:1225 +#: ../../reference/datamodel.rst:1616 ../../reference/datamodel.rst:2624 msgid "object" msgstr "object(物件)" @@ -3665,16 +3665,16 @@ msgstr "object(物件)" msgid "data" msgstr "data(資料)" -#: ../../reference/datamodel.rst:23 ../../reference/datamodel.rst:269 -#: ../../reference/datamodel.rst:310 ../../reference/datamodel.rst:386 -#: ../../reference/datamodel.rst:420 ../../reference/datamodel.rst:697 -#: ../../reference/datamodel.rst:922 ../../reference/datamodel.rst:1192 -#: ../../reference/datamodel.rst:1426 ../../reference/datamodel.rst:1431 -#: ../../reference/datamodel.rst:1512 ../../reference/datamodel.rst:2063 -#: ../../reference/datamodel.rst:2491 ../../reference/datamodel.rst:2649 -#: ../../reference/datamodel.rst:2684 ../../reference/datamodel.rst:2698 -#: ../../reference/datamodel.rst:2745 ../../reference/datamodel.rst:2755 -#: ../../reference/datamodel.rst:2783 +#: ../../reference/datamodel.rst:23 ../../reference/datamodel.rst:292 +#: ../../reference/datamodel.rst:336 ../../reference/datamodel.rst:420 +#: ../../reference/datamodel.rst:459 ../../reference/datamodel.rst:760 +#: ../../reference/datamodel.rst:1005 ../../reference/datamodel.rst:1290 +#: ../../reference/datamodel.rst:1530 ../../reference/datamodel.rst:1535 +#: ../../reference/datamodel.rst:1616 ../../reference/datamodel.rst:2166 +#: ../../reference/datamodel.rst:2594 ../../reference/datamodel.rst:2752 +#: ../../reference/datamodel.rst:2787 ../../reference/datamodel.rst:2801 +#: ../../reference/datamodel.rst:2848 ../../reference/datamodel.rst:2858 +#: ../../reference/datamodel.rst:2886 msgid "built-in function" msgstr "built-in function(內建函式)" @@ -3683,7 +3683,7 @@ msgid "id" msgstr "id" #: ../../reference/datamodel.rst:23 ../../reference/datamodel.rst:122 -#: ../../reference/datamodel.rst:2063 +#: ../../reference/datamodel.rst:2166 msgid "type" msgstr "type(型別)" @@ -3719,7 +3719,7 @@ msgstr "reference counting(參照計數)" msgid "unreachable object" msgstr "unreachable object(不可達物件)" -#: ../../reference/datamodel.rst:95 ../../reference/datamodel.rst:814 +#: ../../reference/datamodel.rst:95 ../../reference/datamodel.rst:891 msgid "container" msgstr "container(容器)" @@ -3731,25 +3731,26 @@ msgstr "hierarchy(階層)" msgid "extension" msgstr "extension(擴充)" -#: ../../reference/datamodel.rst:122 ../../reference/datamodel.rst:380 -#: ../../reference/datamodel.rst:453 ../../reference/datamodel.rst:736 -#: ../../reference/datamodel.rst:755 ../../reference/datamodel.rst:922 +#: ../../reference/datamodel.rst:122 ../../reference/datamodel.rst:393 +#: ../../reference/datamodel.rst:394 ../../reference/datamodel.rst:495 +#: ../../reference/datamodel.rst:810 ../../reference/datamodel.rst:829 +#: ../../reference/datamodel.rst:1005 msgid "module" msgstr "module(模組)" -#: ../../reference/datamodel.rst:122 ../../reference/datamodel.rst:244 -#: ../../reference/datamodel.rst:697 +#: ../../reference/datamodel.rst:122 ../../reference/datamodel.rst:261 +#: ../../reference/datamodel.rst:760 msgid "C" msgstr "C" -#: ../../reference/datamodel.rst:122 ../../reference/datamodel.rst:244 -#: ../../reference/datamodel.rst:697 +#: ../../reference/datamodel.rst:122 ../../reference/datamodel.rst:261 +#: ../../reference/datamodel.rst:760 msgid "language" msgstr "language(語言)" -#: ../../reference/datamodel.rst:135 ../../reference/datamodel.rst:814 -#: ../../reference/datamodel.rst:831 ../../reference/datamodel.rst:879 -#: ../../reference/datamodel.rst:899 +#: ../../reference/datamodel.rst:135 ../../reference/datamodel.rst:891 +#: ../../reference/datamodel.rst:908 ../../reference/datamodel.rst:959 +#: ../../reference/datamodel.rst:979 msgid "attribute" msgstr "attribute(屬性)" @@ -3761,830 +3762,834 @@ msgstr "special" msgid "generic" msgstr "generic(泛型)" -#: ../../reference/datamodel.rst:173 +#: ../../reference/datamodel.rst:180 msgid "..." msgstr "..." -#: ../../reference/datamodel.rst:173 +#: ../../reference/datamodel.rst:180 msgid "ellipsis literal" msgstr "ellipsis literal(刪節號)" -#: ../../reference/datamodel.rst:182 ../../reference/datamodel.rst:906 +#: ../../reference/datamodel.rst:192 ../../reference/datamodel.rst:986 msgid "numeric" msgstr "numeric(數值)" -#: ../../reference/datamodel.rst:212 ../../reference/datamodel.rst:238 -#: ../../reference/datamodel.rst:310 +#: ../../reference/datamodel.rst:225 ../../reference/datamodel.rst:231 +#: ../../reference/datamodel.rst:336 msgid "integer" msgstr "integer(整數)" -#: ../../reference/datamodel.rst:227 +#: ../../reference/datamodel.rst:231 +msgid "representation" +msgstr "representation(表示)" + +#: ../../reference/datamodel.rst:246 msgid "Boolean" msgstr "Boolean(布林)" -#: ../../reference/datamodel.rst:227 +#: ../../reference/datamodel.rst:246 msgid "False" msgstr "False" -#: ../../reference/datamodel.rst:227 +#: ../../reference/datamodel.rst:246 msgid "True" msgstr "True" -#: ../../reference/datamodel.rst:238 -msgid "representation" -msgstr "representation(表示)" - -#: ../../reference/datamodel.rst:244 +#: ../../reference/datamodel.rst:261 msgid "floating point" msgstr "floating point(浮點)" -#: ../../reference/datamodel.rst:244 ../../reference/datamodel.rst:259 +#: ../../reference/datamodel.rst:261 ../../reference/datamodel.rst:279 msgid "number" msgstr "number(數字)" -#: ../../reference/datamodel.rst:244 +#: ../../reference/datamodel.rst:261 msgid "Java" msgstr "Java" -#: ../../reference/datamodel.rst:259 ../../reference/datamodel.rst:2755 +#: ../../reference/datamodel.rst:279 ../../reference/datamodel.rst:2858 msgid "complex" msgstr "complex(複數)" -#: ../../reference/datamodel.rst:269 ../../reference/datamodel.rst:386 -#: ../../reference/datamodel.rst:420 ../../reference/datamodel.rst:2491 +#: ../../reference/datamodel.rst:292 ../../reference/datamodel.rst:420 +#: ../../reference/datamodel.rst:459 ../../reference/datamodel.rst:2594 msgid "len" msgstr "len" -#: ../../reference/datamodel.rst:269 ../../reference/datamodel.rst:906 +#: ../../reference/datamodel.rst:292 ../../reference/datamodel.rst:986 msgid "sequence" msgstr "sequence(序列)" -#: ../../reference/datamodel.rst:269 +#: ../../reference/datamodel.rst:292 msgid "index operation" msgstr "index operation(索引操作)" -#: ../../reference/datamodel.rst:269 +#: ../../reference/datamodel.rst:292 msgid "item selection" msgstr "item selection(項目選取)" -#: ../../reference/datamodel.rst:269 ../../reference/datamodel.rst:352 -#: ../../reference/datamodel.rst:420 +#: ../../reference/datamodel.rst:292 ../../reference/datamodel.rst:381 +#: ../../reference/datamodel.rst:459 msgid "subscription" msgstr "subscription(下標)" -#: ../../reference/datamodel.rst:281 ../../reference/datamodel.rst:352 +#: ../../reference/datamodel.rst:304 ../../reference/datamodel.rst:381 msgid "slicing" msgstr "slice(切片)" -#: ../../reference/datamodel.rst:295 +#: ../../reference/datamodel.rst:321 msgid "immutable sequence" msgstr "immutable sequence(不可變序列)" -#: ../../reference/datamodel.rst:295 +#: ../../reference/datamodel.rst:321 msgid "immutable" msgstr "immutable(不可變)" -#: ../../reference/datamodel.rst:306 ../../reference/datamodel.rst:1401 -#: ../../reference/datamodel.rst:1431 +#: ../../reference/datamodel.rst:332 ../../reference/datamodel.rst:1505 +#: ../../reference/datamodel.rst:1535 msgid "string" msgstr "string(字串)" -#: ../../reference/datamodel.rst:306 +#: ../../reference/datamodel.rst:332 msgid "immutable sequences" msgstr "immutable sequences(不可變序列)" -#: ../../reference/datamodel.rst:310 +#: ../../reference/datamodel.rst:336 msgid "chr" msgstr "chr" -#: ../../reference/datamodel.rst:310 +#: ../../reference/datamodel.rst:336 msgid "ord" msgstr "ord" -#: ../../reference/datamodel.rst:310 +#: ../../reference/datamodel.rst:336 msgid "character" msgstr "character(字元)" -#: ../../reference/datamodel.rst:310 +#: ../../reference/datamodel.rst:336 msgid "Unicode" msgstr "Unicode" -#: ../../reference/datamodel.rst:330 +#: ../../reference/datamodel.rst:356 msgid "tuple" msgstr "tuple(元組)" -#: ../../reference/datamodel.rst:330 +#: ../../reference/datamodel.rst:356 msgid "singleton" msgstr "singleton(單例)" -#: ../../reference/datamodel.rst:330 +#: ../../reference/datamodel.rst:356 msgid "empty" msgstr "empty(空的)" -#: ../../reference/datamodel.rst:343 ../../reference/datamodel.rst:1426 +#: ../../reference/datamodel.rst:369 ../../reference/datamodel.rst:1530 msgid "bytes" msgstr "bytes(位元組)" -#: ../../reference/datamodel.rst:343 +#: ../../reference/datamodel.rst:369 msgid "byte" msgstr "byte(位元組)" -#: ../../reference/datamodel.rst:352 +#: ../../reference/datamodel.rst:381 msgid "mutable sequence" msgstr "mutable sequence(可變序列)" -#: ../../reference/datamodel.rst:352 +#: ../../reference/datamodel.rst:381 msgid "mutable" msgstr "mutable(可變的)" -#: ../../reference/datamodel.rst:352 ../../reference/datamodel.rst:831 -#: ../../reference/datamodel.rst:899 +#: ../../reference/datamodel.rst:381 ../../reference/datamodel.rst:908 +#: ../../reference/datamodel.rst:979 msgid "assignment" msgstr "assignment(賦值)" -#: ../../reference/datamodel.rst:352 ../../reference/datamodel.rst:736 -#: ../../reference/datamodel.rst:1162 ../../reference/datamodel.rst:1322 -#: ../../reference/datamodel.rst:2810 +#: ../../reference/datamodel.rst:381 ../../reference/datamodel.rst:810 +#: ../../reference/datamodel.rst:1257 ../../reference/datamodel.rst:1426 +#: ../../reference/datamodel.rst:2913 msgid "statement" msgstr "statement(陳述式)" -#: ../../reference/datamodel.rst:366 +#: ../../reference/datamodel.rst:393 +msgid "array" +msgstr "array(陣列)" + +#: ../../reference/datamodel.rst:394 +msgid "collections" +msgstr "collections" + +#: ../../reference/datamodel.rst:402 msgid "list" msgstr "list(串列)" -#: ../../reference/datamodel.rst:373 +#: ../../reference/datamodel.rst:409 msgid "bytearray" msgstr "bytearray(位元組陣列)" -#: ../../reference/datamodel.rst:380 -msgid "array" -msgstr "array(陣列)" - -#: ../../reference/datamodel.rst:386 +#: ../../reference/datamodel.rst:420 msgid "set type" msgstr "set type(集合型別)" -#: ../../reference/datamodel.rst:405 +#: ../../reference/datamodel.rst:440 msgid "set" msgstr "set(集合)" -#: ../../reference/datamodel.rst:412 +#: ../../reference/datamodel.rst:448 msgid "frozenset" msgstr "frozenset(凍結集合)" -#: ../../reference/datamodel.rst:420 ../../reference/datamodel.rst:906 +#: ../../reference/datamodel.rst:459 ../../reference/datamodel.rst:986 msgid "mapping" msgstr "mapping(對映)" -#: ../../reference/datamodel.rst:434 ../../reference/datamodel.rst:814 -#: ../../reference/datamodel.rst:1512 +#: ../../reference/datamodel.rst:476 ../../reference/datamodel.rst:891 +#: ../../reference/datamodel.rst:1616 msgid "dictionary" msgstr "dictionary(字典)" -#: ../../reference/datamodel.rst:453 +#: ../../reference/datamodel.rst:495 msgid "dbm.ndbm" msgstr "dbm.ndbm" -#: ../../reference/datamodel.rst:453 +#: ../../reference/datamodel.rst:495 msgid "dbm.gnu" msgstr "dbm.gnu" -#: ../../reference/datamodel.rst:467 +#: ../../reference/datamodel.rst:512 msgid "callable" msgstr "callable(可呼叫物件)" -#: ../../reference/datamodel.rst:467 ../../reference/datamodel.rst:477 -#: ../../reference/datamodel.rst:652 ../../reference/datamodel.rst:667 -#: ../../reference/datamodel.rst:677 ../../reference/datamodel.rst:697 +#: ../../reference/datamodel.rst:512 ../../reference/datamodel.rst:525 +#: ../../reference/datamodel.rst:706 ../../reference/datamodel.rst:724 +#: ../../reference/datamodel.rst:737 ../../reference/datamodel.rst:760 msgid "function" msgstr "function (函式)" -#: ../../reference/datamodel.rst:467 ../../reference/datamodel.rst:814 -#: ../../reference/datamodel.rst:836 ../../reference/datamodel.rst:2444 +#: ../../reference/datamodel.rst:512 ../../reference/datamodel.rst:891 +#: ../../reference/datamodel.rst:913 ../../reference/datamodel.rst:2547 msgid "call" msgstr "call(呼叫)" -#: ../../reference/datamodel.rst:467 +#: ../../reference/datamodel.rst:512 msgid "invocation" msgstr "invocation(調用)" -#: ../../reference/datamodel.rst:467 +#: ../../reference/datamodel.rst:512 msgid "argument" msgstr "argument(引數)" -#: ../../reference/datamodel.rst:477 ../../reference/datamodel.rst:589 +#: ../../reference/datamodel.rst:525 ../../reference/datamodel.rst:640 msgid "user-defined" msgstr "user-defined(使用者定義)" -#: ../../reference/datamodel.rst:477 +#: ../../reference/datamodel.rst:525 msgid "user-defined function" msgstr "user-defined function(使用者定義函式)" -#: ../../reference/datamodel.rst:491 +#: ../../reference/datamodel.rst:539 msgid "__doc__ (function attribute)" msgstr "__doc__ (函式屬性)" -#: ../../reference/datamodel.rst:491 +#: ../../reference/datamodel.rst:539 msgid "__name__ (function attribute)" msgstr "__name__ (函式屬性)" -#: ../../reference/datamodel.rst:491 +#: ../../reference/datamodel.rst:539 msgid "__module__ (function attribute)" msgstr "__module__ (函式屬性)" -#: ../../reference/datamodel.rst:491 +#: ../../reference/datamodel.rst:539 msgid "__dict__ (function attribute)" msgstr "__dict__ (函式屬性)" -#: ../../reference/datamodel.rst:491 +#: ../../reference/datamodel.rst:539 msgid "__defaults__ (function attribute)" msgstr "__defaults__ (函式屬性)" -#: ../../reference/datamodel.rst:491 +#: ../../reference/datamodel.rst:539 msgid "__closure__ (function attribute)" msgstr "__closure__ (函式屬性)" -#: ../../reference/datamodel.rst:491 +#: ../../reference/datamodel.rst:539 msgid "__code__ (function attribute)" msgstr "__code__ (函式屬性)" -#: ../../reference/datamodel.rst:491 +#: ../../reference/datamodel.rst:539 msgid "__globals__ (function attribute)" msgstr "__globals__ (函式屬性)" -#: ../../reference/datamodel.rst:491 +#: ../../reference/datamodel.rst:539 msgid "__annotations__ (function attribute)" msgstr "__annotations__ (函式屬性)" -#: ../../reference/datamodel.rst:491 +#: ../../reference/datamodel.rst:539 msgid "__kwdefaults__ (function attribute)" msgstr "__kwdefaults__ (函式屬性)" -#: ../../reference/datamodel.rst:491 +#: ../../reference/datamodel.rst:539 msgid "__type_params__ (function attribute)" msgstr "__type_params__ (函式屬性)" -#: ../../reference/datamodel.rst:491 +#: ../../reference/datamodel.rst:539 msgid "global" msgstr "global(全域)" -#: ../../reference/datamodel.rst:491 ../../reference/datamodel.rst:755 +#: ../../reference/datamodel.rst:539 ../../reference/datamodel.rst:829 msgid "namespace" msgstr "namespace(命名空間)" -#: ../../reference/datamodel.rst:589 ../../reference/datamodel.rst:712 +#: ../../reference/datamodel.rst:640 ../../reference/datamodel.rst:778 msgid "method" msgstr "method(方法)" -#: ../../reference/datamodel.rst:589 +#: ../../reference/datamodel.rst:640 msgid "user-defined method" msgstr "user-defined method(使用者定義方法)" -#: ../../reference/datamodel.rst:597 +#: ../../reference/datamodel.rst:648 msgid "__func__ (method attribute)" msgstr "__func__ (方法屬性)" -#: ../../reference/datamodel.rst:597 +#: ../../reference/datamodel.rst:648 msgid "__self__ (method attribute)" msgstr "__self__ (方法屬性)" -#: ../../reference/datamodel.rst:597 +#: ../../reference/datamodel.rst:648 msgid "__doc__ (method attribute)" msgstr "__doc__ (方法屬性)" -#: ../../reference/datamodel.rst:597 +#: ../../reference/datamodel.rst:648 msgid "__name__ (method attribute)" msgstr "__name__ (方法屬性)" -#: ../../reference/datamodel.rst:597 +#: ../../reference/datamodel.rst:648 msgid "__module__ (method attribute)" msgstr "__module__ (方法屬性)" -#: ../../reference/datamodel.rst:652 ../../reference/datamodel.rst:1011 +#: ../../reference/datamodel.rst:706 ../../reference/datamodel.rst:1100 msgid "generator" msgstr "generator(產生器)" -#: ../../reference/datamodel.rst:652 +#: ../../reference/datamodel.rst:706 msgid "iterator" msgstr "itorator(疊代器)" -#: ../../reference/datamodel.rst:667 ../../reference/datamodel.rst:2997 +#: ../../reference/datamodel.rst:724 ../../reference/datamodel.rst:3100 msgid "coroutine" msgstr "coroutine(協程)" -#: ../../reference/datamodel.rst:677 +#: ../../reference/datamodel.rst:737 msgid "asynchronous generator" msgstr "asynchronous generator(非同步產生器)" -#: ../../reference/datamodel.rst:677 +#: ../../reference/datamodel.rst:737 msgid "asynchronous iterator" msgstr "asynchronous iterator(非同步疊代器)" -#: ../../reference/datamodel.rst:712 +#: ../../reference/datamodel.rst:778 msgid "built-in method" msgstr "built-in method(內建方法)" -#: ../../reference/datamodel.rst:712 +#: ../../reference/datamodel.rst:778 msgid "built-in" msgstr "built-in(內建)" -#: ../../reference/datamodel.rst:736 +#: ../../reference/datamodel.rst:810 msgid "import" msgstr "import(引入)" -#: ../../reference/datamodel.rst:755 +#: ../../reference/datamodel.rst:829 msgid "__name__ (module attribute)" msgstr "__name__ (模組屬性)" -#: ../../reference/datamodel.rst:755 +#: ../../reference/datamodel.rst:829 msgid "__doc__ (module attribute)" msgstr "__doc__ (模組屬性)" -#: ../../reference/datamodel.rst:755 +#: ../../reference/datamodel.rst:829 msgid "__file__ (module attribute)" msgstr "__file__ (模組屬性)" -#: ../../reference/datamodel.rst:755 +#: ../../reference/datamodel.rst:829 msgid "__annotations__ (module attribute)" msgstr "__annotations__ (模組屬性)" -#: ../../reference/datamodel.rst:786 +#: ../../reference/datamodel.rst:860 msgid "__dict__ (module attribute)" msgstr "__dict__ (模組屬性)" -#: ../../reference/datamodel.rst:814 ../../reference/datamodel.rst:831 -#: ../../reference/datamodel.rst:879 ../../reference/datamodel.rst:1305 -#: ../../reference/datamodel.rst:2174 +#: ../../reference/datamodel.rst:891 ../../reference/datamodel.rst:908 +#: ../../reference/datamodel.rst:959 ../../reference/datamodel.rst:1409 +#: ../../reference/datamodel.rst:2277 msgid "class" msgstr "class(類別)" -#: ../../reference/datamodel.rst:814 ../../reference/datamodel.rst:879 -#: ../../reference/datamodel.rst:899 +#: ../../reference/datamodel.rst:891 ../../reference/datamodel.rst:959 +#: ../../reference/datamodel.rst:979 msgid "class instance" msgstr "class instance(類別實例)" -#: ../../reference/datamodel.rst:814 ../../reference/datamodel.rst:879 -#: ../../reference/datamodel.rst:2444 +#: ../../reference/datamodel.rst:891 ../../reference/datamodel.rst:959 +#: ../../reference/datamodel.rst:2547 msgid "instance" msgstr "instance(實例)" -#: ../../reference/datamodel.rst:814 ../../reference/datamodel.rst:836 +#: ../../reference/datamodel.rst:891 ../../reference/datamodel.rst:913 msgid "class object" msgstr "class object(類別物件)" -#: ../../reference/datamodel.rst:840 +#: ../../reference/datamodel.rst:917 msgid "__name__ (class attribute)" msgstr "__name__ (類別屬性)" -#: ../../reference/datamodel.rst:840 +#: ../../reference/datamodel.rst:917 msgid "__module__ (class attribute)" msgstr "__module__ (類別屬性)" -#: ../../reference/datamodel.rst:840 +#: ../../reference/datamodel.rst:917 msgid "__dict__ (class attribute)" msgstr "__dict__ (類別屬性)" -#: ../../reference/datamodel.rst:840 +#: ../../reference/datamodel.rst:917 msgid "__bases__ (class attribute)" msgstr "__bases__ (類別屬性)" -#: ../../reference/datamodel.rst:840 +#: ../../reference/datamodel.rst:917 msgid "__doc__ (class attribute)" msgstr "__doc__ (類別屬性)" -#: ../../reference/datamodel.rst:840 +#: ../../reference/datamodel.rst:917 msgid "__annotations__ (class attribute)" msgstr "__annotations__ (類別屬性)" -#: ../../reference/datamodel.rst:840 +#: ../../reference/datamodel.rst:917 msgid "__type_params__ (class attribute)" msgstr "__type_params__ (類別屬性)" -#: ../../reference/datamodel.rst:914 +#: ../../reference/datamodel.rst:994 msgid "__dict__ (instance attribute)" msgstr "__dict__ (實例屬性)" -#: ../../reference/datamodel.rst:914 +#: ../../reference/datamodel.rst:994 msgid "__class__ (instance attribute)" msgstr "__class__ (實例屬性)" -#: ../../reference/datamodel.rst:922 +#: ../../reference/datamodel.rst:1005 msgid "open" msgstr "open" -#: ../../reference/datamodel.rst:922 +#: ../../reference/datamodel.rst:1005 msgid "io" msgstr "io" -#: ../../reference/datamodel.rst:922 +#: ../../reference/datamodel.rst:1005 msgid "popen() (in module os)" msgstr "popen() (於 os 模組中)" -#: ../../reference/datamodel.rst:922 +#: ../../reference/datamodel.rst:1005 msgid "makefile() (socket method)" msgstr "makefile() (socket 方法)" -#: ../../reference/datamodel.rst:922 +#: ../../reference/datamodel.rst:1005 msgid "sys.stdin" msgstr "sys.stdin" -#: ../../reference/datamodel.rst:922 +#: ../../reference/datamodel.rst:1005 msgid "sys.stdout" msgstr "sys.stdout" -#: ../../reference/datamodel.rst:922 +#: ../../reference/datamodel.rst:1005 msgid "sys.stderr" msgstr "sys.stderr" -#: ../../reference/datamodel.rst:922 +#: ../../reference/datamodel.rst:1005 msgid "stdio" msgstr "stdio" -#: ../../reference/datamodel.rst:922 +#: ../../reference/datamodel.rst:1005 msgid "stdin (in module sys)" msgstr "stdin (sys 模組中)" -#: ../../reference/datamodel.rst:922 +#: ../../reference/datamodel.rst:1005 msgid "stdout (in module sys)" msgstr "stdout (sys 模組中)" -#: ../../reference/datamodel.rst:922 +#: ../../reference/datamodel.rst:1005 msgid "stderr (in module sys)" msgstr "stderr (sys 模組中)" -#: ../../reference/datamodel.rst:948 +#: ../../reference/datamodel.rst:1034 msgid "internal type" msgstr "internal type(內部型別)" -#: ../../reference/datamodel.rst:948 +#: ../../reference/datamodel.rst:1034 msgid "types, internal" msgstr "types(型別), internal(內部)" -#: ../../reference/datamodel.rst:956 +#: ../../reference/datamodel.rst:1042 msgid "bytecode" msgstr "bytecode(位元組碼)" -#: ../../reference/datamodel.rst:956 +#: ../../reference/datamodel.rst:1042 msgid "code" msgstr "code(程式碼)" -#: ../../reference/datamodel.rst:956 +#: ../../reference/datamodel.rst:1042 msgid "code object" msgstr "code object(程式碼物件)" -#: ../../reference/datamodel.rst:968 +#: ../../reference/datamodel.rst:1057 msgid "co_argcount (code object attribute)" msgstr "co_argcount (程式碼物件屬性)" -#: ../../reference/datamodel.rst:968 +#: ../../reference/datamodel.rst:1057 msgid "co_posonlyargcount (code object attribute)" msgstr "co_posonlyargcount (程式碼物件屬性)" -#: ../../reference/datamodel.rst:968 +#: ../../reference/datamodel.rst:1057 msgid "co_kwonlyargcount (code object attribute)" msgstr "co_kwonlyargcount (程式碼物件屬性)" -#: ../../reference/datamodel.rst:968 +#: ../../reference/datamodel.rst:1057 msgid "co_code (code object attribute)" msgstr "co_code (程式碼物件屬性)" -#: ../../reference/datamodel.rst:968 +#: ../../reference/datamodel.rst:1057 msgid "co_consts (code object attribute)" msgstr "co_consts (程式碼物件屬性)" -#: ../../reference/datamodel.rst:968 +#: ../../reference/datamodel.rst:1057 msgid "co_filename (code object attribute)" msgstr "co_filename (程式碼物件屬性)" -#: ../../reference/datamodel.rst:968 +#: ../../reference/datamodel.rst:1057 msgid "co_firstlineno (code object attribute)" msgstr "co_firstlineno (程式碼物件屬性)" -#: ../../reference/datamodel.rst:968 +#: ../../reference/datamodel.rst:1057 msgid "co_flags (code object attribute)" msgstr "co_flags (程式碼物件屬性)" -#: ../../reference/datamodel.rst:968 +#: ../../reference/datamodel.rst:1057 msgid "co_lnotab (code object attribute)" msgstr "co_lnotab (程式碼物件屬性)" -#: ../../reference/datamodel.rst:968 +#: ../../reference/datamodel.rst:1057 msgid "co_name (code object attribute)" msgstr "co_name (程式碼物件屬性)" -#: ../../reference/datamodel.rst:968 +#: ../../reference/datamodel.rst:1057 msgid "co_names (code object attribute)" msgstr "co_names (程式碼物件屬性)" -#: ../../reference/datamodel.rst:968 +#: ../../reference/datamodel.rst:1057 msgid "co_nlocals (code object attribute)" msgstr "co_nlocals (程式碼物件屬性)" -#: ../../reference/datamodel.rst:968 +#: ../../reference/datamodel.rst:1057 msgid "co_stacksize (code object attribute)" msgstr "co_stacksize (程式碼物件屬性)" -#: ../../reference/datamodel.rst:968 +#: ../../reference/datamodel.rst:1057 msgid "co_varnames (code object attribute)" msgstr "co_varnames (程式碼物件屬性)" -#: ../../reference/datamodel.rst:968 +#: ../../reference/datamodel.rst:1057 msgid "co_cellvars (code object attribute)" msgstr "co_cellvars (程式碼物件屬性)" -#: ../../reference/datamodel.rst:968 +#: ../../reference/datamodel.rst:1057 msgid "co_freevars (code object attribute)" msgstr "co_freevars (程式碼物件屬性)" -#: ../../reference/datamodel.rst:968 +#: ../../reference/datamodel.rst:1057 msgid "co_qualname (code object attribute)" msgstr "co_qualname (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1027 +#: ../../reference/datamodel.rst:1116 msgid "documentation string" msgstr "documentation string(文件字串)" -#: ../../reference/datamodel.rst:1068 +#: ../../reference/datamodel.rst:1160 msgid "frame" msgstr "frame" -#: ../../reference/datamodel.rst:1073 +#: ../../reference/datamodel.rst:1165 msgid "f_back (frame attribute)" msgstr "f_back (frame 屬性)" -#: ../../reference/datamodel.rst:1073 +#: ../../reference/datamodel.rst:1165 msgid "f_code (frame attribute)" msgstr "f_code (frame 屬性)" -#: ../../reference/datamodel.rst:1073 +#: ../../reference/datamodel.rst:1165 msgid "f_globals (frame attribute)" msgstr "f_globals (frame 屬性)" -#: ../../reference/datamodel.rst:1073 +#: ../../reference/datamodel.rst:1165 msgid "f_locals (frame attribute)" msgstr "f_locals (frame 屬性)" -#: ../../reference/datamodel.rst:1073 +#: ../../reference/datamodel.rst:1165 msgid "f_lasti (frame attribute)" msgstr "f_lasti (frame 屬性)" -#: ../../reference/datamodel.rst:1073 +#: ../../reference/datamodel.rst:1165 msgid "f_builtins (frame attribute)" msgstr "f_builtins (frame 屬性)" -#: ../../reference/datamodel.rst:1092 +#: ../../reference/datamodel.rst:1184 msgid "f_trace (frame attribute)" msgstr "f_trace (frame 屬性)" -#: ../../reference/datamodel.rst:1092 +#: ../../reference/datamodel.rst:1184 msgid "f_trace_lines (frame attribute)" msgstr "f_trace_lines (frame 屬性)" -#: ../../reference/datamodel.rst:1092 +#: ../../reference/datamodel.rst:1184 msgid "f_trace_opcodes (frame attribute)" msgstr "f_trace_opcodes (frame 屬性)" -#: ../../reference/datamodel.rst:1092 +#: ../../reference/datamodel.rst:1184 msgid "f_lineno (frame attribute)" msgstr "f_lineno (frame 屬性)" -#: ../../reference/datamodel.rst:1130 +#: ../../reference/datamodel.rst:1225 msgid "traceback" msgstr "traceback" -#: ../../reference/datamodel.rst:1130 +#: ../../reference/datamodel.rst:1225 msgid "stack" msgstr "stack(堆疊)" -#: ../../reference/datamodel.rst:1130 +#: ../../reference/datamodel.rst:1225 msgid "trace" msgstr "trace(追蹤)" -#: ../../reference/datamodel.rst:1130 +#: ../../reference/datamodel.rst:1225 msgid "exception" msgstr "exception(例外)" -#: ../../reference/datamodel.rst:1130 +#: ../../reference/datamodel.rst:1225 msgid "handler" msgstr "handler(處理器)" -#: ../../reference/datamodel.rst:1130 +#: ../../reference/datamodel.rst:1225 msgid "execution" msgstr "execution(執行)" -#: ../../reference/datamodel.rst:1130 +#: ../../reference/datamodel.rst:1225 msgid "exc_info (in module sys)" msgstr "exc_info (sys 模組中)" -#: ../../reference/datamodel.rst:1130 +#: ../../reference/datamodel.rst:1225 msgid "last_traceback (in module sys)" msgstr "last_traceback (sys 模組中)" -#: ../../reference/datamodel.rst:1130 +#: ../../reference/datamodel.rst:1225 msgid "sys.exc_info" msgstr "sys.exc_info" -#: ../../reference/datamodel.rst:1130 +#: ../../reference/datamodel.rst:1225 msgid "sys.exception" msgstr "sys.exception" -#: ../../reference/datamodel.rst:1130 +#: ../../reference/datamodel.rst:1225 msgid "sys.last_traceback" msgstr "sys.last_traceback" -#: ../../reference/datamodel.rst:1162 +#: ../../reference/datamodel.rst:1257 msgid "tb_frame (traceback attribute)" msgstr "tb_frame (traceback 屬性)" -#: ../../reference/datamodel.rst:1162 +#: ../../reference/datamodel.rst:1257 msgid "tb_lineno (traceback attribute)" msgstr "tb_lineno (traceback 屬性)" -#: ../../reference/datamodel.rst:1162 +#: ../../reference/datamodel.rst:1257 msgid "tb_lasti (traceback attribute)" msgstr "tb_lasti (traceback 屬性)" -#: ../../reference/datamodel.rst:1162 +#: ../../reference/datamodel.rst:1257 msgid "try" msgstr "try" -#: ../../reference/datamodel.rst:1180 +#: ../../reference/datamodel.rst:1275 msgid "tb_next (traceback attribute)" msgstr "tb_next (traceback 屬性)" -#: ../../reference/datamodel.rst:1192 ../../reference/datamodel.rst:2521 +#: ../../reference/datamodel.rst:1290 ../../reference/datamodel.rst:2624 msgid "slice" msgstr "slice(切片)" -#: ../../reference/datamodel.rst:1198 +#: ../../reference/datamodel.rst:1296 msgid "start (slice object attribute)" msgstr "start (slice 物件屬性)" -#: ../../reference/datamodel.rst:1198 +#: ../../reference/datamodel.rst:1296 msgid "stop (slice object attribute)" msgstr "stop (slice 物件屬性)" -#: ../../reference/datamodel.rst:1198 +#: ../../reference/datamodel.rst:1296 msgid "step (slice object attribute)" msgstr "step (slice 物件屬性)" -#: ../../reference/datamodel.rst:1240 +#: ../../reference/datamodel.rst:1344 msgid "operator" msgstr "operator(運算子)" -#: ../../reference/datamodel.rst:1240 +#: ../../reference/datamodel.rst:1344 msgid "overloading" msgstr "overloading(多載)" -#: ../../reference/datamodel.rst:1240 +#: ../../reference/datamodel.rst:1344 msgid "__getitem__() (mapping object method)" msgstr "__getitem__() (對映物件方法)" -#: ../../reference/datamodel.rst:1276 +#: ../../reference/datamodel.rst:1380 msgid "subclassing" msgstr "subclassing(子類別化)" -#: ../../reference/datamodel.rst:1276 +#: ../../reference/datamodel.rst:1380 msgid "immutable types" msgstr "immutable types(不可變型別)" -#: ../../reference/datamodel.rst:1305 +#: ../../reference/datamodel.rst:1409 msgid "constructor" msgstr "constructor(建構函式)" -#: ../../reference/datamodel.rst:1322 +#: ../../reference/datamodel.rst:1426 msgid "destructor" msgstr "destructor(解構函式)" -#: ../../reference/datamodel.rst:1322 +#: ../../reference/datamodel.rst:1426 msgid "finalizer" msgstr "finalizer(終結函式)" -#: ../../reference/datamodel.rst:1322 +#: ../../reference/datamodel.rst:1426 msgid "del" msgstr "del" -#: ../../reference/datamodel.rst:1384 +#: ../../reference/datamodel.rst:1488 msgid "repr() (built-in function)" msgstr "repr() (內建函式)" -#: ../../reference/datamodel.rst:1384 +#: ../../reference/datamodel.rst:1488 msgid "__repr__() (object method)" msgstr "__repr__() (物件方法)" -#: ../../reference/datamodel.rst:1401 +#: ../../reference/datamodel.rst:1505 msgid "__str__() (object method)" msgstr "__str__() (物件方法)" -#: ../../reference/datamodel.rst:1401 +#: ../../reference/datamodel.rst:1505 msgid "format() (built-in function)" msgstr "format() (內建函式)" -#: ../../reference/datamodel.rst:1401 +#: ../../reference/datamodel.rst:1505 msgid "print() (built-in function)" msgstr "print() (內建函式)" -#: ../../reference/datamodel.rst:1431 +#: ../../reference/datamodel.rst:1535 msgid "__format__() (object method)" msgstr "__format__() (物件方法)" -#: ../../reference/datamodel.rst:1431 +#: ../../reference/datamodel.rst:1535 msgid "conversion" msgstr "conversion" -#: ../../reference/datamodel.rst:1431 +#: ../../reference/datamodel.rst:1535 msgid "print" msgstr "print" -#: ../../reference/datamodel.rst:1470 +#: ../../reference/datamodel.rst:1574 msgid "comparisons" msgstr "comparison(比較)" -#: ../../reference/datamodel.rst:1512 +#: ../../reference/datamodel.rst:1616 msgid "hash" msgstr "hash(雜湊)" -#: ../../reference/datamodel.rst:1593 +#: ../../reference/datamodel.rst:1697 msgid "__len__() (mapping object method)" msgstr "__len__() (對映物件方法)" -#: ../../reference/datamodel.rst:1696 +#: ../../reference/datamodel.rst:1800 msgid "__getattr__ (module attribute)" msgstr "__getattr__ (模組屬性)" -#: ../../reference/datamodel.rst:1696 +#: ../../reference/datamodel.rst:1800 msgid "__dir__ (module attribute)" msgstr "__dir__ (模組屬性)" -#: ../../reference/datamodel.rst:1696 +#: ../../reference/datamodel.rst:1800 msgid "__class__ (module attribute)" msgstr "__class__ (模組屬性)" -#: ../../reference/datamodel.rst:2063 +#: ../../reference/datamodel.rst:2166 msgid "metaclass" msgstr "metaclass(元類別)" -#: ../../reference/datamodel.rst:2063 +#: ../../reference/datamodel.rst:2166 msgid "= (equals)" msgstr "= (等於)" -#: ../../reference/datamodel.rst:2063 +#: ../../reference/datamodel.rst:2166 msgid "class definition" msgstr "class definition(類別定義)" -#: ../../reference/datamodel.rst:2127 +#: ../../reference/datamodel.rst:2230 msgid "metaclass hint" msgstr "metaclass hint(元類別提示)" -#: ../../reference/datamodel.rst:2150 +#: ../../reference/datamodel.rst:2253 msgid "__prepare__ (metaclass method)" msgstr "__prepare__ (元類別方法)" -#: ../../reference/datamodel.rst:2174 +#: ../../reference/datamodel.rst:2277 msgid "body" msgstr "body" -#: ../../reference/datamodel.rst:2194 +#: ../../reference/datamodel.rst:2297 msgid "__class__ (method cell)" msgstr "__class__ (方法 cell)" -#: ../../reference/datamodel.rst:2194 +#: ../../reference/datamodel.rst:2297 msgid "__classcell__ (class namespace entry)" msgstr "__classcell__ (類別命名空間項目)" -#: ../../reference/datamodel.rst:2491 +#: ../../reference/datamodel.rst:2594 msgid "__bool__() (object method)" msgstr "__bool__() (物件方法)" -#: ../../reference/datamodel.rst:2649 ../../reference/datamodel.rst:2684 +#: ../../reference/datamodel.rst:2752 ../../reference/datamodel.rst:2787 msgid "divmod" msgstr "divmod" -#: ../../reference/datamodel.rst:2649 ../../reference/datamodel.rst:2684 -#: ../../reference/datamodel.rst:2698 +#: ../../reference/datamodel.rst:2752 ../../reference/datamodel.rst:2787 +#: ../../reference/datamodel.rst:2801 msgid "pow" msgstr "pow" -#: ../../reference/datamodel.rst:2745 +#: ../../reference/datamodel.rst:2848 msgid "abs" msgstr "abs" -#: ../../reference/datamodel.rst:2755 +#: ../../reference/datamodel.rst:2858 msgid "int" msgstr "int" -#: ../../reference/datamodel.rst:2755 +#: ../../reference/datamodel.rst:2858 msgid "float" msgstr "float" -#: ../../reference/datamodel.rst:2783 +#: ../../reference/datamodel.rst:2886 msgid "round" msgstr "round" -#: ../../reference/datamodel.rst:2810 +#: ../../reference/datamodel.rst:2913 msgid "with" msgstr "with" -#: ../../reference/datamodel.rst:2810 +#: ../../reference/datamodel.rst:2913 msgid "context manager" msgstr "context manager(情境管理器)" diff --git a/tutorial/classes.po b/tutorial/classes.po index 5bc1b1749f..c7e6db0e8f 100644 --- a/tutorial/classes.po +++ b/tutorial/classes.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-08-22 00:03+0000\n" "PO-Revision-Date: 2022-12-26 23:12+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -35,8 +35,8 @@ msgid "" "also have methods (defined by its class) for modifying its state." msgstr "" "Class 提供了一種結合資料與功能的手段。建立一個 class 將會新增一個物件的\\ *型" -"別 (type)*\\ ,並且允許建立該型別的新\\ *實例 (instance)*\\ 。每一個 class 實" -"例可以擁有一些維持該實例狀態的屬性 (attribute)。Class 實例也可以有一些(由其 " +"別 (type)*\\ ,並且允許建立該型別的新\\ *實例 (instance)*。每一個 class 實例" +"可以擁有一些維持該實例狀態的屬性 (attribute)。Class 實例也可以有一些(由其 " "class 所定義的)method(方法),用於修改該實例的狀態。" #: ../../tutorial/classes.rst:13 @@ -75,7 +75,7 @@ msgid "" "instances." msgstr "" "在 C++ 的術語中,class 成員(包含資料成員)通常都是\\ *公開*\\ 的(除了以下內" -"容:\\ :ref:`tut-private`\\ ),而所有的成員函式都是\\ *虛擬*\\ 的。如同在 " +"容::ref:`tut-private`\\ ),而所有的成員函式都是\\ *虛擬*\\ 的。如同在 " "Modula-3 中一樣,Python 並沒有提供簡寫可以從物件的 method 裡參照其成員:" "method 函式與一個外顯的 (explicit)、第一個代表物件的引數被宣告,而此引數是在" "呼叫時隱性地 (implicitly) 被提供。如同在 Smalltak 中,class 都是物件,這為 " @@ -176,10 +176,10 @@ msgid "" "the global names defined in the module: they share the same namespace! [#]_" msgstr "" "順帶一提,我使用\\ *屬性 (attribute)* 這個字,統稱句號 (dot) 後面的任何名稱——" -"例如,運算式中的 ``z.real``,\\ ``real`` 是物件 ``z`` 的一個屬性。嚴格來說," -"模組中名稱的參照都是屬性參照:在運算式 ``modname.funcname`` 中,\\ " -"``modname`` 是模組物件而 ``funcname`` 是它的屬性。在這種情況下,模組的屬性和" -"模組中定義的全域名稱碰巧有一個直接的對映:他們共享了相同的命名空間![#]_" +"例如,運算式中的 ``z.real``,``real`` 是物件 ``z`` 的一個屬性。嚴格來說,模組" +"中名稱的參照都是屬性參照:在運算式 ``modname.funcname`` 中,``modname`` 是模" +"組物件而 ``funcname`` 是它的屬性。在這種情況下,模組的屬性和模組中定義的全域" +"名稱碰巧有一個直接的對映:他們共享了相同的命名空間![#]_" #: ../../tutorial/classes.rst:90 msgid "" @@ -187,12 +187,13 @@ msgid "" "attributes is possible. Module attributes are writable: you can write " "``modname.the_answer = 42``. Writable attributes may also be deleted with " "the :keyword:`del` statement. For example, ``del modname.the_answer`` will " -"remove the attribute :attr:`the_answer` from the object named by ``modname``." +"remove the attribute :attr:`!the_answer` from the object named by " +"``modname``." msgstr "" "屬性可以是唯讀的或可寫的。在後者的情況下,對屬性的賦值是可能的。模組屬性是可" "寫的:你可以寫 ``modname.the_answer = 42``。可寫屬性也可以用 :keyword:`del` " -"陳述式刪除。例如,\\ ``del modname.the_answer`` 將從名為 ``modname`` 的物件中" -"刪除屬性 :attr:`the_answer`\\ 。" +"陳述式刪除。例如,``del modname.the_answer`` 將從名為 ``modname`` 的物件中刪" +"除屬性 :attr:`!the_answer`。" #: ../../tutorial/classes.rst:96 msgid "" @@ -211,8 +212,7 @@ msgstr "" "命名空間會被建立;一般情況下,模組的命名空間也會持續到直譯器結束。被直譯器的" "頂層調用 (top-level invocation) 執行的陳述式,不論是從腳本檔案讀取的或是互動" "模式中的,會被視為一個稱為 :mod:`__main__` 的模組的一部分,因此它們具有自己的" -"全域命名空間。(內建名稱實際上也存在一個模組中,它被稱為 :mod:" -"`builtins`\\ 。)" +"全域命名空間。(內建名稱實際上也存在一個模組中,它被稱為 :mod:`builtins`。)" #: ../../tutorial/classes.rst:106 msgid "" @@ -335,8 +335,8 @@ msgid "" "enclosing scope and should be rebound there." msgstr "" ":keyword:`global` 陳述式可以用來表示特定變數存活在全域作用域,應該被重新綁定" -"到那裡;\\ :keyword:`nonlocal` 陳述式表示特定變數存活在外圍作用域內,應該被重" -"新綁定到那裡。" +"到那裡;:keyword:`nonlocal` 陳述式表示特定變數存活在外圍作用域內,應該被重新" +"綁定到那裡。" #: ../../tutorial/classes.rst:162 msgid "Scopes and Namespaces Example" @@ -364,9 +364,9 @@ msgid "" "changed *scope_test*\\'s binding of *spam*, and the :keyword:`global` " "assignment changed the module-level binding." msgstr "" -"請注意,\\ *區域*\\ 賦值(預設情況)不會改變 *scope_test* 對 *spam* 的連" -"結。\\ :keyword:`nonlocal` 賦值改變了 *scope_test* 對 *spam* 的連結,而 :" -"keyword:`global` 賦值改變了模組層次的連結。" +"請注意,\\ *區域*\\ 賦值(預設情況)不會改變 *scope_test* 對 *spam* 的連結。:" +"keyword:`nonlocal` 賦值改變了 *scope_test* 對 *spam* 的連結,而 :keyword:" +"`global` 賦值改變了模組層次的連結。" #: ../../tutorial/classes.rst:205 msgid "" @@ -436,14 +436,14 @@ msgid "" "created by the class definition; we'll learn more about class objects in the " "next section. The original local scope (the one in effect just before the " "class definition was entered) is reinstated, and the class object is bound " -"here to the class name given in the class definition header (:class:" -"`ClassName` in the example)." +"here to the class name given in the class definition header (:class:`!" +"ClassName` in the example)." msgstr "" "正常地(從結尾處)離開 class definition 時,一個 *class 物件*\\ 會被建立。基" "本上這是一個包裝器 (wrapper),裝著 class definition 建立的命名空間內容;我們" "將在下一節中更加了解 class 物件。原始的區域作用域(在進入 class definition 之" "前已生效的作用域)會恢復,在此 class 物件會被連結到 class definition 標頭中給" -"出的 class 名稱(在範例中為 :class:`ClassName`\\ )。" +"出的 class 名稱(在範例中為 :class:`!ClassName`\\ )。" #: ../../tutorial/classes.rst:259 msgid "Class Objects" @@ -464,8 +464,8 @@ msgid "" "that were in the class's namespace when the class object was created. So, " "if the class definition looked like this::" msgstr "" -"*屬性參照*\\ 使用 Python 中所有屬性參照的標準語法:\\ ``obj.name``。有效的屬" -"性名稱是 class 物件被建立時,class 的命名空間中所有的名稱。所以,如果 class " +"*屬性參照*\\ 使用 Python 中所有屬性參照的標準語法:``obj.name``。有效的屬性名" +"稱是 class 物件被建立時,class 的命名空間中所有的名稱。所以,如果 class " "definition 看起來像這樣:\n" "\n" "::" @@ -480,8 +480,8 @@ msgid "" msgstr "" "那麼 ``MyClass.i`` 和 ``MyClass.f`` 都是有效的屬性參照,會分別回傳一個整數和" "一個函式物件。Class 屬性也可以被指派 (assign),所以您可以透過賦值改變 " -"``MyClass.i`` 的值。\\ :attr:`__doc__` 也是一個有效的屬性,會回傳屬於該 " -"class 的說明字串 (docstring):\\ ``\"A simple example class\"``。" +"``MyClass.i`` 的值。:attr:`__doc__` 也是一個有效的屬性,會回傳屬於該 class 的" +"說明字串 (docstring):``\"A simple example class\"``。" #: ../../tutorial/classes.rst:282 msgid "" @@ -505,35 +505,35 @@ msgid "" "The instantiation operation (\"calling\" a class object) creates an empty " "object. Many classes like to create objects with instances customized to a " "specific initial state. Therefore a class may define a special method named :" -"meth:`__init__`, like this::" +"meth:`~object.__init__`, like this::" msgstr "" "實例化運算(「呼叫」一個 class 物件)會建立一個空的物件。許多 class 喜歡在建" "立物件時有著自訂的特定實例初始狀態。因此,class 可以定義一個名為 :meth:" -"`__init__` 的特別 method,像這樣:\n" +"`~object.__init__` 的特別 method,像這樣:\n" "\n" "::" #: ../../tutorial/classes.rst:299 msgid "" -"When a class defines an :meth:`__init__` method, class instantiation " -"automatically invokes :meth:`__init__` for the newly created class " +"When a class defines an :meth:`~object.__init__` method, class instantiation " +"automatically invokes :meth:`!__init__` for the newly created class " "instance. So in this example, a new, initialized instance can be obtained " "by::" msgstr "" -"當 class 定義了 :meth:`__init__` method,class 實例化會為新建的 class 實例自" -"動調用 :meth:`__init__`。所以在這個範例中,一個新的、初始化的實例可以如此獲" -"得:\n" +"當 class 定義了 :meth:`~object.__init__` method,class 實例化會為新建的 " +"class 實例自動調用 :meth:`!__init__`。所以在這個範例中,一個新的、初始化的實" +"例可以如此獲得:\n" "\n" "::" #: ../../tutorial/classes.rst:305 msgid "" -"Of course, the :meth:`__init__` method may have arguments for greater " -"flexibility. In that case, arguments given to the class instantiation " -"operator are passed on to :meth:`__init__`. For example, ::" +"Of course, the :meth:`~object.__init__` method may have arguments for " +"greater flexibility. In that case, arguments given to the class " +"instantiation operator are passed on to :meth:`!__init__`. For example, ::" msgstr "" -"當然,\\ :meth:`__init__` method 可能為了更多的彈性而有引數。在這種情況下,要" -"給 class 實例化運算子的引數會被傳遞給 :meth:`__init__`\\ 。例如:\n" +"當然,:meth:`~object.__init__` method 可能為了更多的彈性而有引數。在這種情況" +"下,要給 class 實例化運算子的引數會被傳遞給 :meth:`!__init__`。例如:\n" "\n" "::" @@ -555,13 +555,13 @@ msgid "" "*data attributes* correspond to \"instance variables\" in Smalltalk, and to " "\"data members\" in C++. Data attributes need not be declared; like local " "variables, they spring into existence when they are first assigned to. For " -"example, if ``x`` is the instance of :class:`MyClass` created above, the " +"example, if ``x`` is the instance of :class:`!MyClass` created above, the " "following piece of code will print the value ``16``, without leaving a " "trace::" msgstr "" "*資料屬性*\\ 對應 Smalltalk 中的「實例變數」,以及 C++ 中的「資料成員」。資料" "屬性不需要被宣告;和區域變數一樣,它們在第一次被賦值時就會立即存在。例如,如" -"果 ``x`` 是 :class:`MyClass` 在上述例子中建立的實例,下面的程式碼將印出值 " +"果 ``x`` 是 :class:`!MyClass` 在上述例子中建立的實例,下面的程式碼將印出值 " "``16``,而不留下蹤跡:\n" "\n" "::" @@ -576,7 +576,7 @@ msgid "" "exclusively to mean methods of class instance objects, unless explicitly " "stated otherwise.)" msgstr "" -"實例的另一種屬性參照是 *method*\\ 。Method 是一個「屬於」物件的函式。(在 " +"實例的另一種屬性參照是 *method*。Method 是一個「屬於」物件的函式。(在 " "Python 中,術語 method 並不是 class 實例所獨有的:其他物件型別也可以有 " "method。例如,list 物件具有稱為 append、insert、remove、sort 等 method。但" "是,在下面的討論中,我們將用術語 method 來專門表示 class 實例物件的 method," @@ -592,10 +592,10 @@ msgid "" "``MyClass.f`` --- it is a *method object*, not a function object." msgstr "" "實例物件的有效 method 名稱取決於其 class。根據定義,一個 class 中所有的函式物" -"件屬性,就定義了實例的對應 method。所以在我們的例子中,\\ ``x.f`` 是一個有效" -"的 method 參照,因為 ``MyClass.f`` 是一個函式,但 ``x.i`` 不是,因為 " -"``MyClass.i`` 不是。但 ``x.f`` 與 ``MyClass.f`` 是不一樣的——它是一個 *method " -"物件*\\ ,而不是函式物件。" +"件屬性,就定義了實例的對應 method。所以在我們的例子中,``x.f`` 是一個有效的 " +"method 參照,因為 ``MyClass.f`` 是一個函式,但 ``x.i`` 不是,因為 ``MyClass." +"i`` 不是。但 ``x.f`` 與 ``MyClass.f`` 是不一樣的——它是一個 *method 物件*,而" +"不是函式物件。" #: ../../tutorial/classes.rst:360 msgid "Method Objects" @@ -610,14 +610,14 @@ msgstr "" #: ../../tutorial/classes.rst:366 msgid "" -"In the :class:`MyClass` example, this will return the string ``'hello " +"In the :class:`!MyClass` example, this will return the string ``'hello " "world'``. However, it is not necessary to call a method right away: ``x.f`` " "is a method object, and can be stored away and called at a later time. For " "example::" msgstr "" -"在 :class:`MyClass` 的例子中,這將回傳字串 ``'hello world'``。然而,並沒有必" -"要立即呼叫一個 method:\\ ``x.f`` 是一個 method 物件,並且可以被儲藏起來,之" -"後再被呼叫。舉例來說:\n" +"在 :class:`!MyClass` 的例子中,這將回傳字串 ``'hello world'``。然而,並沒有必" +"要立即呼叫一個 method:``x.f`` 是一個 method 物件,並且可以被儲藏起來,之後再" +"被呼叫。舉例來說:\n" "\n" "::" @@ -629,15 +629,15 @@ msgstr "將會持續印出 ``hello world`` 直到天荒地老。" msgid "" "What exactly happens when a method is called? You may have noticed that ``x." "f()`` was called without an argument above, even though the function " -"definition for :meth:`f` specified an argument. What happened to the " +"definition for :meth:`!f` specified an argument. What happened to the " "argument? Surely Python raises an exception when a function that requires an " "argument is called without any --- even if the argument isn't actually " "used..." msgstr "" "當一個 method 被呼叫時究竟會發生什麼事?你可能已經注意到 ``x.f()`` 被呼叫時沒" -"有任何的引數,儘管 :meth:`f` 的函式定義有指定一個引數。這個引數發生了什麼事?" -"當一個需要引數的函式被呼叫而沒有給任何引數時,Python 肯定會引發例外——即使該引" -"數實際上沒有被使用..." +"有任何的引數,儘管 :meth:`!f` 的函式定義有指定一個引數。這個引數發生了什麼" +"事?當一個需要引數的函式被呼叫而沒有給任何引數時,Python 肯定會引發例外——即使" +"該引數實際上沒有被使用..." #: ../../tutorial/classes.rst:382 msgid "" @@ -650,9 +650,9 @@ msgid "" "argument." msgstr "" "事實上,你可能已經猜到了答案:method 的特殊之處在於,實例物件會作為函式中的第" -"一個引數被傳遞。在我們的例子中,\\ ``x.f()`` 這個呼叫等同於 ``MyClass." -"f(x)``。一般來說,呼叫一個有 *n* 個引數的 method,等同於呼叫一個對應函式,其" -"引數列表 (argument list) 被建立時,會在第一個引數前插入該 method 的實例物件。" +"一個引數被傳遞。在我們的例子中,``x.f()`` 這個呼叫等同於 ``MyClass.f(x)``。一" +"般來說,呼叫一個有 *n* 個引數的 method,等同於呼叫一個對應函式,其引數列表 " +"(argument list) 被建立時,會在第一個引數前插入該 method 的實例物件。" #: ../../tutorial/classes.rst:389 msgid "" @@ -771,10 +771,10 @@ msgid "" "that a *class browser* program might be written that relies upon such a " "convention." msgstr "" -"通常,方法的第一個引數稱為 ``self``。這僅僅只是一個慣例:\\ ``self`` 這個名字" -"對 Python 來說完全沒有特別的意義。但請注意,如果不遵循慣例,你的程式碼可能對" -"其他 Python 程式設計師來說可讀性較低,此外,也可以想像一個可能因信任此慣例而" -"編寫的 *class 瀏覽器 (browser)* 程式。" +"通常,方法的第一個引數稱為 ``self``。這僅僅只是一個慣例:``self`` 這個名字對 " +"Python 來說完全沒有特別的意義。但請注意,如果不遵循慣例,你的程式碼可能對其" +"他 Python 程式設計師來說可讀性較低,此外,也可以想像一個可能因信任此慣例而編" +"寫的 *class 瀏覽器 (browser)* 程式。" #: ../../tutorial/classes.rst:518 msgid "" @@ -791,13 +791,13 @@ msgstr "" #: ../../tutorial/classes.rst:535 msgid "" -"Now ``f``, ``g`` and ``h`` are all attributes of class :class:`C` that refer " -"to function objects, and consequently they are all methods of instances of :" -"class:`C` --- ``h`` being exactly equivalent to ``g``. Note that this " -"practice usually only serves to confuse the reader of a program." +"Now ``f``, ``g`` and ``h`` are all attributes of class :class:`!C` that " +"refer to function objects, and consequently they are all methods of " +"instances of :class:`!C` --- ``h`` being exactly equivalent to ``g``. Note " +"that this practice usually only serves to confuse the reader of a program." msgstr "" -"現在 ``f``、\\ ``g`` 和 ``h`` 都是 class :class:`C` 的屬性,並指向函式物件," -"所以他們都是class :class:`C` 實例的 method —— ``h`` 與 ``g`` 是完全一樣的。請" +"現在 ``f``、``g`` 和 ``h`` 都是 class :class:`!C` 的屬性,並指向函式物件,所" +"以他們都是class :class:`!C` 實例的 method —— ``h`` 與 ``g`` 是完全一樣的。請" "注意,這種做法通常只會使該程式的讀者感到困惑。" #: ../../tutorial/classes.rst:540 @@ -833,8 +833,8 @@ msgid "" "Each value is an object, and therefore has a *class* (also called its " "*type*). It is stored as ``object.__class__``." msgstr "" -"每個值都是一個物件,因此都具有一個 *class*\\ ,也可以稱為它的 *type(型別)" -"*\\ 。它以 ``object.__class__`` 被儲存。" +"每個值都是一個物件,因此都具有一個 *class*,也可以稱為它的 *type(型別)*。它" +"以 ``object.__class__`` 被儲存。" #: ../../tutorial/classes.rst:571 msgid "Inheritance" @@ -853,12 +853,12 @@ msgstr "" #: ../../tutorial/classes.rst:584 msgid "" -"The name :class:`BaseClassName` must be defined in a namespace accessible " +"The name :class:`!BaseClassName` must be defined in a namespace accessible " "from the scope containing the derived class definition. In place of a base " "class name, other arbitrary expressions are also allowed. This can be " "useful, for example, when the base class is defined in another module::" msgstr "" -"名稱 :class:`BaseClassName` 必須被定義於作用域可及的命名空間,且該作用域要包" +"名稱 :class:`!BaseClassName` 必須被定義於作用域可及的命名空間,且該作用域要包" "含 derived class 定義。要代替 base class(基底類別)的名稱,用其他任意的運算" "式也是被允許的。這會很有用,例如,當一個 base class 是在另一個模組中被定義" "時:\n" @@ -887,10 +887,10 @@ msgid "" "searched, descending down the chain of base classes if necessary, and the " "method reference is valid if this yields a function object." msgstr "" -"關於 derived class 的實例化並沒有特別之處:\\ ``DerivedClassName()`` 會建立" -"該 class 的一個新實例。Method 的參照被解析如下:對應的 class 屬性會被搜尋,如" -"果需要,沿著 base class 的繼承鍊往下走,如果這產生了一個函式物件,則該 " -"method 的參照是有效的。" +"關於 derived class 的實例化並沒有特別之處:``DerivedClassName()`` 會建立該 " +"class 的一個新實例。Method 的參照被解析如下:對應的 class 屬性會被搜尋,如果" +"需要,沿著 base class 的繼承鍊往下走,如果這產生了一個函式物件,則該 method " +"的參照是有效的。" #: ../../tutorial/classes.rst:604 msgid "" @@ -931,8 +931,8 @@ msgid "" "will be ``True`` only if ``obj.__class__`` is :class:`int` or some class " "derived from :class:`int`." msgstr "" -"使用 :func:`isinstance` 判斷一個實例的型別:\\ ``isinstance(obj, int)`` 只有" -"在 ``obj.__class__`` 是 :class:`int` 或衍伸自 :class:`int` 時,結果才會是 " +"使用 :func:`isinstance` 判斷一個實例的型別:``isinstance(obj, int)`` 只有在 " +"``obj.__class__`` 是 :class:`int` 或衍伸自 :class:`int` 時,結果才會是 " "``True``。" #: ../../tutorial/classes.rst:623 @@ -942,8 +942,8 @@ msgid "" "``issubclass(float, int)`` is ``False`` since :class:`float` is not a " "subclass of :class:`int`." msgstr "" -"使用 :func:`issubclass` 判斷 class 繼承:\\ ``issubclass(bool, int)`` 會是 " -"``True``,因為 :class:`bool` 是 :class:`int` 的 subclass(子類別)。但是,\\ " +"使用 :func:`issubclass` 判斷 class 繼承:``issubclass(bool, int)`` 會是 " +"``True``,因為 :class:`bool` 是 :class:`int` 的 subclass(子類別)。但是," "``issubclass(float, int)`` 是 ``False``,因為 :class:`float` 並不是 :class:" "`int` 的 subclass。" @@ -966,16 +966,16 @@ msgid "" "For most purposes, in the simplest cases, you can think of the search for " "attributes inherited from a parent class as depth-first, left-to-right, not " "searching twice in the same class where there is an overlap in the " -"hierarchy. Thus, if an attribute is not found in :class:`DerivedClassName`, " -"it is searched for in :class:`Base1`, then (recursively) in the base classes " -"of :class:`Base1`, and if it was not found there, it was searched for in :" -"class:`Base2`, and so on." +"hierarchy. Thus, if an attribute is not found in :class:`!DerivedClassName`, " +"it is searched for in :class:`!Base1`, then (recursively) in the base " +"classes of :class:`!Base1`, and if it was not found there, it was searched " +"for in :class:`!Base2`, and so on." msgstr "" "在大多數情況下,最簡單的例子裡,你可以這樣思考,對於繼承自 parent class(父類" "別)的屬性,其搜尋規則為:深度優先、從左到右、在階層裡重疊的相同 class 中不重" -"複搜尋。因此,假如有一個屬性在 :class:`DerivedClassName` 沒有被找到,則在 :" -"class:`Base1` 搜尋它,接著(遞迴地)在 :class:`Base1` 的 base class 中搜尋," -"假如在那裡又沒有找到的話,會在 :class:`Base2` 搜尋,依此類推。" +"複搜尋。因此,假如有一個屬性在 :class:`!DerivedClassName` 沒有被找到,則在 :" +"class:`!Base1` 搜尋它,接著(遞迴地)在 :class:`!Base1` 的 base class 中搜" +"尋,假如在那裡又沒有找到的話,會在 :class:`!Base2` 搜尋,依此類推。" #: ../../tutorial/classes.rst:652 msgid "" @@ -1007,13 +1007,13 @@ msgid "" msgstr "" "動態排序是必要的,因為多重繼承的所有情況都表現一或多的菱形關係(其中至少一個 " "parent class 可以從最底層 class 透過多個路徑存取)。例如,所有的 class 都繼承" -"自 :class:`object`\\ ,因此任何多重繼承的情況都提供了多個到達 :class:" -"`object` 的路徑。為了避免 base class 被多次存取,動態演算法以這些方式將搜尋順" -"序線性化 (linearize):保留每個 class 中規定的從左到右的順序、對每個 parent 只" -"會呼叫一次、使用單調的 (monotonic) 方式(意思是,一個 class 可以被 subclassed" -"(子類別化),而不會影響其 parent 的搜尋優先順序)。總之,這些特性使設計出可" -"靠又可擴充、具有多重繼承的 class 成為可能。更多資訊,請見 https://www.python." -"org/download/releases/2.3/mro/。" +"自 :class:`object`,因此任何多重繼承的情況都提供了多個到達 :class:`object` 的" +"路徑。為了避免 base class 被多次存取,動態演算法以這些方式將搜尋順序線性化 " +"(linearize):保留每個 class 中規定的從左到右的順序、對每個 parent 只會呼叫一" +"次、使用單調的 (monotonic) 方式(意思是,一個 class 可以被 subclassed(子類別" +"化),而不會影響其 parent 的搜尋優先順序)。總之,這些特性使設計出可靠又可擴" +"充、具有多重繼承的 class 成為可能。更多資訊,請見 https://www.python.org/" +"download/releases/2.3/mro/。" #: ../../tutorial/classes.rst:675 msgid "Private Variables" @@ -1118,29 +1118,30 @@ msgid "" "A piece of Python code that expects a particular abstract data type can " "often be passed a class that emulates the methods of that data type " "instead. For instance, if you have a function that formats some data from a " -"file object, you can define a class with methods :meth:`read` and :meth:`!" -"readline` that get the data from a string buffer instead, and pass it as an " -"argument." +"file object, you can define a class with methods :meth:`~io.TextIOBase.read` " +"and :meth:`~io.TextIOBase.readline` that get the data from a string buffer " +"instead, and pass it as an argument." msgstr "" "用來處理特殊抽象資料型別的一段 Python 程式碼,經常能以傳遞一個 class 來替代," "此 class 模擬該資料型別的多種 method。例如,如果你有一個函式,它會從一個檔案" -"物件來格式化某些資料,你也可以定義一個有 :meth:`read` 和 :meth:`!readline` " -"method 的 class 作為替代方式,從字串緩衝區取得資料,並將其作為引數來傳遞。" +"物件來格式化某些資料,你也可以定義一個有 :meth:`~io.TextIOBase.read` 和 :" +"meth:`~io.TextIOBase.readline` method 的 class 作為替代方式,從字串緩衝區取得" +"資料,並將其作為引數來傳遞。" -#: ../../tutorial/classes.rst:771 +#: ../../tutorial/classes.rst:772 msgid "" "Instance method objects have attributes, too: ``m.__self__`` is the instance " -"object with the method :meth:`m`, and ``m.__func__`` is the function object " +"object with the method :meth:`!m`, and ``m.__func__`` is the function object " "corresponding to the method." msgstr "" -"實例的 method 物件也具有屬性:``m.__self__`` 就是帶有 method :meth:`m` 的實例" -"物件,而 ``m.__func__`` 則是該 method 所對應的函式物件。" +"實例的 method 物件也具有屬性:``m.__self__`` 就是帶有 method :meth:`!m` 的實" +"例物件,而 ``m.__func__`` 則是該 method 所對應的函式物件。" -#: ../../tutorial/classes.rst:779 +#: ../../tutorial/classes.rst:780 msgid "Iterators" msgstr "疊代器 (Iterator)" -#: ../../tutorial/classes.rst:781 +#: ../../tutorial/classes.rst:782 msgid "" "By now you have probably noticed that most container objects can be looped " "over using a :keyword:`for` statement::" @@ -1150,7 +1151,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/classes.rst:795 +#: ../../tutorial/classes.rst:796 msgid "" "This style of access is clear, concise, and convenient. The use of " "iterators pervades and unifies Python. Behind the scenes, the :keyword:" @@ -1163,34 +1164,35 @@ msgid "" "func:`next` built-in function; this example shows how it all works::" msgstr "" "這種存取風格清晰、簡潔且方便。疊代器的使用在 Python 中處處可見且用法一致。在" -"幕後,\\ :keyword:`for` 陳述式會在容器物件上呼叫 :func:`iter`\\ 。該函式回傳" -"一個疊代器物件,此物件定義了 :meth:`~iterator.__next__` method,而此 method " -"會逐一存取容器中的元素。當元素用盡時,\\ :meth:`~iterator.__next__` 將引發 :" -"exc:`StopIteration` 例外,來通知 :keyword:`!for` 終止迴圈。你可以使用內建函" -"式 :func:`next` 來呼叫 :meth:`~iterator.__next__` method;這個例子展示了它的" -"運作方式:\n" +"幕後,:keyword:`for` 陳述式會在容器物件上呼叫 :func:`iter`。該函式回傳一個疊" +"代器物件,此物件定義了 :meth:`~iterator.__next__` method,而此 method 會逐一" +"存取容器中的元素。當元素用盡時,:meth:`~iterator.__next__` 將引發 :exc:" +"`StopIteration` 例外,來通知 :keyword:`!for` 終止迴圈。你可以使用內建函式 :" +"func:`next` 來呼叫 :meth:`~iterator.__next__` method;這個例子展示了它的運作" +"方式:\n" "\n" "::" -#: ../../tutorial/classes.rst:820 +#: ../../tutorial/classes.rst:821 msgid "" "Having seen the mechanics behind the iterator protocol, it is easy to add " -"iterator behavior to your classes. Define an :meth:`__iter__` method which " -"returns an object with a :meth:`~iterator.__next__` method. If the class " -"defines :meth:`__next__`, then :meth:`__iter__` can just return ``self``::" +"iterator behavior to your classes. Define an :meth:`~container.__iter__` " +"method which returns an object with a :meth:`~iterator.__next__` method. If " +"the class defines :meth:`!__next__`, then :meth:`!__iter__` can just return " +"``self``::" msgstr "" "看過疊代器協定的幕後機制後,在你的 class 加入疊代器的行為就很容易了。定義一" -"個 :meth:`__iter__` method 來回傳一個帶有 :meth:`~iterator.__next__` method " -"的物件。如果 class 已定義了 :meth:`__next__`\\ ,則 :meth:`__iter__` 可以只回" -"傳 ``self``:\n" +"個 :meth:`~container.__iter__` method 來回傳一個帶有 :meth:`~iterator." +"__next__` method 的物件。如果 class 已定義了 :meth:`!__next__`,則 :meth:`!" +"__iter__` 可以只回傳 ``self``:\n" "\n" "::" -#: ../../tutorial/classes.rst:857 +#: ../../tutorial/classes.rst:858 msgid "Generators" msgstr "產生器 (Generator)" -#: ../../tutorial/classes.rst:859 +#: ../../tutorial/classes.rst:860 msgid "" ":term:`Generators ` are a simple and powerful tool for creating " "iterators. They are written like regular functions but use the :keyword:" @@ -1206,18 +1208,18 @@ msgstr "" "\n" "::" -#: ../../tutorial/classes.rst:880 +#: ../../tutorial/classes.rst:881 msgid "" "Anything that can be done with generators can also be done with class-based " "iterators as described in the previous section. What makes generators so " -"compact is that the :meth:`__iter__` and :meth:`~generator.__next__` methods " -"are created automatically." +"compact is that the :meth:`~iterator.__iter__` and :meth:`~generator." +"__next__` methods are created automatically." msgstr "" "任何可以用產生器來完成的事,也能用以 class 為基礎的疊代器來完成,如同前一節的" -"描述。而讓產生器的程式碼更為精簡的原因是,\\ :meth:`__iter__` 和 :meth:" -"`~generator.__next__` method 會自動被建立。" +"描述。而讓產生器的程式碼更為精簡的原因是,:meth:`~iterator.__iter__` 和 :" +"meth:`~generator.__next__` method 會自動被建立。" -#: ../../tutorial/classes.rst:885 +#: ../../tutorial/classes.rst:886 msgid "" "Another key feature is that the local variables and execution state are " "automatically saved between calls. This made the function easier to write " @@ -1228,7 +1230,7 @@ msgstr "" "函式比使用 ``self.index`` 和 ``self.data`` 這種實例變數的方式更容易編寫且更為" "清晰。" -#: ../../tutorial/classes.rst:890 +#: ../../tutorial/classes.rst:891 msgid "" "In addition to automatic method creation and saving program state, when " "generators terminate, they automatically raise :exc:`StopIteration`. In " @@ -1236,14 +1238,13 @@ msgid "" "effort than writing a regular function." msgstr "" "除了會自動建立 method 和儲存程式狀態,當產生器終止時,它們還會自動引發 :exc:" -"`StopIteration`\\ 。這些特性結合在一起,使建立疊代器能與編寫常規函式一樣容" -"易。" +"`StopIteration`。這些特性結合在一起,使建立疊代器能與編寫常規函式一樣容易。" -#: ../../tutorial/classes.rst:899 +#: ../../tutorial/classes.rst:900 msgid "Generator Expressions" msgstr "產生器運算式" -#: ../../tutorial/classes.rst:901 +#: ../../tutorial/classes.rst:902 msgid "" "Some simple generators can be coded succinctly as expressions using a syntax " "similar to list comprehensions but with parentheses instead of square " @@ -1258,18 +1259,18 @@ msgstr "" "產生器定義相比,程式碼較精簡但功能較少,也比等效的 list comprehension 更為節" "省記憶體。" -#: ../../tutorial/classes.rst:908 +#: ../../tutorial/classes.rst:909 msgid "Examples::" msgstr "" "例如:\n" "\n" "::" -#: ../../tutorial/classes.rst:929 +#: ../../tutorial/classes.rst:930 msgid "Footnotes" msgstr "註解" -#: ../../tutorial/classes.rst:930 +#: ../../tutorial/classes.rst:931 msgid "" "Except for one thing. Module objects have a secret read-only attribute " "called :attr:`~object.__dict__` which returns the dictionary used to " @@ -1278,10 +1279,10 @@ msgid "" "abstraction of namespace implementation, and should be restricted to things " "like post-mortem debuggers." msgstr "" -"有一個例外。模組物件有一個秘密的唯讀屬性,稱為 :attr:`~object.__dict__`\\ ," -"它回傳用於實作模組命名空間的 dictionary;\\ :attr:`~object.__dict__` 這個名稱" -"是一個屬性但不是全域名稱。顯然,使用此屬性將違反命名空間實作的抽象化,而應該" -"僅限用於事後除錯器 (post-mortem debugger) 之類的東西。" +"有一個例外。模組物件有一個秘密的唯讀屬性,稱為 :attr:`~object.__dict__`,它回" +"傳用於實作模組命名空間的 dictionary;:attr:`~object.__dict__` 這個名稱是一個" +"屬性但不是全域名稱。顯然,使用此屬性將違反命名空間實作的抽象化,而應該僅限用" +"於事後除錯器 (post-mortem debugger) 之類的東西。" #: ../../tutorial/classes.rst:347 msgid "object" diff --git a/tutorial/controlflow.po b/tutorial/controlflow.po index 17d4264089..0b8dd67511 100644 --- a/tutorial/controlflow.po +++ b/tutorial/controlflow.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-08-22 00:03+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-" @@ -199,16 +199,15 @@ msgid "" "The :keyword:`break` statement breaks out of the innermost enclosing :" "keyword:`for` or :keyword:`while` loop." msgstr "" -":keyword:`break` 陳述式,終止包含它的最內部 :keyword:`for` 或 :" -"keyword:`while` 迴圈。" +":keyword:`break` 陳述式,終止包含它的最內部 :keyword:`for` 或 :keyword:" +"`while` 迴圈。" #: ../../tutorial/controlflow.rst:169 msgid "" "A :keyword:`!for` or :keyword:`!while` loop can include an :keyword:`!else` " "clause." msgstr "" -":keyword:`!for` 和 :keyword:`!while` 迴圈可帶有一個 :keyword:`!else` " -"子句" +":keyword:`!for` 和 :keyword:`!while` 迴圈可帶有一個 :keyword:`!else` 子句" #: ../../tutorial/controlflow.rst:171 msgid "" @@ -646,18 +645,19 @@ msgid "" "the object's type. Different types define different methods. Methods of " "different types may have the same name without causing ambiguity. (It is " "possible to define your own object types and methods, using *classes*, see :" -"ref:`tut-classes`) The method :meth:`append` shown in the example is defined " -"for list objects; it adds a new element at the end of the list. In this " -"example it is equivalent to ``result = result + [a]``, but more efficient." +"ref:`tut-classes`) The method :meth:`~list.append` shown in the example is " +"defined for list objects; it adds a new element at the end of the list. In " +"this example it is equivalent to ``result = result + [a]``, but more " +"efficient." msgstr "" "``result.append(a)`` 陳述式呼叫了一個 list 物件 ``result`` 的 *method(方法)" -"*\\ 。method 為「屬於」一個物件的函式,命名規則為 ``obj.methodname``\\ ,其" -"中 ``obj`` 為某個物件(亦可為一運算式),而 ``methodname`` 為該 method 的名" -"稱,並由該物件的型別所定義。不同的型別定義不同的 method。不同型別的 method 可" -"以擁有一樣的名稱而不會讓 Python 混淆。(你可以使用 *class*\\ (類別)定義自己" -"的物件型別和 method,見 :ref:`tut-classes`\\ )範例中的 :meth:`append` " +"*\\ 。method 為「屬於」一個物件的函式,命名規則為 ``obj.methodname``,其中 " +"``obj`` 為某個物件(亦可為一運算式),而 ``methodname`` 為該 method 的名稱," +"並由該物件的型別所定義。不同的型別定義不同的 method。不同型別的 method 可以擁" +"有一樣的名稱而不會讓 Python 混淆。(你可以使用 *class*\\ (類別)定義自己的物" +"件型別和 method,見 :ref:`tut-classes`\\ )範例中的 :meth:`~list.append` " "method 定義在 list 物件中;它會在該 list 的末端加入一個新的元素。這個例子等同" -"於 ``result = result + [a]``\\ ,但更有效率。" +"於 ``result = result + [a]``,但更有效率。" #: ../../tutorial/controlflow.rst:545 msgid "More on Defining Functions" @@ -712,8 +712,7 @@ msgstr "" msgid "" "This example also introduces the :keyword:`in` keyword. This tests whether " "or not a sequence contains a certain value." -msgstr "" -"此例也使用了關鍵字 :keyword:`in`\\ ,用於測試序列中是否包含某個特定值。" +msgstr "此例也使用了關鍵字 :keyword:`in`,用於測試序列中是否包含某個特定值。" #: ../../tutorial/controlflow.rst:584 msgid "" @@ -726,7 +725,7 @@ msgstr "" #: ../../tutorial/controlflow.rst:595 msgid "will print ``5``." -msgstr "將會輸出 ``5``\\ 。" +msgstr "將會輸出 ``5``。" #: ../../tutorial/controlflow.rst:597 msgid "" @@ -764,8 +763,8 @@ msgid "" "argument>` of the form ``kwarg=value``. For instance, the following " "function::" msgstr "" -"函式也可以使用\\ :term:`關鍵字引數 `\\ ,以 " -"``kwarg=value`` 的形式呼叫。舉例來說,以下函式:\n" +"函式也可以使用\\ :term:`關鍵字引數 `,以 ``kwarg=value`` 的" +"形式呼叫。舉例來說,以下函式:\n" "\n" "::" @@ -816,9 +815,9 @@ msgid "" "occur before ``**name``.) For example, if we define a function like this::" msgstr "" "當最後一個參數為 ``**name`` 形式時,它接收一個 dictionary(字典,詳見 :ref:" -"`typesmapping`\\ ),該字典包含所有可對應形式參數以外的關鍵字引數。\\ " -"``**name`` 可以與 ``*name`` 參數(下一小節介紹)組合使用,\\ ``*name`` 接收一" -"個 :ref:`tuple `\\ ,該 tuple 包含一般參數以外的位置引數(\\ " +"`typesmapping`\\ ),該字典包含所有可對應形式參數以外的關鍵字引數。" +"``**name`` 可以與 ``*name`` 參數(下一小節介紹)組合使用,``*name`` 接收一" +"個 :ref:`tuple `,該 tuple 包含一般參數以外的位置引數(\\ " "``*name`` 必須出現在 ``**name`` 前面)。例如,若我們定義這樣的函式:\n" "\n" "::" @@ -921,7 +920,7 @@ msgid "" "the first *keyword-only* parameter." msgstr "" "要把參數標記為\\ *僅限關鍵字*\\ ,表明參數必須以關鍵字引數傳遞,必須在引數列" -"表中第一個\\ *僅限關鍵字*\\ 參數前放上 ``*``\\ 。" +"表中第一個\\ *僅限關鍵字*\\ 參數前放上 ``*``。" #: ../../tutorial/controlflow.rst:771 msgid "Function Examples" @@ -952,7 +951,7 @@ msgid "" "The second function ``pos_only_arg`` is restricted to only use positional " "parameters as there is a ``/`` in the function definition::" msgstr "" -"第二個函式 ``pos_only_arg`` 的函式定義中有 ``/``\\ ,因此僅限使用位置參數:\n" +"第二個函式 ``pos_only_arg`` 的函式定義中有 ``/``,因此僅限使用位置參數:\n" "\n" "::" @@ -1132,10 +1131,10 @@ msgid "" "definitions, lambda functions can reference variables from the containing " "scope::" msgstr "" -":keyword:`lambda` 關鍵字用於建立小巧的匿名函式。\\ ``lambda a, b: a+b`` 函式" -"返回兩個引數的和。Lambda 函式可用於任何需要函式物件的地方。在語法上,它們被限" -"定只能是單一運算式。在語義上,它就是一個普通函式定義的語法糖 (syntactic " -"sugar)。與巢狀函式定義一樣,lambda 函式可以從包含它的作用域中引用變數:\n" +":keyword:`lambda` 關鍵字用於建立小巧的匿名函式。``lambda a, b: a+b`` 函式返回" +"兩個引數的和。Lambda 函式可用於任何需要函式物件的地方。在語法上,它們被限定只" +"能是單一運算式。在語義上,它就是一個普通函式定義的語法糖 (syntactic sugar)。" +"與巢狀函式定義一樣,lambda 函式可以從包含它的作用域中引用變數:\n" "\n" "::" diff --git a/tutorial/datastructures.po b/tutorial/datastructures.po index 193e22cf10..b061e79147 100644 --- a/tutorial/datastructures.po +++ b/tutorial/datastructures.po @@ -14,7 +14,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-02 00:20+0000\n" +"POT-Creation-Date: 2023-08-22 00:03+0000\n" "PO-Revision-Date: 2022-11-12 15:11+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -176,14 +176,14 @@ msgstr "將 List 作為 Stack(堆疊)使用" msgid "" "The list methods make it very easy to use a list as a stack, where the last " "element added is the first element retrieved (\"last-in, first-out\"). To " -"add an item to the top of the stack, use :meth:`append`. To retrieve an " -"item from the top of the stack, use :meth:`pop` without an explicit index. " -"For example::" +"add an item to the top of the stack, use :meth:`~list.append`. To retrieve " +"an item from the top of the stack, use :meth:`~list.pop` without an explicit " +"index. For example::" msgstr "" "List 的操作方法使得它非常簡單可以用來實作 stack(堆疊)。Stack 為一個遵守最後" "加入元素最先被取回(後進先出,\"last-in, first-out\")規則的資料結構。你可以" -"使用方法 :meth:`append` 將一個項目放到堆疊的頂層。而使用方法 :meth:`pop` 且不" -"給定索引值去取得堆疊最上面的項目。舉例而言:\n" +"使用方法 :meth:`~list.append` 將一個項目放到堆疊的頂層。而使用方法 :meth:" +"`~list.pop` 且不給定索引值去取得堆疊最上面的項目。舉例而言:\n" "\n" "::" @@ -371,15 +371,15 @@ msgstr ":keyword:`!del` 陳述式" #: ../../tutorial/datastructures.rst:343 msgid "" "There is a way to remove an item from a list given its index instead of its " -"value: the :keyword:`del` statement. This differs from the :meth:`pop` " -"method which returns a value. The :keyword:`!del` statement can also be " -"used to remove slices from a list or clear the entire list (which we did " +"value: the :keyword:`del` statement. This differs from the :meth:`~list." +"pop` method which returns a value. The :keyword:`!del` statement can also " +"be used to remove slices from a list or clear the entire list (which we did " "earlier by assignment of an empty list to the slice). For example::" msgstr "" "有一個方法可以藉由索引而不是值來刪除 list 中的項目:\\ :keyword:`del` 陳述" -"式。這和 :meth:`pop` method 傳回一個值不同,\\ :keyword:`!del` 陳述式可以用來" -"刪除 list 中的片段或者清空整個 list(我們之前藉由指派一個空的 list 給想刪除的" -"片段來完成這件事)。例如:\n" +"式。這和 :meth:`~list.pop` method 傳回一個值不同,\\ :keyword:`!del` 陳述式可" +"以用來刪除 list 中的片段或者清空整個 list(我們之前藉由指派一個空的 list 給想" +"刪除的片段來完成這件事)。例如:\n" "\n" "::" @@ -552,7 +552,7 @@ msgid "" "tuple contains any mutable object either directly or indirectly, it cannot " "be used as a key. You can't use lists as keys, since lists can be modified " "in place using index assignments, slice assignments, or methods like :meth:" -"`append` and :meth:`extend`." +"`~list.append` and :meth:`~list.extend`." msgstr "" "下一個常用的 Python 內建資料類型為 *dictionary*\\ (請參考\\ :ref:" "`typesmapping`\\ )。 Dictionary 有時被稱為「關聯記憶體」(associative " @@ -561,7 +561,8 @@ msgstr "" "和數字都可以當作鍵。Tuple 也可以當作鍵,如果他們只含有字串、數字或 tuple;若" "一個 tuple 直接或間接地含有任何可變的物件,它就不能當作鍵。你無法使用 list 當" "作鍵,因為 list 可以經由索引指派 (index assignment)、切片指派 (slice " -"assignment) 或是像 :meth:`append` 和 :meth:`extend` 等 method 被修改。" +"assignment) 或是像 :meth:`~list.append` 和 :meth:`~list.extend` 等 method 被" +"修改。" #: ../../tutorial/datastructures.rst:507 msgid "" @@ -640,10 +641,10 @@ msgstr "迴圈技巧" #: ../../tutorial/datastructures.rst:569 msgid "" "When looping through dictionaries, the key and corresponding value can be " -"retrieved at the same time using the :meth:`items` method. ::" +"retrieved at the same time using the :meth:`~dict.items` method. ::" msgstr "" -"當對 dictionary 作迴圈時,鍵以及其對應的值可以藉由使用 :meth:`items` method " -"來同時取得:\n" +"當對 dictionary 作迴圈時,鍵以及其對應的值可以藉由使用 :meth:`~dict.items` " +"method 來同時取得:\n" "\n" "::" diff --git a/tutorial/inputoutput.po b/tutorial/inputoutput.po index e3081e1fab..0189e81ec1 100644 --- a/tutorial/inputoutput.po +++ b/tutorial/inputoutput.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-08-22 00:03+0000\n" "PO-Revision-Date: 2022-10-05 10:26+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -41,14 +41,15 @@ msgstr "更華麗的輸出格式" #: ../../tutorial/inputoutput.rst:17 msgid "" "So far we've encountered two ways of writing values: *expression statements* " -"and the :func:`print` function. (A third way is using the :meth:`write` " -"method of file objects; the standard output file can be referenced as ``sys." -"stdout``. See the Library Reference for more information on this.)" +"and the :func:`print` function. (A third way is using the :meth:`~io." +"TextIOBase.write` method of file objects; the standard output file can be " +"referenced as ``sys.stdout``. See the Library Reference for more information " +"on this.)" msgstr "" "目前為止我們已經學過兩種寫值的方式:\\ *運算式陳述 (expression statements)* " -"與 :func:`print` 函式。(第三種方法是使用檔案物件的 :meth:`write` 方法;標準" -"輸出的檔案是使用 ``sys.stdout`` 來達成的。詳細的資訊請參考對應的函式庫說" -"明。)" +"與 :func:`print` 函式。(第三種方法是使用檔案物件的 :meth:`~io.TextIOBase." +"write` 方法;標準輸出的檔案是使用 ``sys.stdout`` 來達成的。詳細的資訊請參考對" +"應的函式庫說明。)" #: ../../tutorial/inputoutput.rst:22 msgid "" @@ -594,12 +595,12 @@ msgstr "" #: ../../tutorial/inputoutput.rst:459 msgid "" -"File objects have some additional methods, such as :meth:`~file.isatty` and :" -"meth:`~file.truncate` which are less frequently used; consult the Library " -"Reference for a complete guide to file objects." +"File objects have some additional methods, such as :meth:`~io.IOBase.isatty` " +"and :meth:`~io.IOBase.truncate` which are less frequently used; consult the " +"Library Reference for a complete guide to file objects." msgstr "" -"檔案物件還有一些附加的 method,像是較不常使用的 :meth:`~file.isatty` 和 :" -"meth:`~file.truncate`\\ ;檔案物件的完整指南詳見程式庫參考手冊。" +"檔案物件還有一些附加的 method,像是較不常使用的 :meth:`~io.IOBase.isatty` " +"和 :meth:`~io.IOBase.truncate`\\ ;檔案物件的完整指南詳見程式庫參考手冊。" #: ../../tutorial/inputoutput.rst:467 msgid "Saving structured data with :mod:`json`" @@ -608,16 +609,17 @@ msgstr "使用 :mod:`json` 儲存結構化資料" #: ../../tutorial/inputoutput.rst:471 msgid "" "Strings can easily be written to and read from a file. Numbers take a bit " -"more effort, since the :meth:`read` method only returns strings, which will " -"have to be passed to a function like :func:`int`, which takes a string like " -"``'123'`` and returns its numeric value 123. When you want to save more " -"complex data types like nested lists and dictionaries, parsing and " -"serializing by hand becomes complicated." -msgstr "" -"字串可以簡單地從檔案中被寫入和讀取。數字則稍嫌麻煩,因為 :meth:`read` method " -"只回傳字串,這些字串必須傳遞給像 :func:`int` 這樣的函式,它接受 ``'123'`` 這" -"樣的字串,並回傳數值 123。當你想儲存像是巢狀 list 和 dictionary(字典)等複雜" -"的資料類型時,手動剖析 (parsing) 和序列化 (serializing) 就變得複雜。" +"more effort, since the :meth:`~io.TextIOBase.read` method only returns " +"strings, which will have to be passed to a function like :func:`int`, which " +"takes a string like ``'123'`` and returns its numeric value 123. When you " +"want to save more complex data types like nested lists and dictionaries, " +"parsing and serializing by hand becomes complicated." +msgstr "" +"字串可以簡單地從檔案中被寫入和讀取。數字則稍嫌麻煩,因為 :meth:`~io." +"TextIOBase.read` method 只回傳字串,這些字串必須傳遞給像 :func:`int` 這樣的函" +"式,它接受 ``'123'`` 這樣的字串,並回傳數值 123。當你想儲存像是巢狀 list 和 " +"dictionary(字典)等複雜的資料類型時,手動剖析 (parsing) 和序列化 " +"(serializing) 就變得複雜。" #: ../../tutorial/inputoutput.rst:478 msgid "" diff --git a/tutorial/modules.po b/tutorial/modules.po index 14e3459cad..fa8bfdde9f 100644 --- a/tutorial/modules.po +++ b/tutorial/modules.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-08-22 00:03+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-" @@ -66,9 +66,9 @@ msgid "" "to create a file called :file:`fibo.py` in the current directory with the " "following contents::" msgstr "" -"模組是指包含 Python 定義和語句的檔案,檔案名稱是模組名稱加上 :file:`.py`\\ 。" -"在模組中,模組的名稱(作為字串)會是全域變數 ``__name__`` 的值。例如,用您喜" -"歡的文字編輯器在資料夾中創一個名為 :file:`fibo.py` 的檔案,內容如下:\n" +"模組是指包含 Python 定義和語句的檔案,檔案名稱是模組名稱加上 :file:`.py`。在" +"模組中,模組的名稱(作為字串)會是全域變數 ``__name__`` 的值。例如,用您喜歡" +"的文字編輯器在資料夾中創一個名為 :file:`fibo.py` 的檔案,內容如下:\n" "\n" "::" @@ -129,8 +129,8 @@ msgstr "" "每個模組都有它自己的私有命名空間 (namespace),模組內定義的函式會把該模組的私" "有符號表當成全域命名空間使用。因此,模組的作者可以在模組中使用全域變數,而不" "必擔心和使用者的全域變數發生意外的名稱衝突。另一方面,如果你知道自己在做什" -"麼,你可以用這個方式取用模組的全域變數,以和引用函式一樣的寫法,\\ ``modname." -"itemname``\\ 。" +"麼,你可以用這個方式取用模組的全域變數,以和引用函式一樣的寫法,``modname." +"itemname``。" #: ../../tutorial/modules.rst:86 msgid "" @@ -176,9 +176,9 @@ msgid "" "an unknown set of names into the interpreter, possibly hiding some things " "you have already defined." msgstr "" -"這個寫法會 import 模組中所有的名稱,除了使用底線(\\ ``_``\\ )開頭的名稱。大" -"多數情況下,Python 程式設計師不大使用這個功能,因為它在直譯器中引入了一組未知" -"的名稱,並且可能覆蓋了某些您已經定義的內容。" +"這個寫法會 import 模組中所有的名稱,除了使用底線 (``_``) 開頭的名稱。大多數情" +"況下,Python 程式設計師不大使用這個功能,因為它在直譯器中引入了一組未知的名" +"稱,並且可能覆蓋了某些您已經定義的內容。" #: ../../tutorial/modules.rst:112 msgid "" @@ -195,8 +195,8 @@ msgid "" "If the module name is followed by :keyword:`!as`, then the name following :" "keyword:`!as` is bound directly to the imported module." msgstr "" -"如果模組名稱後面出現 :keyword:`!as`\\ ,則 :keyword:`!as` 之後的名稱將直接和" -"被 import 模組綁定在一起。" +"如果模組名稱後面出現 :keyword:`!as`,則 :keyword:`!as` 之後的名稱將直接和被 " +"import 模組綁定在一起。" #: ../../tutorial/modules.rst:125 msgid "" @@ -224,8 +224,8 @@ msgid "" msgstr "" "出於效率原因,每個模組在每個直譯器 session 中僅會被 import 一次。因此,如果您" "更改了模組,則必須重啟直譯器——或者,如果只是一個想要在互動模式下測試的模組," -"可以使用 :func:`importlib.reload`\\ 。例如:\\ ``import importlib; importlib." -"reload(modulename)``\\ 。" +"可以使用 :func:`importlib.reload`。例如:``import importlib; importlib." +"reload(modulename)``。" #: ../../tutorial/modules.rst:147 msgid "Executing modules as scripts" @@ -245,7 +245,7 @@ msgid "" "this code at the end of your module::" msgstr "" "如同使用 import 指令,模組中的程式碼會被執行,但 ``__name__`` 被設為 " -"``\"__main__\"``\\ 。這意味著,透過在模組的末尾添加以下程式碼:\n" +"``\"__main__\"``。這意味著,透過在模組的末尾添加以下程式碼:\n" "\n" "::" @@ -280,16 +280,16 @@ msgstr "模組的搜尋路徑" #: ../../tutorial/modules.rst:186 msgid "" -"When a module named :mod:`spam` is imported, the interpreter first searches " +"When a module named :mod:`!spam` is imported, the interpreter first searches " "for a built-in module with that name. These module names are listed in :data:" "`sys.builtin_module_names`. If not found, it then searches for a file named :" "file:`spam.py` in a list of directories given by the variable :data:`sys." "path`. :data:`sys.path` is initialized from these locations:" msgstr "" -"Import 一個名為 :mod:`spam` 的模組時,直譯器首先會搜尋具有該名稱的內建模組。" +"Import 一個名為 :mod:`!spam` 的模組時,直譯器首先會搜尋具有該名稱的內建模組。" "模組名稱列在 :data:`sys.builtin_module_names` 當中。如果找不到,接下來會在變" "數 :data:`sys.path` 所給定的資料夾清單之中,搜尋一個名為 :file:`spam.py` 的檔" -"案。\\ :data:`sys.path` 從這些位置開始進行初始化:" +"案。:data:`sys.path` 從這些位置開始進行初始化:" #: ../../tutorial/modules.rst:192 msgid "" @@ -336,9 +336,9 @@ msgid "" "library directory. This is an error unless the replacement is intended. See " "section :ref:`tut-standardmodules` for more information." msgstr "" -"初始化之後,Python 程式可以修改 :data:`sys.path`\\ 。執行中腳本的所在資料夾會" -"在搜尋路徑的開頭,在標準函式庫路徑之前。這代表該資料夾中的腳本會優先被載入," -"而不是函式庫資料夾中相同名稱的模組。除非是有意要做這樣的替換,否則這是一個錯" +"初始化之後,Python 程式可以修改 :data:`sys.path`。執行中腳本的所在資料夾會在" +"搜尋路徑的開頭,在標準函式庫路徑之前。這代表該資料夾中的腳本會優先被載入,而" +"不是函式庫資料夾中相同名稱的模組。除非是有意要做這樣的替換,否則這是一個錯" "誤。 請參見\\ :ref:`tut-standardmodules`\\ 以瞭解更多資訊。" #: ../../tutorial/modules.rst:219 @@ -356,10 +356,10 @@ msgid "" "different releases and different versions of Python to coexist." msgstr "" "為了加快載入模組的速度,Python 將每個模組的編譯版本暫存在 ``__pycache__`` 資" -"料夾下,並命名為 :file:`module.{version}.pyc`\\ , 這裡的 version 是編譯後的" -"檔案的格式名稱,且名稱通常會包含 Python 的版本編號。例如,在 CPython 3.3 中," -"spam.py 的編譯版本將被暫存為 ``__pycache__/spam.cpython-33.pyc``\\ 。此命名準" -"則可以讓來自不同版本的編譯模組和 Python 的不同版本同時共存。" +"料夾下,並命名為 :file:`module.{version}.pyc`, 這裡的 version 是編譯後的檔案" +"的格式名稱,且名稱通常會包含 Python 的版本編號。例如,在 CPython 3.3 中," +"spam.py 的編譯版本將被暫存為 ``__pycache__/spam.cpython-33.pyc``。此命名準則" +"可以讓來自不同版本的編譯模組和 Python 的不同版本同時共存。" #: ../../tutorial/modules.rst:229 msgid "" @@ -425,7 +425,7 @@ msgstr "模組 :mod:`compileall` 可以為資料夾中的所有模組創建 .pyc msgid "" "There is more detail on this process, including a flow chart of the " "decisions, in :pep:`3147`." -msgstr "更多的細節,包括決策流程圖,請參考\\ :pep:`3147`\\ 。" +msgstr "更多的細節,包括決策流程圖,請參考\\ :pep:`3147`。" #: ../../tutorial/modules.rst:265 msgid "Standard Modules" @@ -449,9 +449,9 @@ msgstr "" "手冊」(簡稱為「函式庫參考手冊」)。有些模組是直譯器中內建的;它們使一些不屬" "於語言核心但依然內建的運算得以存取,其目的是為了提高效率,或提供作業系統基本" "操作(例如系統呼叫)。這些模組的集合是一個組態選項,它們取決於底層平台。例" -"如:\\ :mod:`winreg` 模組僅供 Windows 使用。值得注意的模組是 :mod:`sys`\\ ," -"它被內建在每個 Python 直譯器中。變數 ``sys.ps1`` 和 ``sys.ps2`` 則用來定義" -"主、次提示字元的字串:\n" +"如::mod:`winreg` 模組僅供 Windows 使用。值得注意的模組是 :mod:`sys`,它被內" +"建在每個 Python 直譯器中。變數 ``sys.ps1`` 和 ``sys.ps2`` 則用來定義主、次提" +"示字元的字串:\n" "\n" "::" @@ -493,7 +493,7 @@ msgstr "" msgid "" "Without arguments, :func:`dir` lists the names you have defined currently::" msgstr "" -"沒有給引數時,\\ :func:`dir` 列出目前已定義的名稱:\n" +"沒有給引數時,:func:`dir` 列出目前已定義的名稱:\n" "\n" "::" @@ -520,15 +520,15 @@ msgstr "套件 (Package)" #: ../../tutorial/modules.rst:391 msgid "" "Packages are a way of structuring Python's module namespace by using " -"\"dotted module names\". For example, the module name :mod:`A.B` designates " -"a submodule named ``B`` in a package named ``A``. Just like the use of " -"modules saves the authors of different modules from having to worry about " -"each other's global variable names, the use of dotted module names saves the " -"authors of multi-module packages like NumPy or Pillow from having to worry " -"about each other's module names." +"\"dotted module names\". For example, the module name :mod:`!A.B` " +"designates a submodule named ``B`` in a package named ``A``. Just like the " +"use of modules saves the authors of different modules from having to worry " +"about each other's global variable names, the use of dotted module names " +"saves the authors of multi-module packages like NumPy or Pillow from having " +"to worry about each other's module names." msgstr "" "套件是一種使用「點分隔模組名稱」組織 Python 模組命名空間的方法。例如,模組名" -"稱 :mod:`A.B` 表示套件 ``A`` 中名為 ``B`` 的子模組。正如模組使用時,不同模組" +"稱 :mod:`!A.B` 表示套件 ``A`` 中名為 ``B`` 的子模組。正如模組使用時,不同模組" "的作者不需擔心與其他模組的全域變數名稱重複,點分隔模組名稱的使用,也讓多模組" "套件(像 NumPy 或 Pillow)的作者們不須擔心其他套件的模組名稱。" @@ -547,12 +547,11 @@ msgid "" "terms of a hierarchical filesystem):" msgstr "" "假設你想設計一個能統一處理音訊檔案及音訊數據的模組集(「套件」)。因為音訊檔" -"案有很多的不同的格式(通常以它們的副檔名來辨識,例如:\\ :file:`." -"wav`\\ ,\\ :file:`.aiff`\\ ,\\ :file:`.au`\\ ),因此,為了不同檔案格式之間" -"的轉換,你會需要建立和維護一個不斷增長的模組集合。為了要達成對音訊數據的許多" -"不同作業(例如,音訊混合、增加回聲、套用等化器功能、創造人工立體音效),你將" -"編寫一系列無止盡的模組來執行這些作業。以下是你的套件可能的架構(以階層式檔案" -"系統的方式表示):" +"案有很多的不同的格式(通常以它們的副檔名來辨識,例如::file:`.wav`、:file:`." +"aiff`、:file:`.au`\\ ),因此,為了不同檔案格式之間的轉換,你會需要建立和維護" +"一個不斷增長的模組集合。為了要達成對音訊數據的許多不同作業(例如,音訊混合、" +"增加回聲、套用等化器功能、創造人工立體音效),你將編寫一系列無止盡的模組來執" +"行這些作業。以下是你的套件可能的架構(以階層式檔案系統的方式表示):" #: ../../tutorial/modules.rst:436 msgid "" @@ -571,7 +570,7 @@ msgid "" msgstr "" "目錄中必須含有 :file:`__init__.py` 檔案,才會被 Pyhon 當成套件;這樣可以避免" "一些以常用名稱命名(例如 ``string``\\ )的目錄,無意中隱藏了較晚出現在模組搜" -"尋路徑中的有效模組。在最簡單的情況,\\ :file:`__init__.py` 可以只是一個空白檔" +"尋路徑中的有效模組。在最簡單的情況,:file:`__init__.py` 可以只是一個空白檔" "案;但它也可以執行套件的初始化程式碼,或設置 ``__all__`` 變數,之後會詳述。" #: ../../tutorial/modules.rst:446 @@ -585,10 +584,10 @@ msgstr "" #: ../../tutorial/modules.rst:451 msgid "" -"This loads the submodule :mod:`sound.effects.echo`. It must be referenced " +"This loads the submodule :mod:`!sound.effects.echo`. It must be referenced " "with its full name. ::" msgstr "" -"這樣就載入了子模組 :mod:`sound.effects.echo`\\ 。引用時必須用它的全名:\n" +"這樣就載入了子模組 :mod:`!sound.effects.echo`。引用時必須用它的全名:\n" "\n" "::" @@ -601,11 +600,11 @@ msgstr "" #: ../../tutorial/modules.rst:460 msgid "" -"This also loads the submodule :mod:`echo`, and makes it available without " +"This also loads the submodule :mod:`!echo`, and makes it available without " "its package prefix, so it can be used as follows::" msgstr "" -"這段程式碼一樣可以載入子模組 :mod:`echo`\\ ,並且不加套件前綴也可以使用,因此" -"能以如下方式使用:\n" +"這段程式碼一樣可以載入子模組 :mod:`!echo`,並且不加套件前綴也可以使用,因此能" +"以如下方式使用:\n" "\n" "::" @@ -620,10 +619,10 @@ msgstr "" #: ../../tutorial/modules.rst:469 msgid "" -"Again, this loads the submodule :mod:`echo`, but this makes its function :" -"func:`echofilter` directly available::" +"Again, this loads the submodule :mod:`!echo`, but this makes its function :" +"func:`!echofilter` directly available::" msgstr "" -"同樣地,這樣也會載入子模組 :mod:`echo`\\ ,但它的函式 :func:`echofilter` 就可" +"同樣地,這樣也會載入子模組 :mod:`!echo`,但它的函式 :func:`!echofilter` 就可" "以直接使用:\n" "\n" "::" @@ -682,11 +681,11 @@ msgid "" "importing \\* from their package. For example, the file :file:`sound/" "effects/__init__.py` could contain the following code::" msgstr "" -"唯一的解法是由套件作者為套件提供明確的索引。\\ :keyword:`import` 陳述式使用以" -"下慣例:如果套件的 :file:`__init__.py` 程式碼有定義一個名為 ``__all__`` 的 " +"唯一的解法是由套件作者為套件提供明確的索引。:keyword:`import` 陳述式使用以下" +"慣例:如果套件的 :file:`__init__.py` 程式碼有定義一個名為 ``__all__`` 的 " "list,若遇到 ``from package import *`` 的時候,它就會是要被 import 的模組名" "稱。發布套件的新版本時,套件作者可自行決定是否更新此 list。如果套件作者認為沒" -"有人會從他的套件中 import \\*,他也可能會決定不支援這個 list。舉例來說,\\ :" +"有人會從他的套件中 import \\*,他也可能會決定不支援這個 list。舉例來說,:" "file:`sound/effects/__init__.py` 檔案可包含以下程式碼:\n" "\n" "::" @@ -694,10 +693,10 @@ msgstr "" #: ../../tutorial/modules.rst:512 msgid "" "This would mean that ``from sound.effects import *`` would import the three " -"named submodules of the :mod:`sound.effects` package." +"named submodules of the :mod:`!sound.effects` package." msgstr "" -"意思是,\\ ``from sound.effects import *`` 將會 import :mod:`sound.effects` " -"套件中,這三個被提名的子模組。" +"意思是,``from sound.effects import *`` 將會 import :mod:`!sound.effects` 套" +"件中,這三個被提名的子模組。" #: ../../tutorial/modules.rst:515 msgid "" @@ -712,33 +711,33 @@ msgstr "" #: ../../tutorial/modules.rst:531 msgid "" "If ``__all__`` is not defined, the statement ``from sound.effects import *`` " -"does *not* import all submodules from the package :mod:`sound.effects` into " -"the current namespace; it only ensures that the package :mod:`sound.effects` " -"has been imported (possibly running any initialization code in :file:" -"`__init__.py`) and then imports whatever names are defined in the package. " -"This includes any names defined (and submodules explicitly loaded) by :file:" -"`__init__.py`. It also includes any submodules of the package that were " -"explicitly loaded by previous :keyword:`import` statements. Consider this " -"code::" -msgstr "" -"如果 ``__all__`` 沒有被定義,\\ ``from sound.effects import *`` 陳述式\\ *並" -"不會*\\ 把 :mod:`sound.effects` 套件中所有子模組都 import 到當前的命名空間;" -"它只保證 :mod:`sound.effects` 套件有被 import(可能會運行 :file:`__init__." -"py` 中的初始化程式碼),然後 import 套件中被定義的全部名稱。這包含 :file:" -"`__init__.py` 定義(以及被明確載入的子模組)的任何名稱。它也包括任何之前被 :" -"keyword:`import` 陳述式明確載入的套件子模組。請看以下程式碼:\n" +"does *not* import all submodules from the package :mod:`!sound.effects` into " +"the current namespace; it only ensures that the package :mod:`!sound." +"effects` has been imported (possibly running any initialization code in :" +"file:`__init__.py`) and then imports whatever names are defined in the " +"package. This includes any names defined (and submodules explicitly loaded) " +"by :file:`__init__.py`. It also includes any submodules of the package that " +"were explicitly loaded by previous :keyword:`import` statements. Consider " +"this code::" +msgstr "" +"如果 ``__all__`` 沒有被定義,``from sound.effects import *`` 陳述式\\ *並不會" +"*\\ 把 :mod:`!sound.effects` 套件中所有子模組都 import 到當前的命名空間;它只" +"保證 :mod:`!sound.effects` 套件有被 import(可能會運行 :file:`__init__.py` 中" +"的初始化程式碼),然後 import 套件中被定義的全部名稱。這包含 :file:`__init__." +"py` 定義(以及被明確載入的子模組)的任何名稱。它也包括任何之前被 :keyword:" +"`import` 陳述式明確載入的套件子模組。請看以下程式碼:\n" "\n" "::" #: ../../tutorial/modules.rst:544 msgid "" -"In this example, the :mod:`echo` and :mod:`surround` modules are imported in " -"the current namespace because they are defined in the :mod:`sound.effects` " -"package when the ``from...import`` statement is executed. (This also works " -"when ``__all__`` is defined.)" +"In this example, the :mod:`!echo` and :mod:`!surround` modules are imported " +"in the current namespace because they are defined in the :mod:`!sound." +"effects` package when the ``from...import`` statement is executed. (This " +"also works when ``__all__`` is defined.)" msgstr "" -"此例中,當 ``from...import`` 陳述式被執行時,\\ :mod:`echo` 和 :mod:" -"`surround` 模組被 import 進當前的命名空間,因為它們是在 :mod:`sound.effects` " +"此例中,當 ``from...import`` 陳述式被執行時,:mod:`!echo` 和 :mod:`!" +"surround` 模組被 import 進當前的命名空間,因為它們是在 :mod:`!sound.effects` " "套件裡定義的。(當 ``__all__`` 有被定義時,這規則也有效。)" #: ../../tutorial/modules.rst:549 @@ -766,27 +765,27 @@ msgstr "套件內引用" #: ../../tutorial/modules.rst:564 msgid "" -"When packages are structured into subpackages (as with the :mod:`sound` " +"When packages are structured into subpackages (as with the :mod:`!sound` " "package in the example), you can use absolute imports to refer to submodules " -"of siblings packages. For example, if the module :mod:`sound.filters." -"vocoder` needs to use the :mod:`echo` module in the :mod:`sound.effects` " +"of siblings packages. For example, if the module :mod:`!sound.filters." +"vocoder` needs to use the :mod:`!echo` module in the :mod:`!sound.effects` " "package, it can use ``from sound.effects import echo``." msgstr "" -"當套件的結構為多個子套件的組合時(如同範例中的 :mod:`sound` 套件),可以使用" -"「絕對 (absolute) import」,引用同層套件中的子模組。例如,要在 :mod:`sound." -"filters.vocoder` 模組中使用 :mod:`sound.effects` 中的 :mod:`echo` 模組時,可" -"以用 ``from sound.effects import echo``\\ 。" +"當套件的結構為多個子套件的組合時(如同範例中的 :mod:`!sound` 套件),可以使用" +"「絕對 (absolute) import」,引用同層套件中的子模組。例如,要在 :mod:`!sound." +"filters.vocoder` 模組中使用 :mod:`!sound.effects` 中的 :mod:`!echo` 模組時," +"可以用 ``from sound.effects import echo``。" #: ../../tutorial/modules.rst:570 msgid "" "You can also write relative imports, with the ``from module import name`` " "form of import statement. These imports use leading dots to indicate the " "current and parent packages involved in the relative import. From the :mod:" -"`surround` module for example, you might use::" +"`!surround` module for example, you might use::" msgstr "" "你也可以用 ``from module import name`` 的 import 陳述式,編寫「相對 " "(relative) import」。這些 import 使用前導句號指示相對 import 中的當前套件和母" -"套件。例如,在 :mod:`surround` 模組中,你可以使用:\n" +"套件。例如,在 :mod:`!urround` 模組中,你可以使用:\n" "\n" "::" @@ -798,8 +797,8 @@ msgid "" "absolute imports." msgstr "" "請注意,相對 import 的運作是以目前的模組名稱為依據。因為主模組的名稱永遠是 " -"``\"__main__\"``\\ ,所以如果一個模組預期被用作 Python 應用程式的主模組,那它" -"必須永遠使用絕對 import。" +"``\"__main__\"``,所以如果一個模組預期被用作 Python 應用程式的主模組,那它必" +"須永遠使用絕對 import。" #: ../../tutorial/modules.rst:585 msgid "Packages in Multiple Directories" @@ -813,10 +812,9 @@ msgid "" "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:`__path__`。它在初始化時是一個 list,包含該套件" +"的 :file:`__init__.py` 檔案所在的目錄名稱,初始化時機是在這個檔案的程式碼被執" +"行之前。這個變數可以被修改,但這樣做會影響將來對套件內的模組和子套件的搜尋。" #: ../../tutorial/modules.rst:593 msgid "" diff --git a/whatsnew/2.2.po b/whatsnew/2.2.po index bbf65b2517..2108feb605 100644 --- a/whatsnew/2.2.po +++ b/whatsnew/2.2.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-18 00:03+0000\n" +"POT-Creation-Date: 2023-08-23 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1263,7 +1263,7 @@ msgid "" msgstr "" #: ../../whatsnew/2.2.rst:1081 -msgid "Rename :c:func:`Py_TPFLAGS_GC` to :c:func:`PyTPFLAGS_HAVE_GC`." +msgid "Rename :c:macro:`!Py_TPFLAGS_GC` to :c:macro:`Py_TPFLAGS_HAVE_GC`." msgstr "" #: ../../whatsnew/2.2.rst:1084 @@ -1275,21 +1275,19 @@ msgstr "" msgid "objects, and :c:func:`PyObject_GC_Del` to deallocate them." msgstr "" -#: ../../whatsnew/2.2.rst:1087 -msgid "Rename :c:func:`PyObject_GC_Init` to :c:func:`PyObject_GC_Track` and" -msgstr "" - -#: ../../whatsnew/2.2.rst:1087 -msgid ":c:func:`PyObject_GC_Fini` to :c:func:`PyObject_GC_UnTrack`." +#: ../../whatsnew/2.2.rst:1086 +msgid "" +"Rename :c:func:`!PyObject_GC_Init` to :c:func:`PyObject_GC_Track` and :c:" +"func:`!PyObject_GC_Fini` to :c:func:`PyObject_GC_UnTrack`." msgstr "" #: ../../whatsnew/2.2.rst:1089 -msgid "Remove :c:func:`PyGC_HEAD_SIZE` from object size calculations." +msgid "Remove :c:macro:`!PyGC_HEAD_SIZE` from object size calculations." msgstr "" #: ../../whatsnew/2.2.rst:1091 msgid "" -"Remove calls to :c:func:`PyObject_AS_GC` and :c:func:`PyObject_FROM_GC`." +"Remove calls to :c:func:`!PyObject_AS_GC` and :c:func:`!PyObject_FROM_GC`." msgstr "" #: ../../whatsnew/2.2.rst:1093 @@ -1459,7 +1457,7 @@ msgid "" "operator, but these features were rarely used and therefore buggy. The :" "meth:`tolist` method and the :attr:`start`, :attr:`stop`, and :attr:`step` " "attributes are also being deprecated. At the C level, the fourth argument " -"to the :c:func:`PyRange_New` function, ``repeat``, has also been deprecated." +"to the :c:func:`!PyRange_New` function, ``repeat``, has also been deprecated." msgstr "" #: ../../whatsnew/2.2.rst:1224 diff --git a/whatsnew/2.3.po b/whatsnew/2.3.po index 186727b21f..ea946a8f00 100644 --- a/whatsnew/2.3.po +++ b/whatsnew/2.3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-18 00:03+0000\n" +"POT-Creation-Date: 2023-08-23 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2084,7 +2084,7 @@ msgstr "" #: ../../whatsnew/2.3.rst:1900 msgid "" -"The :c:func:`PyArg_NoArgs` macro is now deprecated, and code that uses it " +"The :c:func:`!PyArg_NoArgs` macro is now deprecated, and code that uses it " "should be changed. For Python 2.2 and later, the method definition table " "can specify the :c:macro:`METH_NOARGS` flag, signalling that there are no " "arguments, and the argument checking can then be removed. If compatibility " diff --git a/whatsnew/2.4.po b/whatsnew/2.4.po index d442af8ca9..db666a88bd 100644 --- a/whatsnew/2.4.po +++ b/whatsnew/2.4.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-18 00:03+0000\n" +"POT-Creation-Date: 2023-08-23 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1667,8 +1667,8 @@ msgstr "" #: ../../whatsnew/2.4.rst:1470 msgid "" -"C code can avoid unnecessary locking by using the new :c:func:" -"`PyEval_ThreadsInitialized` function to tell if any thread operations have " +"C code can avoid unnecessary locking by using the new :c:func:`!" +"PyEval_ThreadsInitialized` function to tell if any thread operations have " "been performed. If this function returns false, no lock operations are " "needed. (Contributed by Nick Coghlan.)" msgstr "" diff --git a/whatsnew/2.5.po b/whatsnew/2.5.po index 88fbcaede3..f20f05f3ff 100644 --- a/whatsnew/2.5.po +++ b/whatsnew/2.5.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-08-23 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2517,10 +2517,10 @@ msgid "" "definition of the various AST nodes in :file:`Parser/Python.asdl`. A Python " "script reads this file and generates a set of C structure definitions in :" "file:`Include/Python-ast.h`. The :c:func:`PyParser_ASTFromString` and :c:" -"func:`PyParser_ASTFromFile`, defined in :file:`Include/pythonrun.h`, take " +"func:`!PyParser_ASTFromFile`, defined in :file:`Include/pythonrun.h`, take " "Python source as input and return the root of an AST representing the " -"contents. This AST can then be turned into a code object by :c:func:" -"`PyAST_Compile`. For more information, read the source code, and then ask " +"contents. This AST can then be turned into a code object by :c:func:`!" +"PyAST_Compile`. For more information, read the source code, and then ask " "questions on python-dev." msgstr "" @@ -2590,11 +2590,11 @@ msgid "" "``Py_LOCAL(type)`` declares the function as returning a value of the " "specified *type* and uses a fast-calling qualifier. " "``Py_LOCAL_INLINE(type)`` does the same thing and also requests the function " -"be inlined. If :c:func:`PY_LOCAL_AGGRESSIVE` is defined before :file:" -"`python.h` is included, a set of more aggressive optimizations are enabled " -"for the module; you should benchmark the results to find out if these " -"optimizations actually make the code faster. (Contributed by Fredrik Lundh " -"at the NeedForSpeed sprint.)" +"be inlined. If macro :c:macro:`!PY_LOCAL_AGGRESSIVE` is defined before :" +"file:`python.h` is included, a set of more aggressive optimizations are " +"enabled for the module; you should benchmark the results to find out if " +"these optimizations actually make the code faster. (Contributed by Fredrik " +"Lundh at the NeedForSpeed sprint.)" msgstr "" #: ../../whatsnew/2.5.rst:2181 @@ -2605,7 +2605,7 @@ msgstr "" #: ../../whatsnew/2.5.rst:2184 msgid "" -"The :c:func:`PyErr_Warn` function for issuing warnings is now deprecated in " +"The :c:func:`!PyErr_Warn` function for issuing warnings is now deprecated in " "favour of ``PyErr_WarnEx(category, message, stacklevel)`` which lets you " "specify the number of stack frames separating this function and the caller. " "A *stacklevel* of 1 is the function calling :c:func:`PyErr_WarnEx`, 2 is the " @@ -2621,7 +2621,7 @@ msgstr "" #: ../../whatsnew/2.5.rst:2194 msgid "" -"The :c:func:`PyRange_New` function was removed. It was never documented, " +"The :c:func:`!PyRange_New` function was removed. It was never documented, " "never used in the core code, and had dangerously lax error checking. In the " "unlikely case that your extensions were using it, you can replace it by " "something like the following::" diff --git a/whatsnew/2.6.po b/whatsnew/2.6.po index dd902227eb..736ee4d980 100644 --- a/whatsnew/2.6.po +++ b/whatsnew/2.6.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-18 00:03+0000\n" +"POT-Creation-Date: 2023-08-23 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1092,7 +1092,7 @@ msgstr "" #: ../../whatsnew/2.6.rst:979 msgid "" "At the C level, Python 3.0 will rename the existing 8-bit string type, " -"called :c:type:`PyStringObject` in Python 2.x, to :c:type:`PyBytesObject`. " +"called :c:type:`!PyStringObject` in Python 2.x, to :c:type:`PyBytesObject`. " "Python 2.6 uses ``#define`` to support using the names :c:func:" "`PyBytesObject`, :c:func:`PyBytes_Check`, :c:func:" "`PyBytes_FromStringAndSize`, and all the other functions and macros used " @@ -3368,11 +3368,11 @@ msgid "" "thread-safe as the underlying library is. A long-standing potential bug " "occurred if one thread closed a file object while another thread was reading " "from or writing to the object. In 2.6 file objects have a reference count, " -"manipulated by the :c:func:`PyFile_IncUseCount` and :c:func:" -"`PyFile_DecUseCount` functions. File objects can't be closed unless the " -"reference count is zero. :c:func:`PyFile_IncUseCount` should be called " +"manipulated by the :c:func:`!PyFile_IncUseCount` and :c:func:`!" +"PyFile_DecUseCount` functions. File objects can't be closed unless the " +"reference count is zero. :c:func:`!PyFile_IncUseCount` should be called " "while the GIL is still held, before carrying out an I/O operation using the " -"``FILE *`` pointer, and :c:func:`PyFile_DecUseCount` should be called " +"``FILE *`` pointer, and :c:func:`!PyFile_DecUseCount` should be called " "immediately after the GIL is re-acquired. (Contributed by Antoine Pitrou and " "Gregory P. Smith.)" msgstr "" diff --git a/whatsnew/2.7.po b/whatsnew/2.7.po index ce47e5c2bc..2b70b2c4ce 100644 --- a/whatsnew/2.7.po +++ b/whatsnew/2.7.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-18 00:03+0000\n" +"POT-Creation-Date: 2023-08-23 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2513,8 +2513,8 @@ msgstr "" #: ../../whatsnew/2.7.rst:2153 msgid "" "New function: stemming from the rewrite of string-to-float conversion, a " -"new :c:func:`PyOS_string_to_double` function was added. The old :c:func:" -"`PyOS_ascii_strtod` and :c:func:`PyOS_ascii_atof` functions are now " +"new :c:func:`PyOS_string_to_double` function was added. The old :c:func:`!" +"PyOS_ascii_strtod` and :c:func:`!PyOS_ascii_atof` functions are now " "deprecated." msgstr "" @@ -2566,7 +2566,7 @@ msgstr "" #: ../../whatsnew/2.7.rst:2198 msgid "" -"Removed function: :c:macro:`PyEval_CallObject` is now only available as a " +"Removed function: :c:func:`!PyEval_CallObject` is now only available as a " "macro. A function version was being kept around to preserve ABI linking " "compatibility, but that was in 1997; it can certainly be deleted by now. " "(Removed by Antoine Pitrou; :issue:`8276`.)" @@ -2574,8 +2574,8 @@ msgstr "" #: ../../whatsnew/2.7.rst:2203 msgid "" -"New format codes: the :c:func:`PyFormat_FromString`, :c:func:" -"`PyFormat_FromStringV`, and :c:func:`PyErr_Format` functions now accept " +"New format codes: the :c:func:`!PyString_FromFormat`, :c:func:`!" +"PyString_FromFormatV`, and :c:func:`PyErr_Format` functions now accept " "``%lld`` and ``%llu`` format codes for displaying C's :c:expr:`long long` " "types. (Contributed by Mark Dickinson; :issue:`7228`.)" msgstr "" @@ -2959,8 +2959,8 @@ msgstr "" #: ../../whatsnew/2.7.rst:2542 msgid "" "Use the new :c:func:`PyOS_string_to_double` function instead of the old :c:" -"func:`PyOS_ascii_strtod` and :c:func:`PyOS_ascii_atof` functions, which are " -"now deprecated." +"func:`!PyOS_ascii_strtod` and :c:func:`!PyOS_ascii_atof` functions, which " +"are now deprecated." msgstr "" #: ../../whatsnew/2.7.rst:2546 diff --git a/whatsnew/3.0.po b/whatsnew/3.0.po index c533da625c..4dc3a9af51 100644 --- a/whatsnew/3.0.po +++ b/whatsnew/3.0.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-18 00:03+0000\n" +"POT-Creation-Date: 2023-08-23 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1241,8 +1241,8 @@ msgstr "" #: ../../whatsnew/3.0.rst:868 msgid "" -":c:func:`PyNumber_Coerce`, :c:func:`PyNumber_CoerceEx`, :c:func:" -"`PyMember_Get`, and :c:func:`PyMember_Set` C APIs are removed." +":c:func:`!PyNumber_Coerce`, :c:func:`!PyNumber_CoerceEx`, :c:func:`!" +"PyMember_Get`, and :c:func:`!PyMember_Set` C APIs are removed." msgstr "" #: ../../whatsnew/3.0.rst:871 diff --git a/whatsnew/3.1.po b/whatsnew/3.1.po index 5e5a29c54c..12436bb343 100644 --- a/whatsnew/3.1.po +++ b/whatsnew/3.1.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-18 00:03+0000\n" +"POT-Creation-Date: 2023-08-23 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -640,7 +640,7 @@ msgstr "(由 Mark Dickinson 和 Lisandro Dalcrin 貢獻;:issue:`5175`。)" #: ../../whatsnew/3.1.rst:504 msgid "" -"Deprecated :c:func:`PyNumber_Int`. Use :c:func:`PyNumber_Long` instead." +"Deprecated :c:func:`!PyNumber_Int`. Use :c:func:`PyNumber_Long` instead." msgstr "" #: ../../whatsnew/3.1.rst:506 @@ -650,8 +650,8 @@ msgstr "(由 Mark Dickinson 貢獻;:issue:`4910`。)" #: ../../whatsnew/3.1.rst:508 msgid "" "Added a new :c:func:`PyOS_string_to_double` function to replace the " -"deprecated functions :c:func:`PyOS_ascii_strtod` and :c:func:" -"`PyOS_ascii_atof`." +"deprecated functions :c:func:`!PyOS_ascii_strtod` and :c:func:`!" +"PyOS_ascii_atof`." msgstr "" #: ../../whatsnew/3.1.rst:511 diff --git a/whatsnew/3.10.po b/whatsnew/3.10.po index 84c95a3415..e1f2db7479 100644 --- a/whatsnew/3.10.po +++ b/whatsnew/3.10.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-08-23 00:03+0000\n" "PO-Revision-Date: 2023-06-26 03:02+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1933,8 +1933,8 @@ msgid "" "(Contributed by Zackery Spytz in :issue:`34204`.)" msgstr "" "現在,:mod:`shelve` 模組在建立 shelve 時預設使用 :const:`pickle." -"DEFAULT_PROTOCOL`,而不是 :mod:`pickle` 的協議 ``3``。(由 Zackery Spytz " -"在 :issue:`34204` 中貢獻。)" +"DEFAULT_PROTOCOL`,而不是 :mod:`pickle` 的協議 ``3``。(由 Zackery Spytz 在 :" +"issue:`34204` 中貢獻。)" #: ../../whatsnew/3.10.rst:1327 msgid "statistics" @@ -2002,9 +2002,9 @@ msgid "" "`43799`, :issue:`43920`, :issue:`43789`, and :issue:`43811`.)" msgstr "" "ssl 模組初步支援 OpenSSL 3.0.0 和新選項 :const:`~ssl." -"OP_IGNORE_UNEXPECTED_EOF`。(由 Christian Heimes 於 :issue:`38820`、:" -"issue:`43794`、:issue:`43788`、:issue:`43791`、:issue:`43799`、:issue:" -"`43920`、:issue:`43789` 和 :issue:`43811` 貢獻。)" +"OP_IGNORE_UNEXPECTED_EOF`。(由 Christian Heimes 於 :issue:`38820`、:issue:" +"`43794`、:issue:`43788`、:issue:`43791`、:issue:`43799`、:issue:`43920`、:" +"issue:`43789` 和 :issue:`43811` 貢獻。)" #: ../../whatsnew/3.10.rst:1364 msgid "" @@ -2115,9 +2115,9 @@ msgid "" "simulate (the default is still :const:`signal.SIGINT`). (Contributed by " "Antoine Pitrou in :issue:`43356`.)" msgstr "" -":func:`_thread.interrupt_main` 現在需要一個可選的信號編號來進行模擬(預設" -"值仍然是 :const:`signal.SIGINT`)。 (由 Antoine Pitrou 在 :issue:`43356` " -"中貢獻。)" +":func:`_thread.interrupt_main` 現在需要一個可選的信號編號來進行模擬(預設值仍" +"然是 :const:`signal.SIGINT`)。 (由 Antoine Pitrou 在 :issue:`43356` 中貢" +"獻。)" #: ../../whatsnew/3.10.rst:1420 msgid "threading" @@ -2493,7 +2493,6 @@ msgstr "" "語法錯誤。(由 Serhiy Storchaka 在 :issue:`43833` 中貢獻。)" #: ../../whatsnew/3.10.rst:1608 -#, fuzzy msgid "" "Starting in this release, there will be a concerted effort to begin cleaning " "up old import semantics that were kept for Python 2.7 compatibility. " @@ -2509,16 +2508,15 @@ msgid "" "appropriate to help identify code which needs updating during this " "transition." msgstr "" -"從這個版本開始,我們將齊心協力開始清理為相容 Python 2.7 而保留的舊引入語" -"義。具體來說, :meth:`~importlib.abc.PathEntryFinder.find_loader`/:meth:" -"`~importlib.abc.Finder.find_module` (被 :meth:`~importlib.abc.Finder." -"find_spec` 取代)、 :meth:`~importlib.abc.Loader.load_module` (被 :meth:" -"`~importlib.abc.Loader.exec_module` 取代)、 :meth:`~importlib.abc.Loader." -"module_repr` (引入系統負責處理你)、``__package__`` 屬性(由 ``__spec__." -"parent`` 取代)、 ``__loader__`` 屬性(由 ``__spec__.loader`` 取代)和 " -"``__cached__`` 屬性(由 ``__spec__.cached`` 取代)將慢慢被刪除(以及 :mod:" -"`importlib` 中的其他類別和方法)。將酌情引發 :exc:`ImportWarning` 和/或 :" -"exc:`DeprecationWarning` 以幫助識別在此轉換期間需要更新的程式碼。" +"從這個版本開始,我們將齊心協力開始清理為相容 Python 2.7 而保留的舊引入語義。" +"具體來說, :meth:`!find_loader`/:meth:`!find_module` (被 :meth:`~importlib." +"abc.Finder.find_spec` 取代)、:meth:`~importlib.abc.Loader.load_module` " +"(被 :meth:`~importlib.abc.Loader.exec_module` 取代)、 :meth:`!module_repr` " +"(引入系統負責處理你)、``__package__`` 屬性(由 ``__spec__.parent`` 取" +"代)、 ``__loader__`` 屬性(由 ``__spec__.loader`` 取代)和 ``__cached__`` 屬" +"性(由 ``__spec__.cached`` 取代)將慢慢被刪除(以及 :mod:`importlib` 中的其他" +"類別和方法)。將酌情引發 :exc:`ImportWarning` 和/或 :exc:" +"`DeprecationWarning` 以幫助識別在此轉換期間需要更新的程式碼。" #: ../../whatsnew/3.10.rst:1625 msgid "" @@ -2579,11 +2577,11 @@ msgid "" "porting. (Contributed by Brett Cannon in :issue:`42134`.)" msgstr "" "引入系統使用 :meth:`!importlib.abc.MetaPathFinder.find_module` 和 :!meth:" -"`importlib.abc.PathEntryFinder.find_module` 現在會觸發 :exc:" -"`ImportWarning`,因為 :meth:`importlib.abc.MetaPathFinder.find_spec` 和 :" -"meth:`importlib.abc.PathEntryFinder.find_spec` 分別是替代方案的首選。你可以使用 :" -"func:`importlib.util.spec_from_loader` 來幫助移植。(由 Brett Cannon 在 :" -"issue:`42134` 中貢獻。)" +"`importlib.abc.PathEntryFinder.find_module` 現在會觸發 :exc:`ImportWarning`," +"因為 :meth:`importlib.abc.MetaPathFinder.find_spec` 和 :meth:`importlib.abc." +"PathEntryFinder.find_spec` 分別是替代方案的首選。你可以使用 :func:`importlib." +"util.spec_from_loader` 來幫助移植。(由 Brett Cannon 在 :issue:`42134` 中貢" +"獻。)" #: ../../whatsnew/3.10.rst:1657 msgid "" @@ -2593,10 +2591,10 @@ msgid "" "spec_from_loader` to help in porting. (Contributed by Brett Cannon in :issue:" "`43672`.)" msgstr "" -"引入系統使用 :meth:`!importlib.abc.PathEntryFinder.find_loader` 現在會觸" -"發 :exc:`ImportWarning`,因為 :meth:`importlib.abc.PathEntryFinder." -"find_spec` 是首選。你可以使用 :func:`importlib.util.spec_from_loader` 來幫" -"助移植。(由 Brett Cannon 在 :issue:`43672` 中貢獻。)" +"引入系統使用 :meth:`!importlib.abc.PathEntryFinder.find_loader` 現在會觸發 :" +"exc:`ImportWarning`,因為 :meth:`importlib.abc.PathEntryFinder.find_spec` 是" +"首選。你可以使用 :func:`importlib.util.spec_from_loader` 來幫助移植。(由 " +"Brett Cannon 在 :issue:`43672` 中貢獻。)" #: ../../whatsnew/3.10.rst:1663 msgid "" @@ -2612,17 +2610,16 @@ msgid "" "removal in Python 3.12 (previously they were documented as deprecated in " "Python 3.4). (Contributed by Brett Cannon in :issue:`42135`.)" msgstr "" -":meth:`!importlib.abc.MetaPathFinder.find_module` 的各種實作(:meth:" -"`!importlib.machinery.BuiltinImporter.find_module`、:meth:`!importlib." +":meth:`!importlib.abc.MetaPathFinder.find_module` 的各種實作(:meth:`!" +"importlib.machinery.BuiltinImporter.find_module`、:meth:`!importlib." "machinery.FrozenImporter.find_module`、:meth:`!importlib.machinery." "WindowsRegistryFinder.find_module`、:meth:`!importlib.machinery.PathFinder." -"find_module`、:meth:`!importlib.abc.MetaPathFinder.find_module` )、:meth:" -"`!importlib.abc.PathEntryFinder.find_module` (:meth:`!importlib.machinery." +"find_module`、:meth:`!importlib.abc.MetaPathFinder.find_module` )、:meth:`!" +"importlib.abc.PathEntryFinder.find_module` (:meth:`!importlib.machinery." "FileFinder.find_module` ) 和 :meth:`!importlib.abc.PathEntryFinder." "find_loader` (:meth:`!importlib.machinery.FileFinder.find_loader` ) 現在引" "發 :exc:`DeprecationWarning` 並計劃在 Python 3.12 中刪除(之前它們已在 " -"Python 3.4 中被記錄為已棄用)。(由 Brett Cannon 在 :issue:`42135` 中貢" -"獻。)" +"Python 3.4 中被記錄為已棄用)。(由 Brett Cannon 在 :issue:`42135` 中貢獻。)" #: ../../whatsnew/3.10.rst:1678 msgid "" @@ -2632,10 +2629,10 @@ msgid "" "should inherit from one of these two classes as appropriate instead. " "(Contributed by Brett Cannon in :issue:`42135`.)" msgstr "" -":class:`!importlib.abc.Finder` 已被棄用(包括其唯一方法 :" -"meth:`!find_module`)。:class:`importlib.abc.MetaPathFinder` 和 :" -"class:`importlib.abc.PathEntryFinder` 都不再從該類別繼承。使用者應該根據需" -"求來選擇其一以繼承。(由 Brett Cannon 在 :issue:`42135` 中貢獻。)" +":class:`!importlib.abc.Finder` 已被棄用(包括其唯一方法 :meth:`!" +"find_module`)。:class:`importlib.abc.MetaPathFinder` 和 :class:`importlib." +"abc.PathEntryFinder` 都不再從該類別繼承。使用者應該根據需求來選擇其一以繼承。" +"(由 Brett Cannon 在 :issue:`42135` 中貢獻。)" #: ../../whatsnew/3.10.rst:1685 msgid "" @@ -2648,11 +2645,11 @@ msgid "" "Brett Cannon in :issue:`43720`.)" msgstr "" "棄用 :mod:`!imp`、:func:`!importlib.find_loader`、:func:`!importlib.util." -"set_package_wrapper`、:func:`!importlib.util.set_loader_wrapper`、:func:" -"`!importlib.util.module_for_loader`、:class:`!pkgutil.ImpImporter` 和 :" -"class:`!pkgutil.ImpLoader` 均已更新,將於 Python 3.12 列為預定的刪除版本" -"(它們開始在過去版本的 Python 中引發 :exc:`DeprecationWarning`) 。(由 " -"Brett Cannon 在 :issue:`43720` 中貢獻。)" +"set_package_wrapper`、:func:`!importlib.util.set_loader_wrapper`、:func:`!" +"importlib.util.module_for_loader`、:class:`!pkgutil.ImpImporter` 和 :class:`!" +"pkgutil.ImpLoader` 均已更新,將於 Python 3.12 列為預定的刪除版本(它們開始在" +"過去版本的 Python 中引發 :exc:`DeprecationWarning`) 。(由 Brett Cannon 在 :" +"issue:`43720` 中貢獻。)" #: ../../whatsnew/3.10.rst:1695 msgid "" @@ -2661,10 +2658,9 @@ msgid "" "Removal of the use of ``module_repr()`` is scheduled for Python 3.12. " "(Contributed by Brett Cannon in :issue:`42137`.)" msgstr "" -"引入系統現在在模組上使用 ``__spec__`` 屬性,然後才會回退使用 :meth:`!module_repr`" -" 作為模組的 ``__repr__()`` 方法。計劃" -"在 Python 3.12 中刪除 ``module_repr()`` 的使用。(由 Brett Cannon 在 :" -"issue:`42137` 中貢獻。)" +"引入系統現在在模組上使用 ``__spec__`` 屬性,然後才會回退使用 :meth:`!" +"module_repr` 作為模組的 ``__repr__()`` 方法。計劃在 Python 3.12 中刪除 " +"``module_repr()`` 的使用。(由 Brett Cannon 在 :issue:`42137` 中貢獻。)" #: ../../whatsnew/3.10.rst:1701 msgid "" @@ -2675,8 +2671,8 @@ msgid "" msgstr "" ":meth:`!importlib.abc.Loader.module_repr`、:meth:`!importlib.machinery." "FrozenLoader.module_repr` 和 :meth:`!importlib.machinery.BuiltinLoader." -"module_repr` 已棄用並計劃在 Python 3.12 中刪除。(由 Brett Cannon 在 :" -"issue:`42136` 中貢獻。)" +"module_repr` 已棄用並計劃在 Python 3.12 中刪除。(由 Brett Cannon 在 :issue:" +"`42136` 中貢獻。)" #: ../../whatsnew/3.10.rst:1707 msgid "" @@ -2921,13 +2917,13 @@ msgstr "" #: ../../whatsnew/3.10.rst:1822 msgid "" -"Removed the :c:func:`PyModule_GetWarningsModule` function that was useless " -"now due to the _warnings module was converted to a builtin module in 2.6. " -"(Contributed by Hai Shi in :issue:`42599`.)" +"Removed the :c:func:`!PyModule_GetWarningsModule` function that was useless " +"now due to the :mod:`!_warnings` module was converted to a builtin module in " +"2.6. (Contributed by Hai Shi in :issue:`42599`.)" msgstr "" -"刪除了 :c:func:`PyModule_GetWarningsModule` 函式,該函式現在無用,因為 " -"_warnings 模組在 2.6 中已轉換為內建模組。(由 Hai Shi 在 :issue:`42599` 中貢" -"獻。)" +"刪除了 :c:func:`!PyModule_GetWarningsModule` 函式,該函式現在無用,因為 :mod:" +"`!_warnings` 模組在 2.6 中已轉換為內建模組。(由 Hai Shi 在 :issue:`42599` 中" +"貢獻。)" #: ../../whatsnew/3.10.rst:1826 msgid "" @@ -3529,9 +3525,9 @@ msgid "" "immutable type objects: type attributes cannot be set nor deleted. " "(Contributed by Victor Stinner and Erlend E. Aasland in :issue:`43908`.)" msgstr "" -"新增 :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` 型別旗標用於建立不可變型別物件:無" -"法設定或刪除型別屬性。(由 Victor Stinner 和 Erlend E. Aasland 在 :issue:`43908` " -"中貢獻。)" +"新增 :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` 型別旗標用於建立不可變型別物件:無法" +"設定或刪除型別屬性。(由 Victor Stinner 和 Erlend E. Aasland 在 :issue:" +"`43908` 中貢獻。)" #: ../../whatsnew/3.10.rst:2138 msgid "" @@ -3647,10 +3643,10 @@ msgid "" "is set instead. (Contributed by Victor Stinner and Erlend E. Aasland in :" "issue:`43908`.)" msgstr "" -"使用 :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` 型別旗標來建立不可變型別物件。不要" -"依賴 :c:macro:`Py_TPFLAGS_HEAPTYPE` 來決定型別物件是否可變;應改為檢查是否" -"設定了 :c:macro:`Py_TPFLAGS_IMMUTABLETYPE`。(由 Victor Stinner 和 Erlend " -"E. Aasland 在 :issue:`35134` 中貢獻。)" +"使用 :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` 型別旗標來建立不可變型別物件。不要依" +"賴 :c:macro:`Py_TPFLAGS_HEAPTYPE` 來決定型別物件是否可變;應改為檢查是否設定" +"了 :c:macro:`Py_TPFLAGS_IMMUTABLETYPE`。(由 Victor Stinner 和 Erlend E. " +"Aasland 在 :issue:`35134` 中貢獻。)" #: ../../whatsnew/3.10.rst:2196 msgid "" diff --git a/whatsnew/3.11.po b/whatsnew/3.11.po index 4b7eda8345..8f1f96a9a8 100644 --- a/whatsnew/3.11.po +++ b/whatsnew/3.11.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-08-24 00:03+0000\n" "PO-Revision-Date: 2023-05-28 18:21+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -149,7 +149,7 @@ msgid "" "pep670>`" msgstr ":pep:`670`:\\ :ref:`轉換為靜態行內函式的巨集 `" -#: ../../whatsnew/3.11.rst:108 ../../whatsnew/3.11.rst:2193 +#: ../../whatsnew/3.11.rst:108 ../../whatsnew/3.11.rst:2197 msgid "New Features" msgstr "新增特性" @@ -613,16 +613,13 @@ msgid "" "class:`frozenset`, :class:`collections.OrderedDict`, :class:`collections." "deque`, :class:`weakref.WeakSet`, and :class:`datetime.tzinfo` now copies " "and pickles instance attributes implemented as :term:`slots <__slots__>`. " -"(Contributed by Serhiy Storchaka in :issue:`26579`.)" +"This change has an unintended side effect: It trips up a small minority of " +"existing Python projects not expecting :meth:`object.__getstate__` to exist. " +"See the later comments on :gh:`70766` for discussions of what workarounds " +"such code may need. (Contributed by Serhiy Storchaka in :issue:`26579`.)" msgstr "" -"添加了 :meth:`object.__getstate__`,它提供 :meth:`!__getstate__` 方法的預設實" -"作。內建型別 :class:`bytearray`、:class:`set`、:class:`frozenset`、:class:" -"`collections.OrderedDict`、:class:`collections.deque`、:class:`weakref." -"WeakSet` 和 :class:`datetime.tzinfo` 的 :mod:`copy` 和 :mod:`pickle` 實例,現" -"在會以 :term:`slots <__slots__>` 形式複製和 pickle 實例屬性。 (由 Serhiy " -"Storchaka 在 :issue:`26579` 中貢獻。)" -#: ../../whatsnew/3.11.rst:466 +#: ../../whatsnew/3.11.rst:470 msgid "" "Added a :option:`-P` command line option and a :envvar:`PYTHONSAFEPATH` " "environment variable, which disable the automatic prepending to :data:`sys." @@ -639,7 +636,7 @@ msgstr "" "keyword:`import` 取用,以避免不小心或被惡意地將模組與本地(通常是使用者可寫入" "的)目錄中的模組重疊。 (由 Victor Stinner 在 :gh:`57684` 中貢獻。)" -#: ../../whatsnew/3.11.rst:477 +#: ../../whatsnew/3.11.rst:481 msgid "" "A ``\"z\"`` option was added to the :ref:`formatspec` that coerces negative " "to positive zero after rounding to the format precision. See :pep:`682` for " @@ -648,7 +645,7 @@ msgstr "" "``\"z\"`` 選項被新增到 :ref:`formatspec`,它會強迫負的 0 在進位到格式精度後成" "為正的。更多詳情請見 :pep:`682`。(由 John Belmonte 於 :gh:`90153` 中貢獻。)" -#: ../../whatsnew/3.11.rst:482 +#: ../../whatsnew/3.11.rst:486 msgid "" "Bytes are no longer accepted on :data:`sys.path`. Support broke sometime " "between Python 3.2 and 3.6, with no one noticing until after Python 3.10.0 " @@ -663,11 +660,11 @@ msgstr "" "會出現的交互作用,恢復這項支援會出現問題。(由 Thomas Grainger 在 :gh:" "`91181` 中貢獻。)" -#: ../../whatsnew/3.11.rst:493 +#: ../../whatsnew/3.11.rst:497 msgid "Other CPython Implementation Changes" msgstr "其他 CPython 實作更動" -#: ../../whatsnew/3.11.rst:495 +#: ../../whatsnew/3.11.rst:499 msgid "" "The special methods :meth:`~object.__complex__` for :class:`complex` and :" "meth:`~object.__bytes__` for :class:`bytes` are implemented to support the :" @@ -679,7 +676,7 @@ msgstr "" "__complex__` 與 :meth:`~object.__bytes__`。(由 Mark Dickinson 和 Dong-hee " "Na 於 :issue:`24234` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:500 +#: ../../whatsnew/3.11.rst:504 msgid "" "``siphash13`` is added as a new internal hashing algorithm. It has similar " "security properties as ``siphash24``, but it is slightly faster for long " @@ -694,7 +691,7 @@ msgstr "" "案 ` 現在也使用 ``siphash13``。(由 Inada Naoki 於 :issue:" "`29410` 中貢獻。)" -#: ../../whatsnew/3.11.rst:509 +#: ../../whatsnew/3.11.rst:513 msgid "" "When an active exception is re-raised by a :keyword:`raise` statement with " "no parameters, the traceback attached to this exception is now always ``sys." @@ -707,7 +704,7 @@ msgstr "" "當前 :keyword:`except` 子句的追蹤上做的改動會反映在被重複引發的例外上。(由 " "Irit Katriel 於 :issue:`45711` 中貢獻。)" -#: ../../whatsnew/3.11.rst:515 +#: ../../whatsnew/3.11.rst:519 msgid "" "The interpreter state's representation of handled exceptions (aka " "``exc_info`` or ``_PyErr_StackItem``) now only has the ``exc_value`` field; " @@ -719,7 +716,7 @@ msgstr "" "``exc_traceback`` 已被移除,現在只能透過 ``exc_value`` 來取得它們。(由 Irit " "Katriel 於 :issue:`45711` 中貢獻。)" -#: ../../whatsnew/3.11.rst:521 +#: ../../whatsnew/3.11.rst:525 msgid "" "A new :ref:`command line option `, ``AppendPath``, has " "been added for the Windows installer. It behaves similarly to " @@ -730,7 +727,7 @@ msgstr "" "Windows 安裝程式。它的行為類似於 ``PrependPath``,但在安裝和腳本目錄後面附加" "而非新增於它們前面。 (由 Bastian Neuburger 在 :issue:`44934` 中貢獻。)" -#: ../../whatsnew/3.11.rst:527 +#: ../../whatsnew/3.11.rst:531 msgid "" "The :c:member:`PyConfig.module_search_paths_set` field must now be set to " "``1`` for initialization to use :c:member:`PyConfig.module_search_paths` to " @@ -741,7 +738,7 @@ msgstr "" "`sys.path`,則現在 :c:member:`PyConfig.module_search_paths_set` 必須被設為 " "1。否則,初始化會重新計算路徑並取代所有被加到 ``module_search_paths`` 的值。" -#: ../../whatsnew/3.11.rst:532 +#: ../../whatsnew/3.11.rst:536 msgid "" "The output of the :option:`--help` option now fits in 50 lines/80 columns. " "Information about :ref:`Python environment variables ` " @@ -754,7 +751,7 @@ msgstr "" "option:`--help-env` 和 :option:`--help-xoptions` 旗標與 :option:`--help-all` " "一起使用來取得。(由 Éric Araujo 於 :issue:`46142` 中貢獻。)" -#: ../../whatsnew/3.11.rst:539 +#: ../../whatsnew/3.11.rst:543 msgid "" "Converting between :class:`int` and :class:`str` in bases other than 2 " "(binary), 4, 8 (octal), 16 (hexadecimal), or 32 such as base 10 (decimal) " @@ -776,11 +773,11 @@ msgstr "" "或 :mod:`sys` API 來設定或禁用此限制。請參閱\\ :ref:`整數字串轉換長度限制 " "` 文件。預設限制為字串形式的 4300 位數字。" -#: ../../whatsnew/3.11.rst:554 +#: ../../whatsnew/3.11.rst:558 msgid "New Modules" msgstr "新增模組" -#: ../../whatsnew/3.11.rst:556 +#: ../../whatsnew/3.11.rst:560 msgid "" ":mod:`tomllib`: For parsing `TOML `_. See :pep:`680` for " "more details. (Contributed by Taneli Hukkinen in :issue:`40059`.)" @@ -788,7 +785,7 @@ msgstr "" ":mod:`tomllib`:用於剖析 `TOML `_。詳情請見 :pep:`680`。" "(由 Taneli Hukkinen 於 :issue:`40059` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:560 +#: ../../whatsnew/3.11.rst:564 msgid "" ":mod:`wsgiref.types`: :pep:`WSGI <3333>`-specific types for static type " "checking. (Contributed by Sebastian Rittau in :issue:`42012`.)" @@ -796,15 +793,15 @@ msgstr "" ":mod:`wsgiref.types`:\\ :pep:`WSGI <3333>` 限定型別,用於靜態型別檢查。" "(Sebastian Rittau 於 :issue:`42012` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:568 +#: ../../whatsnew/3.11.rst:572 msgid "Improved Modules" msgstr "模組改進" -#: ../../whatsnew/3.11.rst:573 +#: ../../whatsnew/3.11.rst:577 msgid "asyncio" msgstr "asyncio" -#: ../../whatsnew/3.11.rst:575 +#: ../../whatsnew/3.11.rst:579 msgid "" "Added the :class:`~asyncio.TaskGroup` class, an :ref:`asynchronous context " "manager ` holding a group of tasks that will wait " @@ -818,7 +815,7 @@ msgstr "" "和 :func:`~asyncio.gather`。(由 Yury Selivanov 和其他人在 :gh:`90908` 中貢" "獻。)" -#: ../../whatsnew/3.11.rst:582 +#: ../../whatsnew/3.11.rst:586 msgid "" "Added :func:`~asyncio.timeout`, an asynchronous context manager for setting " "a timeout on asynchronous operations. For new code this is recommended over " @@ -829,7 +826,7 @@ msgstr "" "管理器,新的程式建議直接使用它以取代 :func:`~asyncio.wait_for`。(由 Andrew " "Svetlov 於 :gh:`90927` 貢獻。)" -#: ../../whatsnew/3.11.rst:587 +#: ../../whatsnew/3.11.rst:591 msgid "" "Added the :class:`~asyncio.Runner` class, which exposes the machinery used " "by :func:`~asyncio.run`. (Contributed by Andrew Svetlov in :gh:`91218`.)" @@ -837,7 +834,7 @@ msgstr "" "新增 :class:`~asyncio.Runner` 類別,它會對外公布了 :func:`~asyncio.run` 的使" "用機制。(由 Andrew Svetlov 於 :gh:`91218` 貢獻。)" -#: ../../whatsnew/3.11.rst:591 +#: ../../whatsnew/3.11.rst:595 msgid "" "Added the :class:`~asyncio.Barrier` class to the synchronization primitives " "in the asyncio library, and the related :exc:`~asyncio.BrokenBarrierError` " @@ -847,7 +844,7 @@ msgstr "" "相關的 :exc:`~asyncio.BrokenBarrierError` 例外。(由 Yves Duprat 和 Andrew " "Svetlov in :gh:`87518` 貢獻。)" -#: ../../whatsnew/3.11.rst:596 +#: ../../whatsnew/3.11.rst:600 msgid "" "Added keyword argument *all_errors* to :meth:`asyncio.loop." "create_connection` so that multiple connection errors can be raised as an :" @@ -856,7 +853,7 @@ msgstr "" "在 :meth:`asyncio.loop.create_connection` 新增關鍵字引數 *all_errors*,這樣多" "個連接錯誤就可以一起用一個 :exc:`ExceptionGroup` 來引發。" -#: ../../whatsnew/3.11.rst:599 +#: ../../whatsnew/3.11.rst:603 msgid "" "Added the :meth:`asyncio.StreamWriter.start_tls` method for upgrading " "existing stream-based connections to TLS. (Contributed by Ian Good in :issue:" @@ -865,7 +862,7 @@ msgstr "" "新增 :meth:`asyncio.StreamWriter.start_tls` 方法,用來將已存在的串流連線升級" "至 TLS。(由 Ian Good 於 :issue:`34975` 中貢獻。)" -#: ../../whatsnew/3.11.rst:603 +#: ../../whatsnew/3.11.rst:607 msgid "" "Added raw datagram socket functions to the event loop: :meth:`~asyncio.loop." "sock_sendto`, :meth:`~asyncio.loop.sock_recvfrom` and :meth:`~asyncio.loop." @@ -879,7 +876,7 @@ msgstr "" "`~asyncio.ProactorEventLoop` 中都有實作。(由 Alex Grönholm 在 :issue:" "`46805` 中貢獻。)" -#: ../../whatsnew/3.11.rst:611 +#: ../../whatsnew/3.11.rst:615 msgid "" "Added :meth:`~asyncio.Task.cancelling` and :meth:`~asyncio.Task.uncancel` " "methods to :class:`~asyncio.Task`. These are primarily intended for internal " @@ -889,11 +886,11 @@ msgstr "" "`~asyncio.Task.uncancel` 方法。這些預期是只用於內部,尤其是 :class:`~asyncio." "TaskGroup`。" -#: ../../whatsnew/3.11.rst:620 +#: ../../whatsnew/3.11.rst:624 msgid "contextlib" msgstr "contextlib" -#: ../../whatsnew/3.11.rst:622 +#: ../../whatsnew/3.11.rst:626 msgid "" "Added non parallel-safe :func:`~contextlib.chdir` context manager to change " "the current working directory and then restore it on exit. Simple wrapper " @@ -903,11 +900,11 @@ msgstr "" "後在退出時恢復它。:func:`~os.chdir` 的簡單包裝器。(由 Filipe Laíns 在 :" "issue:`25625` 中貢獻)" -#: ../../whatsnew/3.11.rst:630 +#: ../../whatsnew/3.11.rst:634 msgid "dataclasses" msgstr "dataclasses" -#: ../../whatsnew/3.11.rst:632 +#: ../../whatsnew/3.11.rst:636 msgid "" "Change field default mutability check, allowing only defaults which are :" "term:`hashable` instead of any object which is not an instance of :class:" @@ -918,11 +915,11 @@ msgstr "" "而不是任何非 :class:`dict`、:class:`list` 或 :class:`set` 實例的物件。(由 " "Eric V. Smith 在 :issue:`44674` 中貢獻。)" -#: ../../whatsnew/3.11.rst:641 +#: ../../whatsnew/3.11.rst:645 msgid "datetime" msgstr "datetime" -#: ../../whatsnew/3.11.rst:643 +#: ../../whatsnew/3.11.rst:647 msgid "" "Add :const:`datetime.UTC`, a convenience alias for :attr:`datetime.timezone." "utc`. (Contributed by Kabir Kwatra in :gh:`91973`.)" @@ -930,7 +927,7 @@ msgstr "" "新增 :const:`datetime.UTC`,一個 :attr:`datetime.timezone.utc` 的方便別名。" "(由 Kabir Kwatra 於 :gh:`91973` 所貢獻。)" -#: ../../whatsnew/3.11.rst:646 +#: ../../whatsnew/3.11.rst:650 msgid "" ":meth:`datetime.date.fromisoformat`, :meth:`datetime.time.fromisoformat` " "and :meth:`datetime.datetime.fromisoformat` can now be used to parse most " @@ -942,11 +939,11 @@ msgstr "" "(除了那些支援分數形式的小時與分鐘)。(由 Paul Ganssle 於 :gh:`80010` 中所貢" "獻。)" -#: ../../whatsnew/3.11.rst:655 +#: ../../whatsnew/3.11.rst:659 msgid "enum" msgstr "enum" -#: ../../whatsnew/3.11.rst:657 +#: ../../whatsnew/3.11.rst:661 msgid "" "Renamed :class:`!EnumMeta` to :class:`~enum.EnumType` (:class:`!EnumMeta` " "kept as an alias)." @@ -954,13 +951,13 @@ msgstr "" ":class:`!EnumMeta` 更名為 :class:`~enum.EnumType`\\ (:class:`!EnumMeta` 保留" "為別名)。" -#: ../../whatsnew/3.11.rst:660 +#: ../../whatsnew/3.11.rst:664 msgid "" "Added :class:`~enum.StrEnum`, with members that can be used as (and must be) " "strings." msgstr "增加 :class:`~enum.StrEnum`,列舉 (enum) 內的成員必須是字串。" -#: ../../whatsnew/3.11.rst:663 +#: ../../whatsnew/3.11.rst:667 msgid "" "Added :class:`~enum.ReprEnum`, which only modifies the :meth:`~object." "__repr__` of members while returning their literal values (rather than " @@ -972,7 +969,7 @@ msgstr "" "`format` 和 :term:`f-string` 所使用的)\\ :meth:`~object.__str__` 和 :meth:" "`~object.__format__`。" -#: ../../whatsnew/3.11.rst:669 +#: ../../whatsnew/3.11.rst:673 msgid "" "Changed :meth:`Enum.__format__() ` (the default for :" "func:`format`, :meth:`str.format` and :term:`f-string`\\s) to always produce " @@ -985,7 +982,7 @@ msgstr "" "`enum.Enum.__str__` 產生相同結果:對於繼承自 :class:`~enum.ReprEnum` 的列舉," "這會是成員之值;而其他的列舉會是列舉與成員名稱(例如 ``Color.RED``)。" -#: ../../whatsnew/3.11.rst:675 +#: ../../whatsnew/3.11.rst:679 msgid "" "Added a new *boundary* class parameter to :class:`~enum.Flag` enums and the :" "class:`~enum.FlagBoundary` enum with its options, to control how to handle " @@ -994,7 +991,7 @@ msgstr "" "新增 *boundary* 類別參數與其選項到 :class:`~enum.Flag` 列舉和 :class:`~enum." "FlagBoundary` 列舉以控制處理超出範圍旗標數值的方法。" -#: ../../whatsnew/3.11.rst:679 +#: ../../whatsnew/3.11.rst:683 msgid "" "Added the :func:`~enum.verify` enum decorator and the :class:`~enum." "EnumCheck` enum with its options, to check enum classes against several " @@ -1003,7 +1000,7 @@ msgstr "" "新增了 :func:`~enum.verify` 列舉裝飾器和 :class:`~enum.EnumCheck` 列舉及其選" "項,以根據幾個特定限制檢查列舉類別。" -#: ../../whatsnew/3.11.rst:683 +#: ../../whatsnew/3.11.rst:687 msgid "" "Added the :func:`~enum.member` and :func:`~enum.nonmember` decorators, to " "ensure the decorated object is/is not converted to an enum member." @@ -1011,7 +1008,7 @@ msgstr "" "新增 :func:`~enum.member` 與 :func:`~enum.nonmember` 裝飾器以確保被裝飾的物件" "會/不會被轉換成一個列舉成員。" -#: ../../whatsnew/3.11.rst:686 +#: ../../whatsnew/3.11.rst:690 msgid "" "Added the :func:`~enum.property` decorator, which works like :func:" "`property` except for enums. Use this instead of :func:`types." @@ -1020,7 +1017,7 @@ msgstr "" "新增 :func:`~enum.property` 裝飾器,它的作用類似 :func:`property` 但是是用於" "列舉,用以替代 :func:`types.DynamicClassAttribute`。" -#: ../../whatsnew/3.11.rst:690 +#: ../../whatsnew/3.11.rst:694 msgid "" "Added the :func:`~enum.global_enum` enum decorator, which adjusts :meth:" "`~object.__repr__` and :meth:`~object.__str__` to show values as members of " @@ -1030,10 +1027,10 @@ msgid "" msgstr "" "新增 :func:`~enum.global_enum` 列舉裝飾器,用來調整 :meth:`~object.__repr__` " "和 :meth:`~object.__str__` 以模組成員形式而非列舉類別來顯示值。例如,:class:" -"`re.RegexFlag` 的 :const:`~re.ASCII` 成員的 ``'re.ASCII'``,而非 ``'RegexFlag." -"ASCII'``。" +"`re.RegexFlag` 的 :const:`~re.ASCII` 成員的 ``'re.ASCII'``,而非 " +"``'RegexFlag.ASCII'``。" -#: ../../whatsnew/3.11.rst:696 +#: ../../whatsnew/3.11.rst:700 msgid "" "Enhanced :class:`~enum.Flag` to support :func:`len`, iteration and :keyword:" "`in`/:keyword:`not in` on its members. For example, the following now works: " @@ -1043,7 +1040,7 @@ msgstr "" "keyword:`in`/:keyword:`not in` 於其成員。例如,以下程式現在能夠作用了:" "``len(AFlag(3)) == 2 and list(AFlag(3)) == (AFlag.ONE, AFlag.TWO)``" -#: ../../whatsnew/3.11.rst:701 +#: ../../whatsnew/3.11.rst:705 msgid "" "Changed :class:`~enum.Enum` and :class:`~enum.Flag` so that members are now " "defined before :meth:`~object.__init_subclass__` is called; :func:`dir` now " @@ -1053,7 +1050,7 @@ msgstr "" "__init_subclass__` 之前就定義成員;:func:`dir` 現在包括來自混合資料型別的方" "法。" -#: ../../whatsnew/3.11.rst:706 +#: ../../whatsnew/3.11.rst:710 msgid "" "Changed :class:`~enum.Flag` to only consider primary values (power of two) " "canonical while composite values (``3``, ``6``, ``10``, etc.) are considered " @@ -1063,11 +1060,11 @@ msgstr "" "``6``、``10`` 等)被視為別名;倒置旗標 (inverted flags) 會被強制轉換為正等價" "的值。" -#: ../../whatsnew/3.11.rst:715 +#: ../../whatsnew/3.11.rst:719 msgid "fcntl" msgstr "fcntl" -#: ../../whatsnew/3.11.rst:717 +#: ../../whatsnew/3.11.rst:721 msgid "" "On FreeBSD, the :data:`!F_DUP2FD` and :data:`!F_DUP2FD_CLOEXEC` flags " "respectively are supported, the former equals to ``dup2`` usage while the " @@ -1076,11 +1073,11 @@ msgstr "" "FreeBSD 上,:data:`!F_DUP2FD` 和 :data:`!F_DUP2FD_CLOEXEC` 旗標分別有被支援," "前者等同於 ``dup2`` 用法,而後者設定了 ``FD_CLOEXEC`` 旗標。" -#: ../../whatsnew/3.11.rst:725 +#: ../../whatsnew/3.11.rst:729 msgid "fractions" msgstr "fractions" -#: ../../whatsnew/3.11.rst:727 +#: ../../whatsnew/3.11.rst:731 msgid "" "Support :PEP:`515`-style initialization of :class:`~fractions.Fraction` from " "string. (Contributed by Sergey B Kirpichev in :issue:`44258`.)" @@ -1088,7 +1085,7 @@ msgstr "" "支援有 :PEP:`515` 風格的 :class:`~fractions.Fraction` 以字串初始化。(Sergey " "B Kirpichev 於 :issue:`44258` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:730 +#: ../../whatsnew/3.11.rst:734 msgid "" ":class:`~fractions.Fraction` now implements an ``__int__`` method, so that " "an ``isinstance(some_fraction, typing.SupportsInt)`` check passes. " @@ -1098,11 +1095,11 @@ msgstr "" "``isinstance(some_fraction, typing.SupportsInt)`` 的檢查會通過。(由 Mark " "Dickinson 在 :issue:`44547` 中貢獻。)" -#: ../../whatsnew/3.11.rst:738 +#: ../../whatsnew/3.11.rst:742 msgid "functools" msgstr "functools" -#: ../../whatsnew/3.11.rst:740 +#: ../../whatsnew/3.11.rst:744 msgid "" ":func:`functools.singledispatch` now supports :data:`types.UnionType` and :" "data:`typing.Union` as annotations to the dispatch argument.::" @@ -1112,15 +1109,15 @@ msgstr "" "\n" "::" -#: ../../whatsnew/3.11.rst:765 +#: ../../whatsnew/3.11.rst:769 msgid "(Contributed by Yurii Karabas in :issue:`46014`.)" msgstr "(由 Yurii Karabas 於 :issue:`46014` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:771 +#: ../../whatsnew/3.11.rst:775 msgid "hashlib" msgstr "hashlib" -#: ../../whatsnew/3.11.rst:773 +#: ../../whatsnew/3.11.rst:777 msgid "" ":func:`hashlib.blake2b` and :func:`hashlib.blake2s` now prefer `libb2`_ over " "Python's vendored copy. (Contributed by Christian Heimes in :issue:`47095`.)" @@ -1129,7 +1126,7 @@ msgstr "" "於 Python 自發行版的複製。(由 Christian Heimes 於 :issue:`47095` 中所貢" "獻。)" -#: ../../whatsnew/3.11.rst:777 +#: ../../whatsnew/3.11.rst:781 msgid "" "The internal ``_sha3`` module with SHA3 and SHAKE algorithms now uses " "*tiny_sha3* instead of the *Keccak Code Package* to reduce code and binary " @@ -1142,7 +1139,7 @@ msgstr "" "來自 OpenSSL 的 SHA3 和 SHAKE 最佳化實作。此更改僅影響沒有 OpenSSL 支援的安" "裝。(由 Christian Heimes 在 :issue:`47098` 中貢獻。)" -#: ../../whatsnew/3.11.rst:784 +#: ../../whatsnew/3.11.rst:788 msgid "" "Add :func:`hashlib.file_digest`, a helper function for efficient hashing of " "files or file-like objects. (Contributed by Christian Heimes in :gh:`89313`.)" @@ -1150,11 +1147,11 @@ msgstr "" "新增 :func:`hashlib.file_digest`,是個能夠為檔案或類檔案物件做高效率雜湊的幫" "助函式。(由 Christian Heimes 於 :gh:`89313` 中貢獻。)" -#: ../../whatsnew/3.11.rst:792 +#: ../../whatsnew/3.11.rst:796 msgid "IDLE and idlelib" msgstr "IDLE 與 idlelib" -#: ../../whatsnew/3.11.rst:794 +#: ../../whatsnew/3.11.rst:798 msgid "" "Apply syntax highlighting to ``.pyi`` files. (Contributed by Alex Waygood " "and Terry Jan Reedy in :issue:`45447`.)" @@ -1162,7 +1159,7 @@ msgstr "" "在 `.pyi` 檔案施用語法突顯 (syntax highlight)。(由 Alex Waygood 與 Terry " "Jan Reedy 於 :issue:`45447` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:797 +#: ../../whatsnew/3.11.rst:801 msgid "" "Include prompts when saving Shell with inputs and outputs. (Contributed by " "Terry Jan Reedy in :gh:`95191`.)" @@ -1170,11 +1167,11 @@ msgstr "" "當帶有輸入與輸出地儲存 Shell 時,也會包含提示字元。(由 Terry Jan Reedy 於 :" "gh:`95191` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:804 +#: ../../whatsnew/3.11.rst:808 msgid "inspect" msgstr "inspect" -#: ../../whatsnew/3.11.rst:806 +#: ../../whatsnew/3.11.rst:810 msgid "" "Add :func:`~inspect.getmembers_static` to return all members without " "triggering dynamic lookup via the descriptor protocol. (Contributed by " @@ -1184,7 +1181,7 @@ msgstr "" "(descriptor protocol) 觸發動態查找。 (由 Weipeng Hong 在 :issue:`30533` 中貢" "獻。)" -#: ../../whatsnew/3.11.rst:810 +#: ../../whatsnew/3.11.rst:814 msgid "" "Add :func:`~inspect.ismethodwrapper` for checking if the type of an object " "is a :class:`~types.MethodWrapperType`. (Contributed by Hakan Çelik in :" @@ -1193,7 +1190,7 @@ msgstr "" "新增 :func:`inspect.ismethodwrapper`,用來檢查一個物件的型別是否為 :class:" "`~types.MethodWrapperType`。(由 Hakan Çelik 於 :issue:`29418` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:814 +#: ../../whatsnew/3.11.rst:818 msgid "" "Change the frame-related functions in the :mod:`inspect` module to return " "new :class:`~inspect.FrameInfo` and :class:`~inspect.Traceback` class " @@ -1206,35 +1203,35 @@ msgstr "" "`named tuple` 的介面),包括擴充的 :pep:`657` 位置資訊(結束行號、欄和結束" "欄)。受影響的功能是:" -#: ../../whatsnew/3.11.rst:820 +#: ../../whatsnew/3.11.rst:824 msgid ":func:`inspect.getframeinfo`" msgstr ":func:`inspect.getframeinfo`" -#: ../../whatsnew/3.11.rst:821 +#: ../../whatsnew/3.11.rst:825 msgid ":func:`inspect.getouterframes`" msgstr ":func:`inspect.getouterframes`" -#: ../../whatsnew/3.11.rst:822 +#: ../../whatsnew/3.11.rst:826 msgid ":func:`inspect.getinnerframes`," msgstr ":func:`inspect.getinnerframes`," -#: ../../whatsnew/3.11.rst:823 +#: ../../whatsnew/3.11.rst:827 msgid ":func:`inspect.stack`" msgstr ":func:`inspect.stack`" -#: ../../whatsnew/3.11.rst:824 +#: ../../whatsnew/3.11.rst:828 msgid ":func:`inspect.trace`" msgstr ":func:`inspect.trace`" -#: ../../whatsnew/3.11.rst:826 +#: ../../whatsnew/3.11.rst:830 msgid "(Contributed by Pablo Galindo in :gh:`88116`.)" msgstr "(由 Pablo Galindo 於 :gh:`88116` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:832 +#: ../../whatsnew/3.11.rst:836 msgid "locale" msgstr "locale" -#: ../../whatsnew/3.11.rst:834 +#: ../../whatsnew/3.11.rst:838 msgid "" "Add :func:`locale.getencoding` to get the current locale encoding. It is " "similar to ``locale.getpreferredencoding(False)`` but ignores the :ref:" @@ -1244,11 +1241,11 @@ msgstr "" "``locale.getpreferredencoding(False)`` 類似但不考慮 :ref:`Python UTF-8 模式 " "`。" -#: ../../whatsnew/3.11.rst:842 +#: ../../whatsnew/3.11.rst:846 msgid "logging" msgstr "logging" -#: ../../whatsnew/3.11.rst:844 +#: ../../whatsnew/3.11.rst:848 msgid "" "Added :func:`~logging.getLevelNamesMapping` to return a mapping from logging " "level names (e.g. ``'CRITICAL'``) to the values of their corresponding :ref:" @@ -1259,7 +1256,7 @@ msgstr "" "``'CRITICAL'``)指到對應的 :ref:`levels` 數值(例如,預設為 ``50``)的映射。" "(由 Andrei Kulakovin 於 :gh:`88024` 中貢獻。)" -#: ../../whatsnew/3.11.rst:849 +#: ../../whatsnew/3.11.rst:853 msgid "" "Added a :meth:`~logging.handlers.SysLogHandler.createSocket` method to :" "class:`~logging.handlers.SysLogHandler`, to match :meth:`SocketHandler." @@ -1273,11 +1270,11 @@ msgstr "" "用的 socket,它會在處理程式初始化期間和發出一個事件時自動呼叫。 (由 Kirill " "Pinchuk 在 :gh:`88457` 中貢獻。)" -#: ../../whatsnew/3.11.rst:861 +#: ../../whatsnew/3.11.rst:865 msgid "math" msgstr "math" -#: ../../whatsnew/3.11.rst:863 +#: ../../whatsnew/3.11.rst:867 msgid "" "Add :func:`math.exp2`: return 2 raised to the power of x. (Contributed by " "Gideon Mitchell in :issue:`45917`.)" @@ -1285,7 +1282,7 @@ msgstr "" "新增 :func:`math.exp2`:回傳 2 的 x 次方。(由 Gideon Mitchell 於 :issue:" "`45917` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:866 +#: ../../whatsnew/3.11.rst:870 msgid "" "Add :func:`math.cbrt`: return the cube root of x. (Contributed by Ajith " "Ramachandran in :issue:`44357`.)" @@ -1293,7 +1290,7 @@ msgstr "" "新增 :func:`math.cbrt`:回傳 x 的立方根。(由 Ajith Ramachandran 於 :issue:" "`44357` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:869 +#: ../../whatsnew/3.11.rst:873 msgid "" "The behaviour of two :func:`math.pow` corner cases was changed, for " "consistency with the IEEE 754 specification. The operations ``math.pow(0.0, -" @@ -1306,7 +1303,7 @@ msgstr "" "現在回傳 ``inf``,之前它們會引發 :exc:`ValueError`。(由 Mark Dickinson 在 :" "issue:`44339` 中貢獻。)" -#: ../../whatsnew/3.11.rst:875 +#: ../../whatsnew/3.11.rst:879 msgid "" "The :data:`math.nan` value is now always available. (Contributed by Victor " "Stinner in :issue:`46917`.)" @@ -1314,11 +1311,11 @@ msgstr "" ":data:`math.nan` 現為隨時可用。(由 Victor Stinner 於 :issue:`46917` 中所貢" "獻。)" -#: ../../whatsnew/3.11.rst:882 +#: ../../whatsnew/3.11.rst:886 msgid "operator" msgstr "operator" -#: ../../whatsnew/3.11.rst:884 +#: ../../whatsnew/3.11.rst:888 msgid "" "A new function ``operator.call`` has been added, such that ``operator." "call(obj, *args, **kwargs) == obj(*args, **kwargs)``. (Contributed by Antony " @@ -1327,11 +1324,11 @@ msgstr "" "新增 ``operator.call`` 函式,使得 ``operator.call(obj, *args, **kwargs) == " "obj(*args, **kwargs)``。(由 Antony Lee 於 :issue:`44019` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:892 +#: ../../whatsnew/3.11.rst:896 msgid "os" msgstr "os" -#: ../../whatsnew/3.11.rst:894 +#: ../../whatsnew/3.11.rst:898 msgid "" "On Windows, :func:`os.urandom` now uses ``BCryptGenRandom()``, instead of " "``CryptGenRandom()`` which is deprecated. (Contributed by Dong-hee Na in :" @@ -1340,11 +1337,11 @@ msgstr "" "在 Windows 上,:func:`os.urandom` 現在使用 ``BCryptGenRandom()`` 以取代被棄用" "的 ``CryptGenRandom()``。(由 Dong-hee Na 於 :issue:`44611` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:902 +#: ../../whatsnew/3.11.rst:906 msgid "pathlib" msgstr "pathlib" -#: ../../whatsnew/3.11.rst:904 +#: ../../whatsnew/3.11.rst:908 msgid "" ":meth:`~pathlib.Path.glob` and :meth:`~pathlib.Path.rglob` return only " "directories if *pattern* ends with a pathname components separator: :data:" @@ -1355,11 +1352,11 @@ msgstr "" "結尾,:meth:`~pathlib.Path.glob` 和 :meth:`~pathlib.Path.rglob` 只回傳目錄。" "(由 Eisuke Kawasima 於 :issue:`22276` 與 :issue:`33392` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:913 +#: ../../whatsnew/3.11.rst:917 msgid "re" msgstr "re" -#: ../../whatsnew/3.11.rst:915 +#: ../../whatsnew/3.11.rst:919 msgid "" "Atomic grouping (``(?>...)``) and possessive quantifiers (``*+``, ``++``, ``?" "+``, ``{m,n}+``) are now supported in regular expressions. (Contributed by " @@ -1370,11 +1367,11 @@ msgstr "" "``{m,n}+``) 的。 (由 Jeffrey C. Jacobs 和 Serhiy Storchaka 在 :issue:" "`433030` 中貢獻。)" -#: ../../whatsnew/3.11.rst:923 +#: ../../whatsnew/3.11.rst:927 msgid "shutil" msgstr "shutil" -#: ../../whatsnew/3.11.rst:925 +#: ../../whatsnew/3.11.rst:929 msgid "" "Add optional parameter *dir_fd* in :func:`shutil.rmtree`. (Contributed by " "Serhiy Storchaka in :issue:`46245`.)" @@ -1382,11 +1379,11 @@ msgstr "" "新增 :func:`shutil.rmtree` 的可選參數 *dir_fd*。(由 Serhiy Storchaka 於 :" "issue:`46245` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:932 +#: ../../whatsnew/3.11.rst:936 msgid "socket" msgstr "socket" -#: ../../whatsnew/3.11.rst:934 +#: ../../whatsnew/3.11.rst:938 msgid "" "Add CAN Socket support for NetBSD. (Contributed by Thomas Klausner in :issue:" "`30512`.)" @@ -1394,7 +1391,7 @@ msgstr "" "新增 NetBSD 對於 CAN Socket 的支援。(由 Thomas Klausner 於 :issue:`30512` 中" "所貢獻。)" -#: ../../whatsnew/3.11.rst:937 +#: ../../whatsnew/3.11.rst:941 msgid "" ":meth:`~socket.create_connection` has an option to raise, in case of failure " "to connect, an :exc:`ExceptionGroup` containing all errors instead of only " @@ -1404,11 +1401,11 @@ msgstr "" "錯誤的 :exc:`ExceptionGroup`,而非只引發最後一個錯誤。(由 Irit Katriel 於 :" "issue:`29980` 中貢獻。)" -#: ../../whatsnew/3.11.rst:946 +#: ../../whatsnew/3.11.rst:950 msgid "sqlite3" msgstr "sqlite3" -#: ../../whatsnew/3.11.rst:948 +#: ../../whatsnew/3.11.rst:952 msgid "" "You can now disable the authorizer by passing :const:`None` to :meth:" "`~sqlite3.Connection.set_authorizer`. (Contributed by Erlend E. Aasland in :" @@ -1418,7 +1415,7 @@ msgstr "" "set_authorizer` 來停用 authorizer。(由 Erlend E. Aasland 於 :issue:`44491` " "中貢獻。)" -#: ../../whatsnew/3.11.rst:952 +#: ../../whatsnew/3.11.rst:956 msgid "" "Collation name :meth:`~sqlite3.Connection.create_collation` can now contain " "any Unicode character. Collation names with invalid characters now raise :" @@ -1430,7 +1427,7 @@ msgstr "" "`UnicodeEncodeError` 而不是 :exc:`sqlite3.ProgrammingError`。(由 Erlend E. " "Aasland 在 :issue:`44688` 中貢獻。)" -#: ../../whatsnew/3.11.rst:957 +#: ../../whatsnew/3.11.rst:961 msgid "" ":mod:`sqlite3` exceptions now include the SQLite extended error code as :" "attr:`~sqlite3.Error.sqlite_errorcode` and the SQLite error name as :attr:" @@ -1442,7 +1439,7 @@ msgstr "" "sqlite_errorname`)。(由 Aviv Palivoda、Daniel Shahaf 和 Erlend E. Aasland " "在 :issue:`16379` 和 :issue:`24139` 中貢獻。)" -#: ../../whatsnew/3.11.rst:963 +#: ../../whatsnew/3.11.rst:967 msgid "" "Add :meth:`~sqlite3.Connection.setlimit` and :meth:`~sqlite3.Connection." "getlimit` to :class:`sqlite3.Connection` for setting and getting SQLite " @@ -1453,7 +1450,7 @@ msgstr "" "getlimit` 新增到 :class:`sqlite3.Connection` 以根據連線來設定和取得 SQLite 限" "制。(由 Erlend E. Aasland 在 :issue:`45243` 中貢獻。)" -#: ../../whatsnew/3.11.rst:968 +#: ../../whatsnew/3.11.rst:972 msgid "" ":mod:`sqlite3` now sets :attr:`sqlite3.threadsafety` based on the default " "threading mode the underlying SQLite library has been compiled with. " @@ -1463,7 +1460,7 @@ msgstr "" "定 :attr:`sqlite3.threadsafety`。(由 Erlend E. Aasland 在 :issue:`45613` 中" "貢獻。)" -#: ../../whatsnew/3.11.rst:972 +#: ../../whatsnew/3.11.rst:976 msgid "" ":mod:`sqlite3` C callbacks now use unraisable exceptions if callback " "tracebacks are enabled. Users can now register an :func:`unraisable hook " @@ -1475,7 +1472,7 @@ msgstr "" "(unraisable hook handler) ` 來改善他們的除錯體驗。(由 " "Erlend E. Aasland 在 :issue:`45828` 中貢獻。)" -#: ../../whatsnew/3.11.rst:978 +#: ../../whatsnew/3.11.rst:982 msgid "" "Fetch across rollback no longer raises :exc:`~sqlite3.InterfaceError`. " "Instead we leave it to the SQLite library to handle these cases. " @@ -1485,7 +1482,7 @@ msgstr "" "們將其留給 SQLite 函式庫來處理這些情況。(由 Erlend E. Aasland 在 :issue:" "`44092` 中貢獻。)" -#: ../../whatsnew/3.11.rst:982 +#: ../../whatsnew/3.11.rst:986 msgid "" "Add :meth:`~sqlite3.Connection.serialize` and :meth:`~sqlite3.Connection." "deserialize` to :class:`sqlite3.Connection` for serializing and " @@ -1496,7 +1493,7 @@ msgstr "" "deserialize` 新增到 :class:`sqlite3.Connection` 以用於序列化和反序列化資料" "庫。(由 Erlend E. Aasland 在 :issue:`41930` 中貢獻。)" -#: ../../whatsnew/3.11.rst:987 +#: ../../whatsnew/3.11.rst:991 msgid "" "Add :meth:`~sqlite3.Connection.create_window_function` to :class:`sqlite3." "Connection` for creating aggregate window functions. (Contributed by Erlend " @@ -1506,7 +1503,7 @@ msgstr "" "create_window_function` 已建立聚合視窗函式 (aggregate window function)。(由 " "Erlend E. Aasland 於 :issue:`34916` 中貢獻。)" -#: ../../whatsnew/3.11.rst:991 +#: ../../whatsnew/3.11.rst:995 msgid "" "Add :meth:`~sqlite3.Connection.blobopen` to :class:`sqlite3.Connection`. :" "class:`sqlite3.Blob` allows incremental I/O operations on blobs. " @@ -1517,11 +1514,11 @@ msgstr "" "operations)。(由 Aviv Palivoda 和 Erlend E. Aasland 在 :issue:`24905` 中貢" "獻。)" -#: ../../whatsnew/3.11.rst:999 +#: ../../whatsnew/3.11.rst:1003 msgid "string" msgstr "string" -#: ../../whatsnew/3.11.rst:1001 +#: ../../whatsnew/3.11.rst:1005 msgid "" "Add :meth:`~string.Template.get_identifiers` and :meth:`~string.Template." "is_valid` to :class:`string.Template`, which respectively return all valid " @@ -1533,11 +1530,11 @@ msgstr "" "(placeholder) 與是否有任何不合格的預留位置存在。(由 Ben Kehoe 於 :gh:" "`90465` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1011 +#: ../../whatsnew/3.11.rst:1015 msgid "sys" msgstr "sys" -#: ../../whatsnew/3.11.rst:1013 +#: ../../whatsnew/3.11.rst:1017 msgid "" ":func:`sys.exc_info` now derives the ``type`` and ``traceback`` fields from " "the ``value`` (the exception instance), so when an exception is modified " @@ -1549,7 +1546,7 @@ msgstr "" "``traceback`` 欄位,因此當例外在處理過程中被修改時,變更會反映在 :func:`!" "exc_info` 後續呼叫的結果中。 (由 Irit Katriel 在 :issue:`45711` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1019 +#: ../../whatsnew/3.11.rst:1023 msgid "" "Add :func:`sys.exception` which returns the active exception instance " "(equivalent to ``sys.exc_info()[1]``). (Contributed by Irit Katriel in :" @@ -1559,7 +1556,7 @@ msgstr "" "exception`\\ (等價於 ``sys.exc_info()[1]``\\ )。(由 Irit Katriel 於 :" "issue:`46328` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:1023 +#: ../../whatsnew/3.11.rst:1027 msgid "" "Add the :data:`sys.flags.safe_path ` flag. (Contributed by Victor " "Stinner in :gh:`57684`.)" @@ -1567,11 +1564,11 @@ msgstr "" "新增 :data:`sys.flags.safe_path ` 旗標。(由 Victor Stinner 於 :" "gh:`57684` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:1030 +#: ../../whatsnew/3.11.rst:1034 msgid "sysconfig" msgstr "sysconfig" -#: ../../whatsnew/3.11.rst:1032 +#: ../../whatsnew/3.11.rst:1036 msgid "" "Three new :ref:`installation schemes ` (*posix_venv*, " "*nt_venv* and *venv*) were added and are used when Python creates new " @@ -1592,11 +1589,11 @@ msgstr "" "的第三方程式碼應該使用新的 *venv* 安裝方案來確定路徑,就像 :mod:`venv` 一樣。" "(由 Miro Hrončok 在 :issue:`45413` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1049 +#: ../../whatsnew/3.11.rst:1053 msgid "tempfile" msgstr "tempfile" -#: ../../whatsnew/3.11.rst:1051 +#: ../../whatsnew/3.11.rst:1055 msgid "" ":class:`~tempfile.SpooledTemporaryFile` objects now fully implement the " "methods of :class:`io.BufferedIOBase` or :class:`io.TextIOBase` (depending " @@ -1609,11 +1606,11 @@ msgstr "" "能夠正確地使用需要類檔案物件的 API,例如壓縮模組。(由 Carey Metcalfe 在 :gh:" "`70363` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1062 +#: ../../whatsnew/3.11.rst:1066 msgid "threading" msgstr "threading" -#: ../../whatsnew/3.11.rst:1064 +#: ../../whatsnew/3.11.rst:1068 msgid "" "On Unix, if the ``sem_clockwait()`` function is available in the C library " "(glibc 2.30 and newer), the :meth:`threading.Lock.acquire` method now uses " @@ -1624,15 +1621,15 @@ msgid "" msgstr "" "在 Unix 上,如果 ``sem_clockwait()`` 函式在 C 函式庫(glibc 2.30 與其更新的版" "本)中可被使用,則 :meth:`threading.Lock.acquire` 方法現在會使用單調時鐘 (:" -"const:`time. CLOCK_MONOTONIC`) 用於超時 (timeout),而不是使用系統時鐘 (:const:" -"`time.CLOCK_REALTIME`),以免受系統時鐘變化的影響。 由 Victor Stinner 在 :" -"issue:`41710` 中貢獻。)" +"const:`time. CLOCK_MONOTONIC`) 用於超時 (timeout),而不是使用系統時鐘 (:" +"const:`time.CLOCK_REALTIME`),以免受系統時鐘變化的影響。 由 Victor Stinner " +"在 :issue:`41710` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1075 +#: ../../whatsnew/3.11.rst:1079 msgid "time" msgstr "time" -#: ../../whatsnew/3.11.rst:1077 +#: ../../whatsnew/3.11.rst:1081 msgid "" "On Unix, :func:`time.sleep` now uses the ``clock_nanosleep()`` or " "``nanosleep()`` function, if available, which has a resolution of 1 " @@ -1645,7 +1642,7 @@ msgstr "" "`-9` 秒),而不是使用解析度為 1 微秒(10\\ :sup:`-6` 秒)的 ``select()``。" "(由 Benjamin Szőke 和 Victor Stinner 在 :issue:`21302` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1083 +#: ../../whatsnew/3.11.rst:1087 msgid "" "On Windows 8.1 and newer, :func:`time.sleep` now uses a waitable timer based " "on `high-resolution timers `. " @@ -1819,7 +1816,7 @@ msgstr "" "`typing.get_type_hints` 現支援了為字串求值 (evaluate)。(由 Niklas " "Rosenstein 在 :gh:`85542` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1174 +#: ../../whatsnew/3.11.rst:1178 msgid "" ":func:`typing.get_type_hints` no longer adds :data:`~typing.Optional` to " "parameters with ``None`` as a default. (Contributed by Nikita Sobolev in :gh:" @@ -1828,7 +1825,7 @@ msgstr "" ":func:`typing.get_type_hints` 不再將 :data:`~typing.Optional` 新增到預設為 " "``None`` 的參數中。(由 Nikita Sobolev 在 :gh:`90353` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1178 +#: ../../whatsnew/3.11.rst:1182 msgid "" ":func:`typing.get_type_hints` now supports evaluating bare stringified :data:" "`~typing.ClassVar` annotations. (Contributed by Gregory Beauregard in :gh:" @@ -1838,7 +1835,7 @@ msgstr "" "的 :data:`~typing.ClassVar` 標註來求值。(由 Gregory Beauregard 在 :gh:" "`90711` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1182 +#: ../../whatsnew/3.11.rst:1186 msgid "" ":func:`typing.no_type_check` no longer modifies external classes and " "functions. It also now correctly marks classmethods as not to be type " @@ -1847,11 +1844,11 @@ msgstr "" ":func:`typing.no_type_check` 不再修改外部類別和函式。它現在也正確地將類別方法" "標記為不需進行型別檢查。(由 Nikita Sobolev 在 :gh:`90729` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1190 +#: ../../whatsnew/3.11.rst:1194 msgid "unicodedata" msgstr "unicodedata" -#: ../../whatsnew/3.11.rst:1192 +#: ../../whatsnew/3.11.rst:1196 msgid "" "The Unicode database has been updated to version 14.0.0. (Contributed by " "Benjamin Peterson in :issue:`45190`)." @@ -1859,11 +1856,11 @@ msgstr "" "Unicode 資料庫被更新為 14.0.0 版本。(Benjamin Peterson 於 :issue:`45190` 中" "所貢獻。)" -#: ../../whatsnew/3.11.rst:1199 +#: ../../whatsnew/3.11.rst:1203 msgid "unittest" msgstr "unittest" -#: ../../whatsnew/3.11.rst:1201 +#: ../../whatsnew/3.11.rst:1205 msgid "" "Added methods :meth:`~unittest.TestCase.enterContext` and :meth:`~unittest." "TestCase.enterClassContext` of class :class:`~unittest.TestCase`, method :" @@ -1877,11 +1874,11 @@ msgstr "" "IsolatedAsyncioTestCase.enterAsyncContext` 方法、:func:`unittest." "enterModuleContext` 函式。(由 Serhiy Storchaka 於 :issue:`45046` 貢獻。)" -#: ../../whatsnew/3.11.rst:1213 +#: ../../whatsnew/3.11.rst:1217 msgid "venv" msgstr "venv" -#: ../../whatsnew/3.11.rst:1215 +#: ../../whatsnew/3.11.rst:1219 msgid "" "When new Python virtual environments are created, the *venv* :ref:`sysconfig " "installation scheme ` is used to determine the paths " @@ -1898,11 +1895,11 @@ msgstr "" "下更改預設的 sysconfig 安裝方案。建立新虛擬環境的第三方程式碼也應該這樣做。" "(由 Miro Hrončok 在 :issue:`45413` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1229 +#: ../../whatsnew/3.11.rst:1233 msgid "warnings" msgstr "warnings" -#: ../../whatsnew/3.11.rst:1231 +#: ../../whatsnew/3.11.rst:1235 msgid "" ":func:`warnings.catch_warnings` now accepts arguments for :func:`warnings." "simplefilter`, providing a more concise way to locally ignore warnings or " @@ -1913,11 +1910,11 @@ msgstr "" "數,提供了一種更簡潔的方法來在本地端忽略警告或將它們轉換為錯誤。 (由 Zac " "Hatfield-Dodds 在 :issue:`47074` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1239 +#: ../../whatsnew/3.11.rst:1243 msgid "zipfile" msgstr "zipfile" -#: ../../whatsnew/3.11.rst:1241 +#: ../../whatsnew/3.11.rst:1245 msgid "" "Added support for specifying member name encoding for reading metadata in a :" "class:`~zipfile.ZipFile`'s directory and file headers. (Contributed by " @@ -1927,7 +1924,7 @@ msgstr "" "標頭中讀取元資料 (metadata)。(由 Stephen J. Turnbull 和 Serhiy Storchaka " "在 :issue:`28080` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1245 +#: ../../whatsnew/3.11.rst:1249 msgid "" "Added :meth:`ZipFile.mkdir() ` for creating new " "directories inside ZIP archives. (Contributed by Sam Ezeh in :gh:`49083`.)" @@ -1935,7 +1932,7 @@ msgstr "" "新增 :meth:`ZipFile.mkdir() ` 以在 ZIP 歸檔中建立新的" "目錄。(由 Sam Ezeh 於 :gh:`49083` 貢獻。)" -#: ../../whatsnew/3.11.rst:1249 +#: ../../whatsnew/3.11.rst:1253 msgid "" "Added :attr:`~zipfile.Path.stem`, :attr:`~zipfile.Path.suffix` and :attr:" "`~zipfile.Path.suffixes` to :class:`zipfile.Path`. (Contributed by Miguel " @@ -1945,11 +1942,11 @@ msgstr "" "Path.suffix` 和 :attr:`~zipfile.Path.suffixes`。(由 Miguel Brito 於 :gh:" "`88261` 貢獻。)" -#: ../../whatsnew/3.11.rst:1257 +#: ../../whatsnew/3.11.rst:1261 msgid "Optimizations" msgstr "最佳化" -#: ../../whatsnew/3.11.rst:1259 +#: ../../whatsnew/3.11.rst:1263 msgid "" "This section covers specific optimizations independent of the :ref:" "`whatsnew311-faster-cpython` project, which is covered in its own section." @@ -1957,7 +1954,7 @@ msgstr "" "這個部分會涵蓋到特定的最佳化,但獨立於擁有自己一個說明的\\ :ref:`whatsnew311-" "faster-cpython` 計畫。" -#: ../../whatsnew/3.11.rst:1262 +#: ../../whatsnew/3.11.rst:1266 msgid "" "The compiler now optimizes simple :ref:`printf-style % formatting ` on string literals containing only the format codes " @@ -1969,7 +1966,7 @@ msgstr "" "` 最佳化並使其與相應的 :term:`f-string` 運算式一樣快。" "(由 Serhiy Storchaka 在 :issue:`28307` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1268 +#: ../../whatsnew/3.11.rst:1272 msgid "" "Integer division (``//``) is better tuned for optimization by compilers. It " "is now around 20% faster on x86-64 when dividing an :class:`int` by a value " @@ -1980,7 +1977,7 @@ msgstr "" "``2**30`` 的值時,在 x86-64 上快了大約 20%。(由 Gregory P. Smith 和 Tim " "Peters 在 :gh:`90564` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1273 +#: ../../whatsnew/3.11.rst:1277 msgid "" ":func:`sum` is now nearly 30% faster for integers smaller than ``2**30``. " "(Contributed by Stefan Behnel in :gh:`68264`.)" @@ -1988,7 +1985,7 @@ msgstr "" "針對小於 ``2**30`` 的整數,:func:`sum` 現在快了將近 30%。(由 Stefan Behnel " "於 :gh:`68264` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:1276 +#: ../../whatsnew/3.11.rst:1280 msgid "" "Resizing lists is streamlined for the common case, speeding up :meth:`list." "append` by ≈15% and simple :term:`list comprehension`\\s by up to 20-30% " @@ -1998,7 +1995,7 @@ msgstr "" "為簡單的 :term:`list comprehension` 加快了高達 20-30%(由 Dennis Sweeney 在 :" "gh:`91165` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1281 +#: ../../whatsnew/3.11.rst:1285 msgid "" "Dictionaries don't store hash values when all keys are Unicode objects, " "decreasing :class:`dict` size. For example, ``sys.getsizeof(dict." @@ -2010,7 +2007,7 @@ msgstr "" "元組減少到 272 位元組(減少 23%)。(由 Inada Naoki 在 :issue:`46845` 中貢" "獻。)" -#: ../../whatsnew/3.11.rst:1287 +#: ../../whatsnew/3.11.rst:1291 msgid "" "Using :class:`asyncio.DatagramProtocol` is now orders of magnitude faster " "when transferring large files over UDP, with speeds over 100 times higher " @@ -2020,7 +2017,7 @@ msgstr "" "了幾個數量級,傳輸 ≈60 MiB 檔案的速度提高了 100 多倍。(由 msoxzw 在 :gh:" "`91487` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1292 +#: ../../whatsnew/3.11.rst:1296 msgid "" ":mod:`math` functions :func:`~math.comb` and :func:`~math.perm` are now ≈10 " "times faster for large arguments (with a larger speedup for larger *k*). " @@ -2030,7 +2027,7 @@ msgstr "" "了 ≈10 倍(對於更大的 *k* 有更大的加速)。(由 Serhiy Storchaka 在 :issue:" "`37295` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1296 +#: ../../whatsnew/3.11.rst:1300 msgid "" "The :mod:`statistics` functions :func:`~statistics.mean`, :func:`~statistics." "variance` and :func:`~statistics.stdev` now consume iterators in one pass " @@ -2043,7 +2040,7 @@ msgstr "" "們轉換為 :class:`list`,這讓速度提升為兩倍並可以節省大量記憶體空間。(由 " "Raymond Hettinger 在 :gh:`90415` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1302 +#: ../../whatsnew/3.11.rst:1306 msgid "" ":func:`unicodedata.normalize` now normalizes pure-ASCII strings in constant " "time. (Contributed by Dong-hee Na in :issue:`44987`.)" @@ -2051,11 +2048,11 @@ msgstr "" ":func:`unicodedata.normalize` 現在在常數時間內規範化 (normalize) 純 ASCII 字" "串。(由 Dong-hee Na 在 :issue:`44987` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1310 +#: ../../whatsnew/3.11.rst:1314 msgid "Faster CPython" msgstr "更快的 CPython" -#: ../../whatsnew/3.11.rst:1312 +#: ../../whatsnew/3.11.rst:1316 msgid "" "CPython 3.11 is an average of `25% faster `_ than CPython 3.10 as measured with the " @@ -2068,7 +2065,7 @@ msgstr "" "Python 3.10 `快了 25% `_。根據程式工作量可能有所不同,整體加速程度可達 10-60%。" -#: ../../whatsnew/3.11.rst:1319 +#: ../../whatsnew/3.11.rst:1323 msgid "" "This project focuses on two major areas in Python: :ref:`whatsnew311-faster-" "startup` and :ref:`whatsnew311-faster-runtime`. Optimizations not covered by " @@ -2078,15 +2075,15 @@ msgstr "" "`whatsnew311-faster-runtime`。不在此專案內的最佳化被獨立列出在 :ref:" "`whatsnew311-optimizations`。" -#: ../../whatsnew/3.11.rst:1328 +#: ../../whatsnew/3.11.rst:1332 msgid "Faster Startup" msgstr "更快的啟動" -#: ../../whatsnew/3.11.rst:1333 +#: ../../whatsnew/3.11.rst:1337 msgid "Frozen imports / Static code objects" msgstr "凍結引入 (Frozen imports) / 靜態程式碼物件 (Static code objects)" -#: ../../whatsnew/3.11.rst:1335 +#: ../../whatsnew/3.11.rst:1339 msgid "" "Python caches :term:`bytecode` in the :ref:`__pycache__ ` " "directory to speed up module loading." @@ -2094,11 +2091,11 @@ msgstr "" "Python 將\\ :term:`位元組碼 `\\ 於 :ref:`__pycache__` " "目錄中存為快取來加速模組的載入。" -#: ../../whatsnew/3.11.rst:1338 +#: ../../whatsnew/3.11.rst:1342 msgid "Previously in 3.10, Python module execution looked like this:" msgstr "在先前的 3.10 中,執行 Python 模組會像是這樣:" -#: ../../whatsnew/3.11.rst:1344 +#: ../../whatsnew/3.11.rst:1348 msgid "" "In Python 3.11, the core modules essential for Python startup are " "\"frozen\". This means that their :ref:`codeobjects` (and bytecode) are " @@ -2109,7 +2106,7 @@ msgstr "" "ref:`程式碼物件 `\\ (和位元組碼)是由直譯器靜態分配的。這將模組" "執行過程中的步驟減少為:" -#: ../../whatsnew/3.11.rst:1353 +#: ../../whatsnew/3.11.rst:1357 msgid "" "Interpreter startup is now 10-15% faster in Python 3.11. This has a big " "impact for short-running programs using Python." @@ -2117,21 +2114,21 @@ msgstr "" "在 Python 3.11 中直譯器啟動速度快了 10-15%。這對於使用 Python 所撰寫的短暫程" "式有著巨大影響。" -#: ../../whatsnew/3.11.rst:1356 +#: ../../whatsnew/3.11.rst:1360 msgid "" "(Contributed by Eric Snow, Guido van Rossum and Kumar Aditya in many issues.)" msgstr "" "(由 Eric Snow、Guido van Rossum 與 Kumar Aditya 於多個 issue 中貢獻。)" -#: ../../whatsnew/3.11.rst:1362 +#: ../../whatsnew/3.11.rst:1366 msgid "Faster Runtime" msgstr "更快的運行程式" -#: ../../whatsnew/3.11.rst:1367 +#: ../../whatsnew/3.11.rst:1371 msgid "Cheaper, lazy Python frames" msgstr "所需資源更少 (cheaper) 且惰性的 (lazy)) Python 幀 (frame)" -#: ../../whatsnew/3.11.rst:1369 +#: ../../whatsnew/3.11.rst:1373 msgid "" "Python frames, holding execution information, are created whenever Python " "calls a Python function. The following are new frame optimizations:" @@ -2139,16 +2136,16 @@ msgstr "" "每當 Python 呼叫 Python 函式時,就會建立保存執行資訊的 Python 幀。以下是針對" "幀而做的新最佳化:" -#: ../../whatsnew/3.11.rst:1373 +#: ../../whatsnew/3.11.rst:1377 msgid "Streamlined the frame creation process." msgstr "使幀的建立過程更有效率。" -#: ../../whatsnew/3.11.rst:1374 +#: ../../whatsnew/3.11.rst:1378 msgid "" "Avoided memory allocation by generously re-using frame space on the C stack." msgstr "在 C 堆疊 (stack) 中盡量重複利用幀的空間來避免記憶體分配。" -#: ../../whatsnew/3.11.rst:1375 +#: ../../whatsnew/3.11.rst:1379 msgid "" "Streamlined the internal frame struct to contain only essential information. " "Frames previously held extra debugging and memory management information." @@ -2156,7 +2153,7 @@ msgstr "" "讓內部幀結構只包含必要資訊,使其更加精簡。在過去,幀必須帶有額外的偵錯與記憶" "體管理的資訊。" -#: ../../whatsnew/3.11.rst:1378 +#: ../../whatsnew/3.11.rst:1382 msgid "" "Old-style :ref:`frame objects ` are now created only when " "requested by debuggers or by Python introspection functions such as :func:" @@ -2170,15 +2167,15 @@ msgstr "" "對於大多數使用者程式碼,根本不會建立任何幀物件。結果幾乎所有 Python 函式呼叫" "都顯著加速。我們以 pyperformance 測得了 3-7% 的加速。" -#: ../../whatsnew/3.11.rst:1385 +#: ../../whatsnew/3.11.rst:1389 msgid "(Contributed by Mark Shannon in :issue:`44590`.)" msgstr "(由 Mark Shannon 於 :issue:`44590` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:1392 +#: ../../whatsnew/3.11.rst:1396 msgid "Inlined Python function calls" msgstr "行內 Python 函式呼叫" -#: ../../whatsnew/3.11.rst:1394 +#: ../../whatsnew/3.11.rst:1398 msgid "" "During a Python function call, Python will call an evaluating C function to " "interpret that function's code. This effectively limits pure Python " @@ -2187,7 +2184,7 @@ msgstr "" "在 Python 函式呼叫期間,Python 將呼叫一個正在求值的 C 函式來直譯該函式的程式" "碼,這有效地將純 Python 遞迴限制在對 C 堆疊的安全範圍內。" -#: ../../whatsnew/3.11.rst:1398 +#: ../../whatsnew/3.11.rst:1402 msgid "" "In 3.11, when CPython detects Python code calling another Python function, " "it sets up a new frame, and \"jumps\" to the new code inside the new frame. " @@ -2197,7 +2194,7 @@ msgstr "" "一個新框架 (frame),並「跳轉」到新框架內的新程式碼,這避免了呼叫整個 C 直譯函" "式。" -#: ../../whatsnew/3.11.rst:1402 +#: ../../whatsnew/3.11.rst:1406 msgid "" "Most Python function calls now consume no C stack space, speeding them up. " "In simple recursive functions like fibonacci or factorial, we observed a " @@ -2210,15 +2207,15 @@ msgstr "" "以遞迴得更深(如果使用者有增加\\ :func:`遞迴限制 `\\ )。我們在 pyperformance 測得 1-3% 的改進。" -#: ../../whatsnew/3.11.rst:1409 +#: ../../whatsnew/3.11.rst:1413 msgid "(Contributed by Pablo Galindo and Mark Shannon in :issue:`45256`.)" msgstr "(由 Pablo Galindo 與 Mark Shannon 於 :issue:`45256` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:1415 +#: ../../whatsnew/3.11.rst:1419 msgid "PEP 659: Specializing Adaptive Interpreter" msgstr "PEP 659:特化的適應性直譯器" -#: ../../whatsnew/3.11.rst:1417 +#: ../../whatsnew/3.11.rst:1421 msgid "" ":pep:`659` is one of the key parts of the Faster CPython project. The " "general idea is that while Python is a dynamic language, most code has " @@ -2229,7 +2226,7 @@ msgstr "" "種動態語言,但大多數程式碼都有物件和型別很少去更改的區域。這個概念被稱為\\ *" "型別穩定 (type stability)*\\ 。" -#: ../../whatsnew/3.11.rst:1421 +#: ../../whatsnew/3.11.rst:1425 msgid "" "At runtime, Python will try to look for common patterns and type stability " "in the executing code. Python will then replace the current operation with a " @@ -2245,7 +2242,7 @@ msgstr "" "稱為\\ *行內快取 (inline caching)*\\ 的概念,其中 Python 將繁重操作的結果直接" "快取在\\ :term:`位元組碼 `\\ 中。" -#: ../../whatsnew/3.11.rst:1429 +#: ../../whatsnew/3.11.rst:1433 msgid "" "The specializer will also combine certain common instruction pairs into one " "superinstruction, reducing the overhead during execution." @@ -2253,7 +2250,7 @@ msgstr "" "特化程式 (specializer) 還將某些常用指示 (common instruction) 組合成一個超級指" "示 (superinstruction),這減少了執行期間的開銷。" -#: ../../whatsnew/3.11.rst:1432 +#: ../../whatsnew/3.11.rst:1436 msgid "" "Python will only specialize when it sees code that is \"hot\" (executed " "multiple times). This prevents Python from wasting time on run-once code. " @@ -2267,7 +2264,7 @@ msgstr "" "特化 (de-specialize)。特化會定期被嘗試執行,而嘗試的成本也不會太高,這讓特化" "得以適應新的環境。" -#: ../../whatsnew/3.11.rst:1439 +#: ../../whatsnew/3.11.rst:1443 msgid "" "(PEP written by Mark Shannon, with ideas inspired by Stefan Brunthaler. See :" "pep:`659` for more information. Implementation by Mark Shannon and Brandt " @@ -2277,43 +2274,43 @@ msgstr "" "`659`。由 Mark Shannon 和 Brandt Bucher 實作,Irit Katriel 和 Dennis Sweeney " "亦提供了額外的幫助。)" -#: ../../whatsnew/3.11.rst:1447 +#: ../../whatsnew/3.11.rst:1451 msgid "Operation" msgstr "操作" -#: ../../whatsnew/3.11.rst:1447 +#: ../../whatsnew/3.11.rst:1451 msgid "Form" msgstr "形式" -#: ../../whatsnew/3.11.rst:1447 +#: ../../whatsnew/3.11.rst:1451 msgid "Specialization" msgstr "特化" -#: ../../whatsnew/3.11.rst:1447 +#: ../../whatsnew/3.11.rst:1451 msgid "Operation speedup (up to)" msgstr "操作加速程度(上限)" -#: ../../whatsnew/3.11.rst:1447 +#: ../../whatsnew/3.11.rst:1451 msgid "Contributor(s)" msgstr "貢獻者" -#: ../../whatsnew/3.11.rst:1450 +#: ../../whatsnew/3.11.rst:1454 msgid "Binary operations" msgstr "二元操作" -#: ../../whatsnew/3.11.rst:1450 +#: ../../whatsnew/3.11.rst:1454 msgid "``x + x``" msgstr "``x + x``" -#: ../../whatsnew/3.11.rst:1452 +#: ../../whatsnew/3.11.rst:1456 msgid "``x - x``" msgstr "``x - x``" -#: ../../whatsnew/3.11.rst:1454 +#: ../../whatsnew/3.11.rst:1458 msgid "``x * x``" msgstr "``x * x``" -#: ../../whatsnew/3.11.rst:1450 +#: ../../whatsnew/3.11.rst:1454 msgid "" "Binary add, multiply and subtract for common types such as :class:`int`, :" "class:`float` and :class:`str` take custom fast paths for their underlying " @@ -2322,23 +2319,23 @@ msgstr "" "常見型別如 :class:`int`、:class:`float` 與 :class:`str` 的二元加法、乘法與減" "法,為底層型別採取了特製的快速路徑。" -#: ../../whatsnew/3.11.rst:1450 +#: ../../whatsnew/3.11.rst:1454 msgid "10%" msgstr "10%" -#: ../../whatsnew/3.11.rst:1450 +#: ../../whatsnew/3.11.rst:1454 msgid "Mark Shannon, Dong-hee Na, Brandt Bucher, Dennis Sweeney" msgstr "Mark Shannon, Dong-hee Na, Brandt Bucher, Dennis Sweeney" -#: ../../whatsnew/3.11.rst:1456 +#: ../../whatsnew/3.11.rst:1460 msgid "Subscript" msgstr "下標" -#: ../../whatsnew/3.11.rst:1456 +#: ../../whatsnew/3.11.rst:1460 msgid "``a[i]``" msgstr "``a[i]``" -#: ../../whatsnew/3.11.rst:1456 +#: ../../whatsnew/3.11.rst:1460 msgid "" "Subscripting container types such as :class:`list`, :class:`tuple` and :" "class:`dict` directly index the underlying data structures." @@ -2346,7 +2343,7 @@ msgstr "" "下標容器型別如 :class:`list`、:class:`tuple` 和 :class:`dict` 直接索引底層的" "資料結構。" -#: ../../whatsnew/3.11.rst:1460 +#: ../../whatsnew/3.11.rst:1464 msgid "" "Subscripting custom :meth:`~object.__getitem__` is also inlined similar to :" "ref:`inline-calls`." @@ -2354,43 +2351,43 @@ msgstr "" "下標自定義 :meth:`~object.__getitem__` 也是行內的,類似於 :ref:`inline-" "calls`。" -#: ../../whatsnew/3.11.rst:1456 ../../whatsnew/3.11.rst:1463 +#: ../../whatsnew/3.11.rst:1460 ../../whatsnew/3.11.rst:1467 msgid "10-25%" msgstr "10-25%" -#: ../../whatsnew/3.11.rst:1456 +#: ../../whatsnew/3.11.rst:1460 msgid "Irit Katriel, Mark Shannon" msgstr "Irit Katriel, Mark Shannon" -#: ../../whatsnew/3.11.rst:1463 +#: ../../whatsnew/3.11.rst:1467 msgid "Store subscript" msgstr "儲存下標" -#: ../../whatsnew/3.11.rst:1463 +#: ../../whatsnew/3.11.rst:1467 msgid "``a[i] = z``" msgstr "``a[i] = z``" -#: ../../whatsnew/3.11.rst:1463 +#: ../../whatsnew/3.11.rst:1467 msgid "Similar to subscripting specialization above." msgstr "類似於上面的下標特化。" -#: ../../whatsnew/3.11.rst:1463 +#: ../../whatsnew/3.11.rst:1467 msgid "Dennis Sweeney" msgstr "Dennis Sweeney" -#: ../../whatsnew/3.11.rst:1466 +#: ../../whatsnew/3.11.rst:1470 msgid "Calls" msgstr "呼叫" -#: ../../whatsnew/3.11.rst:1466 +#: ../../whatsnew/3.11.rst:1470 msgid "``f(arg)``" msgstr "``f(arg)``" -#: ../../whatsnew/3.11.rst:1468 +#: ../../whatsnew/3.11.rst:1472 msgid "``C(arg)``" msgstr "``C(arg)``" -#: ../../whatsnew/3.11.rst:1466 +#: ../../whatsnew/3.11.rst:1470 msgid "" "Calls to common builtin (C) functions and types such as :func:`len` and :" "class:`str` directly call their underlying C version. This avoids going " @@ -2399,27 +2396,27 @@ msgstr "" "常見內建 (C) 函式和型別的呼叫,例如 :func:`len` 和 :class:`str`,會直接呼叫它" "們的 C 版本底層,這避免了通過內部呼叫的慣例。" -#: ../../whatsnew/3.11.rst:1466 +#: ../../whatsnew/3.11.rst:1470 msgid "20%" msgstr "20%" -#: ../../whatsnew/3.11.rst:1466 +#: ../../whatsnew/3.11.rst:1470 msgid "Mark Shannon, Ken Jin" msgstr "Mark Shannon, Ken Jin" -#: ../../whatsnew/3.11.rst:1471 +#: ../../whatsnew/3.11.rst:1475 msgid "Load global variable" msgstr "載入全域變數" -#: ../../whatsnew/3.11.rst:1471 +#: ../../whatsnew/3.11.rst:1475 msgid "``print``" msgstr "``print``" -#: ../../whatsnew/3.11.rst:1473 +#: ../../whatsnew/3.11.rst:1477 msgid "``len``" msgstr "``len``" -#: ../../whatsnew/3.11.rst:1471 +#: ../../whatsnew/3.11.rst:1475 msgid "" "The object's index in the globals/builtins namespace is cached. Loading " "globals and builtins require zero namespace lookups." @@ -2427,24 +2424,24 @@ msgstr "" "全域/內建之命名空間內的物件索引被快取起來。載入全域與內建變數不需要任何命名空" "間的查找。" -#: ../../whatsnew/3.11.rst:1471 +#: ../../whatsnew/3.11.rst:1475 msgid "[#load-global]_" msgstr "[#load-global]_" -#: ../../whatsnew/3.11.rst:1471 ../../whatsnew/3.11.rst:1475 -#: ../../whatsnew/3.11.rst:1484 +#: ../../whatsnew/3.11.rst:1475 ../../whatsnew/3.11.rst:1479 +#: ../../whatsnew/3.11.rst:1488 msgid "Mark Shannon" msgstr "Mark Shannon" -#: ../../whatsnew/3.11.rst:1475 +#: ../../whatsnew/3.11.rst:1479 msgid "Load attribute" msgstr "載入屬性" -#: ../../whatsnew/3.11.rst:1475 +#: ../../whatsnew/3.11.rst:1479 msgid "``o.attr``" msgstr "``o.attr``" -#: ../../whatsnew/3.11.rst:1475 +#: ../../whatsnew/3.11.rst:1479 msgid "" "Similar to loading global variables. The attribute's index inside the class/" "object's namespace is cached. In most cases, attribute loading will require " @@ -2453,19 +2450,19 @@ msgstr "" "和載入全域變數類似,類別/物件之命名空間內的屬性索引被快取起來。在大部分情況" "中,載入屬性不需要任何命名空間的查找。" -#: ../../whatsnew/3.11.rst:1475 +#: ../../whatsnew/3.11.rst:1479 msgid "[#load-attr]_" msgstr "[#load-attr]_" -#: ../../whatsnew/3.11.rst:1480 +#: ../../whatsnew/3.11.rst:1484 msgid "Load methods for call" msgstr "載入要呼叫的方法" -#: ../../whatsnew/3.11.rst:1480 +#: ../../whatsnew/3.11.rst:1484 msgid "``o.meth()``" msgstr "``o.meth()``" -#: ../../whatsnew/3.11.rst:1480 +#: ../../whatsnew/3.11.rst:1484 msgid "" "The actual address of the method is cached. Method loading now has no " "namespace lookups -- even for classes with long inheritance chains." @@ -2473,54 +2470,54 @@ msgstr "" "方法的真實記憶體地址被快取 (cache) 起來,方法的載入現在不需要命名空間的查找 " "-- 即便有很長繼承鏈結的類別也是。" -#: ../../whatsnew/3.11.rst:1480 +#: ../../whatsnew/3.11.rst:1484 msgid "10-20%" msgstr "10-20%" -#: ../../whatsnew/3.11.rst:1480 +#: ../../whatsnew/3.11.rst:1484 msgid "Ken Jin, Mark Shannon" msgstr "Ken Jin, Mark Shannon" -#: ../../whatsnew/3.11.rst:1484 +#: ../../whatsnew/3.11.rst:1488 msgid "Store attribute" msgstr "儲存屬性" -#: ../../whatsnew/3.11.rst:1484 +#: ../../whatsnew/3.11.rst:1488 msgid "``o.attr = z``" msgstr "``o.attr = z``" -#: ../../whatsnew/3.11.rst:1484 +#: ../../whatsnew/3.11.rst:1488 msgid "Similar to load attribute optimization." msgstr "和載入屬性的最佳化相似。" -#: ../../whatsnew/3.11.rst:1484 +#: ../../whatsnew/3.11.rst:1488 msgid "2% in pyperformance" msgstr "2% 於 pyperformance 中" -#: ../../whatsnew/3.11.rst:1487 +#: ../../whatsnew/3.11.rst:1491 msgid "Unpack Sequence" msgstr "拆解 (unpack) 序列" -#: ../../whatsnew/3.11.rst:1487 +#: ../../whatsnew/3.11.rst:1491 msgid "``*seq``" msgstr "``*seq``" -#: ../../whatsnew/3.11.rst:1487 +#: ../../whatsnew/3.11.rst:1491 msgid "" "Specialized for common containers such as :class:`list` and :class:`tuple`. " "Avoids internal calling convention." msgstr "" "為像是 :class:`list` 和 :class:`tuple` 的常見容器所特化,避免了內部呼叫慣例。" -#: ../../whatsnew/3.11.rst:1487 +#: ../../whatsnew/3.11.rst:1491 msgid "8%" msgstr "8%" -#: ../../whatsnew/3.11.rst:1487 +#: ../../whatsnew/3.11.rst:1491 msgid "Brandt Bucher" msgstr "Brandt Bucher" -#: ../../whatsnew/3.11.rst:1492 +#: ../../whatsnew/3.11.rst:1496 msgid "" "A similar optimization already existed since Python 3.8. 3.11 specializes " "for more forms and reduces some overhead." @@ -2528,7 +2525,7 @@ msgstr "" "類似的最佳化自從 Python 3.8 就存在。3.11 特別處理了更多形式並減少效能開銷 " "(overhead)。" -#: ../../whatsnew/3.11.rst:1495 +#: ../../whatsnew/3.11.rst:1499 msgid "" "A similar optimization already existed since Python 3.10. 3.11 specializes " "for more forms. Furthermore, all attribute loads should be sped up by :issue:" @@ -2537,11 +2534,11 @@ msgstr "" "類似的最佳化自從 Python 3.10 就存在。3.11 特別處理了更多形式。此外,所有屬性" "載入也被 :issue:`45947` 所加速。" -#: ../../whatsnew/3.11.rst:1503 +#: ../../whatsnew/3.11.rst:1507 msgid "Misc" msgstr "雜項" -#: ../../whatsnew/3.11.rst:1505 +#: ../../whatsnew/3.11.rst:1509 msgid "" "Objects now require less memory due to lazily created object namespaces. " "Their namespace dictionaries now also share keys more freely. (Contributed " @@ -2551,7 +2548,7 @@ msgstr "" "字典現在也更自由地共享鍵。(由 Mark Shannon 於 :issue:`45340` 和 :issue:" "`40116` 貢獻。 )" -#: ../../whatsnew/3.11.rst:1509 +#: ../../whatsnew/3.11.rst:1513 msgid "" "\"Zero-cost\" exceptions are implemented, eliminating the cost of :keyword:" "`try` statements when no exception is raised. (Contributed by Mark Shannon " @@ -2560,7 +2557,7 @@ msgstr "" "實作了「無代價 (Zero-cost)」的例外,消除了在沒有例外被引發時的 :keyword:" "`try` 陳述式開銷。(由 Mark Shannon 於 :issue:`40222` 貢獻。)" -#: ../../whatsnew/3.11.rst:1513 +#: ../../whatsnew/3.11.rst:1517 msgid "" "A more concise representation of exceptions in the interpreter reduced the " "time required for catching an exception by about 10%. (Contributed by Irit " @@ -2569,7 +2566,7 @@ msgstr "" "在直譯器內使用更簡潔的例外表示法將捕獲一個例外所需的時間減少了大約 10%。 由 " "Irit Katriel 在 :issue:`45711` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1517 +#: ../../whatsnew/3.11.rst:1521 msgid "" ":mod:`re`'s regular expression matching engine has been partially " "refactored, and now uses computed gotos (or \"threaded code\") on supported " @@ -2584,15 +2581,15 @@ msgstr "" "benchmarks.html#regex-dna>`_\\ 的表現上比起 Python 3.10 快了 10%。(由 " "Brandt Bucher 於 :gh:`91404` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1528 +#: ../../whatsnew/3.11.rst:1532 msgid "FAQ" msgstr "FAQ" -#: ../../whatsnew/3.11.rst:1533 +#: ../../whatsnew/3.11.rst:1537 msgid "How should I write my code to utilize these speedups?" msgstr "我該如何在程式碼中獲取這些加速?" -#: ../../whatsnew/3.11.rst:1535 +#: ../../whatsnew/3.11.rst:1539 msgid "" "Write Pythonic code that follows common best practices; you don't have to " "change your code. The Faster CPython project optimizes for common code " @@ -2601,11 +2598,11 @@ msgstr "" "撰寫符合 Python 風格 (Pythonic) 且依循常見最佳實踐的程式碼就好,你不需要改變" "你的程式碼。CPython 加速計畫中,我們為所觀察到的常見程式編寫模式來做最佳化。" -#: ../../whatsnew/3.11.rst:1543 +#: ../../whatsnew/3.11.rst:1547 msgid "Will CPython 3.11 use more memory?" msgstr "Python 3.11 會不會使用更多記憶體?" -#: ../../whatsnew/3.11.rst:1545 +#: ../../whatsnew/3.11.rst:1549 msgid "" "Maybe not; we don't expect memory use to exceed 20% higher than 3.10. This " "is offset by memory optimizations for frame objects and object dictionaries " @@ -2614,11 +2611,11 @@ msgstr "" "也許不會。我們預期不會有超出 3.10 20% 的記憶體使用量。這數字會和上述禎物件與" "物件字典的記憶體最佳化而有所偏差。" -#: ../../whatsnew/3.11.rst:1553 +#: ../../whatsnew/3.11.rst:1557 msgid "I don't see any speedups in my workload. Why?" msgstr "我在我的程式當中沒感覺到任何加速,為什麼?" -#: ../../whatsnew/3.11.rst:1555 +#: ../../whatsnew/3.11.rst:1559 msgid "" "Certain code won't have noticeable benefits. If your code spends most of its " "time on I/O operations, or already does most of its computation in a C " @@ -2629,7 +2626,7 @@ msgstr "" "將大部分計算用像是 numpy 的 C 擴充函式庫處理,那就不會有明顯的加速。這個計畫" "是對純 Python 的工作負荷最有幫助。" -#: ../../whatsnew/3.11.rst:1560 +#: ../../whatsnew/3.11.rst:1564 msgid "" "Furthermore, the pyperformance figures are a geometric mean. Even within the " "pyperformance benchmarks, certain benchmarks have slowed down slightly, " @@ -2638,19 +2635,19 @@ msgstr "" "此外,pyperformance 數值為一個幾何平均數 (geometric mean)。即便在 " "pyperformance 基準量測中,某些測試稍微慢了一些,但其他加快了將近兩倍!" -#: ../../whatsnew/3.11.rst:1568 +#: ../../whatsnew/3.11.rst:1572 msgid "Is there a JIT compiler?" msgstr "有用到 JIT 編譯器嗎?" -#: ../../whatsnew/3.11.rst:1570 +#: ../../whatsnew/3.11.rst:1574 msgid "No. We're still exploring other optimizations." msgstr "沒有,我們還在探索其他最佳化方式。" -#: ../../whatsnew/3.11.rst:1576 +#: ../../whatsnew/3.11.rst:1580 msgid "About" msgstr "關於" -#: ../../whatsnew/3.11.rst:1578 +#: ../../whatsnew/3.11.rst:1582 msgid "" "Faster CPython explores optimizations for :term:`CPython`. The main team is " "funded by Microsoft to work on this full-time. Pablo Galindo Salgado is also " @@ -2661,11 +2658,11 @@ msgstr "" "(microsoft) 所資助以全職發展該計畫,Pablo Galindo Salgado 亦由彭博有限合夥企" "業 (Bloomberg LP) 資助來兼職開發,更有許許多多來自社群的自發性貢獻者。" -#: ../../whatsnew/3.11.rst:1587 +#: ../../whatsnew/3.11.rst:1591 msgid "CPython bytecode changes" msgstr "CPython 位元組碼 (bytecode) 變更" -#: ../../whatsnew/3.11.rst:1589 +#: ../../whatsnew/3.11.rst:1593 msgid "" "The bytecode now contains inline cache entries, which take the form of the " "newly-added :opcode:`CACHE` instructions. Many opcodes expect to be followed " @@ -2679,11 +2676,11 @@ msgstr "" "(populated) 快取看起來像任意指示,因此在讀取或修改包含加速資料的原始且適應 " "(adaptive) 位元組碼時應格外小心。" -#: ../../whatsnew/3.11.rst:1601 +#: ../../whatsnew/3.11.rst:1605 msgid "New opcodes" msgstr "新增 opcode" -#: ../../whatsnew/3.11.rst:1603 +#: ../../whatsnew/3.11.rst:1607 msgid "" ":opcode:`ASYNC_GEN_WRAP`, :opcode:`RETURN_GENERATOR` and :opcode:`SEND`, " "used in generators and co-routines." @@ -2691,7 +2688,7 @@ msgstr "" ":opcode:`ASYNC_GEN_WRAP`、:opcode:`RETURN_GENERATOR` 和 :opcode:`SEND` 被用於" "產生器與協程。" -#: ../../whatsnew/3.11.rst:1606 +#: ../../whatsnew/3.11.rst:1610 msgid "" ":opcode:`COPY_FREE_VARS`, which avoids needing special caller-side code for " "closures." @@ -2699,17 +2696,17 @@ msgstr "" ":opcode:`COPY_FREE_VARS`,避免了為閉包 (closure) 而生的特殊呼叫方 (caller-" "side) 程式碼的需求。" -#: ../../whatsnew/3.11.rst:1609 +#: ../../whatsnew/3.11.rst:1613 msgid "" ":opcode:`JUMP_BACKWARD_NO_INTERRUPT`, for use in certain loops where " "handling interrupts is undesirable." msgstr ":opcode:`JUMP_BACKWARD_NO_INTERRUPT`,用於某些不需要處理中斷的循環。" -#: ../../whatsnew/3.11.rst:1612 +#: ../../whatsnew/3.11.rst:1616 msgid ":opcode:`MAKE_CELL`, to create :ref:`cell-objects`." msgstr ":opcode:`MAKE_CELL` 被用於建立 :ref:`cell-objects`。" -#: ../../whatsnew/3.11.rst:1614 +#: ../../whatsnew/3.11.rst:1618 msgid "" ":opcode:`CHECK_EG_MATCH` and :opcode:`PREP_RERAISE_STAR`, to handle the :" "ref:`new exception groups and except* ` added in :pep:" @@ -2718,29 +2715,29 @@ msgstr "" ":opcode:`CHECK_EG_MATCH` 和 :opcode:`PREP_RERAISE_STAR`,處理 :pep:`654` 所加" "入的\\ :ref:`新增例外群組和 except* `。" -#: ../../whatsnew/3.11.rst:1618 +#: ../../whatsnew/3.11.rst:1622 msgid ":opcode:`PUSH_EXC_INFO`, for use in exception handlers." msgstr ":opcode:`PUSH_EXC_INFO` 被用於例外處理函式。" -#: ../../whatsnew/3.11.rst:1620 +#: ../../whatsnew/3.11.rst:1624 msgid "" ":opcode:`RESUME`, a no-op, for internal tracing, debugging and optimization " "checks." msgstr ":opcode:`RESUME`,為無操作 (no-po),用於內部追查、除錯和最佳化檢查。" -#: ../../whatsnew/3.11.rst:1627 +#: ../../whatsnew/3.11.rst:1631 msgid "Replaced opcodes" msgstr "被取代的操作碼 (opcode)" -#: ../../whatsnew/3.11.rst:1630 +#: ../../whatsnew/3.11.rst:1634 msgid "Replaced Opcode(s)" msgstr "被取代的操作碼" -#: ../../whatsnew/3.11.rst:1630 +#: ../../whatsnew/3.11.rst:1634 msgid "New Opcode(s)" msgstr "新的操作碼" -#: ../../whatsnew/3.11.rst:1630 +#: ../../whatsnew/3.11.rst:1634 msgid "Notes" msgstr "註記" @@ -2752,11 +2749,11 @@ msgstr ":opcode:`!BINARY_*`" msgid ":opcode:`!INPLACE_*`" msgstr ":opcode:`!INPLACE_*`" -#: ../../whatsnew/3.11.rst:1632 +#: ../../whatsnew/3.11.rst:1636 msgid ":opcode:`BINARY_OP`" msgstr ":opcode:`BINARY_OP`" -#: ../../whatsnew/3.11.rst:1632 +#: ../../whatsnew/3.11.rst:1636 msgid "Replaced all numeric binary/in-place opcodes with a single opcode" msgstr "以單一一個操作碼來取代所有數值的、二進位/原位 (in-place) 操作碼" @@ -2788,7 +2785,7 @@ msgstr ":opcode:`PRECALL`" msgid ":opcode:`PUSH_NULL`" msgstr ":opcode:`PUSH_NULL`" -#: ../../whatsnew/3.11.rst:1635 +#: ../../whatsnew/3.11.rst:1639 msgid "" "Decouples argument shifting for methods from handling of keyword arguments; " "allows better specialization of calls" @@ -2828,7 +2825,7 @@ msgstr ":opcode:`COPY`" msgid ":opcode:`SWAP`" msgstr ":opcode:`SWAP`" -#: ../../whatsnew/3.11.rst:1640 +#: ../../whatsnew/3.11.rst:1644 msgid "Stack manipulation instructions" msgstr "堆疊操作指示" @@ -2840,7 +2837,7 @@ msgstr ":opcode:`!JUMP_IF_NOT_EXC_MATCH`" msgid ":opcode:`CHECK_EXC_MATCH`" msgstr ":opcode:`CHECK_EXC_MATCH`" -#: ../../whatsnew/3.11.rst:1647 +#: ../../whatsnew/3.11.rst:1651 msgid "Now performs check but doesn't jump" msgstr "現在執行檢查但不跳位 (jump)" @@ -2868,7 +2865,7 @@ msgstr ":opcode:`POP_JUMP_BACKWARD_IF_* `" msgid ":opcode:`POP_JUMP_FORWARD_IF_* `" msgstr ":opcode:`POP_JUMP_FORWARD_IF_* `" -#: ../../whatsnew/3.11.rst:1649 +#: ../../whatsnew/3.11.rst:1653 msgid "" "See [#bytecode-jump]_; ``TRUE``, ``FALSE``, ``NONE`` and ``NOT_NONE`` " "variants for each direction" @@ -2884,15 +2881,15 @@ msgstr ":opcode:`!SETUP_WITH`" msgid ":opcode:`!SETUP_ASYNC_WITH`" msgstr ":opcode:`!SETUP_ASYNC_WITH`" -#: ../../whatsnew/3.11.rst:1655 +#: ../../whatsnew/3.11.rst:1659 msgid ":opcode:`BEFORE_WITH`" msgstr ":opcode:`BEFORE_WITH`" -#: ../../whatsnew/3.11.rst:1655 +#: ../../whatsnew/3.11.rst:1659 msgid ":keyword:`with` block setup" msgstr ":keyword:`with` 區塊設置" -#: ../../whatsnew/3.11.rst:1659 +#: ../../whatsnew/3.11.rst:1663 msgid "" "All jump opcodes are now relative, including the existing :opcode:" "`JUMP_IF_TRUE_OR_POP` and :opcode:`JUMP_IF_FALSE_OR_POP`. The argument is " @@ -2902,11 +2899,11 @@ msgstr "" "`JUMP_IF_TRUE_OR_POP` 和 :opcode:`JUMP_IF_FALSE_OR_POP`。該引數現在是當前指" "示 (instruction) 的偏移量而不是絕對位置。" -#: ../../whatsnew/3.11.rst:1670 +#: ../../whatsnew/3.11.rst:1674 msgid "Changed/removed opcodes" msgstr "有更動/被移除的 opcode" -#: ../../whatsnew/3.11.rst:1672 +#: ../../whatsnew/3.11.rst:1676 msgid "" "Changed :opcode:`MATCH_CLASS` and :opcode:`MATCH_KEYS` to no longer push an " "additional boolean value to indicate success/failure. Instead, ``None`` is " @@ -2916,7 +2913,7 @@ msgstr "" "值來表示成功/失敗。取而代之的是會在失敗時推送 ``None``,而非一個包含提取值的" "元組。" -#: ../../whatsnew/3.11.rst:1677 +#: ../../whatsnew/3.11.rst:1681 msgid "" "Changed opcodes that work with exceptions to reflect them now being " "represented as one item on the stack instead of three (see :gh:`89874`)." @@ -2924,7 +2921,7 @@ msgstr "" "更改了運作於例外的操作碼以反映它們現在在堆疊中的表示為一項而不是三項(請參" "閱 :gh:`89874`)。" -#: ../../whatsnew/3.11.rst:1681 +#: ../../whatsnew/3.11.rst:1685 msgid "" "Removed :opcode:`!COPY_DICT_WITHOUT_KEYS`, :opcode:`!GEN_START`, :opcode:`!" "POP_BLOCK`, :opcode:`!SETUP_FINALLY` and :opcode:`!YIELD_FROM`." @@ -2932,26 +2929,26 @@ msgstr "" "刪除 :opcode:`!COPY_DICT_WITHOUT_KEYS`、:opcode:`!GEN_START`、:opcode:`!" "POP_BLOCK`、:opcode:`!SETUP_FINALLY` 和 :opcode:`!YIELD_FROM`。" -#: ../../whatsnew/3.11.rst:1689 ../../whatsnew/3.11.rst:2561 +#: ../../whatsnew/3.11.rst:1693 ../../whatsnew/3.11.rst:2565 msgid "Deprecated" msgstr "已棄用" -#: ../../whatsnew/3.11.rst:1691 +#: ../../whatsnew/3.11.rst:1695 msgid "" "This section lists Python APIs that have been deprecated in Python 3.11." msgstr "這個部分列出了在 Python 3.11 中棄用的 Python API。" -#: ../../whatsnew/3.11.rst:1693 +#: ../../whatsnew/3.11.rst:1697 msgid "" "Deprecated C APIs are :ref:`listed separately `." msgstr "被棄用的 C API 被\\ :ref:`獨立列出 `。" -#: ../../whatsnew/3.11.rst:1700 +#: ../../whatsnew/3.11.rst:1704 msgid "Language/Builtins" msgstr "語言/內建" -#: ../../whatsnew/3.11.rst:1702 +#: ../../whatsnew/3.11.rst:1706 msgid "" "Chaining :class:`classmethod` descriptors (introduced in :issue:`19072`) is " "now deprecated. It can no longer be used to wrap other descriptors such as :" @@ -2966,7 +2963,7 @@ msgstr "" "慮使用 Python 3.10 中添加的 :attr:`!__wrapped__` 屬性。(由 Raymond " "Hettinger 在 :gh:`89519` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1710 +#: ../../whatsnew/3.11.rst:1714 msgid "" "Octal escapes in string and bytes literals with values larger than ``0o377`` " "(255 in decimal) now produce a :exc:`DeprecationWarning`. In a future Python " @@ -2978,7 +2975,7 @@ msgstr "" "Python 版本中,他們將引發一個 :exc:`SyntaxWarning` 並最終引發一個 :exc:" "`SyntaxError`。(由 Serhiy Storchaka 在 :gh:`81548` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1716 +#: ../../whatsnew/3.11.rst:1720 msgid "" "The delegation of :func:`int` to :meth:`~object.__trunc__` is now " "deprecated. Calling ``int(a)`` when ``type(a)`` implements :meth:`!" @@ -2991,93 +2988,93 @@ msgstr "" "meth:`~object.__index__`,呼叫 ``int(a)`` 現在會引發一個 :exc:" "`DeprecationWarning`。(由 Zackery Spytz 在 :issue:`44977` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1726 +#: ../../whatsnew/3.11.rst:1730 msgid "Modules" msgstr "模組" -#: ../../whatsnew/3.11.rst:1730 +#: ../../whatsnew/3.11.rst:1734 msgid "" ":pep:`594` led to the deprecations of the following modules slated for " "removal in Python 3.13:" msgstr ":pep:`594` 引領下列模組的棄用,並排訂於 Python 3.13 移除:" -#: ../../whatsnew/3.11.rst:1734 +#: ../../whatsnew/3.11.rst:1738 msgid ":mod:`aifc`" msgstr ":mod:`aifc`" -#: ../../whatsnew/3.11.rst:1734 +#: ../../whatsnew/3.11.rst:1738 msgid ":mod:`chunk`" msgstr ":mod:`chunk`" -#: ../../whatsnew/3.11.rst:1734 +#: ../../whatsnew/3.11.rst:1738 msgid ":mod:`msilib`" msgstr ":mod:`msilib`" -#: ../../whatsnew/3.11.rst:1734 +#: ../../whatsnew/3.11.rst:1738 msgid ":mod:`pipes`" msgstr ":mod:`pipes`" -#: ../../whatsnew/3.11.rst:1734 +#: ../../whatsnew/3.11.rst:1738 msgid ":mod:`telnetlib`" msgstr ":mod:`telnetlib`" -#: ../../whatsnew/3.11.rst:1736 +#: ../../whatsnew/3.11.rst:1740 msgid ":mod:`audioop`" msgstr ":mod:`audioop`" -#: ../../whatsnew/3.11.rst:1736 +#: ../../whatsnew/3.11.rst:1740 msgid ":mod:`crypt`" msgstr ":mod:`crypt`" -#: ../../whatsnew/3.11.rst:1736 +#: ../../whatsnew/3.11.rst:1740 msgid ":mod:`nis`" msgstr ":mod:`nis`" -#: ../../whatsnew/3.11.rst:1736 +#: ../../whatsnew/3.11.rst:1740 msgid ":mod:`sndhdr`" msgstr ":mod:`sndhdr`" -#: ../../whatsnew/3.11.rst:1736 +#: ../../whatsnew/3.11.rst:1740 msgid ":mod:`uu`" msgstr ":mod:`uu`" -#: ../../whatsnew/3.11.rst:1738 +#: ../../whatsnew/3.11.rst:1742 msgid ":mod:`cgi`" msgstr ":mod:`cgi`" -#: ../../whatsnew/3.11.rst:1738 +#: ../../whatsnew/3.11.rst:1742 msgid ":mod:`imghdr`" msgstr ":mod:`imghdr`" -#: ../../whatsnew/3.11.rst:1738 +#: ../../whatsnew/3.11.rst:1742 msgid ":mod:`nntplib`" msgstr ":mod:`nntplib`" -#: ../../whatsnew/3.11.rst:1738 +#: ../../whatsnew/3.11.rst:1742 msgid ":mod:`spwd`" msgstr ":mod:`spwd`" -#: ../../whatsnew/3.11.rst:1738 +#: ../../whatsnew/3.11.rst:1742 msgid ":mod:`xdrlib`" msgstr ":mod:`xdrlib`" -#: ../../whatsnew/3.11.rst:1740 +#: ../../whatsnew/3.11.rst:1744 msgid ":mod:`cgitb`" msgstr ":mod:`cgitb`" -#: ../../whatsnew/3.11.rst:1740 +#: ../../whatsnew/3.11.rst:1744 msgid ":mod:`mailcap`" msgstr ":mod:`mailcap`" -#: ../../whatsnew/3.11.rst:1740 +#: ../../whatsnew/3.11.rst:1744 msgid ":mod:`ossaudiodev`" msgstr ":mod:`ossaudiodev`" -#: ../../whatsnew/3.11.rst:1740 +#: ../../whatsnew/3.11.rst:1744 msgid ":mod:`sunau`" msgstr ":mod:`sunau`" -#: ../../whatsnew/3.11.rst:1743 +#: ../../whatsnew/3.11.rst:1747 msgid "" "(Contributed by Brett Cannon in :issue:`47061` and Victor Stinner in :gh:" "`68966`.)" @@ -3085,7 +3082,7 @@ msgstr "" "(由 Brett Cannon 和 Victor Stinner 分別於 :issue:`47061` 與 :gh:`68966` 中所" "貢獻。)" -#: ../../whatsnew/3.11.rst:1746 +#: ../../whatsnew/3.11.rst:1750 msgid "" "The :mod:`asynchat`, :mod:`asyncore` and :mod:`smtpd` modules have been " "deprecated since at least Python 3.6. Their documentation and deprecation " @@ -3096,7 +3093,7 @@ msgstr "" "用,它們的文件與棄用警告現在已被更新為會提示它們即將於 Python 3.12 中移除。" "(由 Hugo van Kemenade 於 :issue:`47022` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1751 +#: ../../whatsnew/3.11.rst:1755 msgid "" "The :mod:`lib2to3` package and :ref:`2to3 <2to3-reference>` tool are now " "deprecated and may not be able to parse Python 3.10 or newer. See :pep:" @@ -3107,7 +3104,7 @@ msgstr "" "析 Python 3.10 或更新版本。有關詳細資訊請參閱 :pep:`617`,它引入了新的 PEG 剖" "析器。(由 Victor Stinner 在 :issue:`40360` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1756 +#: ../../whatsnew/3.11.rst:1760 msgid "" "Undocumented modules :mod:`!sre_compile`, :mod:`!sre_constants` and :mod:`!" "sre_parse` are now deprecated. (Contributed by Serhiy Storchaka in :issue:" @@ -3117,11 +3114,11 @@ msgstr "" "sre_parse` 模組現在已被棄用。(由 Serhiy Storchaka 在 :issue:`47152` 中貢" "獻。)" -#: ../../whatsnew/3.11.rst:1764 +#: ../../whatsnew/3.11.rst:1768 msgid "Standard Library" msgstr "標準函式庫" -#: ../../whatsnew/3.11.rst:1766 +#: ../../whatsnew/3.11.rst:1770 msgid "" "The following have been deprecated in :mod:`configparser` since Python 3.2. " "Their deprecation warnings have now been updated to note they will be " @@ -3130,23 +3127,23 @@ msgstr "" "以下 :mod:`configparser` 相關項目已在 Python 3.2 中棄用,它們的棄用警告現在會" "提示它們即將於 Python 3.12 中移除:" -#: ../../whatsnew/3.11.rst:1770 +#: ../../whatsnew/3.11.rst:1774 msgid "the :class:`!configparser.SafeConfigParser` class" msgstr ":class:`!configparser.SafeConfigParser` 類別" -#: ../../whatsnew/3.11.rst:1771 +#: ../../whatsnew/3.11.rst:1775 msgid "the :attr:`!configparser.ParsingError.filename` property" msgstr ":attr:`!configparser.ParsingError.filename` 屬性" -#: ../../whatsnew/3.11.rst:1772 +#: ../../whatsnew/3.11.rst:1776 msgid "the :meth:`configparser.RawConfigParser.readfp` method" msgstr ":meth:`configparser.RawConfigParser.readfp` 方法" -#: ../../whatsnew/3.11.rst:1774 +#: ../../whatsnew/3.11.rst:1778 msgid "(Contributed by Hugo van Kemenade in :issue:`45173`.)" msgstr "(由 Hugo van Kemenade 於 :issue:`45173` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:1776 +#: ../../whatsnew/3.11.rst:1780 msgid "" ":class:`!configparser.LegacyInterpolation` has been deprecated in the " "docstring since Python 3.2, and is not listed in the :mod:`configparser` " @@ -3161,7 +3158,7 @@ msgstr "" "BasicInterpolation` 或 :class:`configparser.ExtendedInterpolation`。(由 " "Hugo van Kemenade 在 :issue:`46607` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1783 +#: ../../whatsnew/3.11.rst:1787 msgid "" "The older set of :mod:`importlib.resources` functions were deprecated in " "favor of the replacements added in Python 3.9 and will be removed in a " @@ -3172,35 +3169,35 @@ msgstr "" "用、並將在未來的 Python 版本中刪除,取而代之的是在 Python 3.9 中添加的替代方" "案:" -#: ../../whatsnew/3.11.rst:1788 +#: ../../whatsnew/3.11.rst:1792 msgid ":func:`importlib.resources.contents`" msgstr ":func:`importlib.resources.contents`" -#: ../../whatsnew/3.11.rst:1789 +#: ../../whatsnew/3.11.rst:1793 msgid ":func:`importlib.resources.is_resource`" msgstr ":func:`importlib.resources.is_resource`" -#: ../../whatsnew/3.11.rst:1790 +#: ../../whatsnew/3.11.rst:1794 msgid ":func:`importlib.resources.open_binary`" msgstr ":func:`importlib.resources.open_binary`" -#: ../../whatsnew/3.11.rst:1791 +#: ../../whatsnew/3.11.rst:1795 msgid ":func:`importlib.resources.open_text`" msgstr ":func:`importlib.resources.open_text`" -#: ../../whatsnew/3.11.rst:1792 +#: ../../whatsnew/3.11.rst:1796 msgid ":func:`importlib.resources.read_binary`" msgstr ":func:`importlib.resources.read_binary`" -#: ../../whatsnew/3.11.rst:1793 +#: ../../whatsnew/3.11.rst:1797 msgid ":func:`importlib.resources.read_text`" msgstr ":func:`importlib.resources.read_text`" -#: ../../whatsnew/3.11.rst:1794 +#: ../../whatsnew/3.11.rst:1798 msgid ":func:`importlib.resources.path`" msgstr ":func:`importlib.resources.path`" -#: ../../whatsnew/3.11.rst:1796 +#: ../../whatsnew/3.11.rst:1800 msgid "" "The :func:`locale.getdefaultlocale` function is deprecated and will be " "removed in Python 3.13. Use :func:`locale.setlocale`, :func:`locale." @@ -3212,7 +3209,7 @@ msgstr "" "` 和 :func:`locale.getlocale`。(Victor Stinner " "於 :gh:`90817` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:1802 +#: ../../whatsnew/3.11.rst:1806 msgid "" "The :func:`locale.resetlocale` function is deprecated and will be removed in " "Python 3.13. Use ``locale.setlocale(locale.LC_ALL, \"\")`` instead. " @@ -3222,7 +3219,7 @@ msgstr "" "``locale.setlocale(locale.LC_ALL, \"\")``。(由 Victor Stinner 於 :gh:" "`90817` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:1806 +#: ../../whatsnew/3.11.rst:1810 msgid "" "Stricter rules will now be applied for numerical group references and group " "names in :ref:`regular expressions `. Only sequences of ASCII " @@ -3238,7 +3235,7 @@ msgstr "" "字母、數字和底線。目前,會針對違反這些規則的語法發出棄用警告。(由 Serhiy " "Storchaka 在 :gh:`91760` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1814 +#: ../../whatsnew/3.11.rst:1818 msgid "" "In the :mod:`re` module, the :func:`!re.template` function and the " "corresponding :const:`!re.TEMPLATE` and :const:`!re.T` flags are deprecated, " @@ -3247,11 +3244,11 @@ msgid "" "in :gh:`92728`.)" msgstr "" "在 :mod:`re` 模組中,:func:`!re.template` 函式和相應的 :const:`!re.TEMPLATE` " -"和 :const:`!re.T` 旗標被棄用,因為它們沒被記錄於文件中並且缺乏明顯的目的。它們" -"將在 Python 3.13 中被刪除。(由 Serhiy Storchaka 和 Miro Hrončok 在 :gh:" +"和 :const:`!re.T` 旗標被棄用,因為它們沒被記錄於文件中並且缺乏明顯的目的。它" +"們將在 Python 3.13 中被刪除。(由 Serhiy Storchaka 和 Miro Hrončok 在 :gh:" "`92728` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1820 +#: ../../whatsnew/3.11.rst:1824 msgid "" ":func:`turtle.settiltangle` has been deprecated since Python 3.1; it now " "emits a deprecation warning and will be removed in Python 3.13. Use :func:" @@ -3264,7 +3261,7 @@ msgstr "" "誤地標記為已棄用,其文件字串現在已更正)。(由 Hugo van Kemenade 在 :issue:" "`45837` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1826 +#: ../../whatsnew/3.11.rst:1830 msgid "" ":class:`typing.Text`, which exists solely to provide compatibility support " "between Python 2 and Python 3 code, is now deprecated. Its removal is " @@ -3275,7 +3272,7 @@ msgstr "" "用。目前未計劃刪除它,但鼓勵用戶盡可能使用 :class:`str` 代替。(由 Alex " "Waygood 在 :gh:`92332` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1832 +#: ../../whatsnew/3.11.rst:1836 msgid "" "The keyword argument syntax for constructing :data:`typing.TypedDict` types " "is now deprecated. Support will be removed in Python 3.13. (Contributed by " @@ -3284,7 +3281,7 @@ msgstr "" "用於建構 :data:`typing.TypedDict` 型別的關鍵字引數語法現已棄用。將在 Python " "3.13 中停止支援。(由 Jingchen Ye 在 :gh:`90224` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1836 +#: ../../whatsnew/3.11.rst:1840 msgid "" ":class:`!webbrowser.MacOSX` is deprecated and will be removed in Python " "3.13. It is untested, undocumented, and not used by :mod:`webbrowser` " @@ -3294,7 +3291,7 @@ msgstr "" "過、沒紀錄於文件、也沒有被 :mod:`webbrowser` 本身使用。(由 Dong-hee Na 於 :" "issue:`42255`。)" -#: ../../whatsnew/3.11.rst:1840 +#: ../../whatsnew/3.11.rst:1844 msgid "" "The behavior of returning a value from a :class:`~unittest.TestCase` and :" "class:`~unittest.IsolatedAsyncioTestCase` test methods (other than the " @@ -3304,7 +3301,7 @@ msgstr "" "IsolatedAsyncioTestCase` 測試方法(預設的 ``None`` 值除外)給定值的行為現已棄" "用。" -#: ../../whatsnew/3.11.rst:1844 +#: ../../whatsnew/3.11.rst:1848 msgid "" "Deprecated the following not-formally-documented :mod:`unittest` functions, " "scheduled for removal in Python 3.13:" @@ -3312,39 +3309,39 @@ msgstr "" "棄用以下並沒有正式紀錄於文件中的 :mod:`unittest` 函式,並預計於 Python 3.13 " "中移除:" -#: ../../whatsnew/3.11.rst:1847 +#: ../../whatsnew/3.11.rst:1851 msgid ":func:`!unittest.findTestCases`" msgstr ":func:`!unittest.findTestCases`" -#: ../../whatsnew/3.11.rst:1848 +#: ../../whatsnew/3.11.rst:1852 msgid ":func:`!unittest.makeSuite`" msgstr ":func:`!unittest.makeSuite`" -#: ../../whatsnew/3.11.rst:1849 +#: ../../whatsnew/3.11.rst:1853 msgid ":func:`!unittest.getTestCaseNames`" msgstr ":func:`!unittest.getTestCaseNames`" -#: ../../whatsnew/3.11.rst:1851 +#: ../../whatsnew/3.11.rst:1855 msgid "Use :class:`~unittest.TestLoader` methods instead:" msgstr "改用 :class:`~unittest.TestLoader` 方法:" -#: ../../whatsnew/3.11.rst:1853 +#: ../../whatsnew/3.11.rst:1857 msgid ":meth:`unittest.TestLoader.loadTestsFromModule`" msgstr ":meth:`unittest.TestLoader.loadTestsFromModule`" -#: ../../whatsnew/3.11.rst:1854 +#: ../../whatsnew/3.11.rst:1858 msgid ":meth:`unittest.TestLoader.loadTestsFromTestCase`" msgstr ":meth:`unittest.TestLoader.loadTestsFromTestCase`" -#: ../../whatsnew/3.11.rst:1855 +#: ../../whatsnew/3.11.rst:1859 msgid ":meth:`unittest.TestLoader.getTestCaseNames`" msgstr ":meth:`unittest.TestLoader.getTestCaseNames`" -#: ../../whatsnew/3.11.rst:1857 +#: ../../whatsnew/3.11.rst:1861 msgid "(Contributed by Erlend E. Aasland in :issue:`5846`.)" msgstr "(由 Erlend E. Aasland 於 :issue:`5846` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:1859 +#: ../../whatsnew/3.11.rst:1863 msgid "" ":meth:`~!unittest.TestProgram.usageExit` is marked deprecated, to be removed " "in 3.13. (Contributed by Carlos Damázio in :gh:`67048`.)" @@ -3352,17 +3349,17 @@ msgstr "" ":meth:`~!unittest.TestProgram.usageExit` 被標記為已棄用,即將在 3.13 中移除" "(由 Carlos Damázio 在 :gh:`67048` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1868 ../../whatsnew/3.11.rst:2589 +#: ../../whatsnew/3.11.rst:1872 ../../whatsnew/3.11.rst:2593 msgid "Pending Removal in Python 3.12" msgstr "Python 3.12 中待決議的移除項目" -#: ../../whatsnew/3.11.rst:1870 +#: ../../whatsnew/3.11.rst:1874 msgid "" "The following Python APIs have been deprecated in earlier Python releases, " "and will be removed in Python 3.12." msgstr "下列 API 已在先前的 Python 發布版本中棄用,並將於 Python 3.12 中移除。" -#: ../../whatsnew/3.11.rst:1873 +#: ../../whatsnew/3.11.rst:1877 msgid "" "C APIs pending removal are :ref:`listed separately `." @@ -3370,270 +3367,270 @@ msgstr "" "待定的 C API 移除項目為\\ :ref:`獨立列出的 `。" -#: ../../whatsnew/3.11.rst:1876 +#: ../../whatsnew/3.11.rst:1880 msgid "The :mod:`asynchat` module" msgstr ":mod:`asynchat` 模組" -#: ../../whatsnew/3.11.rst:1877 +#: ../../whatsnew/3.11.rst:1881 msgid "The :mod:`asyncore` module" msgstr ":mod:`asyncore` 模組" -#: ../../whatsnew/3.11.rst:1878 +#: ../../whatsnew/3.11.rst:1882 msgid "The :ref:`entire distutils package `" msgstr ":ref:`整個 distutils 套件 `" -#: ../../whatsnew/3.11.rst:1879 +#: ../../whatsnew/3.11.rst:1883 msgid "The :mod:`!imp` module" msgstr "" -#: ../../whatsnew/3.11.rst:1880 +#: ../../whatsnew/3.11.rst:1884 msgid "The :class:`typing.io ` namespace" msgstr ":class:`typing.io ` 命名空間" -#: ../../whatsnew/3.11.rst:1881 +#: ../../whatsnew/3.11.rst:1885 msgid "The :class:`typing.re ` namespace" msgstr ":class:`typing.re ` 命名空間" -#: ../../whatsnew/3.11.rst:1882 +#: ../../whatsnew/3.11.rst:1886 msgid ":func:`!cgi.log`" msgstr ":func:`!cgi.log`" -#: ../../whatsnew/3.11.rst:1883 +#: ../../whatsnew/3.11.rst:1887 msgid ":func:`!importlib.find_loader`" msgstr "" -#: ../../whatsnew/3.11.rst:1884 +#: ../../whatsnew/3.11.rst:1888 msgid ":meth:`!importlib.abc.Loader.module_repr`" msgstr "" -#: ../../whatsnew/3.11.rst:1885 +#: ../../whatsnew/3.11.rst:1889 msgid ":meth:`!importlib.abc.MetaPathFinder.find_module`" msgstr "" -#: ../../whatsnew/3.11.rst:1886 +#: ../../whatsnew/3.11.rst:1890 msgid ":meth:`!importlib.abc.PathEntryFinder.find_loader`" msgstr "" -#: ../../whatsnew/3.11.rst:1887 +#: ../../whatsnew/3.11.rst:1891 msgid ":meth:`!importlib.abc.PathEntryFinder.find_module`" msgstr "" -#: ../../whatsnew/3.11.rst:1888 +#: ../../whatsnew/3.11.rst:1892 msgid ":meth:`!importlib.machinery.BuiltinImporter.find_module`" msgstr ":meth:`!importlib.machinery.BuiltinImporter.find_module`" -#: ../../whatsnew/3.11.rst:1889 +#: ../../whatsnew/3.11.rst:1893 msgid ":meth:`!importlib.machinery.BuiltinLoader.module_repr`" msgstr ":meth:`!importlib.machinery.BuiltinLoader.module_repr`" -#: ../../whatsnew/3.11.rst:1890 +#: ../../whatsnew/3.11.rst:1894 msgid ":meth:`!importlib.machinery.FileFinder.find_loader`" msgstr ":meth:`!importlib.machinery.FileFinder.find_loader`" -#: ../../whatsnew/3.11.rst:1891 +#: ../../whatsnew/3.11.rst:1895 msgid ":meth:`!importlib.machinery.FileFinder.find_module`" msgstr ":meth:`!importlib.machinery.FileFinder.find_module`" -#: ../../whatsnew/3.11.rst:1892 +#: ../../whatsnew/3.11.rst:1896 msgid ":meth:`!importlib.machinery.FrozenImporter.find_module`" msgstr ":meth:`!importlib.machinery.FrozenImporter.find_module`" -#: ../../whatsnew/3.11.rst:1893 +#: ../../whatsnew/3.11.rst:1897 msgid ":meth:`!importlib.machinery.FrozenLoader.module_repr`" msgstr ":meth:`!importlib.machinery.FrozenLoader.module_repr`" -#: ../../whatsnew/3.11.rst:1894 +#: ../../whatsnew/3.11.rst:1898 msgid ":meth:`!importlib.machinery.PathFinder.find_module`" msgstr "" -#: ../../whatsnew/3.11.rst:1895 +#: ../../whatsnew/3.11.rst:1899 msgid ":meth:`!importlib.machinery.WindowsRegistryFinder.find_module`" msgstr ":meth:`!importlib.machinery.WindowsRegistryFinder.find_module`" -#: ../../whatsnew/3.11.rst:1896 +#: ../../whatsnew/3.11.rst:1900 msgid ":func:`!importlib.util.module_for_loader`" msgstr "" -#: ../../whatsnew/3.11.rst:1897 +#: ../../whatsnew/3.11.rst:1901 msgid ":func:`!importlib.util.set_loader_wrapper`" msgstr ":func:`!importlib.util.set_loader_wrapper`" -#: ../../whatsnew/3.11.rst:1898 +#: ../../whatsnew/3.11.rst:1902 msgid ":func:`!importlib.util.set_package_wrapper`" msgstr ":func:`!importlib.util.set_package_wrapper`" -#: ../../whatsnew/3.11.rst:1899 +#: ../../whatsnew/3.11.rst:1903 msgid ":class:`!pkgutil.ImpImporter`" msgstr "" -#: ../../whatsnew/3.11.rst:1900 +#: ../../whatsnew/3.11.rst:1904 msgid ":class:`!pkgutil.ImpLoader`" msgstr "" -#: ../../whatsnew/3.11.rst:1901 +#: ../../whatsnew/3.11.rst:1905 msgid ":meth:`pathlib.Path.link_to`" msgstr ":meth:`pathlib.Path.link_to`" -#: ../../whatsnew/3.11.rst:1902 +#: ../../whatsnew/3.11.rst:1906 msgid ":func:`!sqlite3.enable_shared_cache`" msgstr ":func:`!sqlite3.enable_shared_cache`" -#: ../../whatsnew/3.11.rst:1903 +#: ../../whatsnew/3.11.rst:1907 msgid ":func:`!sqlite3.OptimizedUnicode`" msgstr ":func:`!sqlite3.OptimizedUnicode`" -#: ../../whatsnew/3.11.rst:1904 +#: ../../whatsnew/3.11.rst:1908 msgid ":envvar:`PYTHONTHREADDEBUG` environment variable" msgstr ":envvar:`PYTHONTHREADDEBUG` 環境變數" -#: ../../whatsnew/3.11.rst:1905 +#: ../../whatsnew/3.11.rst:1909 msgid "The following deprecated aliases in :mod:`unittest`:" msgstr ":mod:`unittest` 中被棄用的別名:" -#: ../../whatsnew/3.11.rst:1908 +#: ../../whatsnew/3.11.rst:1912 msgid "Deprecated alias" msgstr "已棄用的別名" -#: ../../whatsnew/3.11.rst:1908 +#: ../../whatsnew/3.11.rst:1912 msgid "Method Name" msgstr "方法名稱" -#: ../../whatsnew/3.11.rst:1908 +#: ../../whatsnew/3.11.rst:1912 msgid "Deprecated in" msgstr "棄用於" -#: ../../whatsnew/3.11.rst:1910 +#: ../../whatsnew/3.11.rst:1914 msgid "``failUnless``" msgstr "``failUnless``" -#: ../../whatsnew/3.11.rst:1910 ../../whatsnew/3.11.rst:1917 +#: ../../whatsnew/3.11.rst:1914 ../../whatsnew/3.11.rst:1921 msgid ":meth:`.assertTrue`" msgstr ":meth:`.assertTrue`" -#: ../../whatsnew/3.11.rst:1910 ../../whatsnew/3.11.rst:1911 -#: ../../whatsnew/3.11.rst:1912 ../../whatsnew/3.11.rst:1913 #: ../../whatsnew/3.11.rst:1914 ../../whatsnew/3.11.rst:1915 -#: ../../whatsnew/3.11.rst:1916 +#: ../../whatsnew/3.11.rst:1916 ../../whatsnew/3.11.rst:1917 +#: ../../whatsnew/3.11.rst:1918 ../../whatsnew/3.11.rst:1919 +#: ../../whatsnew/3.11.rst:1920 msgid "3.1" msgstr "3.1" -#: ../../whatsnew/3.11.rst:1911 +#: ../../whatsnew/3.11.rst:1915 msgid "``failIf``" msgstr "``failIf``" -#: ../../whatsnew/3.11.rst:1911 +#: ../../whatsnew/3.11.rst:1915 msgid ":meth:`.assertFalse`" msgstr ":meth:`.assertFalse`" -#: ../../whatsnew/3.11.rst:1912 +#: ../../whatsnew/3.11.rst:1916 msgid "``failUnlessEqual``" msgstr "``failUnlessEqual``" -#: ../../whatsnew/3.11.rst:1912 ../../whatsnew/3.11.rst:1918 +#: ../../whatsnew/3.11.rst:1916 ../../whatsnew/3.11.rst:1922 msgid ":meth:`.assertEqual`" msgstr ":meth:`.assertEqual`" -#: ../../whatsnew/3.11.rst:1913 +#: ../../whatsnew/3.11.rst:1917 msgid "``failIfEqual``" msgstr "``failIfEqual``" -#: ../../whatsnew/3.11.rst:1913 ../../whatsnew/3.11.rst:1919 +#: ../../whatsnew/3.11.rst:1917 ../../whatsnew/3.11.rst:1923 msgid ":meth:`.assertNotEqual`" msgstr ":meth:`.assertNotEqual`" -#: ../../whatsnew/3.11.rst:1914 +#: ../../whatsnew/3.11.rst:1918 msgid "``failUnlessAlmostEqual``" msgstr "``failUnlessAlmostEqual``" -#: ../../whatsnew/3.11.rst:1914 ../../whatsnew/3.11.rst:1920 +#: ../../whatsnew/3.11.rst:1918 ../../whatsnew/3.11.rst:1924 msgid ":meth:`.assertAlmostEqual`" msgstr ":meth:`.assertAlmostEqual`" -#: ../../whatsnew/3.11.rst:1915 +#: ../../whatsnew/3.11.rst:1919 msgid "``failIfAlmostEqual``" msgstr "``failIfAlmostEqual``" -#: ../../whatsnew/3.11.rst:1915 ../../whatsnew/3.11.rst:1921 +#: ../../whatsnew/3.11.rst:1919 ../../whatsnew/3.11.rst:1925 msgid ":meth:`.assertNotAlmostEqual`" msgstr ":meth:`.assertNotAlmostEqual`" -#: ../../whatsnew/3.11.rst:1916 +#: ../../whatsnew/3.11.rst:1920 msgid "``failUnlessRaises``" msgstr "``failUnlessRaises``" -#: ../../whatsnew/3.11.rst:1916 +#: ../../whatsnew/3.11.rst:1920 msgid ":meth:`.assertRaises`" msgstr ":meth:`.assertRaises`" -#: ../../whatsnew/3.11.rst:1917 +#: ../../whatsnew/3.11.rst:1921 msgid "``assert_``" msgstr "``assert_``" -#: ../../whatsnew/3.11.rst:1917 ../../whatsnew/3.11.rst:1918 -#: ../../whatsnew/3.11.rst:1919 ../../whatsnew/3.11.rst:1920 #: ../../whatsnew/3.11.rst:1921 ../../whatsnew/3.11.rst:1922 -#: ../../whatsnew/3.11.rst:1923 +#: ../../whatsnew/3.11.rst:1923 ../../whatsnew/3.11.rst:1924 +#: ../../whatsnew/3.11.rst:1925 ../../whatsnew/3.11.rst:1926 +#: ../../whatsnew/3.11.rst:1927 msgid "3.2" msgstr "3.2" -#: ../../whatsnew/3.11.rst:1918 +#: ../../whatsnew/3.11.rst:1922 msgid "``assertEquals``" msgstr "``assertEquals``" -#: ../../whatsnew/3.11.rst:1919 +#: ../../whatsnew/3.11.rst:1923 msgid "``assertNotEquals``" msgstr "``assertNotEquals``" -#: ../../whatsnew/3.11.rst:1920 +#: ../../whatsnew/3.11.rst:1924 msgid "``assertAlmostEquals``" msgstr "``assertAlmostEquals``" -#: ../../whatsnew/3.11.rst:1921 +#: ../../whatsnew/3.11.rst:1925 msgid "``assertNotAlmostEquals``" msgstr "``assertNotAlmostEquals``" -#: ../../whatsnew/3.11.rst:1922 +#: ../../whatsnew/3.11.rst:1926 msgid "``assertRegexpMatches``" msgstr "``assertRegexpMatches``" -#: ../../whatsnew/3.11.rst:1922 +#: ../../whatsnew/3.11.rst:1926 msgid ":meth:`.assertRegex`" msgstr ":meth:`.assertRegex`" -#: ../../whatsnew/3.11.rst:1923 +#: ../../whatsnew/3.11.rst:1927 msgid "``assertRaisesRegexp``" msgstr "``assertRaisesRegexp``" -#: ../../whatsnew/3.11.rst:1923 +#: ../../whatsnew/3.11.rst:1927 msgid ":meth:`.assertRaisesRegex`" msgstr ":meth:`.assertRaisesRegex`" -#: ../../whatsnew/3.11.rst:1924 +#: ../../whatsnew/3.11.rst:1928 msgid "``assertNotRegexpMatches``" msgstr "``assertNotRegexpMatches``" -#: ../../whatsnew/3.11.rst:1924 +#: ../../whatsnew/3.11.rst:1928 msgid ":meth:`.assertNotRegex`" msgstr ":meth:`.assertNotRegex`" -#: ../../whatsnew/3.11.rst:1924 +#: ../../whatsnew/3.11.rst:1928 msgid "3.5" msgstr "3.5" -#: ../../whatsnew/3.11.rst:1931 ../../whatsnew/3.11.rst:2615 +#: ../../whatsnew/3.11.rst:1935 ../../whatsnew/3.11.rst:2619 msgid "Removed" msgstr "已移除" -#: ../../whatsnew/3.11.rst:1933 +#: ../../whatsnew/3.11.rst:1937 msgid "This section lists Python APIs that have been removed in Python 3.11." msgstr "此部分列出 Python 3.11 中移除的 Python API。" -#: ../../whatsnew/3.11.rst:1935 +#: ../../whatsnew/3.11.rst:1939 msgid "" "Removed C APIs are :ref:`listed separately `." msgstr "被移除的 C API 被\\ :ref:`獨立列出 `。" -#: ../../whatsnew/3.11.rst:1937 +#: ../../whatsnew/3.11.rst:1941 msgid "" "Removed the :func:`!@asyncio.coroutine` :term:`decorator` enabling legacy " "generator-based coroutines to be compatible with :keyword:`async` / :keyword:" @@ -3646,7 +3643,7 @@ msgstr "" "相容。該函式自 Python 3.8 起已被棄用,計劃於 Python 3.10 刪除。請改用 :" "keyword:`async def`。(由 Illia Volochii 在 :issue:`43216` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1944 +#: ../../whatsnew/3.11.rst:1948 msgid "" "Removed :class:`!asyncio.coroutines.CoroWrapper` used for wrapping legacy " "generator-based coroutine objects in the debug mode. (Contributed by Illia " @@ -3655,7 +3652,7 @@ msgstr "" "移除除錯模式中用於包裝遺留基於產生器之協程物件的 :class:`!asyncio.coroutines." "CoroWrapper`。(由 Illia Volochii 於 :issue:`43216` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1948 +#: ../../whatsnew/3.11.rst:1952 msgid "" "Due to significant security concerns, the *reuse_address* parameter of :meth:" "`asyncio.loop.create_datagram_endpoint`, disabled in Python 3.9, is now " @@ -3668,7 +3665,7 @@ msgstr "" "socket 選項 ``SO_REUSEADDR`` 的行為所致。(由 Hugo van Kemenade 於 :issue:" "`45129` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1954 +#: ../../whatsnew/3.11.rst:1958 msgid "" "Removed the :mod:`!binhex` module, deprecated in Python 3.9. Also removed " "the related, similarly-deprecated :mod:`binascii` functions:" @@ -3676,31 +3673,31 @@ msgstr "" "移除 Python 3.9 中棄用的 :mod:`!binhex` 模組,與其相關且相似的 :mod:" "`binascii` 函式也一併被移除:" -#: ../../whatsnew/3.11.rst:1957 +#: ../../whatsnew/3.11.rst:1961 msgid ":func:`!binascii.a2b_hqx`" msgstr ":func:`!binascii.a2b_hqx`" -#: ../../whatsnew/3.11.rst:1958 +#: ../../whatsnew/3.11.rst:1962 msgid ":func:`!binascii.b2a_hqx`" msgstr ":func:`!binascii.b2a_hqx`" -#: ../../whatsnew/3.11.rst:1959 +#: ../../whatsnew/3.11.rst:1963 msgid ":func:`!binascii.rlecode_hqx`" msgstr ":func:`!binascii.rlecode_hqx`" -#: ../../whatsnew/3.11.rst:1960 +#: ../../whatsnew/3.11.rst:1964 msgid ":func:`!binascii.rldecode_hqx`" msgstr ":func:`!binascii.rldecode_hqx`" -#: ../../whatsnew/3.11.rst:1962 +#: ../../whatsnew/3.11.rst:1966 msgid "The :func:`binascii.crc_hqx` function remains available." msgstr ":func:`binascii.crc_hqx` 維持可用。" -#: ../../whatsnew/3.11.rst:1964 +#: ../../whatsnew/3.11.rst:1968 msgid "(Contributed by Victor Stinner in :issue:`45085`.)" msgstr "(由 Victor Stinner 於 :issue:`45085` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:1966 +#: ../../whatsnew/3.11.rst:1970 msgid "" "Removed the :mod:`distutils` ``bdist_msi`` command deprecated in Python 3.9. " "Use ``bdist_wheel`` (wheel packages) instead. (Contributed by Hugo van " @@ -3710,7 +3707,7 @@ msgstr "" "``bdist_wheel``\\ (wheel 套件)。(由 Hugo van Kemenade 於 :issue:`45124` 中" "貢獻。)" -#: ../../whatsnew/3.11.rst:1970 +#: ../../whatsnew/3.11.rst:1974 msgid "" "Removed the :meth:`~object.__getitem__` methods of :class:`xml.dom.pulldom." "DOMEventStream`, :class:`wsgiref.util.FileWrapper` and :class:`fileinput." @@ -3722,7 +3719,7 @@ msgstr "" "`~object.__getitem__` 方法移除。(由 Hugo van Kemenade 在 :issue:`45132` 中貢" "獻。)" -#: ../../whatsnew/3.11.rst:1975 +#: ../../whatsnew/3.11.rst:1979 msgid "" "Removed the deprecated :mod:`gettext` functions :func:`!lgettext`, :func:`!" "ldgettext`, :func:`!lngettext` and :func:`!ldngettext`. Also removed the :" @@ -3739,11 +3736,11 @@ msgstr "" "和 :func:`!install` 的 *codeset* 參數,因為它們僅被用於 :func:`!l*gettext` 函" "式。 (由 Dong-hee Na 和 Serhiy Storchaka 在 :issue:`44235` 中貢獻。)" -#: ../../whatsnew/3.11.rst:1985 +#: ../../whatsnew/3.11.rst:1989 msgid "Removed from the :mod:`inspect` module:" msgstr "於 :mod:`inspect` 模組中移除:" -#: ../../whatsnew/3.11.rst:1987 +#: ../../whatsnew/3.11.rst:1991 msgid "" "The :func:`!getargspec` function, deprecated since Python 3.0; use :func:" "`inspect.signature` or :func:`inspect.getfullargspec` instead." @@ -3751,7 +3748,7 @@ msgstr "" "Python 3.0 中棄用的 :func:`!getargspec`;改用 :func:`inspect.signature` 或 :" "func:`inspect.getfullargspec`。" -#: ../../whatsnew/3.11.rst:1990 +#: ../../whatsnew/3.11.rst:1994 msgid "" "The :func:`!formatargspec` function, deprecated since Python 3.5; use the :" "func:`inspect.signature` function or the :class:`inspect.Signature` object " @@ -3760,7 +3757,7 @@ msgstr "" "Python 3.5 中棄用的 :func:`!formatargspec` 函式;請直接用 :func:`inspect." "signature` 函式或 :class:`inspect.Signature` 物件。" -#: ../../whatsnew/3.11.rst:1994 +#: ../../whatsnew/3.11.rst:1998 msgid "" "The undocumented :meth:`!Signature.from_builtin` and :meth:`!Signature." "from_function` methods, deprecated since Python 3.5; use the :meth:" @@ -3770,11 +3767,11 @@ msgstr "" "meth:`!Signature.from_function` 方法;改用 :meth:`Signature.from_callable() " "` 方法。" -#: ../../whatsnew/3.11.rst:1999 +#: ../../whatsnew/3.11.rst:2003 msgid "(Contributed by Hugo van Kemenade in :issue:`45320`.)" msgstr "(由 Hugo van Kemenade 於 :issue:`45320` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2001 +#: ../../whatsnew/3.11.rst:2005 msgid "" "Removed the :meth:`~object.__class_getitem__` method from :class:`pathlib." "PurePath`, because it was not used and added by mistake in previous " @@ -3784,7 +3781,7 @@ msgstr "" "因為它是前一版本中誤加且沒被使用。(由 Nikita Sobolev 於 :issue:`46483` 中所" "貢獻。)" -#: ../../whatsnew/3.11.rst:2006 +#: ../../whatsnew/3.11.rst:2010 msgid "" "Removed the :class:`!MailmanProxy` class in the :mod:`smtpd` module, as it " "is unusable without the external :mod:`!mailman` package. (Contributed by " @@ -3793,7 +3790,7 @@ msgstr "" "移除 :mod:`smtpd` 模組中的 :class:`!MailmanProxy` 類別,因為它無法獨立於外部" "套件 :mod:`!mailman` 使用。(由 Dong-hee Na 於 :issue:`35800` 貢獻。)" -#: ../../whatsnew/3.11.rst:2010 +#: ../../whatsnew/3.11.rst:2014 msgid "" "Removed the deprecated :meth:`!split` method of :class:`!_tkinter." "TkappType`. (Contributed by Erlend E. Aasland in :issue:`38371`.)" @@ -3801,7 +3798,7 @@ msgstr "" "移除 :class:`!_tkinter.TkappType` 已被棄用的 :meth:`!split` 方法。(由 " "Erlend E. Aasland 於 :issue:`38371` 貢獻。)" -#: ../../whatsnew/3.11.rst:2013 +#: ../../whatsnew/3.11.rst:2017 msgid "" "Removed namespace package support from :mod:`unittest` discovery. It was " "introduced in Python 3.4 but has been broken since Python 3.7. (Contributed " @@ -3810,7 +3807,7 @@ msgstr "" "從 :mod:`unittest` 中刪除了命名空間套件支援。它在 Python 3.4 中引入,但自 " "Python 3.7 以來已無法運作。(由 Inada Naoki 在 :issue:`23882` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2017 +#: ../../whatsnew/3.11.rst:2021 msgid "" "Removed the undocumented private :meth:`!float.__set_format__()` method, " "previously known as :meth:`!float.__setformat__()` in Python 3.7. Its " @@ -3823,7 +3820,7 @@ msgstr "" "到:「你大概不會想要使用這個函式,它只為了讓 Python 測試系列套件 (suite) 使用" "而存在。」(由 Victor Stinner 於 :issue:`46852` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2023 +#: ../../whatsnew/3.11.rst:2027 msgid "" "The :option:`!--experimental-isolated-subinterpreters` configure flag (and " "corresponding :c:macro:`!EXPERIMENTAL_ISOLATED_SUBINTERPRETERS` macro) have " @@ -3832,7 +3829,7 @@ msgstr "" "移除 :option:`!--experimental-isolated-subinterpreters` 配置旗標(與對應的 :" "c:macro:`!EXPERIMENTAL_ISOLATED_SUBINTERPRETERS` 巨集)。" -#: ../../whatsnew/3.11.rst:2027 +#: ../../whatsnew/3.11.rst:2031 msgid "" "`Pynche `_ --- The Pythonically Natural " "Color and Hue Editor --- has been moved out of ``Tools/scripts`` and is " @@ -3843,11 +3840,11 @@ msgstr "" "編輯器 --- 已被移出 ``Tools/scripts``,`獨立開發 `_\\ 於 Python 原始碼之外。" -#: ../../whatsnew/3.11.rst:2037 ../../whatsnew/3.11.rst:2259 +#: ../../whatsnew/3.11.rst:2041 ../../whatsnew/3.11.rst:2263 msgid "Porting to Python 3.11" msgstr "移植至 Python 3.11" -#: ../../whatsnew/3.11.rst:2039 +#: ../../whatsnew/3.11.rst:2043 msgid "" "This section lists previously described changes and other bugfixes in the " "Python API that may require changes to your Python code." @@ -3855,13 +3852,13 @@ msgstr "" "本部分列出了之前描述的 Python API 中可能需要你去更改 Python 程式碼的變更和其" "他錯誤修復。" -#: ../../whatsnew/3.11.rst:2042 +#: ../../whatsnew/3.11.rst:2046 msgid "" "Porting notes for the C API are :ref:`listed separately `." msgstr "C API 的移植被\\ :ref:`獨立列出 `。" -#: ../../whatsnew/3.11.rst:2045 +#: ../../whatsnew/3.11.rst:2049 msgid "" ":func:`open`, :func:`io.open`, :func:`codecs.open` and :class:`fileinput." "FileInput` no longer accept ``'U'`` (\"universal newline\") in the file " @@ -3878,7 +3875,7 @@ msgstr "" "ref:`newline 參數 `\\ 控制了通用換行符的作用方式。" "(由 Victor Stinner 在 :issue:`37330` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2054 +#: ../../whatsnew/3.11.rst:2058 msgid "" ":class:`ast.AST` node positions are now validated when provided to :func:" "`compile` and other related functions. If invalid positions are detected, a :" @@ -3889,7 +3886,7 @@ msgstr "" "證。如果檢測到無效位置,則會引發 :exc:`ValueError`。(由 Pablo Galindo 在 :" "gh:`93351` 中貢獻)" -#: ../../whatsnew/3.11.rst:2058 +#: ../../whatsnew/3.11.rst:2062 msgid "" "Prohibited passing non-:class:`concurrent.futures.ThreadPoolExecutor` " "executors to :meth:`asyncio.loop.set_default_executor` following a " @@ -3899,7 +3896,7 @@ msgstr "" "ThreadPoolExecutor` 執行器傳遞給 :meth:`asyncio.loop.set_default_executor`。" "(由 Illia Volochii 在 :issue:`43234` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2063 +#: ../../whatsnew/3.11.rst:2067 msgid "" ":mod:`calendar`: The :class:`calendar.LocaleTextCalendar` and :class:" "`calendar.LocaleHTMLCalendar` classes now use :func:`locale.getlocale`, " @@ -3911,7 +3908,7 @@ msgstr "" "getlocale` 而非 :func:`locale.getdefaultlocale`。(由 Victor Stinner 在 :" "issue:`46659` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2069 +#: ../../whatsnew/3.11.rst:2073 msgid "" "The :mod:`pdb` module now reads the :file:`.pdbrc` configuration file with " "the ``'UTF-8'`` encoding. (Contributed by Srinivas Reddy Thatiparthy (శ్రీనివాస్ " @@ -3920,7 +3917,7 @@ msgstr "" ":mod:`pdb` 模組現在會讀取 ``'UTF-8'`` 編碼的 :file:`.pdbrc` 配置檔案。" "(Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి) 於 :issue:`41137` 貢獻。)" -#: ../../whatsnew/3.11.rst:2073 +#: ../../whatsnew/3.11.rst:2077 msgid "" "The *population* parameter of :func:`random.sample` must be a sequence, and " "automatic conversion of :class:`set`\\s to :class:`list`\\s is no longer " @@ -3932,7 +3929,7 @@ msgstr "" "`set` 到 :class:`list` 的自動轉換。此外,如果抽樣大小大於總體大小,則會引發 :" "exc:`ValueError`。(由 Raymond Hettinger 在 :issue:`40465` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2079 +#: ../../whatsnew/3.11.rst:2083 msgid "" "The *random* optional parameter of :func:`random.shuffle` was removed. It " "was previously an arbitrary random function to use for the shuffle; now, :" @@ -3942,7 +3939,7 @@ msgstr "" "(shuffle) 的任意隨機函式;現在都會使用 :func:`random.random`\\ (這是它以前的" "預設值)。" -#: ../../whatsnew/3.11.rst:2083 +#: ../../whatsnew/3.11.rst:2087 msgid "" "In :mod:`re` :ref:`re-syntax`, global inline flags (e.g. ``(?i)``) can now " "only be used at the start of regular expressions. Using them elsewhere has " @@ -3953,7 +3950,7 @@ msgstr "" "運算式的開頭使用。自 Python 3.6 以來,在其他地方使用它們已被棄用。 (由 " "Serhiy Storchaka 在 :issue:`47066` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2088 +#: ../../whatsnew/3.11.rst:2092 msgid "" "In the :mod:`re` module, several long-standing bugs where fixed that, in " "rare cases, could cause capture groups to get the wrong result. Therefore, " @@ -3964,11 +3961,11 @@ msgstr "" "致捕獲群組 (capture group) 得到錯誤的結果。因此,這可能會在這些情況下更改捕獲" "的輸出。(Ma Lin 在 :issue:`35859` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2097 +#: ../../whatsnew/3.11.rst:2101 msgid "Build Changes" msgstr "建置變更" -#: ../../whatsnew/3.11.rst:2099 +#: ../../whatsnew/3.11.rst:2103 msgid "" "CPython now has :pep:`11` :pep:`Tier 3 support <11#tier-3>` for cross " "compiling to the `WebAssembly `_ platforms " @@ -3992,11 +3989,11 @@ msgstr "" "Christian Heimes 和 Ethan Smith 在 :gh:`84461` 貢獻,WASI 由 Christian " "Heimes 在 :gh:`90473` 貢獻;平台在 :gh:`95085` 中推廣)" -#: ../../whatsnew/3.11.rst:2113 +#: ../../whatsnew/3.11.rst:2117 msgid "Building CPython now requires:" msgstr "建置 CPython 現在必須要有:" -#: ../../whatsnew/3.11.rst:2115 +#: ../../whatsnew/3.11.rst:2119 msgid "" "A `C11 `_ compiler and standard library. " "`Optional C11 features `_ 並非必要。(由 Victor Stinner " "於 :issue:`46656`、:issue:`45440` 和 :issue:`46640` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2122 +#: ../../whatsnew/3.11.rst:2126 msgid "" "Support for `IEEE 754 `_ floating " "point numbers. (Contributed by Victor Stinner in :issue:`46917`.)" @@ -4017,7 +4014,7 @@ msgstr "" "對 `IEEE 754 `_ 浮點數的支援(由 " "Victor Stinner 於 :issue:`46917` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2126 +#: ../../whatsnew/3.11.rst:2130 msgid "" "The :c:macro:`!Py_NO_NAN` macro has been removed. Since CPython now requires " "IEEE 754 floats, NaN values are always available. (Contributed by Victor " @@ -4026,7 +4023,7 @@ msgstr "" ":c:macro:`!Py_NO_NAN` 巨集已被移除。因為 CPython 現在需要 IEEE 754 浮點數," "NaN 數值皆為可得的。(由 Victor Stinner 在 :issue:`46656` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2130 +#: ../../whatsnew/3.11.rst:2134 msgid "" "The :mod:`tkinter` package now requires `Tcl/Tk `_ " "version 8.5.12 or newer. (Contributed by Serhiy Storchaka in :issue:`46996`.)" @@ -4034,7 +4031,7 @@ msgstr "" ":mod:`tkinter` 套件現在必須要有 `Tcl/Tk `_ 8.5.12 或更新" "的版本。(由 Serhiy Storchaka 於 :issue:`46996` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2134 +#: ../../whatsnew/3.11.rst:2138 msgid "" "Build dependencies, compiler flags, and linker flags for most stdlib " "extension modules are now detected by :program:`configure`. libffi, libnsl, " @@ -4053,7 +4050,7 @@ msgstr "" "和函式庫的開發設定。(由 Christian Heimes 和 Erlend Egeberg Aasland 在 :" "issue:`45847`、:issue:`45747` 和 :issue:`45763` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2144 +#: ../../whatsnew/3.11.rst:2148 msgid "" "libpython is no longer linked against libcrypt. (Contributed by Mike Gilbert " "in :issue:`45433`.)" @@ -4061,7 +4058,7 @@ msgstr "" "libpython 不再鏈接到 libcrypt。 (由 Mike Gilbert 在 :issue:`45433` 中貢" "獻。)" -#: ../../whatsnew/3.11.rst:2147 +#: ../../whatsnew/3.11.rst:2151 msgid "" "CPython can now be built with the `ThinLTO `_ option via passing ``thin`` to :option:`--with-lto`, i.e. " @@ -4073,7 +4070,7 @@ msgstr "" "html>`_ 選項建置。(由 Dong-hee Na 與 Brett Holman 於 :issue:`44340` 中所貢" "獻。)" -#: ../../whatsnew/3.11.rst:2152 +#: ../../whatsnew/3.11.rst:2156 msgid "" "Freelists for object structs can now be disabled. A new :program:`configure` " "option :option:`--without-freelists` can be used to disable all freelists " @@ -4081,7 +4078,7 @@ msgid "" "`45522`.)" msgstr "" -#: ../../whatsnew/3.11.rst:2157 +#: ../../whatsnew/3.11.rst:2161 msgid "" "``Modules/Setup`` and ``Modules/makesetup`` have been improved and tied up. " "Extension modules can now be built through ``makesetup``. All except some " @@ -4094,7 +4091,7 @@ msgstr "" "的二進制文件或函式庫中。(由 Brett Cannon 和 Christian Heimes 在 :issue:" "`45548`、:issue:`45570`、:issue:`45571` 和 :issue:`43974` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2164 +#: ../../whatsnew/3.11.rst:2168 msgid "" "Use the environment variables :envvar:`!TCLTK_CFLAGS` and :envvar:`!" "TCLTK_LIBS` to manually specify the location of Tcl/Tk headers and " @@ -4105,7 +4102,7 @@ msgstr "" "Tk 標頭檔和函式庫的位置。:program:`configure` 選項 :option:`!—with-tcltk-" "includes` 和 :option:`!—with-tcltk-libs` 已被刪除。" -#: ../../whatsnew/3.11.rst:2170 +#: ../../whatsnew/3.11.rst:2174 msgid "" "On RHEL 7 and CentOS 7 the development packages do not provide ``tcl.pc`` " "and ``tk.pc``; use ``TCLTK_LIBS=\"-ltk8.5 -ltkstub8.5 -ltcl8.5\"``. The " @@ -4117,7 +4114,7 @@ msgstr "" "pc`` 檔案與如何使用 RHEL 7 和 CentOS 7 的 Tcl/Tk 與 OpenSSL 建置 Python 的指" "示。" -#: ../../whatsnew/3.11.rst:2175 +#: ../../whatsnew/3.11.rst:2179 msgid "" "CPython will now use 30-bit digits by default for the Python :class:`int` " "implementation. Previously, the default was to use 30-bit digits on " @@ -4135,11 +4132,11 @@ msgstr "" "此選項可能會在將來的某個時候被刪除。 (由 Mark Dickinson 在 :issue:`45569` 中" "貢獻。)" -#: ../../whatsnew/3.11.rst:2188 +#: ../../whatsnew/3.11.rst:2192 msgid "C API Changes" msgstr "C API 變更" -#: ../../whatsnew/3.11.rst:2195 +#: ../../whatsnew/3.11.rst:2199 msgid "" "Add a new :c:func:`PyType_GetName` function to get type's short name. " "(Contributed by Hai Shi in :issue:`42035`.)" @@ -4147,7 +4144,7 @@ msgstr "" "新增 :c:func:`PyType_GetName` 函式來取得型別的短名。(由 Hai Shi 於 :issue:" "`42035` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2198 +#: ../../whatsnew/3.11.rst:2202 msgid "" "Add a new :c:func:`PyType_GetQualName` function to get type's qualified " "name. (Contributed by Hai Shi in :issue:`42035`.)" @@ -4155,7 +4152,7 @@ msgstr "" "新增 :c:func:`PyType_GetQualName` 函式來取得型別的合格名稱 (qualified name)。" "(由 Hai Shi 於 :issue:`42035` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2201 +#: ../../whatsnew/3.11.rst:2205 msgid "" "Add new :c:func:`PyThreadState_EnterTracing` and :c:func:" "`PyThreadState_LeaveTracing` functions to the limited C API to suspend and " @@ -4166,7 +4163,7 @@ msgstr "" "c:func:`PyThreadState_LeaveTracing` 函式來中止和繼續追蹤 (tracing) 和性能分" "析 (profiling)。(由 Victor Stinner 於 :issue:`43760` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2206 +#: ../../whatsnew/3.11.rst:2210 msgid "" "Added the :c:data:`Py_Version` constant which bears the same value as :c:" "macro:`PY_VERSION_HEX`. (Contributed by Gabriele N. Tornetta in :issue:" @@ -4175,61 +4172,61 @@ msgstr "" "添加了 :c:data:`Py_Version` 常數,其值與 :c:macro:`PY_VERSION_HEX` 相同。" "(由 Gabriele N. Tornetta 在 :issue:`43931` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2210 +#: ../../whatsnew/3.11.rst:2214 msgid "" ":c:type:`Py_buffer` and APIs are now part of the limited API and the stable " "ABI:" msgstr ":c:type:`Py_buffer` 與 API 目前是受限 API 與穩定 ABI 中的一部分:" -#: ../../whatsnew/3.11.rst:2213 +#: ../../whatsnew/3.11.rst:2217 msgid ":c:func:`PyObject_CheckBuffer`" msgstr ":c:func:`PyObject_CheckBuffer`" -#: ../../whatsnew/3.11.rst:2214 +#: ../../whatsnew/3.11.rst:2218 msgid ":c:func:`PyObject_GetBuffer`" msgstr ":c:func:`PyObject_GetBuffer`" -#: ../../whatsnew/3.11.rst:2215 +#: ../../whatsnew/3.11.rst:2219 msgid ":c:func:`PyBuffer_GetPointer`" msgstr ":c:func:`PyBuffer_GetPointer`" -#: ../../whatsnew/3.11.rst:2216 +#: ../../whatsnew/3.11.rst:2220 msgid ":c:func:`PyBuffer_SizeFromFormat`" msgstr ":c:func:`PyBuffer_SizeFromFormat`" -#: ../../whatsnew/3.11.rst:2217 +#: ../../whatsnew/3.11.rst:2221 msgid ":c:func:`PyBuffer_ToContiguous`" msgstr ":c:func:`PyBuffer_ToContiguous`" -#: ../../whatsnew/3.11.rst:2218 +#: ../../whatsnew/3.11.rst:2222 msgid ":c:func:`PyBuffer_FromContiguous`" msgstr ":c:func:`PyBuffer_FromContiguous`" -#: ../../whatsnew/3.11.rst:2219 -msgid ":c:func:`PyBuffer_CopyData`" -msgstr ":c:func:`PyBuffer_CopyData`" +#: ../../whatsnew/3.11.rst:2223 +msgid ":c:func:`PyObject_CopyData`" +msgstr "" -#: ../../whatsnew/3.11.rst:2220 +#: ../../whatsnew/3.11.rst:2224 msgid ":c:func:`PyBuffer_IsContiguous`" msgstr ":c:func:`PyBuffer_IsContiguous`" -#: ../../whatsnew/3.11.rst:2221 +#: ../../whatsnew/3.11.rst:2225 msgid ":c:func:`PyBuffer_FillContiguousStrides`" msgstr ":c:func:`PyBuffer_FillContiguousStrides`" -#: ../../whatsnew/3.11.rst:2222 +#: ../../whatsnew/3.11.rst:2226 msgid ":c:func:`PyBuffer_FillInfo`" msgstr ":c:func:`PyBuffer_FillInfo`" -#: ../../whatsnew/3.11.rst:2223 +#: ../../whatsnew/3.11.rst:2227 msgid ":c:func:`PyBuffer_Release`" msgstr ":c:func:`PyBuffer_Release`" -#: ../../whatsnew/3.11.rst:2224 +#: ../../whatsnew/3.11.rst:2228 msgid ":c:func:`PyMemoryView_FromBuffer`" msgstr ":c:func:`PyMemoryView_FromBuffer`" -#: ../../whatsnew/3.11.rst:2225 +#: ../../whatsnew/3.11.rst:2229 msgid "" ":c:member:`~PyBufferProcs.bf_getbuffer` and :c:member:`~PyBufferProcs." "bf_releasebuffer` type slots" @@ -4237,11 +4234,11 @@ msgstr "" ":c:member:`~PyBufferProcs.bf_getbuffer` 與 :c:member:`~PyBufferProcs." "bf_releasebuffer` 型別插槽 (type slot)" -#: ../../whatsnew/3.11.rst:2228 +#: ../../whatsnew/3.11.rst:2232 msgid "(Contributed by Christian Heimes in :issue:`45459`.)" msgstr "(由 Christian Heimes 於 :issue:`45459` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2230 +#: ../../whatsnew/3.11.rst:2234 msgid "" "Added the :c:func:`PyType_GetModuleByDef` function, used to get the module " "in which a method was defined, in cases where this information is not " @@ -4252,7 +4249,7 @@ msgstr "" "以免這項資訊無法直接被取得(透過 :c:type:`PyCMethod`)。(由 Petr Viktorin " "於 :issue:`46613` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2235 +#: ../../whatsnew/3.11.rst:2239 msgid "" "Add new functions to pack and unpack C double (serialize and deserialize): :" "c:func:`PyFloat_Pack2`, :c:func:`PyFloat_Pack4`, :c:func:`PyFloat_Pack8`, :c:" @@ -4264,7 +4261,7 @@ msgstr "" "`PyFloat_Unpack2` , :c:func:`PyFloat_Unpack4` 和 :c:func:`PyFloat_Unpack8`。" "(由 Victor Stinner 在 :issue:`46906` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2241 +#: ../../whatsnew/3.11.rst:2245 msgid "" "Add new functions to get frame object attributes: :c:func:" "`PyFrame_GetBuiltins`, :c:func:`PyFrame_GetGenerator`, :c:func:" @@ -4274,7 +4271,7 @@ msgstr "" "`PyFrame_GetGenerator`、:c:func:`PyFrame_GetGlobals`、:c:func:" "`PyFrame_GetLasti`。" -#: ../../whatsnew/3.11.rst:2245 +#: ../../whatsnew/3.11.rst:2249 msgid "" "Added two new functions to get and set the active exception instance: :c:" "func:`PyErr_GetHandledException` and :c:func:`PyErr_SetHandledException`. " @@ -4288,7 +4285,7 @@ msgstr "" "例外的遺留三元組表示法一起作用。(由 Irit Katriel 在 :issue:`46343` 中貢" "獻。)" -#: ../../whatsnew/3.11.rst:2252 +#: ../../whatsnew/3.11.rst:2256 msgid "" "Added the :c:member:`PyConfig.safe_path` member. (Contributed by Victor " "Stinner in :gh:`57684`.)" @@ -4296,7 +4293,7 @@ msgstr "" "新增 :c:member:`PyConfig.safe_path` 成員。(由 Victor Stinner 於 :gh:`57684` " "中所貢獻。)" -#: ../../whatsnew/3.11.rst:2263 +#: ../../whatsnew/3.11.rst:2267 msgid "" "Some macros have been converted to static inline functions to avoid `macro " "pitfalls `_. The " @@ -4314,7 +4311,7 @@ msgstr "" "要將引數轉換為他們期望的型別。有關更多詳細資訊,請參閱 :pep:`670`。 (由 " "Victor Stinner 和 Erlend E. Aasland 在 :gh:`89653` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2274 +#: ../../whatsnew/3.11.rst:2278 msgid "" ":c:func:`PyErr_SetExcInfo()` no longer uses the ``type`` and ``traceback`` " "arguments, the interpreter now derives those values from the exception " @@ -4325,7 +4322,7 @@ msgstr "" "現在從例外實例(``value`` 引數)中獲得這些值。該函式仍會偷用這三個引數的參" "照。(由 Irit Katriel 在 :issue:`45711` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2280 +#: ../../whatsnew/3.11.rst:2284 msgid "" ":c:func:`PyErr_GetExcInfo()` now derives the ``type`` and ``traceback`` " "fields of the result from the exception instance (the ``value`` field). " @@ -4335,7 +4332,7 @@ msgstr "" "``type`` 和 ``traceback`` 欄位。(由 Irit Katriel 在 :issue:`45711` 中貢" "獻。)" -#: ../../whatsnew/3.11.rst:2284 +#: ../../whatsnew/3.11.rst:2288 msgid "" ":c:struct:`_frozen` has a new ``is_package`` field to indicate whether or " "not the frozen module is a package. Previously, a negative value in the " @@ -4346,7 +4343,7 @@ msgstr "" "件。以前 ``size`` 欄位中的負值是指標,現在只有非負值可用於 ``size``。 (由 " "Kumar Aditya 在 :issue:`46608` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2290 +#: ../../whatsnew/3.11.rst:2294 msgid "" ":c:func:`_PyFrameEvalFunction` now takes ``_PyInterpreterFrame*`` as its " "second parameter, instead of ``PyFrameObject*``. See :pep:`523` for more " @@ -4356,7 +4353,7 @@ msgstr "" "數,而不是 ``PyFrameObject*``。有關如何使用此函式指標型別的更多詳細資訊,請參" "閱 :pep:`523`。" -#: ../../whatsnew/3.11.rst:2294 +#: ../../whatsnew/3.11.rst:2298 msgid "" ":c:func:`PyCode_New` and :c:func:`PyCode_NewWithPosOnlyArgs` now take an " "additional ``exception_table`` argument. Using these functions should be " @@ -4369,7 +4366,7 @@ msgstr "" "碼物件,使用編譯器建立一個程式碼物件,然後使用 ``replace`` 方法來得到修改後的" "版本。" -#: ../../whatsnew/3.11.rst:2300 +#: ../../whatsnew/3.11.rst:2304 msgid "" ":c:type:`PyCodeObject` no longer has the ``co_code``, ``co_varnames``, " "``co_cellvars`` and ``co_freevars`` fields. Instead, use :c:func:" @@ -4384,7 +4381,7 @@ msgstr "" "和 :c:func:`PyCode_GetFreevars` 來存取。(由 Brandt Bucher 在 :issue:" "`46841`、Ken Jin 在 :gh:`92154` 與 :gh:`94936` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2308 +#: ../../whatsnew/3.11.rst:2312 msgid "" "The old trashcan macros (``Py_TRASHCAN_SAFE_BEGIN``/" "``Py_TRASHCAN_SAFE_END``) are now deprecated. They should be replaced by the " @@ -4394,21 +4391,21 @@ msgstr "" "``Py_TRASHCAN_SAFE_END``) 現在已經被棄用,它們應被新的巨集 " "``Py_TRASHCAN_BEGIN`` 和 ``Py_TRASHCAN_END`` 所取代。" -#: ../../whatsnew/3.11.rst:2312 +#: ../../whatsnew/3.11.rst:2316 msgid "A tp_dealloc function that has the old macros, such as::" msgstr "" "一個用到老舊巨集的 tp_dealloc 函式,像是:\n" "\n" "::" -#: ../../whatsnew/3.11.rst:2323 +#: ../../whatsnew/3.11.rst:2327 msgid "should migrate to the new macros as follows::" msgstr "" "應該要搬遷到新的巨集,如下所示:\n" "\n" "::" -#: ../../whatsnew/3.11.rst:2334 +#: ../../whatsnew/3.11.rst:2338 msgid "" "Note that ``Py_TRASHCAN_BEGIN`` has a second argument which should be the " "deallocation function it is in." @@ -4416,7 +4413,7 @@ msgstr "" "請注意 ``Py_TRASHCAN_BEGIN`` 有第二個引數,它應該是它所在的釋放函式 " "(deallocation function)。" -#: ../../whatsnew/3.11.rst:2337 +#: ../../whatsnew/3.11.rst:2341 msgid "" "To support older Python versions in the same codebase, you can define the " "following macros and use them throughout the code (credit: these were copied " @@ -4427,7 +4424,7 @@ msgstr "" "\n" "::" -#: ../../whatsnew/3.11.rst:2349 +#: ../../whatsnew/3.11.rst:2353 msgid "" "The :c:func:`PyType_Ready` function now raises an error if a type is defined " "with the :c:macro:`Py_TPFLAGS_HAVE_GC` flag set but has no traverse function " @@ -4439,18 +4436,18 @@ msgstr "" "`PyType_Ready` 函式現在會引發一個錯誤。(由 Victor Stinner 於 :issue:`44263` " "中貢獻。)" -#: ../../whatsnew/3.11.rst:2354 +#: ../../whatsnew/3.11.rst:2358 msgid "" "Heap types with the :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` flag can now inherit " "the :pep:`590` vectorcall protocol. Previously, this was only possible for :" "ref:`static types `. (Contributed by Erlend E. Aasland in :" "issue:`43908`)" msgstr "" -"帶有 :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` 旗標的堆積型別現在可以繼承 :pep:`590` " -"向量呼叫協定 (vectorcall protocol)。以前這僅適用於 :ref:`static types " +"帶有 :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` 旗標的堆積型別現在可以繼承 :pep:" +"`590` 向量呼叫協定 (vectorcall protocol)。以前這僅適用於 :ref:`static types " "`。(由 Erlend E. Aasland 在 :issue:`43908` 中貢獻)。" -#: ../../whatsnew/3.11.rst:2359 +#: ../../whatsnew/3.11.rst:2363 msgid "" "Since :c:func:`Py_TYPE()` is changed to a inline static function, " "``Py_TYPE(obj) = new_type`` must be replaced with ``Py_SET_TYPE(obj, " @@ -4462,11 +4459,11 @@ msgstr "" "c:func:`Py_SET_TYPE()` 函式(自 Python 3.9 起可用)。為了向後相容,可以使用這" "個巨集:" -#: ../../whatsnew/3.11.rst:2371 ../../whatsnew/3.11.rst:2385 +#: ../../whatsnew/3.11.rst:2375 ../../whatsnew/3.11.rst:2389 msgid "(Contributed by Victor Stinner in :issue:`39573`.)" msgstr "(由 Victor Stinner 於 :issue:`39573` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2373 +#: ../../whatsnew/3.11.rst:2377 msgid "" "Since :c:func:`Py_SIZE()` is changed to a inline static function, " "``Py_SIZE(obj) = new_size`` must be replaced with ``Py_SET_SIZE(obj, " @@ -4478,7 +4475,7 @@ msgstr "" "`Py_SET_SIZE()` 函式(自 Python 3.9 起可用)。為了向後相容,可以使用這個巨" "集:" -#: ../../whatsnew/3.11.rst:2387 +#: ../../whatsnew/3.11.rst:2391 msgid "" "```` no longer includes the header files ````, ````, ```` and ```` when the ``Py_LIMITED_API`` macro is " @@ -4491,7 +4488,7 @@ msgstr "" "和 ````。C 擴充程式應該要清楚的在 ``#include `` 之後引入" "標頭檔案。(由 Victor Stinner 於 :issue:`45434` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2393 +#: ../../whatsnew/3.11.rst:2397 msgid "" "The non-limited API files ``cellobject.h``, ``classobject.h``, ``code.h``, " "``context.h``, ``funcobject.h``, ``genobject.h`` and ``longintrepr.h`` have " @@ -4508,7 +4505,7 @@ msgstr "" "檔案 `。如果它們已被直接引入,請考慮改為引入 ``Python.h``。 " "(由 Victor Stinner 在 :issue:`35134` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2401 +#: ../../whatsnew/3.11.rst:2405 msgid "" "The :c:func:`PyUnicode_CHECK_INTERNED` macro has been excluded from the " "limited C API. It was never usable there, because it used internal " @@ -4519,7 +4516,7 @@ msgstr "" "使用,因為它使用了受限 C API 不提供的內部結構。(由 Victor Stinner 於 :issue:" "`46007` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2406 +#: ../../whatsnew/3.11.rst:2410 msgid "" "The following frame functions and type are now directly available with " "``#include ``, it's no longer needed to add ``#include " @@ -4528,49 +4525,49 @@ msgstr "" "以下用於幀 (frame) 的函式與型別現在可直接透過 ``#include `` 來使" "用,不必再加上 ``#include ``:" -#: ../../whatsnew/3.11.rst:2410 +#: ../../whatsnew/3.11.rst:2414 msgid ":c:func:`PyFrame_Check`" msgstr ":c:func:`PyFrame_Check`" -#: ../../whatsnew/3.11.rst:2411 +#: ../../whatsnew/3.11.rst:2415 msgid ":c:func:`PyFrame_GetBack`" msgstr ":c:func:`PyFrame_GetBack`" -#: ../../whatsnew/3.11.rst:2412 +#: ../../whatsnew/3.11.rst:2416 msgid ":c:func:`PyFrame_GetBuiltins`" msgstr ":c:func:`PyFrame_GetBuiltins`" -#: ../../whatsnew/3.11.rst:2413 +#: ../../whatsnew/3.11.rst:2417 msgid ":c:func:`PyFrame_GetGenerator`" msgstr ":c:func:`PyFrame_GetGenerator`" -#: ../../whatsnew/3.11.rst:2414 +#: ../../whatsnew/3.11.rst:2418 msgid ":c:func:`PyFrame_GetGlobals`" msgstr ":c:func:`PyFrame_GetGlobals`" -#: ../../whatsnew/3.11.rst:2415 +#: ../../whatsnew/3.11.rst:2419 msgid ":c:func:`PyFrame_GetLasti`" msgstr ":c:func:`PyFrame_GetLasti`" -#: ../../whatsnew/3.11.rst:2416 +#: ../../whatsnew/3.11.rst:2420 msgid ":c:func:`PyFrame_GetLocals`" msgstr ":c:func:`PyFrame_GetLocals`" -#: ../../whatsnew/3.11.rst:2417 +#: ../../whatsnew/3.11.rst:2421 msgid ":c:type:`PyFrame_Type`" msgstr ":c:type:`PyFrame_Type`" -#: ../../whatsnew/3.11.rst:2419 +#: ../../whatsnew/3.11.rst:2423 msgid "(Contributed by Victor Stinner in :gh:`93937`.)" msgstr "(由 Victor Stinner 於 :gh:`93937` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2423 +#: ../../whatsnew/3.11.rst:2427 msgid "" "The :c:type:`PyFrameObject` structure members have been removed from the " "public C API." msgstr ":c:type:`PyFrameObject` 結構成員已經從公開的 C API 中移除。" -#: ../../whatsnew/3.11.rst:2426 +#: ../../whatsnew/3.11.rst:2430 msgid "" "While the documentation notes that the :c:type:`PyFrameObject` fields are " "subject to change at any time, they have been stable for a long time and " @@ -4579,7 +4576,7 @@ msgstr "" "雖然文件指出 :c:type:`PyFrameObject` 欄位隨時可能發生變化,但它們已經穩定了很" "長時間,並被用於幾個流行的擴充套件中。" -#: ../../whatsnew/3.11.rst:2430 +#: ../../whatsnew/3.11.rst:2434 msgid "" "In Python 3.11, the frame struct was reorganized to allow performance " "optimizations. Some fields were removed entirely, as they were details of " @@ -4588,39 +4585,39 @@ msgstr "" "Python 3.11 中,幀的結構被重新編制來為性能做最佳化,有些作為舊版實作細節的欄" "位被整個移除。" -#: ../../whatsnew/3.11.rst:2434 +#: ../../whatsnew/3.11.rst:2438 msgid ":c:type:`PyFrameObject` fields:" msgstr ":c:type:`PyFrameObject` 欄位:" -#: ../../whatsnew/3.11.rst:2436 +#: ../../whatsnew/3.11.rst:2440 msgid "``f_back``: use :c:func:`PyFrame_GetBack`." msgstr "``f_back``:使用 :c:func:`PyFrame_GetBack`。" -#: ../../whatsnew/3.11.rst:2437 +#: ../../whatsnew/3.11.rst:2441 msgid "``f_blockstack``: removed." msgstr "``f_blockstack``:已移除。" -#: ../../whatsnew/3.11.rst:2438 +#: ../../whatsnew/3.11.rst:2442 msgid "``f_builtins``: use :c:func:`PyFrame_GetBuiltins`." msgstr "``f_builtins``:使用 :c:func:`PyFrame_GetBuiltins`。" -#: ../../whatsnew/3.11.rst:2439 +#: ../../whatsnew/3.11.rst:2443 msgid "``f_code``: use :c:func:`PyFrame_GetCode`." msgstr "``f_code``:使用 :c:func:`PyFrame_GetCode`。" -#: ../../whatsnew/3.11.rst:2440 +#: ../../whatsnew/3.11.rst:2444 msgid "``f_gen``: use :c:func:`PyFrame_GetGenerator`." msgstr "``f_gen``:使用 :c:func:`PyFrame_GetGenerator`。" -#: ../../whatsnew/3.11.rst:2441 +#: ../../whatsnew/3.11.rst:2445 msgid "``f_globals``: use :c:func:`PyFrame_GetGlobals`." msgstr "``f_globals``:使用 :c:func:`PyFrame_GetGlobals`。" -#: ../../whatsnew/3.11.rst:2442 +#: ../../whatsnew/3.11.rst:2446 msgid "``f_iblock``: removed." msgstr "``f_iblock``:已移除。" -#: ../../whatsnew/3.11.rst:2443 +#: ../../whatsnew/3.11.rst:2447 msgid "" "``f_lasti``: use :c:func:`PyFrame_GetLasti`. Code using ``f_lasti`` with " "``PyCode_Addr2Line()`` should use :c:func:`PyFrame_GetLineNumber` instead; " @@ -4630,51 +4627,51 @@ msgstr "" "``PyCode_Addr2Line()`` 同時使用的部分應該改用 :c:func:" "`PyFrame_GetLineNumber`;它可能會更快。" -#: ../../whatsnew/3.11.rst:2446 +#: ../../whatsnew/3.11.rst:2450 msgid "``f_lineno``: use :c:func:`PyFrame_GetLineNumber`" msgstr "``f_lineno``:使用 :c:func:`PyFrame_GetLineNumber`" -#: ../../whatsnew/3.11.rst:2447 +#: ../../whatsnew/3.11.rst:2451 msgid "``f_locals``: use :c:func:`PyFrame_GetLocals`." msgstr "``f_locals``:使用 :c:func:`PyFrame_GetLocals`。" -#: ../../whatsnew/3.11.rst:2448 +#: ../../whatsnew/3.11.rst:2452 msgid "``f_stackdepth``: removed." msgstr "``f_stackdepth``:已移除。" -#: ../../whatsnew/3.11.rst:2449 +#: ../../whatsnew/3.11.rst:2453 msgid "``f_state``: no public API (renamed to ``f_frame.f_state``)." msgstr "``f_state``:無公開 API(重新命名為 ``f_frame.f_state``)。" -#: ../../whatsnew/3.11.rst:2450 +#: ../../whatsnew/3.11.rst:2454 msgid "``f_trace``: no public API." msgstr "``f_trace``:無公開 API。" -#: ../../whatsnew/3.11.rst:2451 +#: ../../whatsnew/3.11.rst:2455 msgid "" "``f_trace_lines``: use ``PyObject_GetAttrString((PyObject*)frame, " "\"f_trace_lines\")``." msgstr "" "``f_trace_lines``:使用 ``PyObject_GetAttrString((PyObject*)frame, " -"“f_trace_lines”)``。" +"\"f_trace_lines\")``。" -#: ../../whatsnew/3.11.rst:2452 +#: ../../whatsnew/3.11.rst:2456 msgid "" "``f_trace_opcodes``: use ``PyObject_GetAttrString((PyObject*)frame, " "\"f_trace_opcodes\")``." msgstr "" "``f_trace_opcodes``:使用 ``PyObject_GetAttrString((PyObject*)frame, " -"“f_trace_opcodes”)``。" +"\"f_trace_opcodes\")``。" -#: ../../whatsnew/3.11.rst:2453 +#: ../../whatsnew/3.11.rst:2457 msgid "``f_localsplus``: no public API (renamed to ``f_frame.localsplus``)." msgstr "``f_localsplus``:無公開 API(重新命名為 ``f_frame.localsplus``)。" -#: ../../whatsnew/3.11.rst:2454 +#: ../../whatsnew/3.11.rst:2458 msgid "``f_valuestack``: removed." msgstr "``f_valuestack``:已移除。" -#: ../../whatsnew/3.11.rst:2456 +#: ../../whatsnew/3.11.rst:2460 msgid "" "The Python frame object is now created lazily. A side effect is that the " "``f_back`` member must not be accessed directly, since its value is now also " @@ -4684,7 +4681,7 @@ msgstr "" "Python 幀物件的建立現為惰性的 (lazily),一個副作用是 ``f_back`` 成員不能被直" "接存取,因為其職的計算也是惰性的,要改呼叫 :c:func:`PyFrame_GetBack`。" -#: ../../whatsnew/3.11.rst:2461 +#: ../../whatsnew/3.11.rst:2465 msgid "" "Debuggers that accessed the ``f_locals`` directly *must* call :c:func:" "`PyFrame_GetLocals` instead. They no longer need to call :c:func:" @@ -4697,21 +4694,21 @@ msgstr "" "`PyFrame_FastToLocalsWithError` 或 :c:func:`PyFrame_LocalsToFast`,事實上他們" "不應該呼叫這些函式。框架的必要更新現在由虛擬機管理。" -#: ../../whatsnew/3.11.rst:2467 +#: ../../whatsnew/3.11.rst:2471 msgid "Code defining ``PyFrame_GetCode()`` on Python 3.8 and older::" msgstr "" "``PyFrame_GetCode()`` 在 Python 3.8 以前的程式定義:\n" "\n" "::" -#: ../../whatsnew/3.11.rst:2477 +#: ../../whatsnew/3.11.rst:2481 msgid "Code defining ``PyFrame_GetBack()`` on Python 3.8 and older::" msgstr "" "``PyFrame_GetBack()`` 在 Python 3.8 以前的程式定義:\n" "\n" "::" -#: ../../whatsnew/3.11.rst:2487 +#: ../../whatsnew/3.11.rst:2491 msgid "" "Or use the `pythoncapi_compat project `__ to get these two functions on older Python versions." @@ -4719,11 +4716,11 @@ msgstr "" "或是使用 `pythoncap_compat 計畫 `__\\ 來在舊版 Python 函式中取得這兩個函式。" -#: ../../whatsnew/3.11.rst:2491 +#: ../../whatsnew/3.11.rst:2495 msgid "Changes of the :c:type:`PyThreadState` structure members:" msgstr ":c:type:`PyThreadState` 結構成員的改動:" -#: ../../whatsnew/3.11.rst:2493 +#: ../../whatsnew/3.11.rst:2497 msgid "" "``frame``: removed, use :c:func:`PyThreadState_GetFrame` (function added to " "Python 3.9 by :issue:`40429`). Warning: the function returns a :term:`strong " @@ -4733,7 +4730,7 @@ msgstr "" "於 Python 3.9 新增的函式)。警告:會回傳 :term:`strong reference` 的函式必須" "呼叫 :c:func:`Py_XDECREF`。" -#: ../../whatsnew/3.11.rst:2497 +#: ../../whatsnew/3.11.rst:2501 msgid "" "``tracing``: changed, use :c:func:`PyThreadState_EnterTracing` and :c:func:" "`PyThreadState_LeaveTracing` (functions added to Python 3.11 by :issue:" @@ -4743,7 +4740,7 @@ msgstr "" "`PyThreadState_LeaveTracing`\\ (:issue:`43760` 於 Python 3.11 中新增的函" "式)。" -#: ../../whatsnew/3.11.rst:2500 +#: ../../whatsnew/3.11.rst:2504 msgid "" "``recursion_depth``: removed, use ``(tstate->recursion_limit - tstate-" ">recursion_remaining)`` instead." @@ -4751,18 +4748,18 @@ msgstr "" "``recursion_depth``:已移除,請改用 ``(tstate->recursion_limit - tstate-" ">recursion_remaining)``。" -#: ../../whatsnew/3.11.rst:2502 +#: ../../whatsnew/3.11.rst:2506 msgid "``stackcheck_counter``: removed." msgstr "``stackcheck_counter``:已移除。" -#: ../../whatsnew/3.11.rst:2504 +#: ../../whatsnew/3.11.rst:2508 msgid "Code defining ``PyThreadState_GetFrame()`` on Python 3.8 and older::" msgstr "" "``PyThreadState_GetFrame()`` 在 Python 3.8 以前的程式定義:\n" "\n" "::" -#: ../../whatsnew/3.11.rst:2514 +#: ../../whatsnew/3.11.rst:2518 msgid "" "Code defining ``PyThreadState_EnterTracing()`` and " "``PyThreadState_LeaveTracing()`` on Python 3.10 and older::" @@ -4772,7 +4769,7 @@ msgstr "" "\n" "::" -#: ../../whatsnew/3.11.rst:2540 +#: ../../whatsnew/3.11.rst:2544 msgid "" "Or use `the pythoncapi-compat project `__ to get these functions on old Python functions." @@ -4780,13 +4777,13 @@ msgstr "" "或是使用 `pythoncap-compat 計畫 `__\\ 來在舊版 Python 函式中取得它們。" -#: ../../whatsnew/3.11.rst:2544 +#: ../../whatsnew/3.11.rst:2548 msgid "" "Distributors are encouraged to build Python with the optimized Blake2 " "library `libb2`_." msgstr "鼓勵發布者們使用最佳化過的 Blake2 函式庫 `libb2`_ 來建置 Python。" -#: ../../whatsnew/3.11.rst:2547 +#: ../../whatsnew/3.11.rst:2551 msgid "" "The :c:member:`PyConfig.module_search_paths_set` field must now be set to 1 " "for initialization to use :c:member:`PyConfig.module_search_paths` to " @@ -4797,7 +4794,7 @@ msgstr "" "`sys.path`,則現在 :c:member:`PyConfig.module_search_paths_set` 必須被設為 " "1。否則,初始化會重新計算路徑並取代所有被加到 ``module_search_paths`` 的值。" -#: ../../whatsnew/3.11.rst:2552 +#: ../../whatsnew/3.11.rst:2556 msgid "" ":c:func:`PyConfig_Read` no longer calculates the initial search path, and " "will not fill any values into :c:member:`PyConfig.module_search_paths`. To " @@ -4810,60 +4807,60 @@ msgstr "" "初始化並使用 :c:func:`PySys_GetObject` 以取得 :data:`sys.path` 作為 Python 列" "表物件並直接修改它。" -#: ../../whatsnew/3.11.rst:2563 +#: ../../whatsnew/3.11.rst:2567 msgid "" "Deprecate the following functions to configure the Python initialization:" msgstr "棄用以下用來配置 Python 初始化的函式:" -#: ../../whatsnew/3.11.rst:2565 -msgid ":c:func:`PySys_AddWarnOptionUnicode`" -msgstr ":c:func:`PySys_AddWarnOptionUnicode`" - -#: ../../whatsnew/3.11.rst:2566 -msgid ":c:func:`PySys_AddWarnOption`" -msgstr ":c:func:`PySys_AddWarnOption`" - -#: ../../whatsnew/3.11.rst:2567 -msgid ":c:func:`PySys_AddXOption`" -msgstr ":c:func:`PySys_AddXOption`" - -#: ../../whatsnew/3.11.rst:2568 -msgid ":c:func:`PySys_HasWarnOptions`" -msgstr ":c:func:`PySys_HasWarnOptions`" - #: ../../whatsnew/3.11.rst:2569 -msgid ":c:func:`PySys_SetArgvEx`" -msgstr ":c:func:`PySys_SetArgvEx`" +msgid ":c:func:`!PySys_AddWarnOptionUnicode`" +msgstr "" #: ../../whatsnew/3.11.rst:2570 -msgid ":c:func:`PySys_SetArgv`" -msgstr ":c:func:`PySys_SetArgv`" +msgid ":c:func:`!PySys_AddWarnOption`" +msgstr "" #: ../../whatsnew/3.11.rst:2571 -msgid ":c:func:`PySys_SetPath`" -msgstr ":c:func:`PySys_SetPath`" +msgid ":c:func:`!PySys_AddXOption`" +msgstr "" #: ../../whatsnew/3.11.rst:2572 -msgid ":c:func:`Py_SetPath`" -msgstr ":c:func:`Py_SetPath`" +msgid ":c:func:`!PySys_HasWarnOptions`" +msgstr "" #: ../../whatsnew/3.11.rst:2573 -msgid ":c:func:`Py_SetProgramName`" -msgstr ":c:func:`Py_SetProgramName`" +msgid ":c:func:`!PySys_SetArgvEx`" +msgstr "" #: ../../whatsnew/3.11.rst:2574 -msgid ":c:func:`Py_SetPythonHome`" -msgstr ":c:func:`Py_SetPythonHome`" +msgid ":c:func:`!PySys_SetArgv`" +msgstr "" #: ../../whatsnew/3.11.rst:2575 -msgid ":c:func:`Py_SetStandardStreamEncoding`" -msgstr ":c:func:`Py_SetStandardStreamEncoding`" +msgid ":c:func:`!PySys_SetPath`" +msgstr "" #: ../../whatsnew/3.11.rst:2576 -msgid ":c:func:`_Py_SetProgramFullPath`" -msgstr ":c:func:`_Py_SetProgramFullPath`" +msgid ":c:func:`!Py_SetPath`" +msgstr "" + +#: ../../whatsnew/3.11.rst:2577 +msgid ":c:func:`!Py_SetProgramName`" +msgstr "" #: ../../whatsnew/3.11.rst:2578 +msgid ":c:func:`!Py_SetPythonHome`" +msgstr "" + +#: ../../whatsnew/3.11.rst:2579 +msgid ":c:func:`!Py_SetStandardStreamEncoding`" +msgstr "" + +#: ../../whatsnew/3.11.rst:2580 +msgid ":c:func:`!_Py_SetProgramFullPath`" +msgstr "" + +#: ../../whatsnew/3.11.rst:2582 msgid "" "Use the new :c:type:`PyConfig` API of the :ref:`Python Initialization " "Configuration ` instead (:pep:`587`). (Contributed by Victor " @@ -4872,7 +4869,7 @@ msgstr "" "請改用 :ref:`Python 初始化配置 `\\ 中新的 :c:type:`PyConfig` " "API。(由 Victor Stinner 於 :gh:`88279` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2582 +#: ../../whatsnew/3.11.rst:2586 msgid "" "Deprecate the ``ob_shash`` member of the :c:type:`PyBytesObject`. Use :c:" "func:`PyObject_Hash` instead. (Contributed by Inada Naoki in :issue:`46864`.)" @@ -4880,113 +4877,111 @@ msgstr "" "棄用 :c:type:`PyBytesObject` 中的 ``ob_shash`` 成員。請改用 :c:func:" "`PyObject_Hash`。(由 Inada Naoki 於 :issue:`46864` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2591 +#: ../../whatsnew/3.11.rst:2595 msgid "" "The following C APIs have been deprecated in earlier Python releases, and " "will be removed in Python 3.12." msgstr "以下 C API 已於先前 Python 發布版本中棄用,並將於 Python 3.12 中移除。" -#: ../../whatsnew/3.11.rst:2594 -msgid ":c:func:`PyUnicode_AS_DATA`" -msgstr ":c:func:`PyUnicode_AS_DATA`" - -#: ../../whatsnew/3.11.rst:2595 -msgid ":c:func:`PyUnicode_AS_UNICODE`" -msgstr ":c:func:`PyUnicode_AS_UNICODE`" - -#: ../../whatsnew/3.11.rst:2596 -msgid ":c:func:`PyUnicode_AsUnicodeAndSize`" -msgstr ":c:func:`PyUnicode_AsUnicodeAndSize`" - -#: ../../whatsnew/3.11.rst:2597 -msgid ":c:func:`PyUnicode_AsUnicode`" -msgstr ":c:func:`PyUnicode_AsUnicode`" - #: ../../whatsnew/3.11.rst:2598 -msgid ":c:func:`PyUnicode_FromUnicode`" -msgstr ":c:func:`PyUnicode_FromUnicode`" +msgid ":c:func:`!PyUnicode_AS_DATA`" +msgstr "" #: ../../whatsnew/3.11.rst:2599 -msgid ":c:func:`PyUnicode_GET_DATA_SIZE`" -msgstr ":c:func:`PyUnicode_GET_DATA_SIZE`" +msgid ":c:func:`!PyUnicode_AS_UNICODE`" +msgstr "" #: ../../whatsnew/3.11.rst:2600 -msgid ":c:func:`PyUnicode_GET_SIZE`" -msgstr ":c:func:`PyUnicode_GET_SIZE`" +msgid ":c:func:`!PyUnicode_AsUnicodeAndSize`" +msgstr "" #: ../../whatsnew/3.11.rst:2601 -msgid ":c:func:`PyUnicode_GetSize`" -msgstr ":c:func:`PyUnicode_GetSize`" +msgid ":c:func:`!PyUnicode_AsUnicode`" +msgstr "" #: ../../whatsnew/3.11.rst:2602 -msgid ":c:func:`PyUnicode_IS_COMPACT`" -msgstr ":c:func:`PyUnicode_IS_COMPACT`" +msgid ":c:func:`!PyUnicode_FromUnicode`" +msgstr "" #: ../../whatsnew/3.11.rst:2603 -msgid ":c:func:`PyUnicode_IS_READY`" -msgstr ":c:func:`PyUnicode_IS_READY`" +msgid ":c:func:`!PyUnicode_GET_DATA_SIZE`" +msgstr "" #: ../../whatsnew/3.11.rst:2604 -msgid ":c:func:`PyUnicode_READY`" -msgstr ":c:func:`PyUnicode_READY`" +msgid ":c:func:`!PyUnicode_GET_SIZE`" +msgstr "" #: ../../whatsnew/3.11.rst:2605 -msgid ":c:func:`Py_UNICODE_WSTR_LENGTH`" -msgstr ":c:func:`Py_UNICODE_WSTR_LENGTH`" +msgid ":c:func:`!PyUnicode_GetSize`" +msgstr "" #: ../../whatsnew/3.11.rst:2606 -msgid ":c:func:`_PyUnicode_AsUnicode`" -msgstr ":c:func:`_PyUnicode_AsUnicode`" +msgid ":c:func:`PyUnicode_IS_COMPACT`" +msgstr ":c:func:`PyUnicode_IS_COMPACT`" #: ../../whatsnew/3.11.rst:2607 -msgid ":c:macro:`PyUnicode_WCHAR_KIND`" -msgstr ":c:macro:`PyUnicode_WCHAR_KIND`" +msgid ":c:func:`PyUnicode_IS_READY`" +msgstr ":c:func:`PyUnicode_IS_READY`" #: ../../whatsnew/3.11.rst:2608 +msgid ":c:func:`PyUnicode_READY`" +msgstr ":c:func:`PyUnicode_READY`" + +#: ../../whatsnew/3.11.rst:2609 +msgid ":c:func:`!PyUnicode_WSTR_LENGTH`" +msgstr "" + +#: ../../whatsnew/3.11.rst:2610 +msgid ":c:func:`!_PyUnicode_AsUnicode`" +msgstr "" + +#: ../../whatsnew/3.11.rst:2611 +msgid ":c:macro:`!PyUnicode_WCHAR_KIND`" +msgstr "" + +#: ../../whatsnew/3.11.rst:2612 msgid ":c:type:`PyUnicodeObject`" msgstr ":c:type:`PyUnicodeObject`" -#: ../../whatsnew/3.11.rst:2609 -msgid ":c:func:`PyUnicode_InternImmortal()`" -msgstr ":c:func:`PyUnicode_InternImmortal()`" +#: ../../whatsnew/3.11.rst:2613 +msgid ":c:func:`!PyUnicode_InternImmortal`" +msgstr "" -#: ../../whatsnew/3.11.rst:2617 +#: ../../whatsnew/3.11.rst:2621 msgid "" -":c:func:`PyFrame_BlockSetup` and :c:func:`PyFrame_BlockPop` have been " +":c:func:`!PyFrame_BlockSetup` and :c:func:`!PyFrame_BlockPop` have been " "removed. (Contributed by Mark Shannon in :issue:`40222`.)" msgstr "" -"移除 :c:func:`PyFrame_BlockSetup` 和 :c:func:`PyFrame_BlockPop`。(由 Mark " -"Shannon 於 :issue:`40222` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2621 +#: ../../whatsnew/3.11.rst:2625 msgid "Remove the following math macros using the ``errno`` variable:" msgstr "移除以下使用到 ``errno`` 變數的數學巨集:" -#: ../../whatsnew/3.11.rst:2623 +#: ../../whatsnew/3.11.rst:2627 msgid "``Py_ADJUST_ERANGE1()``" msgstr "``Py_ADJUST_ERANGE1()``" -#: ../../whatsnew/3.11.rst:2624 +#: ../../whatsnew/3.11.rst:2628 msgid "``Py_ADJUST_ERANGE2()``" msgstr "``Py_ADJUST_ERANGE2()``" -#: ../../whatsnew/3.11.rst:2625 +#: ../../whatsnew/3.11.rst:2629 msgid "``Py_OVERFLOWED()``" msgstr "``Py_OVERFLOWED()``" -#: ../../whatsnew/3.11.rst:2626 +#: ../../whatsnew/3.11.rst:2630 msgid "``Py_SET_ERANGE_IF_OVERFLOW()``" msgstr "``Py_SET_ERANGE_IF_OVERFLOW()``" -#: ../../whatsnew/3.11.rst:2627 +#: ../../whatsnew/3.11.rst:2631 msgid "``Py_SET_ERRNO_ON_MATH_ERROR()``" msgstr "``Py_SET_ERRNO_ON_MATH_ERROR()``" -#: ../../whatsnew/3.11.rst:2629 +#: ../../whatsnew/3.11.rst:2633 msgid "(Contributed by Victor Stinner in :issue:`45412`.)" msgstr "(由 Victor Stinner 於 :issue:`45412` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2631 +#: ../../whatsnew/3.11.rst:2635 msgid "" "Remove ``Py_UNICODE_COPY()`` and ``Py_UNICODE_FILL()`` macros, deprecated " "since Python 3.3. Use ``PyUnicode_CopyCharacters()`` or ``memcpy()`` " @@ -4998,7 +4993,7 @@ msgstr "" "和 ``PyUnicode_Fill()`` 函式。(由 Victor Stinner 於 :issue:`41123` 中所貢" "獻。)" -#: ../../whatsnew/3.11.rst:2636 +#: ../../whatsnew/3.11.rst:2640 msgid "" "Remove the ``pystrhex.h`` header file. It only contains private functions. C " "extensions should only include the main ```` header file. " @@ -5007,7 +5002,7 @@ msgstr "" "移除 ``pystrhex.h`` 標頭檔案。它只有包含私有函式。C 的擴充應該只要引入主要的 " "```` 標頭檔案。(由 Victor Stinner 於 :issue:`45434` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2640 +#: ../../whatsnew/3.11.rst:2644 msgid "" "Remove the ``Py_FORCE_DOUBLE()`` macro. It was used by the " "``Py_IS_INFINITY()`` macro. (Contributed by Victor Stinner in :issue:" @@ -5016,41 +5011,41 @@ msgstr "" "移除 ``Py_FORCE_DOUBLE()`` 巨集。它先前被用於 ``Py_IS_INFINITY()`` 巨集。" "(由 Victor Stinner 於 :issue:`45440` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2644 +#: ../../whatsnew/3.11.rst:2648 msgid "" "The following items are no longer available when :c:macro:`Py_LIMITED_API` " "is defined:" msgstr "當 :c:macro:`Py_LIMITED_API` 有被定義時,以下項目將無法被取得:" -#: ../../whatsnew/3.11.rst:2647 +#: ../../whatsnew/3.11.rst:2651 msgid ":c:func:`PyMarshal_WriteLongToFile`" msgstr ":c:func:`PyMarshal_WriteLongToFile`" -#: ../../whatsnew/3.11.rst:2648 +#: ../../whatsnew/3.11.rst:2652 msgid ":c:func:`PyMarshal_WriteObjectToFile`" msgstr ":c:func:`PyMarshal_WriteObjectToFile`" -#: ../../whatsnew/3.11.rst:2649 +#: ../../whatsnew/3.11.rst:2653 msgid ":c:func:`PyMarshal_ReadObjectFromString`" msgstr ":c:func:`PyMarshal_ReadObjectFromString`" -#: ../../whatsnew/3.11.rst:2650 +#: ../../whatsnew/3.11.rst:2654 msgid ":c:func:`PyMarshal_WriteObjectToString`" msgstr ":c:func:`PyMarshal_WriteObjectToString`" -#: ../../whatsnew/3.11.rst:2651 +#: ../../whatsnew/3.11.rst:2655 msgid "the ``Py_MARSHAL_VERSION`` macro" msgstr "``Py_MARSHAL_VERSION`` 巨集" -#: ../../whatsnew/3.11.rst:2653 +#: ../../whatsnew/3.11.rst:2657 msgid "These are not part of the :ref:`limited API `." msgstr "" -#: ../../whatsnew/3.11.rst:2655 +#: ../../whatsnew/3.11.rst:2659 msgid "(Contributed by Victor Stinner in :issue:`45474`.)" msgstr "(由 Victor Stinner 於 :issue:`45474` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2657 +#: ../../whatsnew/3.11.rst:2661 msgid "" "Exclude :c:func:`PyWeakref_GET_OBJECT` from the limited C API. It never " "worked since the :c:type:`PyWeakReference` structure is opaque in the " @@ -5060,7 +5055,7 @@ msgstr "" "`PyWeakReference` 結構在受限 C API 中過於晦澀而從未運作。(由 Victor Stinner " "於 :issue:`35134` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2662 +#: ../../whatsnew/3.11.rst:2666 msgid "" "Remove the ``PyHeapType_GET_MEMBERS()`` macro. It was exposed in the public " "C API by mistake, it must only be used by Python internally. Use the " @@ -5071,7 +5066,7 @@ msgstr "" "該只能被 Python 內部所使用。請改用 ``PyTypeObject.tp_members``。(由 Victor " "Stinner 於 :issue:`40170` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2667 +#: ../../whatsnew/3.11.rst:2671 msgid "" "Remove the ``HAVE_PY_SET_53BIT_PRECISION`` macro (moved to the internal C " "API). (Contributed by Victor Stinner in :issue:`45412`.)" @@ -5079,7 +5074,7 @@ msgstr "" "移除 ``HAVE_PY_SET_53BIT_PRECISION`` 巨集(移動至內部 C API)。(由 Victor " "Stinner 於 :issue:`45412` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2673 +#: ../../whatsnew/3.11.rst:2677 msgid "" "Remove the :c:type:`Py_UNICODE` encoder APIs, as they have been deprecated " "since Python 3.3, are little used and are inefficient relative to the " @@ -5088,66 +5083,165 @@ msgstr "" "移除 :c:type:`Py_UNICODE` 編碼器 API,它們自從 Python 3.3 就被棄用,非常少用" "且和推薦的替代方案已無太大關聯。" -#: ../../whatsnew/3.11.rst:2678 +#: ../../whatsnew/3.11.rst:2682 msgid "The removed functions are:" msgstr "被移除的函式為:" -#: ../../whatsnew/3.11.rst:2680 +#: ../../whatsnew/3.11.rst:2684 msgid ":func:`!PyUnicode_Encode`" msgstr ":func:`!PyUnicode_Encode`" -#: ../../whatsnew/3.11.rst:2681 +#: ../../whatsnew/3.11.rst:2685 msgid ":func:`!PyUnicode_EncodeASCII`" msgstr ":func:`!PyUnicode_EncodeASCII`" -#: ../../whatsnew/3.11.rst:2682 +#: ../../whatsnew/3.11.rst:2686 msgid ":func:`!PyUnicode_EncodeLatin1`" msgstr ":func:`!PyUnicode_EncodeLatin1`" -#: ../../whatsnew/3.11.rst:2683 +#: ../../whatsnew/3.11.rst:2687 msgid ":func:`!PyUnicode_EncodeUTF7`" msgstr ":func:`!PyUnicode_EncodeUTF7`" -#: ../../whatsnew/3.11.rst:2684 +#: ../../whatsnew/3.11.rst:2688 msgid ":func:`!PyUnicode_EncodeUTF8`" msgstr ":func:`!PyUnicode_EncodeUTF8`" -#: ../../whatsnew/3.11.rst:2685 +#: ../../whatsnew/3.11.rst:2689 msgid ":func:`!PyUnicode_EncodeUTF16`" msgstr ":func:`!PyUnicode_EncodeUTF16`" -#: ../../whatsnew/3.11.rst:2686 +#: ../../whatsnew/3.11.rst:2690 msgid ":func:`!PyUnicode_EncodeUTF32`" msgstr ":func:`!PyUnicode_EncodeUTF32`" -#: ../../whatsnew/3.11.rst:2687 +#: ../../whatsnew/3.11.rst:2691 msgid ":func:`!PyUnicode_EncodeUnicodeEscape`" msgstr ":func:`!PyUnicode_EncodeUnicodeEscape`" -#: ../../whatsnew/3.11.rst:2688 +#: ../../whatsnew/3.11.rst:2692 msgid ":func:`!PyUnicode_EncodeRawUnicodeEscape`" msgstr ":func:`!PyUnicode_EncodeRawUnicodeEscape`" -#: ../../whatsnew/3.11.rst:2689 +#: ../../whatsnew/3.11.rst:2693 msgid ":func:`!PyUnicode_EncodeCharmap`" msgstr ":func:`!PyUnicode_EncodeCharmap`" -#: ../../whatsnew/3.11.rst:2690 +#: ../../whatsnew/3.11.rst:2694 msgid ":func:`!PyUnicode_TranslateCharmap`" msgstr ":func:`!PyUnicode_TranslateCharmap`" -#: ../../whatsnew/3.11.rst:2691 +#: ../../whatsnew/3.11.rst:2695 msgid ":func:`!PyUnicode_EncodeDecimal`" msgstr ":func:`!PyUnicode_EncodeDecimal`" -#: ../../whatsnew/3.11.rst:2692 +#: ../../whatsnew/3.11.rst:2696 msgid ":func:`!PyUnicode_TransformDecimalToASCII`" msgstr ":func:`!PyUnicode_TransformDecimalToASCII`" -#: ../../whatsnew/3.11.rst:2694 +#: ../../whatsnew/3.11.rst:2698 msgid "" "See :pep:`624` for details and :pep:`migration guidance <624#alternative-" "apis>`. (Contributed by Inada Naoki in :issue:`44029`.)" msgstr "" "詳情請見 :pep:`624` 與\\ :pep:`搬遷指南 <624#alternative-apis>`。(由 Inada " "Naoki 於 :issue:`44029` 中所貢獻。)" + +#~ msgid "" +#~ "Added :meth:`object.__getstate__`, which provides the default " +#~ "implementation of the :meth:`!__getstate__` method. :mod:`copy`\\ing and :" +#~ "mod:`pickle`\\ing instances of subclasses of builtin types :class:" +#~ "`bytearray`, :class:`set`, :class:`frozenset`, :class:`collections." +#~ "OrderedDict`, :class:`collections.deque`, :class:`weakref.WeakSet`, and :" +#~ "class:`datetime.tzinfo` now copies and pickles instance attributes " +#~ "implemented as :term:`slots <__slots__>`. (Contributed by Serhiy " +#~ "Storchaka in :issue:`26579`.)" +#~ msgstr "" +#~ "添加了 :meth:`object.__getstate__`,它提供 :meth:`!__getstate__` 方法的預" +#~ "設實作。內建型別 :class:`bytearray`、:class:`set`、:class:`frozenset`、:" +#~ "class:`collections.OrderedDict`、:class:`collections.deque`、:class:" +#~ "`weakref.WeakSet` 和 :class:`datetime.tzinfo` 的 :mod:`copy` 和 :mod:" +#~ "`pickle` 實例,現在會以 :term:`slots <__slots__>` 形式複製和 pickle 實例屬" +#~ "性。 (由 Serhiy Storchaka 在 :issue:`26579` 中貢獻。)" + +#~ msgid ":c:func:`PyBuffer_CopyData`" +#~ msgstr ":c:func:`PyBuffer_CopyData`" + +#~ msgid ":c:func:`PySys_AddWarnOptionUnicode`" +#~ msgstr ":c:func:`PySys_AddWarnOptionUnicode`" + +#~ msgid ":c:func:`PySys_AddWarnOption`" +#~ msgstr ":c:func:`PySys_AddWarnOption`" + +#~ msgid ":c:func:`PySys_AddXOption`" +#~ msgstr ":c:func:`PySys_AddXOption`" + +#~ msgid ":c:func:`PySys_HasWarnOptions`" +#~ msgstr ":c:func:`PySys_HasWarnOptions`" + +#~ msgid ":c:func:`PySys_SetArgvEx`" +#~ msgstr ":c:func:`PySys_SetArgvEx`" + +#~ msgid ":c:func:`PySys_SetArgv`" +#~ msgstr ":c:func:`PySys_SetArgv`" + +#~ msgid ":c:func:`PySys_SetPath`" +#~ msgstr ":c:func:`PySys_SetPath`" + +#~ msgid ":c:func:`Py_SetPath`" +#~ msgstr ":c:func:`Py_SetPath`" + +#~ msgid ":c:func:`Py_SetProgramName`" +#~ msgstr ":c:func:`Py_SetProgramName`" + +#~ msgid ":c:func:`Py_SetPythonHome`" +#~ msgstr ":c:func:`Py_SetPythonHome`" + +#~ msgid ":c:func:`Py_SetStandardStreamEncoding`" +#~ msgstr ":c:func:`Py_SetStandardStreamEncoding`" + +#~ msgid ":c:func:`_Py_SetProgramFullPath`" +#~ msgstr ":c:func:`_Py_SetProgramFullPath`" + +#~ msgid ":c:func:`PyUnicode_AS_DATA`" +#~ msgstr ":c:func:`PyUnicode_AS_DATA`" + +#~ msgid ":c:func:`PyUnicode_AS_UNICODE`" +#~ msgstr ":c:func:`PyUnicode_AS_UNICODE`" + +#~ msgid ":c:func:`PyUnicode_AsUnicodeAndSize`" +#~ msgstr ":c:func:`PyUnicode_AsUnicodeAndSize`" + +#~ msgid ":c:func:`PyUnicode_AsUnicode`" +#~ msgstr ":c:func:`PyUnicode_AsUnicode`" + +#~ msgid ":c:func:`PyUnicode_FromUnicode`" +#~ msgstr ":c:func:`PyUnicode_FromUnicode`" + +#~ msgid ":c:func:`PyUnicode_GET_DATA_SIZE`" +#~ msgstr ":c:func:`PyUnicode_GET_DATA_SIZE`" + +#~ msgid ":c:func:`PyUnicode_GET_SIZE`" +#~ msgstr ":c:func:`PyUnicode_GET_SIZE`" + +#~ msgid ":c:func:`PyUnicode_GetSize`" +#~ msgstr ":c:func:`PyUnicode_GetSize`" + +#~ msgid ":c:func:`Py_UNICODE_WSTR_LENGTH`" +#~ msgstr ":c:func:`Py_UNICODE_WSTR_LENGTH`" + +#~ msgid ":c:func:`_PyUnicode_AsUnicode`" +#~ msgstr ":c:func:`_PyUnicode_AsUnicode`" + +#~ msgid ":c:macro:`PyUnicode_WCHAR_KIND`" +#~ msgstr ":c:macro:`PyUnicode_WCHAR_KIND`" + +#~ msgid ":c:func:`PyUnicode_InternImmortal()`" +#~ msgstr ":c:func:`PyUnicode_InternImmortal()`" + +#~ msgid "" +#~ ":c:func:`PyFrame_BlockSetup` and :c:func:`PyFrame_BlockPop` have been " +#~ "removed. (Contributed by Mark Shannon in :issue:`40222`.)" +#~ msgstr "" +#~ "移除 :c:func:`PyFrame_BlockSetup` 和 :c:func:`PyFrame_BlockPop`。(由 " +#~ "Mark Shannon 於 :issue:`40222` 中所貢獻。)" diff --git a/whatsnew/3.12.po b/whatsnew/3.12.po index b130430e5e..20e10941bc 100644 --- a/whatsnew/3.12.po +++ b/whatsnew/3.12.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-14 13:46+0000\n" +"POT-Creation-Date: 2023-08-23 00:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -143,7 +143,7 @@ msgid "" "in :gh:`91058`." msgstr "" -#: ../../whatsnew/3.12.rst:149 ../../whatsnew/3.12.rst:1639 +#: ../../whatsnew/3.12.rst:149 ../../whatsnew/3.12.rst:1652 msgid "New Features" msgstr "新增特性" @@ -1004,7 +1004,7 @@ msgid "" "Katriel in :gh:`102778`.)" msgstr "" -#: ../../whatsnew/3.12.rst:801 ../../whatsnew/3.12.rst:1547 +#: ../../whatsnew/3.12.rst:801 ../../whatsnew/3.12.rst:1560 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 " @@ -1277,7 +1277,7 @@ msgid "" "demos>`_. (Contributed by Victor Stinner in :gh:`97669`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1009 ../../whatsnew/3.12.rst:1938 +#: ../../whatsnew/3.12.rst:1009 ../../whatsnew/3.12.rst:1951 msgid "Deprecated" msgstr "已棄用" @@ -1496,57 +1496,65 @@ msgid ":mod:`xdrlib`" msgstr ":mod:`xdrlib`" #: ../../whatsnew/3.12.rst:1116 -msgid "APIs:" +msgid "Other modules:" msgstr "" #: ../../whatsnew/3.12.rst:1118 +msgid ":mod:`!lib2to3`, and the :program:`2to3` program (:gh:`84540`)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1120 +msgid "APIs:" +msgstr "" + +#: ../../whatsnew/3.12.rst:1122 msgid ":class:`!configparser.LegacyInterpolation` (:gh:`90765`)" msgstr ":class:`!configparser.LegacyInterpolation` (:gh:`90765`)" -#: ../../whatsnew/3.12.rst:1119 +#: ../../whatsnew/3.12.rst:1123 msgid ":func:`locale.getdefaultlocale` (:gh:`90817`)" msgstr ":func:`locale.getdefaultlocale` (:gh:`90817`)" -#: ../../whatsnew/3.12.rst:1120 +#: ../../whatsnew/3.12.rst:1124 msgid ":meth:`!turtle.RawTurtle.settiltangle` (:gh:`50096`)" msgstr ":meth:`!turtle.RawTurtle.settiltangle` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1121 +#: ../../whatsnew/3.12.rst:1125 msgid ":func:`!unittest.findTestCases` (:gh:`50096`)" msgstr ":func:`!unittest.findTestCases` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1122 +#: ../../whatsnew/3.12.rst:1126 msgid ":func:`!unittest.getTestCaseNames` (:gh:`50096`)" msgstr ":func:`!unittest.getTestCaseNames` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1123 +#: ../../whatsnew/3.12.rst:1127 msgid ":func:`!unittest.makeSuite` (:gh:`50096`)" msgstr ":func:`!unittest.makeSuite` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1124 +#: ../../whatsnew/3.12.rst:1128 msgid ":meth:`!unittest.TestProgram.usageExit` (:gh:`67048`)" msgstr ":meth:`!unittest.TestProgram.usageExit` (:gh:`67048`)" -#: ../../whatsnew/3.12.rst:1125 +#: ../../whatsnew/3.12.rst:1129 msgid ":class:`!webbrowser.MacOSX` (:gh:`86421`)" msgstr ":class:`!webbrowser.MacOSX` (:gh:`86421`)" -#: ../../whatsnew/3.12.rst:1126 +#: ../../whatsnew/3.12.rst:1130 msgid ":class:`classmethod` descriptor chaining (:gh:`89519`)" msgstr "" -#: ../../whatsnew/3.12.rst:1129 +#: ../../whatsnew/3.12.rst:1133 msgid "Pending Removal in Python 3.14" msgstr "" -#: ../../whatsnew/3.12.rst:1131 +#: ../../whatsnew/3.12.rst:1135 msgid "" ":mod:`argparse`: The *type*, *choices*, and *metavar* parameters of :class:`!" "argparse.BooleanOptionalAction` are deprecated and will be removed in 3.14. " "(Contributed by Nikita Sobolev in :gh:`92248`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1136 +#: ../../whatsnew/3.12.rst:1140 msgid "" ":mod:`ast`: The following :mod:`ast` features have been deprecated in " "documentation since Python 3.8, now cause a :exc:`DeprecationWarning` to be " @@ -1554,33 +1562,39 @@ msgid "" "Python 3.14:" msgstr "" -#: ../../whatsnew/3.12.rst:1140 +#: ../../whatsnew/3.12.rst:1144 msgid ":class:`!ast.Num`" msgstr ":class:`!ast.Num`" -#: ../../whatsnew/3.12.rst:1141 +#: ../../whatsnew/3.12.rst:1145 msgid ":class:`!ast.Str`" msgstr ":class:`!ast.Str`" -#: ../../whatsnew/3.12.rst:1142 +#: ../../whatsnew/3.12.rst:1146 msgid ":class:`!ast.Bytes`" msgstr ":class:`!ast.Bytes`" -#: ../../whatsnew/3.12.rst:1143 +#: ../../whatsnew/3.12.rst:1147 msgid ":class:`!ast.NameConstant`" msgstr ":class:`!ast.NameConstant`" -#: ../../whatsnew/3.12.rst:1144 +#: ../../whatsnew/3.12.rst:1148 msgid ":class:`!ast.Ellipsis`" msgstr ":class:`!ast.Ellipsis`" -#: ../../whatsnew/3.12.rst:1146 +#: ../../whatsnew/3.12.rst:1150 msgid "" "Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka in :gh:" "`90953`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1149 +#: ../../whatsnew/3.12.rst:1153 +msgid "" +":mod:`asyncio`: the *msg* parameter of both :meth:`asyncio.Future.cancel` " +"and :meth:`asyncio.Task.cancel` (:gh:`90985`)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1157 msgid "" ":mod:`collections.abc`: Deprecated :class:`collections.abc.ByteString`. " "Prefer :class:`Sequence` or :class:`collections.abc.Buffer`. For use in " @@ -1588,47 +1602,47 @@ msgid "" "abc.Buffer`. (Contributed by Shantanu Jain in :gh:`91896`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1154 +#: ../../whatsnew/3.12.rst:1162 msgid "" ":mod:`email`: Deprecated the *isdst* parameter in :func:`email.utils." "localtime`. (Contributed by Alan Williams in :gh:`72346`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1157 +#: ../../whatsnew/3.12.rst:1165 msgid "" ":mod:`importlib.abc`: Deprecated the following classes, scheduled for " "removal in Python 3.14:" msgstr "" -#: ../../whatsnew/3.12.rst:1160 +#: ../../whatsnew/3.12.rst:1168 msgid ":class:`!importlib.abc.ResourceReader`" msgstr ":class:`!importlib.abc.ResourceReader`" -#: ../../whatsnew/3.12.rst:1161 +#: ../../whatsnew/3.12.rst:1169 msgid ":class:`!importlib.abc.Traversable`" msgstr ":class:`!importlib.abc.Traversable`" -#: ../../whatsnew/3.12.rst:1162 +#: ../../whatsnew/3.12.rst:1170 msgid ":class:`!importlib.abc.TraversableResources`" msgstr ":class:`!importlib.abc.TraversableResources`" -#: ../../whatsnew/3.12.rst:1164 +#: ../../whatsnew/3.12.rst:1172 msgid "Use :mod:`importlib.resources.abc` classes instead:" msgstr "" -#: ../../whatsnew/3.12.rst:1166 +#: ../../whatsnew/3.12.rst:1174 msgid ":class:`importlib.resources.abc.Traversable`" msgstr ":class:`importlib.resources.abc.Traversable`" -#: ../../whatsnew/3.12.rst:1167 +#: ../../whatsnew/3.12.rst:1175 msgid ":class:`importlib.resources.abc.TraversableResources`" msgstr ":class:`importlib.resources.abc.TraversableResources`" -#: ../../whatsnew/3.12.rst:1169 +#: ../../whatsnew/3.12.rst:1177 msgid "(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)" msgstr "(由 Jason R. Coombs 和 Hugo van Kemenade 於 :gh:`93963` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1171 +#: ../../whatsnew/3.12.rst:1179 msgid "" ":mod:`itertools`: The module had undocumented, inefficient, historically " "buggy, and inconsistent support for copy, deepcopy, and pickle operations. " @@ -1636,7 +1650,7 @@ msgid "" "maintenance burden. (Contributed by Raymond Hettinger in :gh:`101588`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1177 +#: ../../whatsnew/3.12.rst:1185 msgid "" ":mod:`multiprocessing`: The default :mod:`multiprocessing` start method will " "change to a safer one on Linux, BSDs, and other non-macOS POSIX platforms " @@ -1647,52 +1661,52 @@ msgid "" "code *requires* ``'fork'``. See :ref:`multiprocessing-start-methods`." msgstr "" -#: ../../whatsnew/3.12.rst:1185 +#: ../../whatsnew/3.12.rst:1193 msgid "" ":mod:`pkgutil`: :func:`pkgutil.find_loader` and :func:`pkgutil.get_loader` " "now raise :exc:`DeprecationWarning`; use :func:`importlib.util.find_spec` " "instead. (Contributed by Nikita Sobolev in :gh:`97850`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1190 +#: ../../whatsnew/3.12.rst:1198 msgid "" ":mod:`pty`: The module has two undocumented ``master_open()`` and " "``slave_open()`` functions that have been deprecated since Python 2 but only " "gained a proper :exc:`DeprecationWarning` in 3.12. Remove them in 3.14." msgstr "" -#: ../../whatsnew/3.12.rst:1194 +#: ../../whatsnew/3.12.rst:1202 msgid "" ":mod:`shutil`: The *onerror* argument of :func:`shutil.rmtree` is deprecated " "in 3.12, and will be removed in 3.14." msgstr "" -#: ../../whatsnew/3.12.rst:1197 +#: ../../whatsnew/3.12.rst:1205 msgid "" ":mod:`typing`: :class:`typing.ByteString`, deprecated since Python 3.9, now " "causes a :exc:`DeprecationWarning` to be emitted when it is used." msgstr "" -#: ../../whatsnew/3.12.rst:1200 +#: ../../whatsnew/3.12.rst:1208 msgid "" ":mod:`xml.etree.ElementTree`: Testing the truth value of an :class:`xml." "etree.ElementTree.Element` is deprecated and will raise an exception in " "Python 3.14." msgstr "" -#: ../../whatsnew/3.12.rst:1203 +#: ../../whatsnew/3.12.rst:1211 msgid "" "Creating immutable types (:c:macro:`Py_TPFLAGS_IMMUTABLETYPE`) with mutable " -"bases using the C API." +"bases using the C API (:gh:`95388`)." msgstr "" -#: ../../whatsnew/3.12.rst:1206 +#: ../../whatsnew/3.12.rst:1214 msgid "" "``__package__`` and ``__cached__`` will cease to be set or taken into " "consideration by the import system (:gh:`97879`)." msgstr "" -#: ../../whatsnew/3.12.rst:1209 +#: ../../whatsnew/3.12.rst:1217 msgid "" "Accessing ``co_lnotab`` was deprecated in :pep:`626` since 3.10 and was " "planned to be removed in 3.12 but it only got a proper :exc:" @@ -1700,21 +1714,31 @@ msgid "" "Sobolev in :gh:`101866`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1216 +#: ../../whatsnew/3.12.rst:1223 +msgid "" +"Creating :c:data:`immutable types ` with mutable " +"bases using the C API (:gh:`95388`)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1227 msgid "Pending Removal in Future Versions" msgstr "" -#: ../../whatsnew/3.12.rst:1218 +#: ../../whatsnew/3.12.rst:1229 msgid "" "The following APIs were deprecated in earlier Python versions and will be " "removed, although there is currently no date scheduled for their removal." msgstr "" -#: ../../whatsnew/3.12.rst:1221 +#: ../../whatsnew/3.12.rst:1232 +msgid ":mod:`array`'s ``'u'`` format code (:gh:`57281`)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1234 msgid ":class:`typing.Text` (:gh:`92332`)" msgstr ":class:`typing.Text` (:gh:`92332`)" -#: ../../whatsnew/3.12.rst:1223 +#: ../../whatsnew/3.12.rst:1236 msgid "" "Currently Python accepts numeric literals immediately followed by keywords, " "for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing and " @@ -1726,42 +1750,42 @@ msgid "" "syntax error. (:gh:`87999`)" msgstr "" -#: ../../whatsnew/3.12.rst:1234 ../../whatsnew/3.12.rst:2020 +#: ../../whatsnew/3.12.rst:1247 ../../whatsnew/3.12.rst:2033 msgid "Removed" msgstr "已移除" -#: ../../whatsnew/3.12.rst:1236 +#: ../../whatsnew/3.12.rst:1249 msgid "" "``asynchat`` and ``asyncore``: 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:1242 +#: ../../whatsnew/3.12.rst:1255 msgid "" ":mod:`configparser`: Several names deprecated in the :mod:`configparser` way " "back in 3.2 have been removed per :gh:`89336`:" msgstr "" -#: ../../whatsnew/3.12.rst:1245 +#: ../../whatsnew/3.12.rst:1258 msgid "" ":class:`configparser.ParsingError` no longer has a ``filename`` attribute or " "argument. Use the ``source`` attribute and argument instead." msgstr "" -#: ../../whatsnew/3.12.rst:1247 +#: ../../whatsnew/3.12.rst:1260 msgid "" ":mod:`configparser` no longer has a ``SafeConfigParser`` class. Use the " "shorter :class:`~configparser.ConfigParser` name instead." msgstr "" -#: ../../whatsnew/3.12.rst:1249 +#: ../../whatsnew/3.12.rst:1262 msgid "" ":class:`configparser.ConfigParser` no longer has a ``readfp`` method. Use :" "meth:`~configparser.ConfigParser.read_file` instead." msgstr "" -#: ../../whatsnew/3.12.rst:1252 +#: ../../whatsnew/3.12.rst:1265 msgid "" "``distutils``: Remove the ``distutils`` package. It was deprecated in Python " "3.10 by :pep:`632` \"Deprecate distutils module\". For projects still using " @@ -1770,13 +1794,13 @@ msgid "" "Victor Stinner in :gh:`92584`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1258 +#: ../../whatsnew/3.12.rst:1271 msgid "" ":mod:`ensurepip`: Remove the bundled setuptools wheel from :mod:`ensurepip`, " "and stop installing setuptools in environments created by :mod:`venv`." msgstr "" -#: ../../whatsnew/3.12.rst:1261 +#: ../../whatsnew/3.12.rst:1274 msgid "" "``pip (>= 22.1)`` does not require setuptools to be installed in the " "environment. ``setuptools``-based (and ``distutils``-based) packages can " @@ -1784,7 +1808,7 @@ msgid "" "the build environment it uses for building a package." msgstr "" -#: ../../whatsnew/3.12.rst:1267 +#: ../../whatsnew/3.12.rst:1280 msgid "" "``easy_install``, ``pkg_resources``, ``setuptools`` and ``distutils`` are no " "longer provided by default in environments created with ``venv`` or " @@ -1794,23 +1818,23 @@ msgid "" "(typically, using pip)." msgstr "" -#: ../../whatsnew/3.12.rst:1274 +#: ../../whatsnew/3.12.rst:1287 msgid "(Contributed by Pradyun Gedam in :gh:`95299`.)" msgstr "(由 Pradyun Gedam 於 :gh:`95299` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1276 +#: ../../whatsnew/3.12.rst:1289 msgid "" ":mod:`enum`: Remove ``EnumMeta.__getattr__``, which is no longer needed for " "enum attribute access. (Contributed by Ethan Furman in :gh:`95083`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1280 +#: ../../whatsnew/3.12.rst:1293 msgid "" ":mod:`ftplib`: Remove the ``FTP_TLS.ssl_version`` class attribute: use the " "*context* parameter instead. (Contributed by Victor Stinner in :gh:`94172`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1284 +#: ../../whatsnew/3.12.rst:1297 msgid "" ":mod:`gzip`: Remove the ``filename`` attribute of :class:`gzip.GzipFile`, " "deprecated since Python 2.6, use the :attr:`~gzip.GzipFile.name` attribute " @@ -1819,7 +1843,7 @@ msgid "" "`94196`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1290 +#: ../../whatsnew/3.12.rst:1303 msgid "" ":mod:`hashlib`: Remove the pure Python implementation of :func:`hashlib." "pbkdf2_hmac()`, deprecated in Python 3.10. Python 3.10 and newer requires " @@ -1828,178 +1852,178 @@ msgid "" "Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1296 +#: ../../whatsnew/3.12.rst:1309 msgid "" ":mod:`importlib`: Many previously deprecated cleanups in :mod:`importlib` " "have now been completed:" msgstr "" -#: ../../whatsnew/3.12.rst:1299 +#: ../../whatsnew/3.12.rst:1312 msgid "" "References to, and support for :meth:`!module_repr()` has been removed. " "(Contributed by Barry Warsaw in :gh:`97850`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1302 +#: ../../whatsnew/3.12.rst:1315 msgid "" "``importlib.util.set_package`` has been removed. (Contributed by Brett " "Cannon in :gh:`65961`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1305 +#: ../../whatsnew/3.12.rst:1318 msgid "" "Support for ``find_loader()`` and ``find_module()`` APIs have been removed. " "(Contributed by Barry Warsaw in :gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1308 +#: ../../whatsnew/3.12.rst:1321 msgid "" "``importlib.abc.Finder``, ``pkgutil.ImpImporter``, and ``pkgutil.ImpLoader`` " "have been removed. (Contributed by Barry Warsaw in :gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1311 +#: ../../whatsnew/3.12.rst:1324 msgid "" "The :mod:`!imp` module has been removed. (Contributed by Barry Warsaw in :" "gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1314 +#: ../../whatsnew/3.12.rst:1327 msgid "Replace removed :mod:`!imp` functions with :mod:`importlib` functions:" msgstr "" -#: ../../whatsnew/3.12.rst:1317 +#: ../../whatsnew/3.12.rst:1330 msgid "imp" msgstr "imp" -#: ../../whatsnew/3.12.rst:1317 +#: ../../whatsnew/3.12.rst:1330 msgid "importlib" msgstr "importlib" -#: ../../whatsnew/3.12.rst:1319 +#: ../../whatsnew/3.12.rst:1332 msgid "``imp.NullImporter``" msgstr "``imp.NullImporter``" -#: ../../whatsnew/3.12.rst:1319 +#: ../../whatsnew/3.12.rst:1332 msgid "Insert ``None`` into ``sys.path_importer_cache``" msgstr "" -#: ../../whatsnew/3.12.rst:1320 +#: ../../whatsnew/3.12.rst:1333 msgid "``imp.cache_from_source()``" msgstr "``imp.cache_from_source()``" -#: ../../whatsnew/3.12.rst:1320 +#: ../../whatsnew/3.12.rst:1333 msgid ":func:`importlib.util.cache_from_source`" msgstr ":func:`importlib.util.cache_from_source`" -#: ../../whatsnew/3.12.rst:1321 +#: ../../whatsnew/3.12.rst:1334 msgid "``imp.find_module()``" msgstr "``imp.find_module()``" -#: ../../whatsnew/3.12.rst:1321 +#: ../../whatsnew/3.12.rst:1334 msgid ":func:`importlib.util.find_spec`" msgstr ":func:`importlib.util.find_spec`" -#: ../../whatsnew/3.12.rst:1322 +#: ../../whatsnew/3.12.rst:1335 msgid "``imp.get_magic()``" msgstr "``imp.get_magic()``" -#: ../../whatsnew/3.12.rst:1322 +#: ../../whatsnew/3.12.rst:1335 msgid ":attr:`importlib.util.MAGIC_NUMBER`" msgstr ":attr:`importlib.util.MAGIC_NUMBER`" -#: ../../whatsnew/3.12.rst:1323 +#: ../../whatsnew/3.12.rst:1336 msgid "``imp.get_suffixes()``" msgstr "``imp.get_suffixes()``" -#: ../../whatsnew/3.12.rst:1323 +#: ../../whatsnew/3.12.rst:1336 msgid "" ":attr:`importlib.machinery.SOURCE_SUFFIXES`, :attr:`importlib.machinery." "EXTENSION_SUFFIXES`, and :attr:`importlib.machinery.BYTECODE_SUFFIXES`" msgstr "" -#: ../../whatsnew/3.12.rst:1324 +#: ../../whatsnew/3.12.rst:1337 msgid "``imp.get_tag()``" msgstr "``imp.get_tag()``" -#: ../../whatsnew/3.12.rst:1324 +#: ../../whatsnew/3.12.rst:1337 msgid ":attr:`sys.implementation.cache_tag `" msgstr ":attr:`sys.implementation.cache_tag `" -#: ../../whatsnew/3.12.rst:1325 +#: ../../whatsnew/3.12.rst:1338 msgid "``imp.load_module()``" msgstr "``imp.load_module()``" -#: ../../whatsnew/3.12.rst:1325 +#: ../../whatsnew/3.12.rst:1338 msgid ":func:`importlib.import_module`" msgstr ":func:`importlib.import_module`" -#: ../../whatsnew/3.12.rst:1326 +#: ../../whatsnew/3.12.rst:1339 msgid "``imp.new_module(name)``" msgstr "``imp.new_module(name)``" -#: ../../whatsnew/3.12.rst:1326 +#: ../../whatsnew/3.12.rst:1339 msgid "``types.ModuleType(name)``" msgstr "``types.ModuleType(name)``" -#: ../../whatsnew/3.12.rst:1327 +#: ../../whatsnew/3.12.rst:1340 msgid "``imp.reload()``" msgstr "``imp.reload()``" -#: ../../whatsnew/3.12.rst:1327 +#: ../../whatsnew/3.12.rst:1340 msgid ":func:`importlib.reload`" msgstr ":func:`importlib.reload`" -#: ../../whatsnew/3.12.rst:1328 +#: ../../whatsnew/3.12.rst:1341 msgid "``imp.source_from_cache()``" msgstr "``imp.source_from_cache()``" -#: ../../whatsnew/3.12.rst:1328 +#: ../../whatsnew/3.12.rst:1341 msgid ":func:`importlib.util.source_from_cache`" msgstr ":func:`importlib.util.source_from_cache`" -#: ../../whatsnew/3.12.rst:1331 +#: ../../whatsnew/3.12.rst:1344 msgid "Replace ``imp.load_source()`` with::" msgstr "" -#: ../../whatsnew/3.12.rst:1346 +#: ../../whatsnew/3.12.rst:1359 msgid "Removed :mod:`!imp` functions and attributes with no replacements:" msgstr "" -#: ../../whatsnew/3.12.rst:1348 +#: ../../whatsnew/3.12.rst:1361 msgid "undocumented functions:" msgstr "" -#: ../../whatsnew/3.12.rst:1350 +#: ../../whatsnew/3.12.rst:1363 msgid "``imp.init_builtin()``" msgstr "``imp.init_builtin()``" -#: ../../whatsnew/3.12.rst:1351 +#: ../../whatsnew/3.12.rst:1364 msgid "``imp.load_compiled()``" msgstr "``imp.load_compiled()``" -#: ../../whatsnew/3.12.rst:1352 +#: ../../whatsnew/3.12.rst:1365 msgid "``imp.load_dynamic()``" msgstr "``imp.load_dynamic()``" -#: ../../whatsnew/3.12.rst:1353 +#: ../../whatsnew/3.12.rst:1366 msgid "``imp.load_package()``" msgstr "``imp.load_package()``" -#: ../../whatsnew/3.12.rst:1355 +#: ../../whatsnew/3.12.rst:1368 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:1357 +#: ../../whatsnew/3.12.rst:1370 msgid "" "``imp.find_module()`` constants: ``SEARCH_ERROR``, ``PY_SOURCE``, " "``PY_COMPILED``, ``C_EXTENSION``, ``PY_RESOURCE``, ``PKG_DIRECTORY``, " "``C_BUILTIN``, ``PY_FROZEN``, ``PY_CODERESOURCE``, ``IMP_HOOK``." msgstr "" -#: ../../whatsnew/3.12.rst:1361 +#: ../../whatsnew/3.12.rst:1374 msgid "" ":mod:`io`: Remove ``io.OpenWrapper`` and ``_pyio.OpenWrapper``, deprecated " "in Python 3.10: just use :func:`open` instead. The :func:`open` (:func:`io." @@ -2008,14 +2032,14 @@ msgid "" "`94169`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1367 +#: ../../whatsnew/3.12.rst:1380 msgid "" ":mod:`locale`: Remove the :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:1371 +#: ../../whatsnew/3.12.rst:1384 msgid "" "``smtpd``: The module has been removed according to the schedule in :pep:" "`594`, having been deprecated in Python 3.4.7 and 3.5.4. Use aiosmtpd_ PyPI " @@ -2023,27 +2047,27 @@ msgid "" "Oleg Iarygin in :gh:`93243`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1379 +#: ../../whatsnew/3.12.rst:1392 msgid "" ":mod:`sqlite3`: The following undocumented :mod:`sqlite3` features, " "deprecated in Python 3.10, are now removed:" msgstr "" -#: ../../whatsnew/3.12.rst:1382 +#: ../../whatsnew/3.12.rst:1395 msgid "``sqlite3.enable_shared_cache()``" msgstr "``sqlite3.enable_shared_cache()``" -#: ../../whatsnew/3.12.rst:1383 +#: ../../whatsnew/3.12.rst:1396 msgid "``sqlite3.OptimizedUnicode``" msgstr "``sqlite3.OptimizedUnicode``" -#: ../../whatsnew/3.12.rst:1385 +#: ../../whatsnew/3.12.rst:1398 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:1388 +#: ../../whatsnew/3.12.rst:1401 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 " @@ -2051,22 +2075,22 @@ msgid "" "default value which is also ``str``." msgstr "" -#: ../../whatsnew/3.12.rst:1393 +#: ../../whatsnew/3.12.rst:1406 msgid "(Contributed by Erlend E. Aasland in :gh:`92548`.)" msgstr "(由 Erlend E. Aasland 於 :gh:`92548` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1395 +#: ../../whatsnew/3.12.rst:1408 msgid ":mod:`ssl`:" msgstr "" -#: ../../whatsnew/3.12.rst:1397 +#: ../../whatsnew/3.12.rst:1410 msgid "" "Remove the :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:1401 +#: ../../whatsnew/3.12.rst:1414 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 " @@ -2074,7 +2098,7 @@ msgid "" "Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1407 +#: ../../whatsnew/3.12.rst:1420 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." @@ -2085,174 +2109,174 @@ msgid "" "Validation. (Contributed by Victor Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1416 +#: ../../whatsnew/3.12.rst:1429 msgid ":mod:`unittest`: Removed many old deprecated :mod:`unittest` features:" msgstr "" -#: ../../whatsnew/3.12.rst:1418 +#: ../../whatsnew/3.12.rst:1431 msgid "A number of :class:`~unittest.TestCase` method aliases:" msgstr "" -#: ../../whatsnew/3.12.rst:1421 +#: ../../whatsnew/3.12.rst:1434 msgid "Deprecated alias" msgstr "" -#: ../../whatsnew/3.12.rst:1421 +#: ../../whatsnew/3.12.rst:1434 msgid "Method Name" msgstr "" -#: ../../whatsnew/3.12.rst:1421 +#: ../../whatsnew/3.12.rst:1434 msgid "Deprecated in" msgstr "" -#: ../../whatsnew/3.12.rst:1423 +#: ../../whatsnew/3.12.rst:1436 msgid "``failUnless``" msgstr "``failUnless``" -#: ../../whatsnew/3.12.rst:1423 ../../whatsnew/3.12.rst:1430 +#: ../../whatsnew/3.12.rst:1436 ../../whatsnew/3.12.rst:1443 msgid ":meth:`.assertTrue`" msgstr ":meth:`.assertTrue`" -#: ../../whatsnew/3.12.rst:1423 ../../whatsnew/3.12.rst:1424 -#: ../../whatsnew/3.12.rst:1425 ../../whatsnew/3.12.rst:1426 -#: ../../whatsnew/3.12.rst:1427 ../../whatsnew/3.12.rst:1428 -#: ../../whatsnew/3.12.rst:1429 +#: ../../whatsnew/3.12.rst:1436 ../../whatsnew/3.12.rst:1437 +#: ../../whatsnew/3.12.rst:1438 ../../whatsnew/3.12.rst:1439 +#: ../../whatsnew/3.12.rst:1440 ../../whatsnew/3.12.rst:1441 +#: ../../whatsnew/3.12.rst:1442 msgid "3.1" msgstr "3.1" -#: ../../whatsnew/3.12.rst:1424 +#: ../../whatsnew/3.12.rst:1437 msgid "``failIf``" msgstr "``failIf``" -#: ../../whatsnew/3.12.rst:1424 +#: ../../whatsnew/3.12.rst:1437 msgid ":meth:`.assertFalse`" msgstr ":meth:`.assertFalse`" -#: ../../whatsnew/3.12.rst:1425 +#: ../../whatsnew/3.12.rst:1438 msgid "``failUnlessEqual``" msgstr "``failUnlessEqual``" -#: ../../whatsnew/3.12.rst:1425 ../../whatsnew/3.12.rst:1431 +#: ../../whatsnew/3.12.rst:1438 ../../whatsnew/3.12.rst:1444 msgid ":meth:`.assertEqual`" msgstr ":meth:`.assertEqual`" -#: ../../whatsnew/3.12.rst:1426 +#: ../../whatsnew/3.12.rst:1439 msgid "``failIfEqual``" msgstr "``failIfEqual``" -#: ../../whatsnew/3.12.rst:1426 ../../whatsnew/3.12.rst:1432 +#: ../../whatsnew/3.12.rst:1439 ../../whatsnew/3.12.rst:1445 msgid ":meth:`.assertNotEqual`" msgstr ":meth:`.assertNotEqual`" -#: ../../whatsnew/3.12.rst:1427 +#: ../../whatsnew/3.12.rst:1440 msgid "``failUnlessAlmostEqual``" msgstr "``failUnlessAlmostEqual``" -#: ../../whatsnew/3.12.rst:1427 ../../whatsnew/3.12.rst:1433 +#: ../../whatsnew/3.12.rst:1440 ../../whatsnew/3.12.rst:1446 msgid ":meth:`.assertAlmostEqual`" msgstr ":meth:`.assertAlmostEqual`" -#: ../../whatsnew/3.12.rst:1428 +#: ../../whatsnew/3.12.rst:1441 msgid "``failIfAlmostEqual``" msgstr "``failIfAlmostEqual``" -#: ../../whatsnew/3.12.rst:1428 ../../whatsnew/3.12.rst:1434 +#: ../../whatsnew/3.12.rst:1441 ../../whatsnew/3.12.rst:1447 msgid ":meth:`.assertNotAlmostEqual`" msgstr ":meth:`.assertNotAlmostEqual`" -#: ../../whatsnew/3.12.rst:1429 +#: ../../whatsnew/3.12.rst:1442 msgid "``failUnlessRaises``" msgstr "``failUnlessRaises``" -#: ../../whatsnew/3.12.rst:1429 +#: ../../whatsnew/3.12.rst:1442 msgid ":meth:`.assertRaises`" msgstr ":meth:`.assertRaises`" -#: ../../whatsnew/3.12.rst:1430 +#: ../../whatsnew/3.12.rst:1443 msgid "``assert_``" msgstr "``assert_``" -#: ../../whatsnew/3.12.rst:1430 ../../whatsnew/3.12.rst:1431 -#: ../../whatsnew/3.12.rst:1432 ../../whatsnew/3.12.rst:1433 -#: ../../whatsnew/3.12.rst:1434 ../../whatsnew/3.12.rst:1435 -#: ../../whatsnew/3.12.rst:1436 +#: ../../whatsnew/3.12.rst:1443 ../../whatsnew/3.12.rst:1444 +#: ../../whatsnew/3.12.rst:1445 ../../whatsnew/3.12.rst:1446 +#: ../../whatsnew/3.12.rst:1447 ../../whatsnew/3.12.rst:1448 +#: ../../whatsnew/3.12.rst:1449 msgid "3.2" msgstr "3.2" -#: ../../whatsnew/3.12.rst:1431 +#: ../../whatsnew/3.12.rst:1444 msgid "``assertEquals``" msgstr "``assertEquals``" -#: ../../whatsnew/3.12.rst:1432 +#: ../../whatsnew/3.12.rst:1445 msgid "``assertNotEquals``" msgstr "``assertNotEquals``" -#: ../../whatsnew/3.12.rst:1433 +#: ../../whatsnew/3.12.rst:1446 msgid "``assertAlmostEquals``" msgstr "``assertAlmostEquals``" -#: ../../whatsnew/3.12.rst:1434 +#: ../../whatsnew/3.12.rst:1447 msgid "``assertNotAlmostEquals``" msgstr "``assertNotAlmostEquals``" -#: ../../whatsnew/3.12.rst:1435 +#: ../../whatsnew/3.12.rst:1448 msgid "``assertRegexpMatches``" msgstr "``assertRegexpMatches``" -#: ../../whatsnew/3.12.rst:1435 +#: ../../whatsnew/3.12.rst:1448 msgid ":meth:`.assertRegex`" msgstr ":meth:`.assertRegex`" -#: ../../whatsnew/3.12.rst:1436 +#: ../../whatsnew/3.12.rst:1449 msgid "``assertRaisesRegexp``" msgstr "``assertRaisesRegexp``" -#: ../../whatsnew/3.12.rst:1436 +#: ../../whatsnew/3.12.rst:1449 msgid ":meth:`.assertRaisesRegex`" msgstr ":meth:`.assertRaisesRegex`" -#: ../../whatsnew/3.12.rst:1437 +#: ../../whatsnew/3.12.rst:1450 msgid "``assertNotRegexpMatches``" msgstr "``assertNotRegexpMatches``" -#: ../../whatsnew/3.12.rst:1437 +#: ../../whatsnew/3.12.rst:1450 msgid ":meth:`.assertNotRegex`" msgstr ":meth:`.assertNotRegex`" -#: ../../whatsnew/3.12.rst:1437 +#: ../../whatsnew/3.12.rst:1450 msgid "3.5" msgstr "3.5" -#: ../../whatsnew/3.12.rst:1440 +#: ../../whatsnew/3.12.rst:1453 msgid "" "You can use https://github.com/isidentical/teyit to automatically modernise " "your unit tests." msgstr "" -#: ../../whatsnew/3.12.rst:1443 +#: ../../whatsnew/3.12.rst:1456 msgid "" "Undocumented and broken :class:`~unittest.TestCase` method " "``assertDictContainsSubset`` (deprecated in Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1446 +#: ../../whatsnew/3.12.rst:1459 msgid "" "Undocumented :meth:`TestLoader.loadTestsFromModule ` parameter *use_load_tests* (deprecated and ignored " "since Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1450 +#: ../../whatsnew/3.12.rst:1463 msgid "" "An alias of the :class:`~unittest.TextTestResult` class: ``_TextTestResult`` " "(deprecated in Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1453 +#: ../../whatsnew/3.12.rst:1466 msgid "(Contributed by Serhiy Storchaka in :issue:`45162`.)" msgstr "(由 Serhiy Storchaka 於 :issue:`45162` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1455 +#: ../../whatsnew/3.12.rst:1468 msgid "" ":mod:`webbrowser`: Remove support for obsolete browsers from :mod:" "`webbrowser`. Removed browsers include: Grail, Mosaic, Netscape, Galeon, " @@ -2260,7 +2284,7 @@ msgid "" "`102871`)." msgstr "" -#: ../../whatsnew/3.12.rst:1459 +#: ../../whatsnew/3.12.rst:1472 msgid "" ":mod:`xml.etree.ElementTree`: Remove the ``ElementTree.Element.copy()`` " "method of the pure Python implementation, deprecated in Python 3.10, use " @@ -2269,21 +2293,21 @@ msgid "" "(Contributed by Victor Stinner in :gh:`94383`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1465 +#: ../../whatsnew/3.12.rst:1478 msgid "" ":mod:`zipimport`: Remove ``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:1470 +#: ../../whatsnew/3.12.rst:1483 msgid "" "Removed the ``suspicious`` rule from the documentation Makefile, and removed " "``Doc/tools/rstlint.py``, both in favor of `sphinx-lint `_. (Contributed by Julien Palard in :gh:`98179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1475 +#: ../../whatsnew/3.12.rst:1488 msgid "" "Remove the *keyfile* and *certfile* parameters from the :mod:`ftplib`, :mod:" "`imaplib`, :mod:`poplib` and :mod:`smtplib` modules, and the *key_file*, " @@ -2293,21 +2317,21 @@ msgid "" "in :gh:`94172`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1486 ../../whatsnew/3.12.rst:1798 +#: ../../whatsnew/3.12.rst:1499 ../../whatsnew/3.12.rst:1811 msgid "Porting to Python 3.12" msgstr "" -#: ../../whatsnew/3.12.rst:1488 +#: ../../whatsnew/3.12.rst:1501 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." msgstr "" -#: ../../whatsnew/3.12.rst:1492 +#: ../../whatsnew/3.12.rst:1505 msgid "Changes in the Python API" msgstr "" -#: ../../whatsnew/3.12.rst:1494 +#: ../../whatsnew/3.12.rst:1507 msgid "" "More strict rules are now applied for numerical group references and group " "names in regular expressions. Only sequence of ASCII digits is now accepted " @@ -2316,7 +2340,7 @@ msgid "" "(Contributed by Serhiy Storchaka in :gh:`91760`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1501 +#: ../../whatsnew/3.12.rst:1514 msgid "" "Removed ``randrange()`` functionality deprecated since Python 3.10. " "Formerly, ``randrange(10.0)`` losslessly converted to ``randrange(10)``. " @@ -2328,7 +2352,7 @@ msgid "" "`86388`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1509 +#: ../../whatsnew/3.12.rst:1522 msgid "" ":class:`argparse.ArgumentParser` changed encoding and error handler for " "reading arguments from file (e.g. ``fromfile_prefix_chars`` option) from " @@ -2338,21 +2362,21 @@ msgid "" "on Windows." msgstr "" -#: ../../whatsnew/3.12.rst:1515 +#: ../../whatsnew/3.12.rst:1528 msgid "" "Removed the ``asyncore``-based ``smtpd`` module deprecated in Python 3.4.7 " "and 3.5.4. A recommended replacement is the :mod:`asyncio`-based aiosmtpd_ " "PyPI module." msgstr "" -#: ../../whatsnew/3.12.rst:1519 +#: ../../whatsnew/3.12.rst:1532 msgid "" ":func:`shlex.split`: Passing ``None`` for *s* argument now raises an " "exception, rather than reading :data:`sys.stdin`. The feature was deprecated " "in Python 3.9. (Contributed by Victor Stinner in :gh:`94352`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1524 +#: ../../whatsnew/3.12.rst:1537 msgid "" "The :mod:`os` module no longer accepts bytes-like paths, like :class:" "`bytearray` and :class:`memoryview` types: only the exact :class:`bytes` " @@ -2360,7 +2384,7 @@ msgid "" "`98393`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1529 +#: ../../whatsnew/3.12.rst:1542 msgid "" ":func:`syslog.openlog` and :func:`syslog.closelog` now fail if used in " "subinterpreters. :func:`syslog.syslog` may still be used in subinterpreters, " @@ -2372,7 +2396,7 @@ msgid "" "(Contributed by Dong-hee Na in :gh:`99127`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1538 +#: ../../whatsnew/3.12.rst:1551 msgid "" "The undocumented locking behavior of :func:`~functools.cached_property` is " "removed, because it locked across all instances of the class, leading to " @@ -2384,14 +2408,14 @@ msgid "" "property getter function or around multi-threaded access points." msgstr "" -#: ../../whatsnew/3.12.rst:1551 +#: ../../whatsnew/3.12.rst:1564 msgid "" "When extracting tar files using :mod:`tarfile` or :func:`shutil." "unpack_archive`, pass the *filter* argument to limit features that may be " "surprising or dangerous. See :ref:`tarfile-extraction-filter` for details." msgstr "" -#: ../../whatsnew/3.12.rst:1556 +#: ../../whatsnew/3.12.rst:1569 msgid "" "The output of the :func:`tokenize.tokenize` and :func:`tokenize." "generate_tokens` functions is now changed due to the changes introduced in :" @@ -2403,45 +2427,45 @@ msgid "" "``f\"start {1+1} end\"`` the old version of the tokenizer emitted::" msgstr "" -#: ../../whatsnew/3.12.rst:1567 +#: ../../whatsnew/3.12.rst:1580 msgid "while the new version emits::" msgstr "" -#: ../../whatsnew/3.12.rst:1579 +#: ../../whatsnew/3.12.rst:1592 msgid "" "Additionally, there may be some minor behavioral changes as a consequence of " "the changes required to support :pep:`701`. Some of these changes include:" msgstr "" -#: ../../whatsnew/3.12.rst:1582 +#: ../../whatsnew/3.12.rst:1595 msgid "" "The ``type`` attribute of the tokens emitted when tokenizing some invalid " "Python characters such as ``!`` has changed from ``ERRORTOKEN`` to ``OP``." msgstr "" -#: ../../whatsnew/3.12.rst:1585 +#: ../../whatsnew/3.12.rst:1598 msgid "" "Incomplete single-line strings now also raise :exc:`tokenize.TokenError` as " "incomplete multiline strings do." msgstr "" -#: ../../whatsnew/3.12.rst:1588 +#: ../../whatsnew/3.12.rst:1601 msgid "" "Some incomplete or invalid Python code now raises :exc:`tokenize.TokenError` " "instead of returning arbitrary ``ERRORTOKEN`` tokens when tokenizing it." msgstr "" -#: ../../whatsnew/3.12.rst:1591 +#: ../../whatsnew/3.12.rst:1604 msgid "" "Mixing tabs and spaces as indentation in the same file is not supported " "anymore and will raise a :exc:`TabError`." msgstr "" -#: ../../whatsnew/3.12.rst:1595 +#: ../../whatsnew/3.12.rst:1608 msgid "Build Changes" msgstr "" -#: ../../whatsnew/3.12.rst:1597 +#: ../../whatsnew/3.12.rst:1610 msgid "" "Python no longer uses ``setup.py`` to build shared C extension modules. " "Build parameters like headers and libraries are detected in ``configure`` " @@ -2450,21 +2474,21 @@ msgid "" "in :gh:`93939`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1603 +#: ../../whatsnew/3.12.rst:1616 msgid "" "``va_start()`` with two parameters, like ``va_start(args, format),`` is now " "required to build Python. ``va_start()`` is no longer called with a single " "parameter. (Contributed by Kumar Aditya in :gh:`93207`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1608 +#: ../../whatsnew/3.12.rst:1621 msgid "" "CPython now uses the ThinLTO option as the default link time optimization " "policy if the Clang compiler accepts the flag. (Contributed by Dong-hee Na " "in :gh:`89536`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1612 +#: ../../whatsnew/3.12.rst:1625 msgid "" "Add ``COMPILEALL_OPTS`` variable in Makefile to override :mod:`compileall` " "options (default: ``-j0``) in ``make install``. Also merged the 3 " @@ -2473,46 +2497,46 @@ msgid "" "`99289`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1618 +#: ../../whatsnew/3.12.rst:1631 msgid "Add platform triplets for 64-bit LoongArch:" msgstr "" -#: ../../whatsnew/3.12.rst:1620 +#: ../../whatsnew/3.12.rst:1633 msgid "loongarch64-linux-gnusf" msgstr "loongarch64-linux-gnusf" -#: ../../whatsnew/3.12.rst:1621 +#: ../../whatsnew/3.12.rst:1634 msgid "loongarch64-linux-gnuf32" msgstr "loongarch64-linux-gnuf32" -#: ../../whatsnew/3.12.rst:1622 +#: ../../whatsnew/3.12.rst:1635 msgid "loongarch64-linux-gnu" msgstr "loongarch64-linux-gnu" -#: ../../whatsnew/3.12.rst:1624 +#: ../../whatsnew/3.12.rst:1637 msgid "(Contributed by Zhang Na in :gh:`90656`.)" msgstr "(由 Zhang Na 於 :gh:`90656` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1626 +#: ../../whatsnew/3.12.rst:1639 msgid "``PYTHON_FOR_REGEN`` now require Python 3.10 or newer." msgstr "" -#: ../../whatsnew/3.12.rst:1628 +#: ../../whatsnew/3.12.rst:1641 msgid "" "Autoconf 2.71 and aclocal 1.16.4 is now required to regenerate :file:`!" "configure`. (Contributed by Christian Heimes in :gh:`89886`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1632 +#: ../../whatsnew/3.12.rst:1645 msgid "" "Windows builds and macOS installers from python.org now use OpenSSL 3.0." msgstr "" -#: ../../whatsnew/3.12.rst:1636 +#: ../../whatsnew/3.12.rst:1649 msgid "C API Changes" msgstr "" -#: ../../whatsnew/3.12.rst:1642 +#: ../../whatsnew/3.12.rst:1655 msgid "" ":pep:`697`: Introduced the :ref:`Unstable C API tier `, " "intended for low-level tools like debuggers and JIT compilers. This API may " @@ -2520,84 +2544,84 @@ msgid "" "contents are marked by the ``PyUnstable_`` prefix in names." msgstr "" -#: ../../whatsnew/3.12.rst:1648 +#: ../../whatsnew/3.12.rst:1661 msgid "Code object constructors:" msgstr "" -#: ../../whatsnew/3.12.rst:1650 +#: ../../whatsnew/3.12.rst:1663 msgid "``PyUnstable_Code_New()`` (renamed from ``PyCode_New``)" msgstr "" -#: ../../whatsnew/3.12.rst:1651 +#: ../../whatsnew/3.12.rst:1664 msgid "" "``PyUnstable_Code_NewWithPosOnlyArgs()`` (renamed from " "``PyCode_NewWithPosOnlyArgs``)" msgstr "" -#: ../../whatsnew/3.12.rst:1653 +#: ../../whatsnew/3.12.rst:1666 msgid "Extra storage for code objects (:pep:`523`):" msgstr "" -#: ../../whatsnew/3.12.rst:1655 +#: ../../whatsnew/3.12.rst:1668 msgid "" "``PyUnstable_Eval_RequestCodeExtraIndex()`` (renamed from " "``_PyEval_RequestCodeExtraIndex``)" msgstr "" -#: ../../whatsnew/3.12.rst:1656 +#: ../../whatsnew/3.12.rst:1669 msgid "``PyUnstable_Code_GetExtra()`` (renamed from ``_PyCode_GetExtra``)" msgstr "" -#: ../../whatsnew/3.12.rst:1657 +#: ../../whatsnew/3.12.rst:1670 msgid "``PyUnstable_Code_SetExtra()`` (renamed from ``_PyCode_SetExtra``)" msgstr "" -#: ../../whatsnew/3.12.rst:1659 +#: ../../whatsnew/3.12.rst:1672 msgid "" "The original names will continue to be available until the respective API " "changes." msgstr "" -#: ../../whatsnew/3.12.rst:1662 +#: ../../whatsnew/3.12.rst:1675 msgid "(Contributed by Petr Viktorin in :gh:`101101`.)" msgstr "(由 Petr Viktorin 於 :gh:`101101` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1664 +#: ../../whatsnew/3.12.rst:1677 msgid "" ":pep:`697`: Added API for extending types whose instance memory layout is " "opaque:" msgstr "" -#: ../../whatsnew/3.12.rst:1667 +#: ../../whatsnew/3.12.rst:1680 msgid "" ":c:member:`PyType_Spec.basicsize` can be zero or negative to specify " "inheriting or extending the base class size." msgstr "" -#: ../../whatsnew/3.12.rst:1669 +#: ../../whatsnew/3.12.rst:1682 msgid "" ":c:func:`PyObject_GetTypeData` and :c:func:`PyType_GetTypeDataSize` added to " "allow access to subclass-specific instance data." msgstr "" -#: ../../whatsnew/3.12.rst:1671 +#: ../../whatsnew/3.12.rst:1684 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:1674 +#: ../../whatsnew/3.12.rst:1687 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:1677 +#: ../../whatsnew/3.12.rst:1690 msgid "(Contributed by Petr Viktorin in :gh:`103509`.)" msgstr "(由 Petr Viktorin 於 :gh:`103509` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1679 +#: ../../whatsnew/3.12.rst:1692 msgid "" "Added the new :ref:`limited C API ` function :c:func:" "`PyType_FromMetaclass`, which generalizes the existing :c:func:" @@ -2605,29 +2629,29 @@ msgid "" "(Contributed by Wenzel Jakob in :gh:`93012`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1684 +#: ../../whatsnew/3.12.rst:1697 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:1688 +#: ../../whatsnew/3.12.rst:1701 msgid ":c:macro:`Py_TPFLAGS_HAVE_VECTORCALL`" msgstr "" -#: ../../whatsnew/3.12.rst:1689 +#: ../../whatsnew/3.12.rst:1702 msgid ":c:func:`PyVectorcall_NARGS`" msgstr ":c:func:`PyVectorcall_NARGS`" -#: ../../whatsnew/3.12.rst:1690 +#: ../../whatsnew/3.12.rst:1703 msgid ":c:func:`PyVectorcall_Call`" msgstr ":c:func:`PyVectorcall_Call`" -#: ../../whatsnew/3.12.rst:1691 +#: ../../whatsnew/3.12.rst:1704 msgid ":c:type:`vectorcallfunc`" msgstr ":c:type:`vectorcallfunc`" -#: ../../whatsnew/3.12.rst:1693 +#: ../../whatsnew/3.12.rst:1706 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 " @@ -2638,7 +2662,7 @@ msgid "" "`93274`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1701 +#: ../../whatsnew/3.12.rst:1714 msgid "" "The :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" "`Py_TPFLAGS_MANAGED_WEAKREF` flags have been added. This allows extensions " @@ -2646,32 +2670,32 @@ msgid "" "using less memory and with faster access." msgstr "" -#: ../../whatsnew/3.12.rst:1706 +#: ../../whatsnew/3.12.rst:1719 msgid "" "API for performing calls using :ref:`the vectorcall protocol ` " "was added to the :ref:`Limited API `:" msgstr "" -#: ../../whatsnew/3.12.rst:1710 +#: ../../whatsnew/3.12.rst:1723 msgid ":c:func:`PyObject_Vectorcall`" msgstr ":c:func:`PyObject_Vectorcall`" -#: ../../whatsnew/3.12.rst:1711 +#: ../../whatsnew/3.12.rst:1724 msgid ":c:func:`PyObject_VectorcallMethod`" msgstr ":c:func:`PyObject_VectorcallMethod`" -#: ../../whatsnew/3.12.rst:1712 +#: ../../whatsnew/3.12.rst:1725 msgid ":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`" msgstr "" -#: ../../whatsnew/3.12.rst:1714 +#: ../../whatsnew/3.12.rst:1727 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:1718 +#: ../../whatsnew/3.12.rst:1731 msgid "" "Added two new public functions, :c:func:`PyEval_SetProfileAllThreads` and :c:" "func:`PyEval_SetTraceAllThreads`, that allow to set tracing and profiling " @@ -2679,14 +2703,14 @@ msgid "" "(Contributed by Pablo Galindo in :gh:`93503`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1724 +#: ../../whatsnew/3.12.rst:1737 msgid "" "Added 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:1728 +#: ../../whatsnew/3.12.rst:1741 msgid "" "The C API now permits registering callbacks via :c:func:" "`PyDict_AddWatcher`, :c:func:`PyDict_Watch` and related APIs to be called " @@ -2695,28 +2719,28 @@ msgid "" "`91052`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1734 +#: ../../whatsnew/3.12.rst:1747 msgid "" "Added :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:1738 +#: ../../whatsnew/3.12.rst:1751 msgid "" "Added :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 Ostricher in :gh:`91054`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1743 +#: ../../whatsnew/3.12.rst:1756 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:1747 +#: ../../whatsnew/3.12.rst:1760 msgid "" "Add :c:func:`PyErr_GetRaisedException` and :c:func:" "`PyErr_SetRaisedException` for saving and restoring the current exception. " @@ -2726,14 +2750,14 @@ msgid "" "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1755 +#: ../../whatsnew/3.12.rst:1768 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:1759 +#: ../../whatsnew/3.12.rst:1772 msgid "" "Add :c:func:`PyException_GetArgs` and :c:func:`PyException_SetArgs` as " "convenience functions for retrieving and modifying the :attr:`~BaseException." @@ -2741,71 +2765,71 @@ msgid "" "in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1764 +#: ../../whatsnew/3.12.rst:1777 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:1768 +#: ../../whatsnew/3.12.rst:1781 msgid "" ":pep:`683`: Introduced Immortal Objects to Python which allows objects to " "bypass reference counts and introduced changes to the C-API:" msgstr "" -#: ../../whatsnew/3.12.rst:1771 +#: ../../whatsnew/3.12.rst:1784 msgid "``_Py_IMMORTAL_REFCNT``: The reference count that defines an object" msgstr "" -#: ../../whatsnew/3.12.rst:1772 +#: ../../whatsnew/3.12.rst:1785 msgid "as immortal." msgstr "" -#: ../../whatsnew/3.12.rst:1773 +#: ../../whatsnew/3.12.rst:1786 msgid "" "``_Py_IsImmortal`` Checks if an object has the immortal reference count." msgstr "" -#: ../../whatsnew/3.12.rst:1774 +#: ../../whatsnew/3.12.rst:1787 msgid "``PyObject_HEAD_INIT`` This will now initialize reference count to" msgstr "" -#: ../../whatsnew/3.12.rst:1775 +#: ../../whatsnew/3.12.rst:1788 msgid "``_Py_IMMORTAL_REFCNT`` when used with ``Py_BUILD_CORE``." msgstr "" -#: ../../whatsnew/3.12.rst:1776 +#: ../../whatsnew/3.12.rst:1789 msgid "``SSTATE_INTERNED_IMMORTAL`` An identifier for interned unicode objects" msgstr "" -#: ../../whatsnew/3.12.rst:1777 +#: ../../whatsnew/3.12.rst:1790 msgid "that are immortal." msgstr "" -#: ../../whatsnew/3.12.rst:1778 +#: ../../whatsnew/3.12.rst:1791 msgid "``SSTATE_INTERNED_IMMORTAL_STATIC`` An identifier for interned unicode" msgstr "" -#: ../../whatsnew/3.12.rst:1779 +#: ../../whatsnew/3.12.rst:1792 msgid "objects that are immortal and static" msgstr "" -#: ../../whatsnew/3.12.rst:1782 +#: ../../whatsnew/3.12.rst:1795 msgid "``sys.getunicodeinternedsize`` This returns the total number of unicode" msgstr "" -#: ../../whatsnew/3.12.rst:1781 +#: ../../whatsnew/3.12.rst:1794 msgid "" "objects that have been interned. This is now needed for refleak.py to " "correctly track reference counts and allocated blocks" msgstr "" -#: ../../whatsnew/3.12.rst:1784 +#: ../../whatsnew/3.12.rst:1797 msgid "(Contributed by Eddie Elizondo in :gh:`84436`.)" msgstr "(由 Eddie Elizondo 於 :gh:`84436` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1786 +#: ../../whatsnew/3.12.rst:1799 msgid "" ":pep:`684`: Added the new :c:func:`Py_NewInterpreterFromConfig` function " "and :c:type:`PyInterpreterConfig`, which may be used to create sub-" @@ -2813,27 +2837,27 @@ msgid "" "info.) (Contributed by Eric Snow in :gh:`104110`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1792 +#: ../../whatsnew/3.12.rst:1805 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:1800 +#: ../../whatsnew/3.12.rst:1813 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:1803 +#: ../../whatsnew/3.12.rst:1816 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:1807 +#: ../../whatsnew/3.12.rst:1820 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 " @@ -2842,7 +2866,7 @@ msgid "" "necessary, the (internal-only) ``_PyObject_GET_WEAKREFS_LISTPTR()`` macro." msgstr "" -#: ../../whatsnew/3.12.rst:1814 +#: ../../whatsnew/3.12.rst:1827 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 " @@ -2850,13 +2874,13 @@ msgid "" "only field directly." msgstr "" -#: ../../whatsnew/3.12.rst:1819 +#: ../../whatsnew/3.12.rst:1832 msgid "" "To get a list of subclasses, call the Python method :py:meth:`~class." "__subclasses__` (using :c:func:`PyObject_CallMethod`, for example)." msgstr "" -#: ../../whatsnew/3.12.rst:1823 +#: ../../whatsnew/3.12.rst:1836 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 " @@ -2865,7 +2889,7 @@ msgid "" "`98836`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1829 +#: ../../whatsnew/3.12.rst:1842 msgid "" "An unrecognized format character in :c:func:`PyUnicode_FromFormat` and :c:" "func:`PyUnicode_FromFormatV` now sets a :exc:`SystemError`. In previous " @@ -2874,13 +2898,13 @@ msgid "" "Storchaka in :gh:`95781`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1835 +#: ../../whatsnew/3.12.rst:1848 msgid "" "Fixed 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:1839 +#: ../../whatsnew/3.12.rst:1852 msgid "" "Extension classes wanting to add a ``__dict__`` or weak reference slot " "should use :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" @@ -2894,7 +2918,7 @@ msgid "" "func:`PyObject_ClearWeakRefs`, as before." msgstr "" -#: ../../whatsnew/3.12.rst:1851 +#: ../../whatsnew/3.12.rst:1864 msgid "" "The :c:func:`PyUnicode_FSDecoder` function no longer accepts bytes-like " "paths, like :class:`bytearray` and :class:`memoryview` types: only the " @@ -2902,7 +2926,7 @@ msgid "" "Victor Stinner in :gh:`98393`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1856 +#: ../../whatsnew/3.12.rst:1869 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 " @@ -2910,7 +2934,7 @@ msgid "" "Stinner in :gh:`98724`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1861 +#: ../../whatsnew/3.12.rst:1874 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 " @@ -2918,7 +2942,7 @@ msgid "" "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1866 +#: ../../whatsnew/3.12.rst:1879 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 " @@ -2926,25 +2950,25 @@ msgid "" "``_Py_GetGlobalRefTotal()``." msgstr "" -#: ../../whatsnew/3.12.rst:1871 +#: ../../whatsnew/3.12.rst:1884 msgid "" "The following functions now select an appropriate metaclass for the newly " "created type:" msgstr "" -#: ../../whatsnew/3.12.rst:1874 +#: ../../whatsnew/3.12.rst:1887 msgid ":c:func:`PyType_FromSpec`" msgstr ":c:func:`PyType_FromSpec`" -#: ../../whatsnew/3.12.rst:1875 +#: ../../whatsnew/3.12.rst:1888 msgid ":c:func:`PyType_FromSpecWithBases`" msgstr ":c:func:`PyType_FromSpecWithBases`" -#: ../../whatsnew/3.12.rst:1876 +#: ../../whatsnew/3.12.rst:1889 msgid ":c:func:`PyType_FromModuleAndSpec`" msgstr ":c:func:`PyType_FromModuleAndSpec`" -#: ../../whatsnew/3.12.rst:1878 +#: ../../whatsnew/3.12.rst:1891 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 " @@ -2952,14 +2976,14 @@ msgid "" "initialization." msgstr "" -#: ../../whatsnew/3.12.rst:1883 +#: ../../whatsnew/3.12.rst:1896 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:1887 +#: ../../whatsnew/3.12.rst:1900 msgid "" "Since ``tp_new`` overrides almost everything ``PyType_From*`` functions do, " "the two are incompatible with each other. The existing behavior -- ignoring " @@ -2968,17 +2992,17 @@ msgid "" "general workaround. One of the following may work for you:" msgstr "" -#: ../../whatsnew/3.12.rst:1894 +#: ../../whatsnew/3.12.rst:1907 msgid "If you control the metaclass, avoid using ``tp_new`` in it:" msgstr "" -#: ../../whatsnew/3.12.rst:1896 +#: ../../whatsnew/3.12.rst:1909 msgid "" "If initialization can be skipped, it can be done in :c:member:`~PyTypeObject." "tp_init` instead." msgstr "" -#: ../../whatsnew/3.12.rst:1898 +#: ../../whatsnew/3.12.rst:1911 msgid "" "If the metaclass doesn't need to be instantiated from Python, set its " "``tp_new`` to ``NULL`` using the :c:macro:" @@ -2986,20 +3010,20 @@ msgid "" "``PyType_From*`` functions." msgstr "" -#: ../../whatsnew/3.12.rst:1903 +#: ../../whatsnew/3.12.rst:1916 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:1907 +#: ../../whatsnew/3.12.rst:1920 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:1910 +#: ../../whatsnew/3.12.rst:1923 msgid "" ":c:var:`PyOS_InputHook` and :c:var:`PyOS_ReadlineFunctionPointer` are no " "longer called in :ref:`subinterpreters `. This is " @@ -3007,14 +3031,14 @@ msgid "" "callbacks have no way of recovering extension module state)." msgstr "" -#: ../../whatsnew/3.12.rst:1915 +#: ../../whatsnew/3.12.rst:1928 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:1919 +#: ../../whatsnew/3.12.rst:1932 msgid "" ":c:struct:`PyLongObject` has had its internals changed for better " "performance. Although the internals of :c:struct:`PyLongObject` are private, " @@ -3025,15 +3049,15 @@ msgid "" "a single machine word:" msgstr "" -#: ../../whatsnew/3.12.rst:1927 +#: ../../whatsnew/3.12.rst:1940 msgid ":c:func:`PyUnstable_Long_IsCompact`" msgstr "" -#: ../../whatsnew/3.12.rst:1928 +#: ../../whatsnew/3.12.rst:1941 msgid ":c:func:`PyUnstable_Long_CompactValue`" msgstr "" -#: ../../whatsnew/3.12.rst:1930 +#: ../../whatsnew/3.12.rst:1943 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 " @@ -3042,281 +3066,281 @@ msgid "" "create a new GitHub issue and CC ``@ericsnowcurrently``." msgstr "" -#: ../../whatsnew/3.12.rst:1940 +#: ../../whatsnew/3.12.rst:1953 msgid "Deprecate global configuration variable:" msgstr "" -#: ../../whatsnew/3.12.rst:1942 +#: ../../whatsnew/3.12.rst:1955 msgid ":c:var:`Py_DebugFlag`: use :c:member:`PyConfig.parser_debug`" msgstr "" -#: ../../whatsnew/3.12.rst:1943 +#: ../../whatsnew/3.12.rst:1956 msgid ":c:var:`Py_VerboseFlag`: use :c:member:`PyConfig.verbose`" msgstr "" -#: ../../whatsnew/3.12.rst:1944 +#: ../../whatsnew/3.12.rst:1957 msgid ":c:var:`Py_QuietFlag`: use :c:member:`PyConfig.quiet`" msgstr "" -#: ../../whatsnew/3.12.rst:1945 +#: ../../whatsnew/3.12.rst:1958 msgid ":c:var:`Py_InteractiveFlag`: use :c:member:`PyConfig.interactive`" msgstr "" -#: ../../whatsnew/3.12.rst:1946 +#: ../../whatsnew/3.12.rst:1959 msgid ":c:var:`Py_InspectFlag`: use :c:member:`PyConfig.inspect`" msgstr "" -#: ../../whatsnew/3.12.rst:1947 +#: ../../whatsnew/3.12.rst:1960 msgid ":c:var:`Py_OptimizeFlag`: use :c:member:`PyConfig.optimization_level`" msgstr "" -#: ../../whatsnew/3.12.rst:1948 +#: ../../whatsnew/3.12.rst:1961 msgid ":c:var:`Py_NoSiteFlag`: use :c:member:`PyConfig.site_import`" msgstr "" -#: ../../whatsnew/3.12.rst:1949 +#: ../../whatsnew/3.12.rst:1962 msgid ":c:var:`Py_BytesWarningFlag`: use :c:member:`PyConfig.bytes_warning`" msgstr "" -#: ../../whatsnew/3.12.rst:1950 +#: ../../whatsnew/3.12.rst:1963 msgid ":c:var:`Py_FrozenFlag`: use :c:member:`PyConfig.pathconfig_warnings`" msgstr "" -#: ../../whatsnew/3.12.rst:1951 +#: ../../whatsnew/3.12.rst:1964 msgid "" ":c:var:`Py_IgnoreEnvironmentFlag`: use :c:member:`PyConfig.use_environment`" msgstr "" -#: ../../whatsnew/3.12.rst:1952 +#: ../../whatsnew/3.12.rst:1965 msgid "" ":c:var:`Py_DontWriteBytecodeFlag`: use :c:member:`PyConfig.write_bytecode`" msgstr "" -#: ../../whatsnew/3.12.rst:1953 +#: ../../whatsnew/3.12.rst:1966 msgid "" ":c:var:`Py_NoUserSiteDirectory`: use :c:member:`PyConfig.user_site_directory`" msgstr "" -#: ../../whatsnew/3.12.rst:1954 +#: ../../whatsnew/3.12.rst:1967 msgid "" ":c:var:`Py_UnbufferedStdioFlag`: use :c:member:`PyConfig.buffered_stdio`" msgstr "" -#: ../../whatsnew/3.12.rst:1955 +#: ../../whatsnew/3.12.rst:1968 msgid "" ":c:var:`Py_HashRandomizationFlag`: use :c:member:`PyConfig.use_hash_seed` " "and :c:member:`PyConfig.hash_seed`" msgstr "" -#: ../../whatsnew/3.12.rst:1957 +#: ../../whatsnew/3.12.rst:1970 msgid ":c:var:`Py_IsolatedFlag`: use :c:member:`PyConfig.isolated`" msgstr "" -#: ../../whatsnew/3.12.rst:1958 +#: ../../whatsnew/3.12.rst:1971 msgid "" ":c:var:`Py_LegacyWindowsFSEncodingFlag`: use :c:member:`PyPreConfig." "legacy_windows_fs_encoding`" msgstr "" -#: ../../whatsnew/3.12.rst:1959 +#: ../../whatsnew/3.12.rst:1972 msgid "" ":c:var:`Py_LegacyWindowsStdioFlag`: use :c:member:`PyConfig." "legacy_windows_stdio`" msgstr "" -#: ../../whatsnew/3.12.rst:1960 +#: ../../whatsnew/3.12.rst:1973 msgid "" ":c:var:`!Py_FileSystemDefaultEncoding`: use :c:member:`PyConfig." "filesystem_encoding`" msgstr "" -#: ../../whatsnew/3.12.rst:1961 +#: ../../whatsnew/3.12.rst:1974 msgid "" ":c:var:`!Py_HasFileSystemDefaultEncoding`: use :c:member:`PyConfig." "filesystem_encoding`" msgstr "" -#: ../../whatsnew/3.12.rst:1962 +#: ../../whatsnew/3.12.rst:1975 msgid "" ":c:var:`!Py_FileSystemDefaultEncodeErrors`: use :c:member:`PyConfig." "filesystem_errors`" msgstr "" -#: ../../whatsnew/3.12.rst:1963 +#: ../../whatsnew/3.12.rst:1976 msgid "" ":c:var:`!Py_UTF8Mode`: use :c:member:`PyPreConfig.utf8_mode` (see :c:func:" "`Py_PreInitialize`)" msgstr "" -#: ../../whatsnew/3.12.rst:1965 +#: ../../whatsnew/3.12.rst:1978 msgid "" "The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" "`PyConfig` instead. (Contributed by Victor Stinner in :gh:`77782`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1969 +#: ../../whatsnew/3.12.rst:1982 msgid "" "Creating immutable types (:c:macro:`Py_TPFLAGS_IMMUTABLETYPE`) with mutable " "bases is deprecated and will be disabled in Python 3.14." msgstr "" -#: ../../whatsnew/3.12.rst:1972 +#: ../../whatsnew/3.12.rst:1985 msgid "" "The ``structmember.h`` header is deprecated, though it continues to be " "available and there are no plans to remove it." msgstr "" -#: ../../whatsnew/3.12.rst:1975 +#: ../../whatsnew/3.12.rst:1988 msgid "" "Its contents are now available just by including ``Python.h``, with a ``Py`` " "prefix added if it was missing:" msgstr "" -#: ../../whatsnew/3.12.rst:1978 +#: ../../whatsnew/3.12.rst:1991 msgid "" ":c:struct:`PyMemberDef`, :c:func:`PyMember_GetOne` and :c:func:" "`PyMember_SetOne`" msgstr "" -#: ../../whatsnew/3.12.rst:1980 +#: ../../whatsnew/3.12.rst:1993 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:1982 +#: ../../whatsnew/3.12.rst:1995 msgid "" "The flags :c:macro:`Py_READONLY` (previously ``READONLY``) and :c:macro:" "`Py_AUDIT_READ` (previously all uppercase)" msgstr "" -#: ../../whatsnew/3.12.rst:1985 +#: ../../whatsnew/3.12.rst:1998 msgid "Several items are not exposed from ``Python.h``:" msgstr "" -#: ../../whatsnew/3.12.rst:1987 +#: ../../whatsnew/3.12.rst:2000 msgid ":c:macro:`T_OBJECT` (use :c:macro:`Py_T_OBJECT_EX`)" msgstr "" -#: ../../whatsnew/3.12.rst:1988 +#: ../../whatsnew/3.12.rst:2001 msgid ":c:macro:`T_NONE` (previously undocumented, and pretty quirky)" msgstr "" -#: ../../whatsnew/3.12.rst:1989 +#: ../../whatsnew/3.12.rst:2002 msgid "The macro ``WRITE_RESTRICTED`` which does nothing." msgstr "" -#: ../../whatsnew/3.12.rst:1990 +#: ../../whatsnew/3.12.rst:2003 msgid "" "The macros ``RESTRICTED`` and ``READ_RESTRICTED``, equivalents of :c:macro:" "`Py_AUDIT_READ`." msgstr "" -#: ../../whatsnew/3.12.rst:1992 +#: ../../whatsnew/3.12.rst:2005 msgid "" "In some configurations, ```` is not included from ``Python.h``. It " "should be included manually when using ``offsetof()``." msgstr "" -#: ../../whatsnew/3.12.rst:1995 +#: ../../whatsnew/3.12.rst:2008 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:2000 +#: ../../whatsnew/3.12.rst:2013 msgid "" "(Contributed in :gh:`47146` by Petr Viktorin, based on earlier work by " "Alexander Belopolsky and Matthias Braun.)" msgstr "" -#: ../../whatsnew/3.12.rst:2003 +#: ../../whatsnew/3.12.rst:2016 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:2008 +#: ../../whatsnew/3.12.rst:2021 msgid "" ":c:func:`!PyErr_Display` is deprecated. Use :c:func:`PyErr_DisplayException` " "instead. (Contributed by Irit Katriel in :gh:`102755`)." msgstr "" -#: ../../whatsnew/3.12.rst:2011 +#: ../../whatsnew/3.12.rst:2024 msgid "" "``_PyErr_ChainExceptions`` is deprecated. Use ``_PyErr_ChainExceptions1`` " "instead. (Contributed by Irit Katriel in :gh:`102192`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2014 +#: ../../whatsnew/3.12.rst:2027 msgid "" "Using :c:func:`PyType_FromSpec`, :c:func:`PyType_FromSpecWithBases` or :c:" "func:`PyType_FromModuleAndSpec` to create a class whose metaclass overrides :" "c:member:`~PyTypeObject.tp_new` is deprecated. Call the metaclass instead." msgstr "" -#: ../../whatsnew/3.12.rst:2022 +#: ../../whatsnew/3.12.rst:2035 msgid "" "Remove the ``token.h`` header file. There was never any public tokenizer C " "API. The ``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:2027 +#: ../../whatsnew/3.12.rst:2040 msgid "Legacy Unicode APIs have been removed. See :pep:`623` for detail." msgstr "" -#: ../../whatsnew/3.12.rst:2029 +#: ../../whatsnew/3.12.rst:2042 msgid ":c:macro:`!PyUnicode_WCHAR_KIND`" msgstr ":c:macro:`!PyUnicode_WCHAR_KIND`" -#: ../../whatsnew/3.12.rst:2030 +#: ../../whatsnew/3.12.rst:2043 msgid ":c:func:`!PyUnicode_AS_UNICODE`" msgstr ":c:func:`!PyUnicode_AS_UNICODE`" -#: ../../whatsnew/3.12.rst:2031 +#: ../../whatsnew/3.12.rst:2044 msgid ":c:func:`!PyUnicode_AsUnicode`" msgstr ":c:func:`!PyUnicode_AsUnicode`" -#: ../../whatsnew/3.12.rst:2032 +#: ../../whatsnew/3.12.rst:2045 msgid ":c:func:`!PyUnicode_AsUnicodeAndSize`" msgstr ":c:func:`!PyUnicode_AsUnicodeAndSize`" -#: ../../whatsnew/3.12.rst:2033 +#: ../../whatsnew/3.12.rst:2046 msgid ":c:func:`!PyUnicode_AS_DATA`" msgstr ":c:func:`!PyUnicode_AS_DATA`" -#: ../../whatsnew/3.12.rst:2034 +#: ../../whatsnew/3.12.rst:2047 msgid ":c:func:`!PyUnicode_FromUnicode`" msgstr ":c:func:`!PyUnicode_FromUnicode`" -#: ../../whatsnew/3.12.rst:2035 +#: ../../whatsnew/3.12.rst:2048 msgid ":c:func:`!PyUnicode_GET_SIZE`" msgstr ":c:func:`!PyUnicode_GET_SIZE`" -#: ../../whatsnew/3.12.rst:2036 +#: ../../whatsnew/3.12.rst:2049 msgid ":c:func:`!PyUnicode_GetSize`" msgstr ":c:func:`!PyUnicode_GetSize`" -#: ../../whatsnew/3.12.rst:2037 +#: ../../whatsnew/3.12.rst:2050 msgid ":c:func:`!PyUnicode_GET_DATA_SIZE`" msgstr ":c:func:`!PyUnicode_GET_DATA_SIZE`" -#: ../../whatsnew/3.12.rst:2039 +#: ../../whatsnew/3.12.rst:2052 msgid "" "Remove the ``PyUnicode_InternImmortal()`` function macro. (Contributed by " "Victor Stinner in :gh:`85858`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2042 +#: ../../whatsnew/3.12.rst:2055 msgid "" "Remove ``Jython`` compatibility hacks from several stdlib modules and tests. " "(Contributed by Nikita Sobolev in :gh:`99482`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2045 +#: ../../whatsnew/3.12.rst:2058 msgid "" "Remove ``_use_broken_old_ctypes_structure_semantics_`` flag from :mod:" "`ctypes` module. (Contributed by Nikita Sobolev in :gh:`99285`.)" diff --git a/whatsnew/3.2.po b/whatsnew/3.2.po index 74ef2a0d5b..88b5c3adfa 100644 --- a/whatsnew/3.2.po +++ b/whatsnew/3.2.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-18 00:03+0000\n" +"POT-Creation-Date: 2023-08-23 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2981,7 +2981,7 @@ msgstr "" #: ../../whatsnew/3.2.rst:2572 msgid "" -":c:macro:`PyEval_CallObject` is now only available in macro form. The " +":c:func:`!PyEval_CallObject` is now only available in macro form. The " "function declaration, which was kept for backwards compatibility reasons, is " "now removed -- the macro was introduced in 1997 (:issue:`8276`)." msgstr "" @@ -3251,10 +3251,10 @@ msgstr "(由 Antoine Pitrou 於 :issue:`10272` 貢獻。)" #: ../../whatsnew/3.2.rst:2734 msgid "" -"The misleading functions :c:func:`PyEval_AcquireLock()` and :c:func:" -"`PyEval_ReleaseLock()` have been officially deprecated. The thread-state " -"aware APIs (such as :c:func:`PyEval_SaveThread()` and :c:func:" -"`PyEval_RestoreThread()`) should be used instead." +"The misleading functions :c:func:`!PyEval_AcquireLock` and :c:func:`!" +"PyEval_ReleaseLock` have been officially deprecated. The thread-state aware " +"APIs (such as :c:func:`PyEval_SaveThread` and :c:func:" +"`PyEval_RestoreThread`) should be used instead." msgstr "" #: ../../whatsnew/3.2.rst:2739 @@ -3270,6 +3270,6 @@ msgstr "(由 Giampaolo Rodola 在 :issue:`6706` 中貢獻。)" #: ../../whatsnew/3.2.rst:2744 msgid "" -"Due to the new :term:`GIL` implementation, :c:func:`PyEval_InitThreads()` " -"cannot be called before :c:func:`Py_Initialize()` anymore." +"Due to the new :term:`GIL` implementation, :c:func:`!PyEval_InitThreads` " +"cannot be called before :c:func:`Py_Initialize` anymore." msgstr "" diff --git a/whatsnew/3.3.po b/whatsnew/3.3.po index 4d7fa2d5d6..8242c1e3d3 100644 --- a/whatsnew/3.3.po +++ b/whatsnew/3.3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-08-27 18:15+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-" @@ -31,7 +31,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:51 msgid ":pep:`398` - Python 3.3 Release Schedule" -msgstr "" +msgstr ":pep:`398` - Python 3.3 發佈時間表" #: ../../whatsnew/3.3.rst:55 msgid "Summary -- Release highlights" @@ -39,7 +39,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:60 msgid "New syntax features:" -msgstr "" +msgstr "新的語法特徵:" #: ../../whatsnew/3.3.rst:62 msgid "" @@ -48,11 +48,11 @@ msgstr "" #: ../../whatsnew/3.3.rst:63 msgid "The ``u'unicode'`` syntax is accepted again for :class:`str` objects." -msgstr "" +msgstr ":class:`str` 物件再次接受 ``u'unicode'`` 語法。" #: ../../whatsnew/3.3.rst:65 msgid "New library modules:" -msgstr "" +msgstr "新的函式庫模組:" #: ../../whatsnew/3.3.rst:67 msgid ":mod:`faulthandler` (helps debugging low-level crashes)" @@ -81,15 +81,15 @@ msgstr "" #: ../../whatsnew/3.3.rst:74 msgid "New built-in features:" -msgstr "" +msgstr "新的內建功能:" #: ../../whatsnew/3.3.rst:76 msgid "Reworked :ref:`I/O exception hierarchy `." -msgstr "" +msgstr "重新設計 :ref:`I/O 例外層次結構 `。" #: ../../whatsnew/3.3.rst:78 msgid "Implementation improvements:" -msgstr "" +msgstr "實作改進:" #: ../../whatsnew/3.3.rst:80 msgid "" @@ -120,11 +120,11 @@ msgstr "" #: ../../whatsnew/3.3.rst:90 msgid "Security improvements:" -msgstr "" +msgstr "安全性改進:" #: ../../whatsnew/3.3.rst:92 msgid "Hash randomization is switched on by default." -msgstr "" +msgstr "預設情況下,雜湊隨機化處於打開狀態。" #: ../../whatsnew/3.3.rst:94 msgid "Please read on for a comprehensive list of user-facing changes." @@ -132,7 +132,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:100 msgid "PEP 405: Virtual Environments" -msgstr "" +msgstr "PEP 405:虛擬環境" #: ../../whatsnew/3.3.rst:102 msgid "" @@ -155,7 +155,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:118 msgid ":pep:`405` - Python Virtual Environments" -msgstr "" +msgstr ":pep:`405` - Python 虛擬環境" #: ../../whatsnew/3.3.rst:119 msgid "PEP written by Carl Meyer; implementation by Carl Meyer and Vinay Sajip" @@ -181,7 +181,7 @@ msgstr "" msgid "" "PEP written by Eric V. Smith; implementation by Eric V. Smith and Barry " "Warsaw" -msgstr "" +msgstr "由 Eric V. Smith 撰寫 PEP;由 Eric V. Smith 和 Barry Warsaw 實施" #: ../../whatsnew/3.3.rst:140 msgid "" @@ -219,7 +219,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:161 ../../whatsnew/3.3.rst:1123 msgid "Features" -msgstr "" +msgstr "功能" #: ../../whatsnew/3.3.rst:163 msgid "" @@ -256,7 +256,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:180 ../../whatsnew/3.3.rst:1133 msgid "API changes" -msgstr "" +msgstr "API 變更" #: ../../whatsnew/3.3.rst:182 msgid "The maximum number of dimensions is officially limited to 64." @@ -325,11 +325,11 @@ msgstr "" #: ../../whatsnew/3.3.rst:227 msgid "Functionality" -msgstr "" +msgstr "功能性" #: ../../whatsnew/3.3.rst:229 msgid "Changes introduced by :pep:`393` are the following:" -msgstr "" +msgstr ":pep:`393` 引入的更改如下:" #: ../../whatsnew/3.3.rst:231 msgid "" @@ -372,18 +372,18 @@ msgstr "" #: ../../whatsnew/3.3.rst:251 msgid "" "The value of :data:`sys.maxunicode` is now always ``1114111`` (``0x10FFFF`` " -"in hexadecimal). The :c:func:`PyUnicode_GetMax` function still returns " +"in hexadecimal). The :c:func:`!PyUnicode_GetMax` function still returns " "either ``0xFFFF`` or ``0x10FFFF`` for backward compatibility, and it should " "not be used with the new Unicode API (see :issue:`13054`)." msgstr "" #: ../../whatsnew/3.3.rst:256 msgid "The :file:`./configure` flag ``--with-wide-unicode`` has been removed." -msgstr "" +msgstr ":file:`./configure` 旗標 ``--with-wide-unicode`` 已被刪除。" #: ../../whatsnew/3.3.rst:259 msgid "Performance and resource usage" -msgstr "" +msgstr "性能和資源使用情況" #: ../../whatsnew/3.3.rst:261 msgid "" @@ -426,10 +426,11 @@ msgid "" "PEP written by Martin von Löwis; implementation by Torsten Becker and Martin " "von Löwis." msgstr "" +"PEP 由 Martin von Löwis 撰寫;由 Torsten Becker 和 Martin von Löwis 實作。" #: ../../whatsnew/3.3.rst:290 msgid "PEP 397: Python Launcher for Windows" -msgstr "" +msgstr "PEP 397:適用於 Windows 的 Python 啟動器" #: ../../whatsnew/3.3.rst:292 msgid "" @@ -466,17 +467,17 @@ msgstr "" #: ../../whatsnew/3.3.rst:317 msgid ":pep:`397` - Python Launcher for Windows" -msgstr "" +msgstr ":pep:`397` - 適用於 Windows 的 Python 啟動器" #: ../../whatsnew/3.3.rst:316 msgid "" "PEP written by Mark Hammond and Martin v. Löwis; implementation by Vinay " "Sajip." -msgstr "" +msgstr "由 Mark Hammond 和 Martin v. Löwis 撰寫 PEP;由 Vinay Sajip 實作。" #: ../../whatsnew/3.3.rst:319 msgid "Launcher documentation: :ref:`launcher`" -msgstr "" +msgstr "啟動器文件::ref:`launcher`" #: ../../whatsnew/3.3.rst:321 msgid "Installer PATH modification: :ref:`windows-path-mod`" @@ -761,7 +762,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:623 msgid ":pep:`412` - Key-Sharing Dictionary" -msgstr "" +msgstr ":pep:`412` - 密鑰共享字典" #: ../../whatsnew/3.3.rst:624 msgid "PEP written and implemented by Mark Shannon." @@ -769,7 +770,7 @@ msgstr "由 Mark Shannon 撰寫 PEP 與實作。" #: ../../whatsnew/3.3.rst:628 msgid "PEP 362: Function Signature Object" -msgstr "" +msgstr "PEP 362:函式簽名物件" #: ../../whatsnew/3.3.rst:630 msgid "" @@ -785,17 +786,19 @@ msgstr "" #: ../../whatsnew/3.3.rst:642 msgid ":pep:`362`: - Function Signature Object" -msgstr "" +msgstr ":pep:`362`: - 函式簽名物件" #: ../../whatsnew/3.3.rst:642 msgid "" "PEP written by Brett Cannon, Yury Selivanov, Larry Hastings, Jiwon Seo; " "implemented by Yury Selivanov." msgstr "" +"PEP 由 Brett Cannon、Yury Selivanov、Larry Hastings、Jiwon Seo 撰寫;由 Yury " +"Selivanov 實作。" #: ../../whatsnew/3.3.rst:647 msgid "PEP 421: Adding sys.implementation" -msgstr "" +msgstr "PEP 421:新增 sys.implementation" #: ../../whatsnew/3.3.rst:649 msgid "" @@ -840,7 +843,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:679 msgid ":pep:`421` - Adding sys.implementation" -msgstr "" +msgstr ":pep:`421` - 新增 sys.implementation" #: ../../whatsnew/3.3.rst:680 msgid "PEP written and implemented by Eric Snow." @@ -848,7 +851,7 @@ msgstr "由 Eric Snow 撰寫 PEP 與實作。" #: ../../whatsnew/3.3.rst:686 msgid "Using importlib as the Implementation of Import" -msgstr "" +msgstr "使用 importlib 作為 import 的實作" #: ../../whatsnew/3.3.rst:687 msgid "" @@ -880,7 +883,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:707 msgid "New APIs" -msgstr "" +msgstr "新 API" #: ../../whatsnew/3.3.rst:708 msgid "" @@ -934,7 +937,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:742 msgid "Visible Changes" -msgstr "" +msgstr "明顯的變更" #: ../../whatsnew/3.3.rst:744 msgid "" @@ -995,7 +998,7 @@ msgstr "其他語言更動" #: ../../whatsnew/3.3.rst:779 msgid "Some smaller changes made to the core Python language are:" -msgstr "" +msgstr "對核心 Python 語言所做的一些較小的更改包括:" #: ../../whatsnew/3.3.rst:781 msgid "" @@ -1010,7 +1013,7 @@ msgstr "(由 Ezio Melotti 在 :issue:`12753` 中貢獻。)" #: ../../whatsnew/3.3.rst:787 msgid "Unicode database updated to UCD version 6.1.0" -msgstr "" +msgstr "Unicode 資料庫更新至 UCD 版本 6.1.0" #: ../../whatsnew/3.3.rst:789 msgid "" @@ -1101,7 +1104,7 @@ msgstr "(由 Antoine Pitrou 在 :issue:`9260` 中貢獻。)" #: ../../whatsnew/3.3.rst:841 msgid "Builtin functions and types" -msgstr "" +msgstr "內建函式和型別" #: ../../whatsnew/3.3.rst:843 msgid "" @@ -1194,7 +1197,7 @@ msgstr "(由 Nadeem Vawda 和 Per Øyvind Karlsen 在 :issue:`6715` 中貢獻 #: ../../whatsnew/3.3.rst:910 msgid "Improved Modules" -msgstr "" +msgstr "改進的模組" #: ../../whatsnew/3.3.rst:913 msgid "abc" @@ -1213,18 +1216,24 @@ msgid "" ":class:`abc.abstractproperty` has been deprecated, use :class:`property` " "with :func:`abc.abstractmethod` instead." msgstr "" +":class:`abc.abstractproperty` 已被棄用,請改 :class:`property` 和 :func:`abc." +"abstractmethod`。" #: ../../whatsnew/3.3.rst:922 ../../whatsnew/3.3.rst:2248 msgid "" ":class:`abc.abstractclassmethod` has been deprecated, use :class:" "`classmethod` with :func:`abc.abstractmethod` instead." msgstr "" +":class:`abc.abstractclassmethod` 已被棄用,請改用 :class:`classmethod` 和 :" +"func:`abc.abstractmethod`。" #: ../../whatsnew/3.3.rst:924 ../../whatsnew/3.3.rst:2250 msgid "" ":class:`abc.abstractstaticmethod` has been deprecated, use :class:" "`staticmethod` with :func:`abc.abstractmethod` instead." msgstr "" +":class:`abc.abstractstaticmethod` 已被棄用,請改用 :class:`staticmethod` 和 :" +"func:`abc.abstractmethod`。" #: ../../whatsnew/3.3.rst:927 msgid "(Contributed by Darren Dale in :issue:`11610`.)" @@ -1367,7 +1376,7 @@ msgstr "(:issue:`12100`)" #: ../../whatsnew/3.3.rst:1015 msgid "The ``unicode_internal`` codec has been deprecated." -msgstr "" +msgstr "``unicode_internal`` 編解碼器已被棄用。" #: ../../whatsnew/3.3.rst:1019 msgid "collections" @@ -1448,12 +1457,15 @@ msgstr "" msgid "" ":class:`curses.window` has a new :attr:`curses.window.encoding` attribute." msgstr "" +":class:`curses.window` 有一個新的 :attr:`curses.window.encoding` 屬性。" #: ../../whatsnew/3.3.rst:1068 msgid "" "The :class:`curses.window` class has a new :meth:`~curses.window.get_wch` " "method to get a wide character" msgstr "" +":class:`curses.window` 類別有一個新的 :meth:`~curses.window.get_wch` 方法來獲" +"取寬字元" #: ../../whatsnew/3.3.rst:1070 msgid "" @@ -1505,7 +1517,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:1097 msgid "C-module and libmpdec written by Stefan Krah." -msgstr "" +msgstr "由 Stefan Krah 編寫的 C 模組和 libmpdec。" #: ../../whatsnew/3.3.rst:1099 msgid "" @@ -1611,11 +1623,11 @@ msgstr "" #: ../../whatsnew/3.3.rst:1139 msgid "32-bit" -msgstr "" +msgstr "32 位元" #: ../../whatsnew/3.3.rst:1139 msgid "64-bit" -msgstr "" +msgstr "64 位元" #: ../../whatsnew/3.3.rst:1141 msgid ":const:`MAX_PREC`" @@ -1699,7 +1711,7 @@ msgstr "" msgid "" "The ``watchexp`` parameter in the :meth:`~decimal.Decimal.quantize` method " "is deprecated." -msgstr "" +msgstr ":meth:`~decimal.Decimal.quantize` 方法中的 ``watchexp`` 參數已棄用。" #: ../../whatsnew/3.3.rst:1193 msgid "email" @@ -1864,7 +1876,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:1326 msgid "Decoding to unicode is done automatically::" -msgstr "" +msgstr "解碼為 unicode 是自動完成的:: :" #: ../../whatsnew/3.3.rst:1332 msgid "" @@ -1883,7 +1895,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:1347 msgid "Other API Changes" -msgstr "" +msgstr "其他 API 變更" #: ../../whatsnew/3.3.rst:1349 msgid "" @@ -1894,7 +1906,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:1353 msgid "New utility functions:" -msgstr "" +msgstr "新工具函式:" #: ../../whatsnew/3.3.rst:1355 msgid "" @@ -2236,8 +2248,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:1591 msgid "" "(Patch submitted by Ross Lagerwall and Giampaolo Rodolà in :issue:`10882`.)" -msgstr "" -"(由 Ross Lagerwall 和 Giampaolo Rodolà 於 :issue:`10882` 提交補丁。)" +msgstr "(由 Ross Lagerwall 和 Giampaolo Rodolà 於 :issue:`10882` 提交補丁。)" #: ../../whatsnew/3.3.rst:1593 msgid "" @@ -2363,7 +2374,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:1672 msgid "Additional new posix functions:" -msgstr "" +msgstr "其他新的 posix 函式:" #: ../../whatsnew/3.3.rst:1674 msgid "" @@ -2526,12 +2537,16 @@ msgid "" "*argument* parameter is now optional. (Contributed by Chris Clark in :issue:" "`13245`.)" msgstr "" +":meth:`~sched.scheduler.enter` 和 :meth:`~sched.scheduler.enterabs` " +"*argument* 參數現在是可選的。(由 Chris Clark 在 :issue:`13245` 中貢獻。)" #: ../../whatsnew/3.3.rst:1764 msgid "" ":meth:`~sched.scheduler.enter` and :meth:`~sched.scheduler.enterabs` now " "accept a *kwargs* parameter. (Contributed by Chris Clark in :issue:`13245`.)" msgstr "" +":meth:`~sched.scheduler.enter` 和 :meth:`~sched.scheduler.enterabs` 現在接受 " +"*kwargs* 參數。(由 Chris Clark 在 :issue:`13245` 中貢獻。)" #: ../../whatsnew/3.3.rst:1770 msgid "select" @@ -2562,7 +2577,7 @@ msgstr "shutil" #: ../../whatsnew/3.3.rst:1789 msgid "New functions:" -msgstr "" +msgstr "新功能:" #: ../../whatsnew/3.3.rst:1791 msgid "" @@ -2633,27 +2648,28 @@ msgstr "" #: ../../whatsnew/3.3.rst:1829 msgid ":func:`~signal.pthread_kill`: send a signal to a thread;" -msgstr "" +msgstr ":func:`~signal.pthread_kill`:向執行緒發送訊號;" #: ../../whatsnew/3.3.rst:1830 msgid ":func:`~signal.sigpending`: examine pending functions;" -msgstr "" +msgstr ":func:`~signal.sigpending`:檢查未定的函式;" #: ../../whatsnew/3.3.rst:1831 msgid ":func:`~signal.sigwait`: wait a signal;" -msgstr "" +msgstr ":func:`~signal.sigwait`:等待訊號;" #: ../../whatsnew/3.3.rst:1832 msgid "" ":func:`~signal.sigwaitinfo`: wait for a signal, returning detailed " "information about it;" -msgstr "" +msgstr ":func:`~signal.sigwaitinfo`:等待訊號,回傳有關該訊號的詳細資訊;" #: ../../whatsnew/3.3.rst:1834 msgid "" ":func:`~signal.sigtimedwait`: like :func:`~signal.sigwaitinfo` but with a " "timeout." msgstr "" +":func:`~signal.sigtimedwait`:類似於 :func:`~signal.sigwaitinfo` 但有超時。" #: ../../whatsnew/3.3.rst:1837 msgid "" @@ -2667,6 +2683,8 @@ msgid "" ":func:`signal.signal` and :func:`signal.siginterrupt` raise an OSError, " "instead of a RuntimeError: OSError has an errno attribute." msgstr "" +":func:`signal.signal` 和 :func:`signal.siginterrupt` 會引發 OSError,而不是 " +"RuntimeError:OSError 有一個 errno 屬性。" #: ../../whatsnew/3.3.rst:1846 msgid "smtpd" @@ -2705,6 +2723,8 @@ msgid "" "allowing an ``SMTP`` instance to be used in a ``with`` statement. " "(Contributed by Giampaolo Rodolà in :issue:`11289`.)" msgstr "" +":class:`~smtplib.SMTP` 現在支援情境管理協議,允許在 ``with`` 陳述式中使用 " +"``SMTP`` 實例。 (由 Giampaolo Rodolà 在 :issue:`11289` 中貢獻。)" #: ../../whatsnew/3.3.rst:1870 msgid "" @@ -2712,6 +2732,9 @@ msgid "" "starttls` method now accept an SSLContext parameter to control parameters of " "the secure channel. (Contributed by Kasun Herath in :issue:`8809`.)" msgstr "" +":class:`~smtplib.SMTP_SSL` 構造函式和 :meth:`~smtplib.SMTP.starttls` 方法現在" +"接受 SSLContext 參數來控制安全通道的參數。 (由 Kasun Herath 在 :issue:" +"`8809` 中貢獻。)" #: ../../whatsnew/3.3.rst:1876 msgid "socket" @@ -2722,6 +2745,8 @@ msgid "" "The :class:`~socket.socket` class now exposes additional methods to process " "ancillary data when supported by the underlying platform:" msgstr "" +"當底層平台支援時,:class:`~socket.socket` 類現在公開了額外的方法來處理輔助資" +"料:" #: ../../whatsnew/3.3.rst:1881 msgid ":func:`~socket.socket.sendmsg`" @@ -2739,7 +2764,8 @@ msgstr ":func:`~socket.socket.recvmsg_into`" msgid "" "(Contributed by David Watson in :issue:`6560`, based on an earlier patch by " "Heiko Wundram)" -msgstr "(由 David Watson 在 :issue:`6560` 中貢獻,其基於 Heiko Wundram 的早期補丁)" +msgstr "" +"(由 David Watson 在 :issue:`6560` 中貢獻,其基於 Heiko Wundram 的早期補丁)" #: ../../whatsnew/3.3.rst:1888 msgid "" @@ -2752,7 +2778,8 @@ msgstr "" msgid "" "(Contributed by Matthias Fuchs, updated by Tiago Gonçalves in :issue:" "`10141`.)" -msgstr "(在 :issue:`10141` 中由 Matthias Fuchs 貢獻、並由 Tiago Gonçalves 更新。)" +msgstr "" +"(在 :issue:`10141` 中由 Matthias Fuchs 貢獻、並由 Tiago Gonçalves 更新。)" #: ../../whatsnew/3.3.rst:1894 msgid "" @@ -2761,12 +2788,18 @@ msgid "" "oracle.com/projects/rds `__)." msgstr "" +":class:`~socket.socket` 類別現在支援 PF_RDS 協議系列(https://en.wikipedia." +"org/wiki/Reliable_Datagram_Sockets 和 `https://oss.oracle.com/projects/rds " +"`__\\ )。" #: ../../whatsnew/3.3.rst:1898 msgid "" "The :class:`~socket.socket` class now supports the ``PF_SYSTEM`` protocol " "family on OS X. (Contributed by Michael Goderbauer in :issue:`13777`.)" msgstr "" +":class:`~socket.socket` 類別現在支援 OS X 上的 ``PF_SYSTEM`` 協議系列。(由 " +"Michael Goderbauer 在 :issue:`13777` 中貢獻。)" #: ../../whatsnew/3.3.rst:1901 msgid "" @@ -2805,17 +2838,17 @@ msgstr "ssl" #: ../../whatsnew/3.3.rst:1928 msgid "The :mod:`ssl` module has two new random generation functions:" -msgstr "" +msgstr ":mod:`ssl` 模組有兩個新的隨機生成函式:" #: ../../whatsnew/3.3.rst:1930 msgid "" ":func:`~ssl.RAND_bytes`: generate cryptographically strong pseudo-random " "bytes." -msgstr "" +msgstr ":func:`~ssl.RAND_bytes`:生成加密的強偽隨機位元組。" #: ../../whatsnew/3.3.rst:1932 msgid ":func:`~ssl.RAND_pseudo_bytes`: generate pseudo-random bytes." -msgstr "" +msgstr ":func:`~ssl.RAND_pseudo_bytes`:生成偽隨機位元組。" #: ../../whatsnew/3.3.rst:1934 msgid "(Contributed by Victor Stinner in :issue:`12049`.)" @@ -2947,6 +2980,8 @@ msgid "" ":mod:`tarfile` now supports ``lzma`` encoding via the :mod:`lzma` module. " "(Contributed by Lars Gustäbel in :issue:`5689`.)" msgstr "" +":mod:`tarfile` 現在透過 :mod:`lzma` 模組支援 ``lzma`` 編碼。 (由 Lars " +"Gustäbel 在 :issue:`5689` 中貢獻。)" #: ../../whatsnew/3.3.rst:2019 msgid "tempfile" @@ -3005,17 +3040,18 @@ msgstr "time" #: ../../whatsnew/3.3.rst:2057 msgid "The :pep:`418` added new functions to the :mod:`time` module:" -msgstr "" +msgstr ":pep:`418` 向 :mod:`time` 模組新增了新功能:" #: ../../whatsnew/3.3.rst:2059 msgid ":func:`~time.get_clock_info`: Get information on a clock." -msgstr "" +msgstr ":func:`~time.get_clock_info`:獲取時鐘資訊。" #: ../../whatsnew/3.3.rst:2060 msgid "" ":func:`~time.monotonic`: Monotonic clock (cannot go backward), not affected " "by system clock updates." msgstr "" +":func:`~time.monotonic`:單調時鐘(不能倒退),不受系統時鐘更新的影響。" #: ../../whatsnew/3.3.rst:2062 msgid "" @@ -3027,11 +3063,11 @@ msgstr "" msgid "" ":func:`~time.process_time`: Sum of the system and user CPU time of the " "current process." -msgstr "" +msgstr ":func:`~time.process_time`:當前行程的系統和使用者 CPU 時間總和。" #: ../../whatsnew/3.3.rst:2067 msgid "Other new functions:" -msgstr "" +msgstr "其他新功能:" #: ../../whatsnew/3.3.rst:2069 msgid "" @@ -3039,6 +3075,9 @@ msgid "" "clock_settime` functions with ``CLOCK_xxx`` constants. (Contributed by " "Victor Stinner in :issue:`10278`.)" msgstr "" +":func:`~time.clock_getres`、:func:`~time.clock_gettime` 和 :func:`~time." +"clock_settime` 函式帶有 ``CLOCK_xxx`` 常數。 (由 Victor Stinner 在 :issue:" +"`10278` 中貢獻。)" #: ../../whatsnew/3.3.rst:2073 msgid "" @@ -3081,6 +3120,7 @@ msgid "" ":meth:`unittest.TestCase.run` now returns the :class:`~unittest.TestResult` " "object." msgstr "" +":meth:`unittest.TestCase.run` 現在回傳 :class:`~unittest.TestResult` 物件。" #: ../../whatsnew/3.3.rst:2102 msgid "urllib" @@ -3095,7 +3135,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:2110 msgid "(:issue:`1673007`)" -msgstr "" +msgstr "(:issue:`1673007`)" #: ../../whatsnew/3.3.rst:2114 msgid "webbrowser" @@ -3187,20 +3227,20 @@ msgid "" "(Contributed by Serhiy Storchaka, :issue:`14624`, :issue:`14738` and :issue:" "`15026`.)" msgstr "" -"(由 Serhiy Storchaka 於 :issue:`14624`、:issue:`14738` 和 :issue:`15026` " -"貢獻。)" +"(由 Serhiy Storchaka 於 :issue:`14624`、:issue:`14738` 和 :issue:`15026` 貢" +"獻。)" #: ../../whatsnew/3.3.rst:2170 msgid "Build and C API Changes" -msgstr "" +msgstr "建置和 C API 更改" #: ../../whatsnew/3.3.rst:2172 msgid "Changes to Python's build process and to the C API include:" -msgstr "" +msgstr "Python 建置程序和 C API 的更改包括:" #: ../../whatsnew/3.3.rst:2174 msgid "New :pep:`3118` related function:" -msgstr "" +msgstr "新的 :pep:`3118` 相關功能:" #: ../../whatsnew/3.3.rst:2176 msgid ":c:func:`PyMemoryView_FromMemory`" @@ -3212,7 +3252,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:2180 msgid "High-level API:" -msgstr "" +msgstr "高階 API:" #: ../../whatsnew/3.3.rst:2182 msgid ":c:func:`PyUnicode_CopyCharacters`" @@ -3248,7 +3288,7 @@ msgstr ":c:type:`Py_UCS1`、:c:type:`Py_UCS2`、:c:type:`Py_UCS4` 型別" #: ../../whatsnew/3.3.rst:2192 msgid ":c:type:`PyASCIIObject` and :c:type:`PyCompactUnicodeObject` structures" -msgstr "" +msgstr ":c:type:`PyASCIIObject` 和 :c:type:`PyCompactUnicodeObject` 結構" #: ../../whatsnew/3.3.rst:2193 msgid ":c:macro:`PyUnicode_READY`" @@ -3272,8 +3312,8 @@ msgstr "" #: ../../whatsnew/3.3.rst:2198 msgid "" -":c:macro:`PyUnicode_KIND` with :c:enum:`PyUnicode_Kind` enum: :c:data:" -"`PyUnicode_WCHAR_KIND`, :c:data:`PyUnicode_1BYTE_KIND`, :c:data:" +":c:macro:`PyUnicode_KIND` with :c:enum:`PyUnicode_Kind` enum: :c:data:`!" +"PyUnicode_WCHAR_KIND`, :c:data:`PyUnicode_1BYTE_KIND`, :c:data:" "`PyUnicode_2BYTE_KIND`, :c:data:`PyUnicode_4BYTE_KIND`" msgstr "" @@ -3294,6 +3334,8 @@ msgid "" ":c:macro:`PyArg_ParseTuple` now accepts a :class:`bytearray` for the ``c`` " "format (:issue:`12380`)." msgstr "" +":c:macro:`PyArg_ParseTuple` 現在接受 :class:`bytearray` 為 ``c`` 格式 (:" +"issue:`12380`)。" #: ../../whatsnew/3.3.rst:2210 msgid "Deprecated" @@ -3301,11 +3343,11 @@ msgstr "已棄用" #: ../../whatsnew/3.3.rst:2213 msgid "Unsupported Operating Systems" -msgstr "" +msgstr "不支援的作業系統" #: ../../whatsnew/3.3.rst:2215 msgid "OS/2 and VMS are no longer supported due to the lack of a maintainer." -msgstr "" +msgstr "由於缺乏維護者,OS/2 和 VMS 不再受支援。" #: ../../whatsnew/3.3.rst:2217 msgid "" @@ -3315,11 +3357,11 @@ msgstr "" #: ../../whatsnew/3.3.rst:2220 msgid "OSF support, which was deprecated in 3.2, has been completely removed." -msgstr "" +msgstr "OSF 支援在 3.2 中已棄用,現已完全刪除。" #: ../../whatsnew/3.3.rst:2224 msgid "Deprecated Python modules, functions and methods" -msgstr "" +msgstr "已棄用的 Python 模組、函式和方法" #: ../../whatsnew/3.3.rst:2226 msgid "" @@ -3339,12 +3381,16 @@ msgid "" ":meth:`ftplib.FTP.nlst` and :meth:`ftplib.FTP.dir`: use :meth:`ftplib.FTP." "mlsd`" msgstr "" +":meth:`ftplib.FTP.nlst` 和 :meth:`ftplib.FTP.dir`:使用 :meth:`ftplib.FTP." +"mlsd`" #: ../../whatsnew/3.3.rst:2233 msgid "" ":func:`platform.popen`: use the :mod:`subprocess` module. Check especially " "the :ref:`subprocess-replacements` section (:issue:`11377`)." msgstr "" +":func:`platform.popen`:使用 :mod:`subprocess` 模組。請特別檢查 :ref:" +"`subprocess-replacements` 部分 (:issue:`11377`)。" #: ../../whatsnew/3.3.rst:2235 msgid "" @@ -3368,7 +3414,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:2243 msgid "The :func:`os.stat_float_times` function is deprecated." -msgstr "" +msgstr ":func:`os.stat_float_times` 函式已棄用。" #: ../../whatsnew/3.3.rst:2244 msgid ":mod:`abc` module:" @@ -3376,7 +3422,7 @@ msgstr ":mod:`abc` 模組:" #: ../../whatsnew/3.3.rst:2253 msgid ":mod:`importlib` package:" -msgstr "" +msgstr ":mod:`importlib` 套件:" #: ../../whatsnew/3.3.rst:2255 msgid "" @@ -3388,13 +3434,15 @@ msgstr "" #: ../../whatsnew/3.3.rst:2265 msgid "Deprecated functions and types of the C API" -msgstr "" +msgstr "C API 中已棄用的函式和型別" #: ../../whatsnew/3.3.rst:2267 msgid "" "The :c:type:`Py_UNICODE` has been deprecated by :pep:`393` and will be " "removed in Python 4. All functions using this type are deprecated:" msgstr "" +":c:type:`Py_UNICODE` 已被 :pep:`393` 棄用,並將在 Python 4 中刪除。所有使用此" +"型別的函式均已棄用:" #: ../../whatsnew/3.3.rst:2270 msgid "" @@ -3404,161 +3452,192 @@ msgstr "" #: ../../whatsnew/3.3.rst:2273 msgid "" -":c:macro:`PyUnicode_FromUnicode`: use :c:func:`PyUnicode_FromWideChar` or :c:" -"func:`PyUnicode_FromKindAndData`" +":c:macro:`!PyUnicode_FromUnicode`: use :c:func:`PyUnicode_FromWideChar` or :" +"c:func:`PyUnicode_FromKindAndData`" msgstr "" +":c:macro:`!PyUnicode_FromUnicode`:使用 :c:func:`PyUnicode_FromWideChar` 或 :" +"c:func:`PyUnicode_FromKindAndData`" #: ../../whatsnew/3.3.rst:2275 msgid "" -":c:macro:`PyUnicode_AS_UNICODE`, :c:func:`PyUnicode_AsUnicode`, :c:func:" -"`PyUnicode_AsUnicodeAndSize`: use :c:func:`PyUnicode_AsWideCharString`" +":c:macro:`!PyUnicode_AS_UNICODE`, :c:func:`!PyUnicode_AsUnicode`, :c:func:`!" +"PyUnicode_AsUnicodeAndSize`: use :c:func:`PyUnicode_AsWideCharString`" msgstr "" +":c:macro:`!PyUnicode_AS_UNICODE`、:c:func:`!PyUnicode_AsUnicode`、:c:func:`!" +"PyUnicode_AsUnicodeAndSize`:使用 :c:func:`PyUnicode_AsWideCharString`" #: ../../whatsnew/3.3.rst:2277 msgid "" -":c:macro:`PyUnicode_AS_DATA`: use :c:macro:`PyUnicode_DATA` with :c:macro:" +":c:macro:`!PyUnicode_AS_DATA`: use :c:macro:`PyUnicode_DATA` with :c:macro:" "`PyUnicode_READ` and :c:macro:`PyUnicode_WRITE`" msgstr "" +":c:macro:`!PyUnicode_AS_DATA`:將 :c:macro:`PyUnicode_DATA` 與 :c:macro:" +"`PyUnicode_READ` 和 :c:macro:`PyUnicode_WRITE` 一起使用" #: ../../whatsnew/3.3.rst:2279 msgid "" -":c:macro:`PyUnicode_GET_SIZE`, :c:func:`PyUnicode_GetSize`: use :c:macro:" +":c:macro:`!PyUnicode_GET_SIZE`, :c:func:`!PyUnicode_GetSize`: use :c:macro:" "`PyUnicode_GET_LENGTH` or :c:func:`PyUnicode_GetLength`" msgstr "" +":c:macro:`!PyUnicode_GET_SIZE`、:c:func:`!PyUnicode_GetSize`:使用 :c:macro:" +"`PyUnicode_GET_LENGTH` 或 :c:func:`PyUnicode_GetLength`" #: ../../whatsnew/3.3.rst:2281 msgid "" -":c:macro:`PyUnicode_GET_DATA_SIZE`: use ``PyUnicode_GET_LENGTH(str) * " +":c:macro:`!PyUnicode_GET_DATA_SIZE`: use ``PyUnicode_GET_LENGTH(str) * " "PyUnicode_KIND(str)`` (only work on ready strings)" msgstr "" +":c:macro:`!PyUnicode_GET_DATA_SIZE`:使用 ``PyUnicode_GET_LENGTH(str) * " +"PyUnicode_KIND(str)``\\ (僅適用於準備好的字串)" #: ../../whatsnew/3.3.rst:2284 msgid "" -":c:func:`PyUnicode_AsUnicodeCopy`: use :c:func:`PyUnicode_AsUCS4Copy` or :c:" +":c:func:`!PyUnicode_AsUnicodeCopy`: use :c:func:`PyUnicode_AsUCS4Copy` or :c:" "func:`PyUnicode_AsWideCharString`" msgstr "" +":c:func:`!PyUnicode_AsUnicodeCopy`:使用 :c:func:`PyUnicode_AsUCS4Copy` 或 :" +"c:func:`PyUnicode_AsWideCharString`" #: ../../whatsnew/3.3.rst:2286 -msgid ":c:func:`PyUnicode_GetMax`" -msgstr ":c:func:`PyUnicode_GetMax`" +msgid ":c:func:`!PyUnicode_GetMax`" +msgstr ":c:func:`!PyUnicode_GetMax`" #: ../../whatsnew/3.3.rst:2289 msgid "Functions and macros manipulating Py_UNICODE* strings:" -msgstr "" +msgstr "操作 Py_UNICODE* 字串的函式和巨集:" #: ../../whatsnew/3.3.rst:2291 msgid "" -":c:macro:`Py_UNICODE_strlen`: use :c:func:`PyUnicode_GetLength` or :c:macro:" -"`PyUnicode_GET_LENGTH`" +":c:macro:`!Py_UNICODE_strlen()`: use :c:func:`PyUnicode_GetLength` or :c:" +"macro:`PyUnicode_GET_LENGTH`" msgstr "" +":c:macro:`!Py_UNICODE_strlen()`:使用 :c:func:`PyUnicode_GetLength` 或 :c:" +"macro:`PyUnicode_GET_LENGTH`" #: ../../whatsnew/3.3.rst:2293 msgid "" -":c:macro:`Py_UNICODE_strcat`: use :c:func:`PyUnicode_CopyCharacters` or :c:" -"func:`PyUnicode_FromFormat`" +":c:macro:`!Py_UNICODE_strcat()`: use :c:func:`PyUnicode_CopyCharacters` or :" +"c:func:`PyUnicode_FromFormat`" msgstr "" +":c:macro:`!Py_UNICODE_strcat()`:使用 :c:func:`PyUnicode_CopyCharacters` 或 :" +"c:func:`PyUnicode_FromFormat`" #: ../../whatsnew/3.3.rst:2295 msgid "" -":c:macro:`Py_UNICODE_strcpy`, :c:macro:`Py_UNICODE_strncpy`, :c:macro:" -"`Py_UNICODE_COPY`: use :c:func:`PyUnicode_CopyCharacters` or :c:func:" +":c:macro:`!Py_UNICODE_strcpy()`, :c:macro:`!Py_UNICODE_strncpy()`, :c:macro:" +"`!Py_UNICODE_COPY()`: use :c:func:`PyUnicode_CopyCharacters` or :c:func:" "`PyUnicode_Substring`" msgstr "" +":c:macro:`!Py_UNICODE_strcpy()`、:c:macro:`!Py_UNICODE_strncpy()`、:c:macro:" +"`!Py_UNICODE_COPY()`:使用 :c:func:`PyUnicode_CopyCharacters` 或 :c:func:" +"`PyUnicode_Substring`" #: ../../whatsnew/3.3.rst:2298 -msgid ":c:macro:`Py_UNICODE_strcmp`: use :c:func:`PyUnicode_Compare`" -msgstr "" +msgid ":c:macro:`!Py_UNICODE_strcmp()`: use :c:func:`PyUnicode_Compare`" +msgstr ":c:macro:`!Py_UNICODE_strcmp()`:使用 :c:func:`PyUnicode_Compare`" #: ../../whatsnew/3.3.rst:2299 -msgid ":c:macro:`Py_UNICODE_strncmp`: use :c:func:`PyUnicode_Tailmatch`" -msgstr "" +msgid ":c:macro:`!Py_UNICODE_strncmp()`: use :c:func:`PyUnicode_Tailmatch`" +msgstr ":c:macro:`!Py_UNICODE_strncmp()`: 使用 :c:func:`PyUnicode_Tailmatch`" #: ../../whatsnew/3.3.rst:2300 msgid "" -":c:macro:`Py_UNICODE_strchr`, :c:macro:`Py_UNICODE_strrchr`: use :c:func:" -"`PyUnicode_FindChar`" +":c:macro:`!Py_UNICODE_strchr()`, :c:macro:`!Py_UNICODE_strrchr()`: use :c:" +"func:`PyUnicode_FindChar`" msgstr "" +":c:macro:`!Py_UNICODE_strchr()`, :c:macro:`!Py_UNICODE_strrchr()`: 使用 :c:" +"func:`PyUnicode_FindChar`" #: ../../whatsnew/3.3.rst:2302 -msgid ":c:macro:`Py_UNICODE_FILL`: use :c:func:`PyUnicode_Fill`" -msgstr "" +msgid ":c:macro:`!Py_UNICODE_FILL()`: use :c:func:`PyUnicode_Fill`" +msgstr ":c:macro:`!Py_UNICODE_FILL()`: 使用 :c:func:`PyUnicode_Fill`" #: ../../whatsnew/3.3.rst:2303 -msgid ":c:macro:`Py_UNICODE_MATCH`" -msgstr ":c:macro:`Py_UNICODE_MATCH`" +msgid ":c:macro:`!Py_UNICODE_MATCH`" +msgstr ":c:macro:`!Py_UNICODE_MATCH`" #: ../../whatsnew/3.3.rst:2305 msgid "Encoders:" -msgstr "" +msgstr "編碼器:" #: ../../whatsnew/3.3.rst:2307 -msgid ":c:func:`PyUnicode_Encode`: use :c:func:`PyUnicode_AsEncodedObject`" -msgstr "" +msgid ":c:func:`!PyUnicode_Encode`: use :c:func:`!PyUnicode_AsEncodedObject`" +msgstr ":c:func:`!PyUnicode_Encode`:使用 :c:func:`!PyUnicode_AsEncodedObject`" #: ../../whatsnew/3.3.rst:2308 -msgid ":c:func:`PyUnicode_EncodeUTF7`" -msgstr ":c:func:`PyUnicode_EncodeUTF7`" +msgid ":c:func:`!PyUnicode_EncodeUTF7`" +msgstr ":c:func:`!PyUnicode_EncodeUTF7`" #: ../../whatsnew/3.3.rst:2309 msgid "" -":c:func:`PyUnicode_EncodeUTF8`: use :c:func:`PyUnicode_AsUTF8` or :c:func:" +":c:func:`!PyUnicode_EncodeUTF8`: use :c:func:`PyUnicode_AsUTF8` or :c:func:" "`PyUnicode_AsUTF8String`" msgstr "" +":c:func:`!PyUnicode_EncodeUTF8`:使用 :c:func:`PyUnicode_AsUTF8` 或 :c:func:" +"`PyUnicode_AsUTF8String`" #: ../../whatsnew/3.3.rst:2311 -msgid ":c:func:`PyUnicode_EncodeUTF32`" -msgstr ":c:func:`PyUnicode_EncodeUTF32`" +msgid ":c:func:`!PyUnicode_EncodeUTF32`" +msgstr ":c:func:`!PyUnicode_EncodeUTF32`" #: ../../whatsnew/3.3.rst:2312 -msgid ":c:func:`PyUnicode_EncodeUTF16`" -msgstr ":c:func:`PyUnicode_EncodeUTF16`" +msgid ":c:func:`!PyUnicode_EncodeUTF16`" +msgstr ":c:func:`!PyUnicode_EncodeUTF16`" #: ../../whatsnew/3.3.rst:2313 msgid "" -":c:func:`PyUnicode_EncodeUnicodeEscape` use :c:func:" +":c:func:`!PyUnicode_EncodeUnicodeEscape` use :c:func:" "`PyUnicode_AsUnicodeEscapeString`" msgstr "" +":c:func:`!PyUnicode_EncodeUnicodeEscape` 使用 :c:func:" +"`PyUnicode_AsUnicodeEscapeString`" #: ../../whatsnew/3.3.rst:2315 msgid "" -":c:func:`PyUnicode_EncodeRawUnicodeEscape` use :c:func:" +":c:func:`!PyUnicode_EncodeRawUnicodeEscape` use :c:func:" "`PyUnicode_AsRawUnicodeEscapeString`" msgstr "" +":c:func:`!PyUnicode_EncodeRawUnicodeEscape` 使用 :c:func:" +"`PyUnicode_AsRawUnicodeEscapeString`" #: ../../whatsnew/3.3.rst:2317 msgid "" -":c:func:`PyUnicode_EncodeLatin1`: use :c:func:`PyUnicode_AsLatin1String`" -msgstr ":c:func:`PyUnicode_EncodeLatin1`:使用 :c:func:`PyUnicode_AsLatin1String`" +":c:func:`!PyUnicode_EncodeLatin1`: use :c:func:`PyUnicode_AsLatin1String`" +msgstr "" +":c:func:`!PyUnicode_EncodeLatin1`: 使用 :c:func:`PyUnicode_AsLatin1String`" #: ../../whatsnew/3.3.rst:2318 -msgid ":c:func:`PyUnicode_EncodeASCII`: use :c:func:`PyUnicode_AsASCIIString`" -msgstr ":c:func:`PyUnicode_EncodeASCII`:使用 :c:func:`PyUnicode_AsASCIIString`" +msgid ":c:func:`!PyUnicode_EncodeASCII`: use :c:func:`PyUnicode_AsASCIIString`" +msgstr "" +":c:func:`!PyUnicode_EncodeASCII`:使用 :c:func:`PyUnicode_AsASCIIString`" #: ../../whatsnew/3.3.rst:2319 -msgid ":c:func:`PyUnicode_EncodeCharmap`" -msgstr ":c:func:`PyUnicode_EncodeCharmap`" +msgid ":c:func:`!PyUnicode_EncodeCharmap`" +msgstr ":c:func:`!PyUnicode_EncodeCharmap`" #: ../../whatsnew/3.3.rst:2320 -msgid ":c:func:`PyUnicode_TranslateCharmap`" -msgstr ":c:func:`PyUnicode_TranslateCharmap`" +msgid ":c:func:`!PyUnicode_TranslateCharmap`" +msgstr ":c:func:`!PyUnicode_TranslateCharmap`" #: ../../whatsnew/3.3.rst:2321 msgid "" -":c:func:`PyUnicode_EncodeMBCS`: use :c:func:`PyUnicode_AsMBCSString` or :c:" +":c:func:`!PyUnicode_EncodeMBCS`: use :c:func:`PyUnicode_AsMBCSString` or :c:" "func:`PyUnicode_EncodeCodePage` (with ``CP_ACP`` code_page)" msgstr "" +":c:func:`!PyUnicode_EncodeMBCS`:使用 :c:func:`PyUnicode_AsMBCSString` 或 :c:" +"func:`PyUnicode_EncodeCodePage` (帶有 ``CP_ACP`` code_page)" #: ../../whatsnew/3.3.rst:2323 msgid "" -":c:func:`PyUnicode_EncodeDecimal`, :c:func:" -"`PyUnicode_TransformDecimalToASCII`" +":c:func:`!PyUnicode_EncodeDecimal`, :c:func:`!" +"PyUnicode_TransformDecimalToASCII`" msgstr "" -":c:func:`PyUnicode_EncodeDecimal`、:c:func:" -"`PyUnicode_TransformDecimalToASCII`" +":c:func:`!PyUnicode_EncodeDecimal`、:c:func:`!" +"PyUnicode_TransformDecimalToASCII`" #: ../../whatsnew/3.3.rst:2328 msgid "Deprecated features" -msgstr "" +msgstr "已棄用的功能" #: ../../whatsnew/3.3.rst:2330 msgid "" @@ -3568,17 +3647,17 @@ msgstr "" #: ../../whatsnew/3.3.rst:2335 msgid "Porting to Python 3.3" -msgstr "" +msgstr "移植到 Python 3.3" #: ../../whatsnew/3.3.rst:2337 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." -msgstr "" +msgstr "本節列出了前面描述的更改以及可能需要你更改程式碼的其他錯誤修復。" #: ../../whatsnew/3.3.rst:2343 msgid "Porting Python code" -msgstr "" +msgstr "移植 Python 程式碼" #: ../../whatsnew/3.3.rst:2345 msgid "" @@ -3711,16 +3790,18 @@ msgid "" "The ``strict`` argument to :class:`email.parser.Parser`, deprecated since " "Python 2.4, has finally been removed." msgstr "" +"自 Python 2.4 以來已棄用的 :class:`email.parser.Parser` 的 ``strict`` 引數終" +"於被刪除了。" #: ../../whatsnew/3.3.rst:2431 msgid "" "The deprecated method ``unittest.TestCase.assertSameElements`` has been " "removed." -msgstr "" +msgstr "已棄用的方法 ``unittest.TestCase.assertSameElements`` 已被刪除。" #: ../../whatsnew/3.3.rst:2434 msgid "The deprecated variable ``time.accept2dyear`` has been removed." -msgstr "" +msgstr "已棄用的變數 ``time.accept2dyear`` 已被刪除。" #: ../../whatsnew/3.3.rst:2436 msgid "" @@ -3770,9 +3851,9 @@ msgstr "" #: ../../whatsnew/3.3.rst:2464 msgid "" -"In the course of changes to the buffer API the undocumented :c:member:" -"`~Py_buffer.smalltable` member of the :c:type:`Py_buffer` structure has been " -"removed and the layout of the :c:type:`PyMemoryViewObject` has changed." +"In the course of changes to the buffer API the undocumented :c:member:`!" +"smalltable` member of the :c:type:`Py_buffer` structure has been removed and " +"the layout of the :c:type:`PyMemoryViewObject` has changed." msgstr "" #: ../../whatsnew/3.3.rst:2469 @@ -3801,7 +3882,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:2484 msgid ":c:func:`PyImport_GetMagicNumber` now returns ``-1`` upon failure." -msgstr "" +msgstr ":c:func:`PyImport_GetMagicNumber` 現在在失敗時回傳 ``-1``。" #: ../../whatsnew/3.3.rst:2486 msgid "" @@ -3831,7 +3912,7 @@ msgstr "(於 :issue:`14040` 中實作。)" #: ../../whatsnew/3.3.rst:2507 msgid "Command Line Switch Changes" -msgstr "" +msgstr "命令列開關更改" #: ../../whatsnew/3.3.rst:2509 msgid "" @@ -3862,3 +3943,10 @@ msgstr "yield" #: ../../whatsnew/3.3.rst:396 msgid "yield from (in What's New)" msgstr "yield from(在有什麼新功能中)" + +#~ msgid "" +#~ "The :class:`~socket.socket` class now supports the PF_CAN protocol family " +#~ "(https://en.wikipedia.org/wiki/Socketcan), on Linux ." +#~ msgstr "" +#~ "~socket.socket` 類別現在支援 Linux (https://lwn.net/Articles/253425) 上的 " +#~ "PF_CAN 協議系列 (https://en.wikipedia.org/wiki/Socketcan)。" diff --git a/whatsnew/3.5.po b/whatsnew/3.5.po index 4ebf6aad9c..d09d5e9665 100644 --- a/whatsnew/3.5.po +++ b/whatsnew/3.5.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-27 00:03+0000\n" +"POT-Creation-Date: 2023-08-23 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -3280,10 +3280,9 @@ msgstr "C API 中的改動" #: ../../whatsnew/3.5.rst:2515 msgid "" -"The undocumented :c:member:`~PyMemoryViewObject.format` member of the (non-" -"public) :c:type:`PyMemoryViewObject` structure has been removed. All " -"extensions relying on the relevant parts in ``memoryobject.h`` must be " -"rebuilt." +"The undocumented :c:member:`!format` member of the (non-public) :c:type:" +"`PyMemoryViewObject` structure has been removed. All extensions relying on " +"the relevant parts in ``memoryobject.h`` must be rebuilt." msgstr "" #: ../../whatsnew/3.5.rst:2520 @@ -3294,7 +3293,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:2523 msgid "" -"Removed non-documented macro :c:macro:`PyObject_REPR` which leaked " +"Removed non-documented macro :c:macro:`!PyObject_REPR()` which leaked " "references. Use format character ``%R`` in :c:func:`PyUnicode_FromFormat`-" "like functions to format the :func:`repr` of the object. (Contributed by " "Serhiy Storchaka in :issue:`22453`.)" diff --git a/whatsnew/3.6.po b/whatsnew/3.6.po index ff85eacb82..722a05f71c 100644 --- a/whatsnew/3.6.po +++ b/whatsnew/3.6.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-08-22 00:03+0000\n" "PO-Revision-Date: 2018-07-15 18:56+0800\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -2683,9 +2683,9 @@ msgstr "" #: ../../whatsnew/3.6.rst:2069 msgid "" -"Undocumented functions :c:func:`PyUnicode_AsEncodedObject`, :c:func:" -"`PyUnicode_AsDecodedObject`, :c:func:`PyUnicode_AsEncodedUnicode` and :c:" -"func:`PyUnicode_AsDecodedUnicode` are deprecated now. Use the :ref:`generic " +"Undocumented functions :c:func:`!PyUnicode_AsEncodedObject`, :c:func:`!" +"PyUnicode_AsDecodedObject`, :c:func:`!PyUnicode_AsEncodedUnicode` and :c:" +"func:`!PyUnicode_AsDecodedUnicode` are deprecated now. Use the :ref:`generic " "codec based API ` instead." msgstr "" diff --git a/whatsnew/3.8.po b/whatsnew/3.8.po index c950b96b9c..876384f4a2 100644 --- a/whatsnew/3.8.po +++ b/whatsnew/3.8.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-08-23 00:03+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-" @@ -488,7 +488,8 @@ msgid "" "(Contributed by Jeroen Demeyer, Mark Shannon and Petr Viktorin in :issue:" "`36974`.)" msgstr "" -"(由 Jeroen Demeyer、Mark Shannon 和 Petr Viktorin 在 :issue:`36974` 中貢獻。)" +"(由 Jeroen Demeyer、Mark Shannon 和 Petr Viktorin 在 :issue:`36974` 中貢" +"獻。)" #: ../../whatsnew/3.8.rst:369 msgid "Pickle protocol 5 with out-of-band data buffers" @@ -1195,8 +1196,8 @@ msgid "" "(Contributed by Yash Aggarwal, Keller Fuchs, Serhiy Storchaka, and Raymond " "Hettinger in :issue:`37128`, :issue:`37178`, and :issue:`35431`.)" msgstr "" -"(由 Yash Aggarwal、Keller Fuchs、Serhiy Storchaka 和 Raymond Hettinger 在 " -":issue:`37128`、:issue:`37178` 和 :issue:`35431` 中貢獻。)" +"(由 Yash Aggarwal、Keller Fuchs、Serhiy Storchaka 和 Raymond Hettinger 在 :" +"issue:`37128`、:issue:`37178` 和 :issue:`35431` 中貢獻。)" #: ../../whatsnew/3.8.rst:985 msgid "" @@ -1965,8 +1966,8 @@ msgid "" "(Contributed by Victor Stinner in :issue:`35134` and :issue:`35081`, work " "initiated by Eric Snow in Python 3.7.)" msgstr "" -"(由 Victor Stinner 在 :issue:`35134` 和 :issue:`35081` 中貢獻,該工作由 Eric Snow 在 Python " -"3.7 中發起。)" +"(由 Victor Stinner 在 :issue:`35134` 和 :issue:`35081` 中貢獻,該工作由 " +"Eric Snow 在 Python 3.7 中發起。)" #: ../../whatsnew/3.8.rst:1570 msgid "" @@ -1989,8 +1990,8 @@ msgstr ":c:func:`PyObject_INIT`, :c:func:`PyObject_INIT_VAR`" #: ../../whatsnew/3.8.rst:1577 msgid "" -"Private functions: :c:func:`_PyObject_GC_TRACK`, :c:func:" -"`_PyObject_GC_UNTRACK`, :c:func:`_Py_Dealloc`" +"Private functions: :c:func:`!_PyObject_GC_TRACK`, :c:func:`!" +"_PyObject_GC_UNTRACK`, :c:func:`!_Py_Dealloc`" msgstr "" #: ../../whatsnew/3.8.rst:1580 @@ -1999,9 +2000,9 @@ msgstr "(由 Victor Stinner 在 :issue:`35059` 中貢獻。)" #: ../../whatsnew/3.8.rst:1582 msgid "" -"The :c:func:`PyByteArray_Init` and :c:func:`PyByteArray_Fini` functions have " -"been removed. They did nothing since Python 2.7.4 and Python 3.2.0, were " -"excluded from the limited API (stable ABI), and were not documented. " +"The :c:func:`!PyByteArray_Init` and :c:func:`!PyByteArray_Fini` functions " +"have been removed. They did nothing since Python 2.7.4 and Python 3.2.0, " +"were excluded from the limited API (stable ABI), and were not documented. " "(Contributed by Victor Stinner in :issue:`35713`.)" msgstr "" @@ -2070,7 +2071,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:1631 msgid "" -":c:func:`Py_SetPath` now sets :data:`sys.executable` to the program full " +":c:func:`!Py_SetPath` now sets :data:`sys.executable` to the program full " "path (:c:func:`Py_GetProgramFullPath`) rather than to the program name (:c:" "func:`Py_GetProgramName`). (Contributed by Victor Stinner in :issue:`38234`.)" msgstr "" @@ -2407,11 +2408,11 @@ msgstr "" #: ../../whatsnew/3.8.rst:1848 msgid "" -":c:func:`PyEval_AcquireLock` and :c:func:`PyEval_AcquireThread` now " +":c:func:`!PyEval_AcquireLock` and :c:func:`!PyEval_AcquireThread` now " "terminate the current thread if called while the interpreter is finalizing, " "making them consistent with :c:func:`PyEval_RestoreThread`, :c:func:" "`Py_END_ALLOW_THREADS`, and :c:func:`PyGILState_Ensure`. If this behavior is " -"not desired, guard the call by checking :c:func:`_Py_IsFinalizing` or :func:" +"not desired, guard the call by checking :c:func:`!_Py_IsFinalizing` or :func:" "`sys.is_finalizing`. (Contributed by Joannah Nanjekye in :issue:`36475`.)" msgstr "" @@ -2641,8 +2642,8 @@ msgstr "" #: ../../whatsnew/3.8.rst:2024 msgid "" -"The :c:func:`PyEval_ReInitThreads` function has been removed from the C API. " -"It should not be called explicitly: use :c:func:`PyOS_AfterFork_Child` " +"The :c:func:`!PyEval_ReInitThreads` function has been removed from the C " +"API. It should not be called explicitly: use :c:func:`PyOS_AfterFork_Child` " "instead. (Contributed by Victor Stinner in :issue:`36728`.)" msgstr "" @@ -2744,8 +2745,9 @@ msgstr "(由 Antoine Pitrou 在 :issue:`32388` 中貢獻。)" #: ../../whatsnew/3.8.rst:2124 msgid "" -"The functions :c:func:`PyNode_AddChild` and :c:func:`PyParser_AddToken` now " -"accept two additional ``int`` arguments *end_lineno* and *end_col_offset*." +"The functions :c:func:`!PyNode_AddChild` and :c:func:`!PyParser_AddToken` " +"now accept two additional ``int`` arguments *end_lineno* and " +"*end_col_offset*." msgstr "" #: ../../whatsnew/3.8.rst:2127 @@ -2796,8 +2798,8 @@ msgid "" "(Contributed by Mark Shannon, Antoine Pitrou and Serhiy Storchaka in :issue:" "`17611`.)" msgstr "" -"(由 Mark Shannon、Antoine Pitrou 和 Serhiy Storchaka 在 :issue:`17611` " -"中貢獻。)" +"(由 Mark Shannon、Antoine Pitrou 和 Serhiy Storchaka 在 :issue:`17611` 中貢" +"獻。)" #: ../../whatsnew/3.8.rst:2164 msgid "" diff --git a/whatsnew/3.9.po b/whatsnew/3.9.po index 35ad207120..05e821457f 100644 --- a/whatsnew/3.9.po +++ b/whatsnew/3.9.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-08-23 00:03+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-" @@ -1242,9 +1242,9 @@ msgstr "" #: ../../whatsnew/3.9.rst:873 msgid "" -"The Public C API functions :c:func:`PyParser_SimpleParseStringFlags`, :c:" -"func:`PyParser_SimpleParseStringFlagsFilename`, :c:func:" -"`PyParser_SimpleParseFileFlags` and :c:func:`PyNode_Compile` are deprecated " +"The Public C API functions :c:func:`!PyParser_SimpleParseStringFlags`, :c:" +"func:`!PyParser_SimpleParseStringFlagsFilename`, :c:func:`!" +"PyParser_SimpleParseFileFlags` and :c:func:`!PyNode_Compile` are deprecated " "and will be removed in Python 3.10 together with the old parser." msgstr "" @@ -1326,11 +1326,11 @@ msgstr "" #: ../../whatsnew/3.9.rst:926 msgid "" -"The :c:func:`PyEval_InitThreads` and :c:func:`PyEval_ThreadsInitialized` " +"The :c:func:`!PyEval_InitThreads` and :c:func:`!PyEval_ThreadsInitialized` " "functions are now deprecated and will be removed in Python 3.11. Calling :c:" -"func:`PyEval_InitThreads` now does nothing. The :term:`GIL` is initialized " -"by :c:func:`Py_Initialize()` since Python 3.7. (Contributed by Victor " -"Stinner in :issue:`39877`.)" +"func:`!PyEval_InitThreads` now does nothing. The :term:`GIL` is initialized " +"by :c:func:`Py_Initialize` since Python 3.7. (Contributed by Victor Stinner " +"in :issue:`39877`.)" msgstr "" #: ../../whatsnew/3.9.rst:932 @@ -1962,8 +1962,8 @@ msgstr "" #: ../../whatsnew/3.9.rst:1372 msgid "" "The ``Py_UNICODE_COPY``, ``Py_UNICODE_FILL``, ``PyUnicode_WSTR_LENGTH``, :c:" -"func:`PyUnicode_FromUnicode`, :c:func:`PyUnicode_AsUnicode`, " -"``_PyUnicode_AsUnicode``, and :c:func:`PyUnicode_AsUnicodeAndSize` are " +"func:`!PyUnicode_FromUnicode`, :c:func:`!PyUnicode_AsUnicode`, " +"``_PyUnicode_AsUnicode``, and :c:func:`!PyUnicode_AsUnicodeAndSize` are " "marked as deprecated in C. They have been deprecated by :pep:`393` since " "Python 3.3. (Contributed by Inada Naoki in :issue:`36346`.)" msgstr ""