8
8
msgstr ""
9
9
"Project-Id-Version : Python 3.12\n "
10
10
"Report-Msgid-Bugs-To : \n "
11
- "POT-Creation-Date : 2023-11-30 00:03+0000\n "
11
+ "POT-Creation-Date : 2024-06-20 00:03+0000\n "
12
12
"PO-Revision-Da
8000
te : YEAR-MO-DA HO:MI+ZONE\n "
13
13
"Last-Translator : FULL NAME <EMAIL@ADDRESS>\n "
14
14
"Language-Team : LANGUAGE <LL@li.org>\n "
@@ -972,78 +972,78 @@ msgstr ""
972
972
msgid "names of pseudo-flags are constructed from their members' names::"
973
973
msgstr ""
974
974
975
- #: ../../howto/enum.rst:1132
975
+ #: ../../howto/enum.rst:1140
976
976
msgid "multi-bit flags, aka aliases, can be returned from operations::"
977
977
msgstr ""
978
978
979
- #: ../../howto/enum.rst:1143
979
+ #: ../../howto/enum.rst:1151
980
980
msgid ""
981
981
"membership / containment checking: zero-valued flags are always considered "
982
982
"to be contained::"
983
983
msgstr ""
984
984
985
- #: ../../howto/enum.rst:1149
985
+ #: ../../howto/enum.rst:1157
986
986
msgid ""
987
987
"otherwise, only if all bits of one flag are in the other flag will True be "
988
988
"returned::"
989
989
msgstr ""
990
990
991
- #: ../../howto/enum.rst:1158
991
+ #: ../../howto/enum.rst:1166
992
992
msgid ""
993
993
"There is a new boundary mechanism that controls how out-of-range / invalid "
994
994
"bits are handled: ``STRICT``, ``CONFORM``, ``EJECT``, and ``KEEP``:"
995
995
msgstr ""
996
996
997
- #: ../../howto/enum.rst:1161
997
+ #: ../../howto/enum.rst:1169
998
998
msgid "STRICT --> raises an exception when presented with invalid values"
999
999
msgstr ""
1000
1000
1001
- #: ../../howto/enum.rst:1162
1001
+ #: ../../howto/enum.rst:1170
1002
1002
msgid "CONFORM --> discards any invalid bits"
1003
1003
msgstr ""
1004
1004
1005
- #: ../../howto/enum.rst:1163
1005
+ #: ../../howto/enum.rst:1171
1006
1006
msgid "EJECT --> lose Flag status and become a normal int with the given value"
1007
1007
msgstr ""
1008
1008
1009
- #: ../../howto/enum.rst:1164
1009
+ #: ../../howto/enum.rst:1172
1010
1010
msgid "KEEP --> keep the extra bits"
1011
1011
msgstr ""
1012
1012
1013
- #: ../../howto/enum.rst:1166
1013
+ #: ../../howto/enum.rst:1174
1014
1014
msgid "keeps Flag status and extra bits"
1015
1015
msgstr ""
1016
1016
1017
- #: ../../howto/enum.rst:1167
1017
+ #: ../../howto/enum.rst:1175
1018
1018
msgid "extra bits do not show up in iteration"
1019
1019
msgstr ""
1020
1020
1021
- #: ../../howto/enum.rst:1168
1021
+ #: ../../howto/enum.rst:1176
1022
1022
msgid "extra bits do show up in repr() and str()"
1023
1023
msgstr ""
1024
1024
1025
- #: ../../howto/enum.rst:1170
1025
+ #: ../../howto/enum.rst:1178
1026
1026
msgid ""
1027
1027
"The default for Flag is ``STRICT``, the default for ``IntFlag`` is "
1028
1028
"``EJECT``, and the default for ``_convert_`` is ``KEEP`` (see ``ssl."
1029
1029
"Options`` for an example of when ``KEEP`` is needed)."
1030
1030
msgstr ""
1031
1031
1032
- #: ../../howto/enum.rst:1178
1032
+ #: ../../howto/enum.rst:1186
1033
1033
msgid "How are Enums and Flags different?"
1034
1034
msgstr ""
1035
1035
1036
- #: ../../howto/enum.rst:1180
1036
+ #: ../../howto/enum.rst:1188
1037
1037
msgid ""
1038
1038
"Enums have a custom metaclass that affects many aspects of both derived :"
1039
1039
"class:`Enum` classes and their instances (members)."
1040
1040
msgstr ""
1041
1041
1042
- #: ../../howto/enum.rst:1185
1042
+ #: ../../howto/enum.rst:1193
1043
1043
msgid "Enum Classes"
1044
1044
msgstr ""
1045
1045
1046
- #: ../../howto/enum.rst:1187
1046
+ #: ../../howto/enum.rst:1195
1047
1047
msgid ""
1048
1048
"The :class:`EnumType` metaclass is responsible for providing the :meth:"
1049
1049
"`__contains__`, :meth:`__dir__`, :meth:`__iter__` and other methods that "
@@ -1054,11 +1054,11 @@ msgid ""
1054
1054
"`__getnewargs__`, :meth:`__str__` and :meth:`__repr__`)."
1055
1055
msgstr ""
1056
1056
1057
- #: ../../howto/enum.rst:1196
1057
+ #: ../../howto/enum.rst:1204
1058
1058
msgid "Flag Classes"
1059
1059
msgstr ""
1060
1060
1061
- #: ../../howto/enum.rst:1198
1061
+ #: ../../howto/enum.rst:1206
1062
1062
msgid ""
1063
1063
"Flags have an expanded view of aliasing: to be canonical, the value of a "
1064
1064
"flag needs to be a power-of-two value, and not a duplicate name. So, in "
@@ -1067,11 +1067,11 @@ msgid ""
1067
1067
"considered an alias."
1068
1068
msgstr ""
1069
1069
1070
- #: ../../howto/enum.rst:1204
1070
+ #: ../../howto/enum.rst:1212
1071
1071
msgid "Enum Members (aka instances)"
1072
1072
msgstr ""
1073
1073
1074
- #: ../../howto/enum.rst:1206
1074
+ #: ../../howto/enum.rst:1214
1075
1075
msgid ""
1076
1076
"The most interesting thing about enum members is that they are singletons. :"
1077
1077
"class:`EnumType` creates them all while it is creating the enum class "
@@ -1080,193 +1080,193 @@ msgid ""
1080
1080
"instances."
1081
1081
msgstr ""
1082
1082
1083
- #: ../../howto/enum.rst:1212
1083
+ #: ../../howto/enum.rst:1220
1084
1084
msgid "Flag Members"
1085
1085
msgstr ""
1086
1086
1087
- #: ../../howto/enum.rst:1214
1087
+ #: ../../howto/enum.rst:1222
1088
1088
msgid ""
1089
1089
"Flag members can be iterated over just like the :class:`Flag` class, and "
1090
1090
"only the canonical members will be returned. For example::"
1091
1091
msgstr ""
1092
1092
1093
- #: ../../howto/enum.rst:1220
1093
+ #: ../../howto/enum.rst:1228
1094
1094
msgid "(Note that ``BLACK``, ``PURPLE``, and ``WHITE`` do not show up.)"
1095
1095
msgstr ""
1096
1096
1097
- #: ../../howto/enum.rst:1222
1097
+ #: ../../howto/enum.rst:1230
1098
1098
msgid ""
1099
1099
"Inverting a flag member returns the corresponding positive value, rather "
1100
1100
"than a negative value --- for example::"
1101
1101
msgstr ""
1102
1102
1103
- #: ../../howto/enum.rst:1228
1103
+ #: ../../howto/enum.rst:1236
1104
1104
msgid ""
1105
1105
"Flag members have a length corresponding to the number of power-of-two "
1106
1106
"values they contain. For example::"
1107
1107
msgstr ""
1108
1108
1109
- #: ../../howto/enum.rst:1238
1109
+ #: ../../howto/enum.rst:1246
1110
1110
msgid "Enum Cookbook"
1111
1111
msgstr ""
1112
1112
1113
- #: ../../howto/enum.rst:1241
1113
+ #: ../../howto/enum.rst:1249
1114
1114
msgid ""
1115
1115
"While :class:`Enum`, :class:`IntEnum`, :class:`StrEnum`, :class:`Flag`, and :"
1116
1116
"class:`IntFlag` are expected to cover the majority of use-cases, they cannot "
1117
1117
"cover them all. Here are recipes for some different types of enumerations "
1118
1118
"that can be used directly, or as examples for creating one's own."
1119
1119
msgstr ""
1120
1120
1121
- #: ../../howto/enum.rst:1248
1121
+ #: ../../howto/enum.rst:1256
1122
1122
msgid "Omitting values"
1123
1123
msgstr ""
1124
1124
1125
- #: ../../howto/enum.rst:1250
1125
+ #: ../../howto/enum.rst:1258
1126
1126
msgid ""
1127
1127
"In many use-cases, one doesn't care what the actual value of an enumeration "
1128
1128
"is. There are several ways to define this type of simple enumeration:"
1129
1129
msgstr ""
1130
1130
1131
- #: ../../howto/enum.rst:1253
1131
+ #: ../../howto/enum.rst:1261
1132
1132
msgid "use instances of :class:`auto` for the value"
1133
1133
msgstr ""
1134
1134
1135
- #: ../../howto/enum.rst:1254
1135
+ #: ../../howto/enum.rst:1262
1136
1136
msgid "use instances of :class:`object` as the value"
1137
1137
msgstr ""
1138
1138
1139
- #: ../../howto/enum.rst:1255
1139
+ #: ../../howto/enum.rst:1263
1140
1140
msgid "use a descriptive string as the value"
1141
1141
msgstr ""
1142
1142
1143
- #: ../../howto/enum.rst:1256
1143
+ #: ../../howto/enum.rst:1264
1144
1144
msgid ""
1145
1145
"use a tuple as the value and a custom :meth:`__new__` to replace the tuple "
1146
1146
"with an :class:`int` value"
1147
1147
msgstr ""
1148
1148
1149
- #: ../../howto/enum.rst:1259
1149
+ #: ../../howto/enum.rst:1267
1150
1150
msgid ""
1151
1151
"Using any of these methods signifies to the user that these values are not "
1152
1152
"important, and also enables one to add, remove, or reorder members without "
1153
1153
"having to renumber the remaining members."
1154
1154
msgstr ""
1155
1155
1156
- #: ../../howto/enum.rst:1265
1156
+ #: ../../howto/enum.rst:1273
1157
1157
msgid "Using :class:`auto`"
1158
1158
msgstr ""
1159
1159
1160
- #: ../../howto/enum.rst:1267
1160
+ #: ../../howto/enum.rst:1275
1161
1161
msgid "Using :class:`auto` would look like::"
1162
1162
msgstr ""
1163
1163
1164
- #: ../../howto/enum.rst:1279
1164
+ #: ../../howto/enum.rst:1287
1165
1165
msgid "Using :class:`object`"
1166
1166
msgstr ""
1167
1167
1168
- #: ../../howto/enum.rst:1281
1168
+ #: ../../howto/enum.rst:1289
1169
1169
msgid "Using :class:`object` would look like::"
1170
1170
msgstr ""
1171
1171
1172
- #: ../../howto/enum.rst:1291
1172
+ #: ../../howto/enum.rst:1299
1173
1173
msgid ""
1174
1174
"This is also a good example of why you might want to write your own :meth:"
1175
1175
"`__repr__`::"
1176
1176
msgstr ""
1177
1177
1178
- #: ../../howto/enum.rst:1307
1178
+ #: ../../howto/enum.rst:1315
1179
1179
msgid "Using a descriptive string"
1180
1180
msgstr ""
1181
1181
1182
- #: ../../howto/enum.rst:1309
1182
+ #: ../../howto/enum.rst:1317
1183
1183
msgid "Using a string as the value would look like::"
1184
1184
msgstr ""
1185
1185
1186
- #: ../../howto/enum.rst:1321
1186
+ #: ../../howto/enum.rst:1329
1187
1187
msgid "Using a custom :meth:`__new__`"
1188
1188
msgstr ""
1189
1189
1190
- #: ../../howto/enum.rst:1323
1190
+ #: ../../howto/enum.rst:1331
1191
1191
msgid "Using an auto-numbering :meth:`__new__` would look like::"
1192
1192
msgstr ""
1193
1193
1194
- #: ../../howto/enum.rst:1340
1194
+ #: ../../howto/enum.rst:1348
1195
1195
msgid ""
1196
1196
"To make a more general purpose ``AutoNumber``, add ``*args`` to the "
1197
1197
"signature::"
1198
1198
msgstr ""
1199
1199
1200
- #: ../../howto/enum.rst:1350
1200
+ #: ../../howto/enum.rst:1358
1201
1201
msgid ""
1202
1202
"Then when you inherit from ``AutoNumber`` you can write your own "
1203
1203
"``__init__`` to handle any extra arguments::"
1204
1204
msgstr ""
1205
1205
1206
- #: ../../howto/enum.rst:1369
1206
+ #: ../../howto/enum.rst:1377
1207
1207
msgid ""
1208
1208
"The :meth:`__new__` method, if defined, is used during creation of the Enum "
1209
1209
"members; it is then replaced by Enum's :meth:`__new__` which is used after "
1210
1210
"class creation for lookup of existing members."
1211
1211
msgstr ""
1212
1212
1213
- #: ../../howto/enum.rst:1375
1213
+ #: ../../howto/enum.rst:1383
1214
1214
msgid ""
1215
1215
"*Do not* call ``super().__new__()``, as the lookup-only ``__new__`` is the "
1216
1216
"one that is found; instead, use the data type directly -- e.g.::"
1217
1217
msgstr ""
1218
1218
1219
- #: ../../howto/enum.rst:1382
1219
+ #: ../../howto/enum.rst:1390
1220
1220
msgid "OrderedEnum"
1221
1221
msgstr ""
1222
1222
1223
- #: ../../howto/enum.rst:1384
1223
+ #: ../../howto/enum.rst:1392
1224
1224
msgid ""
1225
1225
"An ordered enumeration that is not based on :class:`IntEnum` and so "
1226
1226
"maintains the normal :class:`Enum` invariants (such as not being comparable "
1227
1227
"to other enumerations)::"
1228
1228
msgstr ""
1229
1229
1230
- #: ../../howto/enum.rst:1418
1230
+ #: ../../howto/enum.rst:1426
1231
1231
msgid "DuplicateFreeEnum"
1232
1232
msgstr ""
1233
1233
1234
- #: ../../howto/enum.rst:1420
1234
+ #: ../../howto/enum.rst:1428
1235
1235
msgid ""
1236
1236
"Raises an error if a duplicate member value is found instead of creating an "
1237
1237
"alias::"
1238
1238
msgstr ""
1239
1239
1240
- #: ../../howto/enum.rst:1445
1240
+ #: ../../howto/enum.rst:1453
1241
1241
msgid ""
1242
1242
"This is a useful example for subclassing Enum to add or change other "
1243
1243
"behaviors as well as disallowing aliases. If the only desired change is "
1244
1244
"disallowing aliases, the :func:`unique` decorator can be used instead."
1245
1245
msgstr ""
1246
1246
1247
- #: ../../howto/enum.rst:1451
1247
+ #: ../../howto/enum.rst:1459
1248
1248
msgid "Planet"
1249
1249
msgstr ""
1250
1250
1251
- #: ../../howto/enum.rst:1453
1251
+ #: ../../howto/enum.rst:1461
1252
1252
msgid ""
1253
1253
"If :meth:`__new__` or :meth:`__init__` is defined, the value of the enum "
1254
1254
"member will be passed to those methods::"
1255
1255
msgstr ""
1256
1256
1257
- #: ../../howto/enum.rst:1482
1257
+ #: ../../howto/enum.rst:1490
1258
1258
msgid "TimePeriod"
1259
1259
msgstr ""
1260
1260
1261
- #: ../../howto/enum.rst:1484
1261
+ #: ../../howto/enum.rst:1492
1262
1262
msgid "An example to show the :attr:`_ignore_` attribute in use::"
1263
1263
msgstr ""
1264
1264
1265
- #: ../../howto/enum.rst:1503
1265
+ #: ../../howto/enum.rst:1511
1266
1266
msgid "Subclassing EnumType"
1267
1267
msgstr ""
1268
1268
1269
- #: ../../howto/enum.rst:1505
1269
+ #: ../../howto/enum.rst:1513
1270
1270
msgid ""
1271
1271
"While most enum needs can be met by customizing :class:`Enum` subclasses, "
1272
1272
"either with class decorators or custom functions, :class:`EnumType` can be "
0 commit comments