@@ -11,7 +11,7 @@ msgid ""
11
11
msgstr ""
12
12
"Project-Id-Version : Python 3.10\n "
13
13
"Report-Msgid-Bugs-To : \n "
14
- "POT-Creation-Date : 2023-07-29 03:05 +0000\n "
14
+ "POT-Creation-Date : 2023-11-24 18:59 +0000\n "
15
15
"PO-Revision-Date : 2022-11-05 17:21+0000\n "
16
16
"Last-Translator : Rafael Fontenelle <rffontenelle@gmail.com>, 2023\n "
17
17
"Language-Team : Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n "
@@ -211,14 +211,16 @@ msgstr ""
211
211
msgid ""
212
212
"Read a code point from a canonical representation *data* (as obtained with "
213
213
":c:func:`PyUnicode_DATA`). No checks or ready calls are performed."
214
- msgstr ""
214
+ msgstr "从规范表示的 *data* (如同用 :c:func:`PyUnicode_DATA` 获取) 中读取一个码位。 不会执行检查或就绪调用。 "
215
215
216
216
#: ../../c-api/unicode.rst:194
217
217
msgid ""
218
218
"Read a character from a Unicode object *o*, which must be in the "
219
219
"\" canonical\" representation. This is less efficient than "
220
220
":c:func:`PyUnicode_READ` if you do multiple consecutive reads."
221
221
msgstr ""
222
+ "从 Unicode 对象 *o* 读取一个字符,必须使用“规范”表示形式。 如果你执行行多次连续读取则此函数的效率将低于 "
223
+ ":c:func:`PyUnicode_READ`。"
222
224
223
225
#: ../../c-api/unicode.rst:203
224
226
msgid ""
@@ -282,7 +284,7 @@ msgstr "如果字符串按照语言定义是合法的标识符则返回 ``1``,
282
284
msgid ""
283
285
"The function does not call :c:func:`Py_FatalError` anymore if the string is "
284
286
"not ready."
285
- msgstr ""
287
+ msgstr "如果字符串尚未就绪则此函数不会再调用 :c:func:`Py_FatalError`。 "
286
288
287
289
#: ../../c-api/unicode.rst:264
288
290
msgid "Unicode Character Properties"
@@ -355,27 +357,31 @@ msgid ""
355
357
"invoked on a string. It has no bearing on the handling of strings written to"
356
358
" :data:`sys.stdout` or :data:`sys.stderr`.)"
357
359
msgstr ""
360
+ "根据 *ch* 是否为可打印字符返回 ``1`` 或``0``。 不可打印字符是指在 Unicode 字符数据库中被定义为 \" Other\" 或 "
361
+ "\" Separator\" 的字符,例外情况是 ASCII 空格 (0x20) 被视为可打印字符。 (请注意在此语境下可打印字符是指当在字符串上发起调用"
362
+ " :func:`repr` 时不应被转义的字符。 它们字符串写入 :data:`sys.stdout` 或 :data:`sys.stderr` "
363
+ "时所需的处理无关)。"
358
364
359
365
#: ../../c-api/unicode.rst:332
360
366
msgid "These APIs can be used for fast direct character conversions:"
361
- msgstr ""
367
+ msgstr "这些 API 可用于快速直接的字符转换: "
362
368
363
369
#: ../../c-api/unicode.rst:337
364
370
msgid "Return the character *ch* converted to lower case."
365
- msgstr ""
371
+ msgstr "返回转换为小写形式的字符 *ch*。 "
366
372
367
373
#: ../../c-api/unicode.rst:339 ../../c-api/unicode.rst:347
368
374
#: ../../c-api/unicode.rst:355
369
375
msgid "This function uses simple case mappings."
370
- msgstr ""
376
+ msgstr "此函数使用简单的大小写映射。 "
371
377
372
378
#: ../../c-api/unicode.rst:345
373
379
msgid "Return the character *ch* converted to upper case."
374
- msgstr ""
380
+ msgstr "返回转换为大写形式的字符 *ch*。 "
375
381
376
382
#: ../../c-api/unicode.rst:353
377
383
msgid "Return the character *ch* converted to title case."
378
- msgstr ""
384
+ msgstr "返回转换为标题大小写形式的字符 *ch*。 "
379
385
380
386
#: ../../c-api/unicode.rst:361
381
387
msgid ""
@@ -397,19 +403,19 @@ msgstr ""
397
403
398
404
#: ../../c-api/unicode.rst:377
399
405
msgid "These APIs can be used to work with surrogates:"
400
- msgstr ""
406
+ msgstr "这些 API 可被用来操作代理项: "
401
407
402
408
#: ../../c-api/unicode.rst:381
403
409
msgid "Check if *ch* is a surrogate (``0xD800 <= ch <= 0xDFFF``)."
404
- msgstr ""
410
+ msgstr "检测 *ch* 是否为代理项 (``0xD800 <= ch <= 0xDFFF``)。 "
405
411
406
412
#: ../../c-api/unicode.rst:385
407
413
msgid "Check if *ch* is a high surrogate (``0xD800 <= ch <= 0xDBFF``)."
408
- msgstr ""
414
+ msgstr "检测 *ch* 是否为高代理项 (``0xD800 <= ch <= 0xDBFF``)。 "
409
415
410
416
#: ../../c-api/unicode.rst:389
411
417
msgid "Check if *ch* is a low surrogate (``0xDC00 <= ch <= 0xDFFF``)."
412
- msgstr ""
418
+ msgstr "检测 *ch* 是否为低代理项 (``0xDC00 <= ch <= 0xDFFF``)。 "
413
419
414
420
#: ../../c-api/unicode.rst:393
415
421
msgid ""
@@ -420,26 +426,28 @@ msgstr ""
420
426
421
427
#: ../../c-api/unicode.rst:399
422
428
msgid "Creating and accessing Unicode strings"
423
- msgstr ""
429
+ msgstr "创建和访问 Unicode 字符串 "
424
430
425
431
#: ../../c-api/unicode.rst:401
426
432
msgid ""
427
433
"To create Unicode objects and access their basic sequence properties, use "
428
434
"these APIs:"
429
- msgstr ""
435
+ msgstr "要创建 Unicode 对象和访问其基本序列属性,请使用这些 API: "
430
436
431
437
#: ../../c-api/unicode.rst:406
432
438
msgid ""
433
439
"Create a new Unicode object. *maxchar* should be the true maximum code "
434
440
"point to be placed in the string. As an approximation, it can be rounded up"
435
441
" to the nearest value in the sequence 127, 255, 65535, 1114111."
436
442
msgstr ""
443
+ "创建一个新的 Unicode 对象。 *maxchar* 应为可放入字符串的实际最大码位。 作为一个近似值,它可被向上舍入到序列 127, 255, "
444
+ "65535, 1114111 中最接近的值。"
437
445
438
446
#: ../../c-api/unicode.rst:410
439
447
msgid ""
440
448
"This is the recommended way to allocate a new Unicode object. Objects "
441
449
"created using this function are not resizable."
442
- msgstr ""
450
+ msgstr "这是分配新的 Unicode 对象的推荐方式。 使用此函数创建的对象不可改变大小。 "
443
451
444
452
#: ../../c-api/unicode.rst:419
445
453
msgid ""
@@ -448,6 +456,9 @@ msgid ""
448
456
":c:func:`PyUnicode_KIND`). The *buffer* must point to an array of *size* "
449
457
"units of 1, 2 or 4 bytes per character, as given by the kind."
450
458
msgstr ""
459
+ "以给定的 *kind* 创建一个新的 Unicode 对象(可能的值为 :c:macro:`PyUnicode_1BYTE_KIND` 等,即 "
460
+ ":c:func:`PyUnicode_KIND` 所返回的值)。 *buffer* 必须指向由此分类所给出的,以每字符 1, 2 或 4 字节单位的 "
461
+ "*size* 大小的数组。"
451
462
452
463
#: ../../c-api/unicode.rst:429
453
464
msgid ""
@@ -469,7 +480,7 @@ msgstr ""
469
480
msgid ""
470
481
"Create a Unicode object from a UTF-8 encoded null-terminated char buffer "
471
482
"*u*."
472
- msgstr ""
483
+ msgstr "根据 UTF-8 编码的以空值结束的字符缓冲区 *u* 创建一个 Unicode 对象。 "
473
484
474
485
#: ../../c-api/unicode.rst:447
475
486
msgid ""
@@ -713,22 +724,24 @@ msgid ""
713
724
"array as a second parameter (which will be used, if the first parameter is "
714
725
"``NULL``)."
715
726
msgstr ""
727
+ "一个 Unicode 对象 (可以为 ``NULL``) 和一个以空值结束的 C 字符数组作为第二个形参(如果第一个形参为 "
728
+ "``NULL``,第二个形参将被使用)。"
716
729
717
730
#: ../../c-api/unicode.rst:531
718
731
msgid ":attr:`%S`"
719
732
msgstr ":attr:`%S`"
720
733
721
734
#: ../../c-api/unicode.rst:531
722
735
msgid "The result of calling :c:func:`PyObject_Str`."
723
- msgstr ""
736
+ msgstr "调用 :c:func:`PyObject_Str` 的结果。 "
724
737
725
738
#: ../../c-api/unicode.rst:534
726
739
msgid ":attr:`%R`"
727
740
msgstr ":attr:`%R`"
728
741
729
742
#: ../../c-api/unicode.rst:534
730
743
msgid "The result of calling :c:func:`PyObject_Repr`."
731
- msgstr ""
744
+ msgstr "调用 :c:func:`PyObject_Repr` 的结果。 "
732
745
733
746
#: ../../c-api/unicode.rst:538
734
747
msgid ""
@@ -753,27 +766,27 @@ msgstr ""
753
766
754
767
#: ../../c-api/unicode.rst:551
755
768
msgid "Support for ``\" %lld\" `` and ``\" %llu\" `` added."
756
- msgstr ""
769
+ msgstr "增加了对 `` \" %lld \" `` 和 `` \" %llu \" `` 的支持。 "
757
770
758
771
#: ../../c-api/unicode.rst:554
759
772
msgid "Support for ``\" %li\" ``, ``\" %lli\" `` and ``\" %zi\" `` added."
760
- msgstr ""
773
+ msgstr "增加了对 `` \" %li \" ``, `` \" %lli \" `` 和 `` \" %zi \" `` 的支持。 "
761
774
762
775
#: ../../c-api/unicode.rst:557
763
776
msgid ""
764
777
"Support width and precision formatter for ``\" %s\" ``, ``\" %A\" ``, "
765
778
"``\" %U\" ``, ``\" %V\" ``, ``\" %S\" ``, ``\" %R\" `` added."
766
- msgstr ""
779
+ msgstr "增加了对 `` \" %s \" ``, `` \" %A \" ``, `` \" %U \" ``, `` \" %V \" ``, `` \" %S \" ``, `` \" %R \" `` 的宽度和精度格式符支持。 "
767
780
768
781
#: ../../c-api/unicode.rst:564
769
782
msgid ""
770
783
"Identical to :c:func:`PyUnicode_FromFormat` except that it takes exactly two"
771
784
" arguments."
772
- msgstr ""
785
+ msgstr "等同于 :c:func:`PyUnicode_FromFormat` 但它将接受恰好两个参数。 "
773
786
774
787
#: ../../c-api/unicode.rst:571
775
788
msgid "Decode an encoded object *obj* to a Unicode object."
776
- msgstr ""
789
+ msgstr "将一个已编码的对象 *obj* 解码为 Unicode 对象。 "
777
790
778
791
#: ../../c-api/unicode.rst:573
779
792
msgid ""
@@ -782,22 +795,25 @@ msgid ""
782
795
" the error handling defined by *errors*. Both can be ``NULL`` to have the "
783
796
"interface use the default values (see :ref:`builtincodecs` for details)."
784
797
msgstr ""
798
+ ":class:`bytes`, :class:`bytearray` 和其他 :term:`字节类对象 <bytes-like object>` "
799
+ "将按照给定的 *encoding* 来解码并使用由 *errors* 定义的错误处理方式。 两者均可为 ``NULL`` 即让接口使用默认值(请参阅 "
800
+ ":ref:`builtincodecs` 了解详情)。"
785
801
786
802
#: ../../c-api/unicode.rst:579
787
803
msgid ""
788
804
"All other objects, including Unicode objects, cause a :exc:`TypeError` to be"
789
805
" set."
790
- msgstr ""
806
+ msgstr "所有其他对象,包括 Unicode 对象,都将导致设置 :exc:`TypeError`。 "
791
807
792
808
#: ../../c-api/unicode.rst:582
793
809
msgid ""
794
810
"The API returns ``NULL`` if there was an error. The caller is responsible "
795
811
"for decref'ing the returned objects."
796
- msgstr ""
812
+ msgstr "如有错误该 API 将返回 ``NULL``。 调用方要负责递减指向所返回对象的引用。 "
797
813
798
814
#: ../../c-api/unicode.rst:588
799
815
msgid "Return the length of the Unicode object, in code points."
800
- msgstr ""
816
+ msgstr "返回 Unicode 对象码位的长度。 "
801
817
802
818
#: ../../c-api/unicode.rst:599
803
819
msgid ""
@@ -811,33 +827,35 @@ msgstr ""
811
827
msgid ""
812
828
"Fill a string with a character: write *fill_char* into "
813
829
"``unicode[start:start+length]``."
814
- msgstr ""
830
+ msgstr "使用一个字符填充字符串:将 *fill_char* 写入 ``unicode[start:start+length]``。 "
815
831
816
832
#: ../../c-api/unicode.rst:613
817
833
msgid ""
818
834
"Fail if *fill_char* is bigger than the string maximum character, or if the "
819
835
"string has more than 1 reference."
820
- msgstr ""
836
+ msgstr "如果 *fill_char* 值大于字符串最大字符值,或者如果字符串有 1 以上的引用将执行失败。 "
821
837
822
838
#: ../../c-api/unicode.rst:616
823
839
msgid ""
824
840
"Return the number of written character, or return ``-1`` and raise an "
825
841
"exception on error."
826
- msgstr ""
842
+ msgstr "返回写入的字符数量,或者在出错时返回 ``-1`` 并引发一个异常。 "
827
843
828
844
#: ../../c-api/unicode.rst:625
829
845
msgid ""
830
846
"Write a character to a string. The string must have been created through "
831
847
":c:func:`PyUnicode_New`. Since Unicode strings are supposed to be "
832
848
"immutable, the string must not be shared, or have been hashed yet."
833
849
msgstr ""
850
+ "将一个字符写入到字符串。 字符串必须通过 :c:func:`PyUnicode_New` 创建。 由于 Unicode "
851
+ "字符串应当是不可变的,因此该字符串不能被共享,或是被哈希。"
834
852
835
853
#: ../../c-api/unicode.rst:629
836
854
msgid ""
837
855
"This function checks that *unicode* is a Unicode object, that the index is "
838
856
"not out of bounds, and that the object can be modified safely (i.e. that it "
839
857
"its reference count is one)."
840
- msgstr ""
858
+ msgstr "该函数将检查 *unicode* 是否为 Unicode 对象,索引是否未越界,并且对象是否可被安全地修改(即其引用计数为一)。 "
841
859
842
860
#: ../../c-api/unicode.rst:638
843
861
msgid ""
@@ -850,7 +868,7 @@ msgstr ""
850
868
msgid ""
851
869
"Return a substring of *str*, from character index *start* (included) to "
852
870
"character index *end* (excluded). Negative indices are not supported."
853
- msgstr ""
871
+ msgstr "返回 *str* 的一个子串,从字符索引 *start* (包括) 到字符索引 *end* (不包括)。 不支持负索引号。 "
854
872
855
873
#: ../../c-api/unicode.rst:657
856
874
msgid ""
@@ -859,6 +877,8 @@ msgid ""
859
877
"particular, a :exc:`SystemError` if *buflen* is smaller than the length of "
860
878
"*u*). *buffer* is returned on success."
861
879
msgstr ""
880
+ "将字符串 *u* 拷贝到一个 UCS4 缓冲区,包括一个空字符,如果设置了 *copy_null* 的话。 出错时返回 ``NULL`` "
881
+ "并设置一个异常(特别是当 *buflen* 小于 *u* 的长度时,:exc:`SystemError` 将被设置)。 成功时返回 *buffer*。"
862
882
863
883
#: ../../c-api/unicode.rst:667
864
884
msgid ""
@@ -965,7 +985,7 @@ msgstr ""
965
985
#: ../../c-api/unicode.rst:765
966
986
msgid ""
967
987
"Objects other than Unicode or its subtypes will cause a :exc:`TypeError`."
968
- msgstr ""
988
+ msgstr "非 Unicode 或其子类型的对象将导致 :exc:`TypeError`。 "
969
989
970
990
#: ../../c-api/unicode.rst:769
971
991
msgid "Locale Encoding"
@@ -2001,12 +2021,12 @@ msgid ""
2001
2021
"Intern the argument *\\ *string* in place. The argument must be the address "
2002
2022
"of a pointer variable pointing to a Python Unicode string object. If there "
2003
2023
"is an existing interned string that is the same as *\\ *string*, it sets "
2004
- "*\\ *string* to it (decrementing the reference count of the old string object"
2005
- " and incrementing the reference count of the interned string object), "
2006
- "otherwise it leaves *\\ *string* alone and interns it (incrementing its "
2007
- "reference count ). (Clarification: even though there is a lot of talk about "
2008
- "reference counts , think of this function as reference-count- neutral; you own"
2009
- " the object after the call if and only if you owned it before the call.)"
2024
+ "*\\ *string* to it (releasing the reference to the old string object and "
2025
+ "creating a new :term:`strong reference` to the interned string object), "
2026
+ "otherwise it leaves *\\ *string* alone and interns it (creating a new "
2027
+ ":term:`strong reference` ). (Clarification: even though there is a lot of "
2028
+ "talk about references , think of this function as reference-neutral; you own "
2029
+ "the object after the call if and only if you owned it before the call.)"
2010
2030
msgstr ""
2011
2031
2012
2032
#: ../../c-api/unicode.rst:1728
0 commit comments