Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit72e0383

Browse files
[po] auto sync
1 parent706f2dd commit72e0383

File tree

2 files changed

+45
-11
lines changed

2 files changed

+45
-11
lines changed

‎.stat.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"translation":"81.51%","updated_at":"2025-04-27T06:55:41Z"}
1+
{"translation":"81.54%","updated_at":"2025-04-27T14:55:33Z"}

‎whatsnew/3.0.po

Lines changed: 44 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1263,16 +1263,19 @@ msgid ""
12631263
" except for this latter category is to use :keyword:`except` "
12641264
":exc:`Exception`."
12651265
msgstr""
1266+
"几乎所有异常实际上都应当派生自 :exc:`Exception`;:exc:`BaseException` "
1267+
"仅应当被用作那些仅应当在最高层级中处理的异常的基类,如 :exc:`SystemExit` 或 :exc:`KeyboardInterrupt`。 "
1268+
"处理除了后面这一类之外的所有异常的推荐写法是使用 :keyword:`except` :exc:`Exception`。"
12661269

12671270
#:../../whatsnew/3.0.rst:705
12681271
msgid":exc:`!StandardError` was removed."
1269-
msgstr""
1272+
msgstr":exc:`!StandardError` 已被移除。"
12701273

12711274
#:../../whatsnew/3.0.rst:707
12721275
msgid""
12731276
"Exceptions no longer behave as sequences. Use the "
12741277
":attr:`~BaseException.args` attribute instead."
1275-
msgstr""
1278+
msgstr"异常已不再被当作序列来处理。 而应改用 :attr:`~BaseException.args` 属性。"
12761279

12771280
#:../../whatsnew/3.0.rst:710
12781281
msgid""
@@ -1282,6 +1285,9 @@ msgid ""
12821285
"you *have* to do this, you can assign directly to the "
12831286
":attr:`~BaseException.__traceback__` attribute (see below)."
12841287
msgstr""
1288+
":pep:`3109`: 引发异常。 你现在必须使用 :samp:`raise {Exception}({args})` 而不是 "
1289+
":samp:`raise {Exception}, {args}`。 此外,你不再可以显式地指定回溯;作为替代,如果你 *必须* "
1290+
"这样做,你可以直接赋值给 :attr:`~BaseException.__traceback__` 属性(见下文)。"
12851291

12861292
#:../../whatsnew/3.0.rst:716
12871293
msgid""
@@ -1290,6 +1296,9 @@ msgid ""
12901296
"{variable}`. Moreover, the *variable* is explicitly deleted when the "
12911297
":keyword:`except` block is left."
12921298
msgstr""
1299+
":pep:`3110`: 捕获异常。 你现在必须使用 :samp:`except {SomeException} as {variable}` 而不是 "
1300+
":samp:`except {SomeException}, {variable}`。 此外,*variable* 会在离开 "
1301+
":keyword:`except` 代码块时被显式地删除。"
12931302

12941303
#:../../whatsnew/3.0.rst:722
12951304
msgid""
@@ -1301,10 +1310,14 @@ msgid ""
13011310
" saved as the :attr:`~BaseException.__context__` attribute of the secondary "
13021311
"exception. Explicit chaining is invoked with this syntax::"
13031312
msgstr""
1313+
":pep:`3134`: 异常串连。 存在两种情况:隐式串连和显式串连。 当异常在 :keyword:`except` 或 "
1314+
":keyword:`finally` 处理器代码块中被引发时将发生隐式串连。 通常发生这种情况是由于处理器代码块中存在程序缺陷;我们将其称为 *二级* "
1315+
"异常。 在这种情况下,(正在处理的)原始异常将被保存为该二级异常的 :attr:`~BaseException.__context__` 属性。 "
1316+
"显式串连则是由以下语法来唤起::"
13041317

13051318
#:../../whatsnew/3.0.rst:731
13061319
msgid"raise SecondaryException() from primary_exception"
1307-
msgstr""
1320+
msgstr"raise SecondaryException() from primary_exception"
13081321

13091322
#:../../whatsnew/3.0.rst:733
13101323
msgid""
@@ -1317,6 +1330,10 @@ msgid ""
13171330
"traceback for each component of the chain, with the primary exception at the"
13181331
" top. (Java users may recognize this behavior.)"
13191332
msgstr""
1333+
"(这里 *primary_exception* 是产生一个异常对象的任何异常,它可能是在之前被捕获的异常)。 在这种情况下,该原始异常将存储在二级异常的"
1334+
" :attr:`~BaseException.__cause__` 属性中。 如果遍历 :attr:`!__cause__` 和 "
1335+
":attr:`~BaseException.__context__` "
1336+
"属性链时发生了未被处理的异常则会打印回溯信息并为属性链中的每个部分打印单独的回溯信息,原始异常将位于最上面。 (Java 用户可能很了解这样的行为。)"
13201337

13211338
#:../../whatsnew/3.0.rst:743
13221339
msgid""
@@ -1326,34 +1343,38 @@ msgid ""
13261343
"exception, and there are fewer reasons to use :func:`sys.exc_info` (though "
13271344
"the latter is not removed)."
13281345
msgstr""
1346+
":pep:`3134`: 异常对象现在会将其回溯信息保存为 :attr:`~BaseException.__traceback__` 属性。 "
1347+
"这意味着一个异常对象现在将包含从属于异常的所有信息,没有什么理由再使用 :func:`sys.exc_info` (不过后者并未被移除)。"
13291348

13301349
#:../../whatsnew/3.0.rst:749
13311350
msgid""
13321351
"A few exception messages are improved when Windows fails to load an "
13331352
"extension module. For example, ``error code 193`` is now ``%1 is not a "
13341353
"valid Win32 application``. Strings now deal with non-English locales."
13351354
msgstr""
1355+
"一些提示 Windows 载入扩展模块失败的异常消息得到了改进。 例如,``error code 193`` 现在是 ``%1 is not a "
1356+
"valid Win32 application``。 字符串现在可处理非英语的语言区域。"
13361357

13371358
#:../../whatsnew/3.0.rst:756
13381359
msgid"Miscellaneous Other Changes"
1339-
msgstr""
1360+
msgstr"其他杂项修改"
13401361

13411362
#:../../whatsnew/3.0.rst:759
13421363
msgid"Operators And Special Methods"
1343-
msgstr""
1364+
msgstr"运算符与特殊方法"
13441365

13451366
#:../../whatsnew/3.0.rst:761
13461367
msgid""
13471368
"``!=`` now returns the opposite of ``==``, unless ``==`` returns "
13481369
":data:`NotImplemented`."
1349-
msgstr""
1370+
msgstr"现在 ``!=`` 将返回与 ``==`` 相反的结果,除非 ``==`` 是返回 :data:`NotImplemented`。"
13501371

13511372
#:../../whatsnew/3.0.rst:764
13521373
msgid""
13531374
"The concept of\"unbound methods\" has been removed from the language. When "
13541375
"referencing a method as a class attribute, you now get a plain function "
13551376
"object."
1356-
msgstr""
1377+
msgstr"“未绑定方法”的概念已从语言中移除。 现在当把一个方法作为类属性来引用时,你将得到一个普通函数对象。"
13571378

13581379
#:../../whatsnew/3.0.rst:768
13591380
msgid""
@@ -1362,23 +1383,28 @@ msgid ""
13621383
"j))`` (or :meth:`~object.__setitem__` or :meth:`~object.__delitem__`, when "
13631384
"used as an assignment or deletion target, respectively)."
13641385
msgstr""
1386+
":meth:`!__getslice__`, :meth:`!__setslice__` 和 :meth:`!__delslice__` 已被去除。 "
1387+
"现在 ``a[i:j]`` 语法形式将被转为 ``a.__getitem__(slice(i, j))`` (或者当用作赋值或删除的目标时,分别被转为 "
1388+
":meth:`~object.__setitem__` 或 :meth:`~object.__delitem__`)。"
13651389

13661390
#:../../whatsnew/3.0.rst:774
13671391
msgid""
13681392
":pep:`3114`: the standard :meth:`next` method has been renamed to "
13691393
":meth:`~iterator.__next__`."
1370-
msgstr""
1394+
msgstr":pep:`3114`: 标准的 :meth:`next` 方法已被重命名为 :meth:`~iterator.__next__`。"
13711395

13721396
#:../../whatsnew/3.0.rst:777
13731397
msgid""
13741398
"The :meth:`!__oct__` and :meth:`!__hex__` special methods are removed -- "
13751399
":func:`oct` and :func:`hex` use :meth:`~object.__index__` now to convert the"
13761400
" argument to an integer."
13771401
msgstr""
1402+
":meth:`!__oct__` 和 :meth:`!__hex__` 特殊方法已被移除 -- 现在 :func:`oct` 和 :func:`hex`"
1403+
" 将使用 :meth:`~object.__index__` 来将参数转换为整数。"
13781404

13791405
#:../../whatsnew/3.0.rst:781
13801406
msgid"Removed support for :attr:`!__members__` and :attr:`!__methods__`."
1381-
msgstr""
1407+
msgstr"移除了对 :attr:`!__members__` 和 :attr:`!__methods__` 的支持。"
13821408

13831409
#:../../whatsnew/3.0.rst:783
13841410
msgid""
@@ -1392,10 +1418,18 @@ msgid ""
13921418
":attr:`~function.__doc__`, :attr:`~function.__globals__`, "
13931419
":attr:`~function.__name__`, respectively."
13941420
msgstr""
1421+
"名为 :attr:`!func_X` 的函数属性已被重命名为使用 :attr:`!__X__` "
1422+
"的形式,在函数属性命名空间中释放这些名称以便作为用户自定义属性。 也就是说,:attr:`!func_closure`, "
1423+
":attr:`!func_code`, :attr:`!func_defaults`, :attr:`!func_dict`, "
1424+
":attr:`!func_doc`, :attr:`!func_globals`, :attr:`!func_name` 分别被重命名为 "
1425+
":attr:`~function.__closure__`, :attr:`~function.__code__`, "
1426+
":attr:`~function.__defaults__`, :attr:`~function.__dict__`, "
1427+
":attr:`~function.__doc__`, :attr:`~function.__globals__`, "
1428+
":attr:`~function.__name__`。"
13951429

13961430
#:../../whatsnew/3.0.rst:794
13971431
msgid":meth:`!__nonzero__` is now :meth:`~object.__bool__`."
1398-
msgstr""
1432+
msgstr":meth:`!__nonzero__` 现在为 :meth:`~object.__bool__`。"
13991433

14001434
#:../../whatsnew/3.0.rst:797
14011435
msgid"Builtins"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp